郑根木 пре 2 година
родитељ
комит
2081eb88fc
3 измењених фајлова са 65 додато и 4 уклоњено
  1. +3
    -3
      smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java
  2. +8
    -1
      smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowService.java
  3. +54
    -0
      smtweb-system/sw-system-bpm/src/test/java/cc/smtweb/system/bpm/test/ToolTest.java

+ 3
- 3
smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/common/SwEnum.java Прегледај датотеку

@@ -202,11 +202,11 @@ public interface SwEnum {
/**
* 界面定义类型:::控件/页面
*/
class FormType extends StrEnum {
class FormType extends IntEnum {
public static FormType instance = new FormType();

public static StrEnumBean PAGE = instance.addEnum("page", "页面");
public static StrEnumBean WIDGET = instance.addEnum("widget", "控件");
public static IntEnumBean PAGE = instance.addEnum(0, "页面");
public static IntEnumBean WIDGET = instance.addEnum(1, "控件");
}

/**


+ 8
- 1
smtweb-system/sw-system-bpm/src/main/java/cc/smtweb/system/bpm/web/engine/flow/FlowService.java Прегледај датотеку

@@ -1,8 +1,15 @@
package cc.smtweb.system.bpm.web.engine.flow;

import cc.smtweb.framework.core.mvc.service.AbstractCompService;
import cc.smtweb.framework.core.mvc.service.IHandler;

/**
* Created by Akmm at 2022/5/24 14:21
* 工作流
*/
public class FlowService {
public class FlowService extends AbstractCompService {
@Override
protected IHandler createHandler(String type) {
return null;
}
}

+ 54
- 0
smtweb-system/sw-system-bpm/src/test/java/cc/smtweb/system/bpm/test/ToolTest.java Прегледај датотеку

@@ -0,0 +1,54 @@
package cc.smtweb.system.bpm.test;

import cc.smtweb.framework.core.common.SwEnum;
import cc.smtweb.framework.core.common.SwMap;
import cc.smtweb.framework.core.db.DbEngine;
import cc.smtweb.framework.core.db.EntityDao;
import cc.smtweb.framework.core.db.cache.ModelTableCache;
import cc.smtweb.framework.core.db.vo.ModelField;
import cc.smtweb.framework.core.db.vo.ModelTable;
import cc.smtweb.framework.core.util.JsonUtil;
import cc.smtweb.system.bpm.spring.BpmApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
* Created by Akmm at 2022/5/24 18:40
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = BpmApplication.class)
public class ToolTest {
@Test
public void resetTable() {
ModelTableCache cache = ModelTableCache.getInstance();
EntityDao<ModelTable> dao = DbEngine.getInstance().findDao(ModelTable.class);
Collection<ModelTable> list = new ArrayList<>(cache.getAll());
for (ModelTable table: list) {
table.setName(table.getName().toUpperCase());
List<ModelField> fields = table.getFields();
for (ModelField field: fields) {
field.setName(field.getName().toLowerCase());
if ("COMMENT".equalsIgnoreCase(field.getDataType())) field.setDataType(SwEnum.DataType.REMARK.value);
SwEnum.DataTypeBean dtb = SwEnum.DataType.instance.getByValue(field.getDataType());
if (dtb == null) {
System.out.println(table.getName() + "." + field.getName() + "字段类型错误:[" + field.getDataType() + "]");
continue;
}
field.setDataType(dtb.value);
}
SwMap map = new SwMap();
map.put("fields", table.getFields());
map.put("indexes", table.getIndexes());
map.put("caches", table.getCaches());
table.getData().put("tb_content", JsonUtil.encodeString(map));
dao.updateEntity(table);
cache.put(table);
}
}
}

Loading…
Откажи
Сачувај