提交 f0d4f878 authored 作者: 黄夏豪's avatar 黄夏豪

[数据模型] 修改了扫描的BUG

上级 7eab9967
......@@ -18,6 +18,12 @@ public class EntityInfo {
@ApiModelProperty(value = "参数名")
private String name;
/**
* 方便前端加的字段
*/
@ApiModelProperty(value = "表达式")
private String exp;
@ApiModelProperty(value = "变量信息")
private List<EntityInfo> fields;
......
......@@ -101,7 +101,7 @@ public class ApiService {
if (isDifferentClass) {
fieldClassInfo = entityInfo(fieldClass, fieldName);
} else {
fieldClassInfo = new EntityInfo(fieldClass.getSimpleName(), field.getName(), new ArrayList<>(), description);
fieldClassInfo = new EntityInfo(fieldClass.getSimpleName(), field.getName(),"", new ArrayList<>(), description);
}
fields.add(fieldClassInfo);
}
......@@ -109,6 +109,7 @@ public class ApiService {
return new EntityInfo(
classType,
name,
"",
fields,
description
);
......
......@@ -33,4 +33,6 @@ public interface TableInfoDao extends JpaRepository<TableInfo, Integer>, JpaSpec
@Transactional(rollbackFor = Exception.class)
@Modifying
List<TableInfo> deleteAllByModelType(Integer type);
List<TableInfo> findAllByModelType(Integer modeType);
}
......@@ -348,22 +348,22 @@ public class ModelImpl implements ModelService {
//判断是否存在
if (checkRepeat(realName)) {
tableInfo = tableInfoDao.save(tableInfo);
List<ColumnVO> dataList = tableVO.getDataList();
for (ColumnVO columnVO : dataList) {
ColumnInfo columnInfo = new ColumnInfo();
columnInfo.setFieldName(columnVO.getFieldName());
columnInfo.setFieldType(columnVO.getFieldType());
columnInfo.setFieldLength(columnVO.getFieldLength());
columnInfo.setFieldTitle(columnVO.getFieldTitle());
columnInfo.setPrimaryKey(columnVO.getPrimaryKey());
columnInfo.setDbName(realName);
columnInfo.setDbId(tableInfo.getId());
columnInfoDao.save(columnInfo);
}
} else {
tableInfo = tableInfoDao.findByModelName(tableInfo.getModelName());
log.info("{}已存在", realName);
}
List<ColumnVO> dataList = tableVO.getDataList();
for (ColumnVO columnVO : dataList) {
ColumnInfo columnInfo = new ColumnInfo();
columnInfo.setFieldName(columnVO.getFieldName());
columnInfo.setFieldType(columnVO.getFieldType());
columnInfo.setFieldLength(columnVO.getFieldLength());
columnInfo.setFieldTitle(columnVO.getFieldTitle());
columnInfo.setPrimaryKey(columnVO.getPrimaryKey());
columnInfo.setDbName(realName);
columnInfo.setDbId(tableInfo.getId());
columnInfoDao.save(columnInfo);
}
}
}
}
......@@ -608,12 +608,10 @@ public class ModelImpl implements ModelService {
public void delTableAndColumnInfo() {
/* 先删除上次扫描的基础类型*/
List<TableInfo> tableInfos = tableInfoDao.deleteAllByModelType(ModelType.BASICS);
for (TableInfo tableInfo : tableInfos) {
List<TableInfo> tableInfoList = tableInfoDao.findAllByModelType(ModelType.BASICS);
for (TableInfo tableInfo : tableInfoList) {
/*删除columnInfo*/
columnInfoDao.deleteAllByDbId(tableInfo.getId());
}
}
}
......@@ -24,6 +24,6 @@ public class ParameterVo {
private String name;
private List<ParameterVo> parameterVoList;
private List<ParameterVo> params;
}
......@@ -36,14 +36,14 @@ public class VariableStorageVo {
private String className;
@ApiModelProperty("调用方法名")
private String method;
private String name;
private List<ParameterVo> parameterList;
private List<ParameterVo> params;
public VariableStorage toEntity(){
VariableStorage variableStorage = new VariableStorage();
BeanUtils.copyProperties(this,variableStorage);
variableStorage.setParameterInfo(JSON.toJSONString(parameterList));
variableStorage.setParameterInfo(JSON.toJSONString(params));
return variableStorage;
}
}
......@@ -191,7 +191,7 @@ public class ProcessEndListener extends AbstractFlowableEngineEventListener {
}else {
instance.put(parameterVo.getName(),"");
}
List<ParameterVo> parameterVoList = parameterVo.getParameterVoList();
List<ParameterVo> parameterVoList = parameterVo.getParams();
if (parameterVoList!=null&&parameterVoList.size()>0){
for (int i = 0; i < parameterVoList.size() ; i++) {
FillParameter(instance,parameterVoList.get(i),execution);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论