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

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

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