分析项库绑定流程模版添加分析项库ID

This commit is contained in:
daiqy88
2025-12-11 16:31:16 +08:00
parent 223d118e0b
commit 079f3b5a82
7 changed files with 23 additions and 7 deletions

View File

@@ -7,7 +7,7 @@ import java.util.List;
public class SimulationFlowTaskBindInfo {
public String simulationPoolId;
public int simulationPoolId;
public String simulationPoolName;

View File

@@ -107,6 +107,7 @@ public class FlowServiceImpl extends BaseService implements IFlowService {
FlowBindTaskPoolItem bindTaskPoolItem = new FlowBindTaskPoolItem();
bindTaskPoolItem.flowCode = flowCode;
bindTaskPoolItem.poolName = bindInfo.simulationPoolName;
bindTaskPoolItem.poolId = bindInfo.simulationPoolId;
bindTaskPoolItem.version = bindInfo.simulationPoolVersion;
for(String taskId : bindInfo.simulationPoolTaskIds)
{
@@ -337,8 +338,15 @@ public class FlowServiceImpl extends BaseService implements IFlowService {
{
SimulationFlowTaskBindInfo flowTaskBindInfo = new SimulationFlowTaskBindInfo();
flowTaskBindInfo.simulationPoolName = flowBindTaskPoolItem.poolName;
flowTaskBindInfo.simulationPoolId = flowBindTaskPoolItem.poolId;
flowTaskBindInfo.simulationPoolVersion = flowBindTaskPoolItem.version;
flowTaskBindInfo.taskBaseInfoList = flowBindTaskPoolItem.taskList;
List<String> taskIds = new ArrayList<>();
for(TaskBaseInfo taskBaseInfo : flowBindTaskPoolItem.taskList)
{
taskIds.add(taskBaseInfo.uuid);
}
flowTaskBindInfo.simulationPoolTaskIds = taskIds;
flowTemplate.simulationPoolInfoList.add(flowTaskBindInfo);
}

View File

@@ -7,6 +7,8 @@ public class FlowBindTaskPoolItem {
public String poolName;
public int poolId;
public String version;
public String flowCode;

View File

@@ -218,15 +218,15 @@ public interface SimulationPoolMapper {
@Insert({
"<script>",
"INSERT INTO simulation_taskpool_flowtemplate_relate(poolName,version,taskUuid,flowCode) VALUES ",
"INSERT INTO simulation_taskpool_flowtemplate_relate(poolName,version,taskUuid,flowCode,poolId) VALUES ",
"<foreach collection ='list' item='it' index='index' separator =','>",
"(#{it.poolName},#{it.version},#{it.taskUuid},#{it.flowCode}) ",
"(#{it.poolName},#{it.version},#{it.taskUuid},#{it.flowCode},#{it.poolId}) ",
"</foreach>",
"</script>"
})
int batchAddTaskFlowRelate(@Param("list") List<SimulatePoolTaskFlowTemplateRelate> list);
@Insert("INSERT INTO simulation_taskpool_flowtemplate_relate(poolName,version,taskUuid,flowCode) VALUES (#{relate.poolName},#{relate.version},#{relate.taskUuid},#{relate.flowCode})")
@Insert("INSERT INTO simulation_taskpool_flowtemplate_relate(poolName,version,taskUuid,flowCode,poolId) VALUES (#{relate.poolName},#{relate.version},#{relate.taskUuid},#{relate.flowCode},#{relate.poolId})")
int addTaskFlowRelate(@Param("relate") SimulatePoolTaskFlowTemplateRelate relate);
@Select("SELECT * FROM simulation_taskpool_flowtemplate_relate WHERE flowCode=#{flowCode} AND poolName=#{poolName} AND version=#{version} AND taskUuid=#{taskUuid}")

View File

@@ -6,6 +6,8 @@ public class SimulatePoolTaskFlowTemplateRelate {
public String poolName;
public int poolId;
public String version;
public String taskUuid;

View File

@@ -12,7 +12,7 @@ public class TaskPoolVersion extends BaseBean {
public String parentVersion;
public String childVersion;
public String versionContents;
public long poolId;
public int poolId;
public long creator;
public String createTime;
}

View File

@@ -76,6 +76,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
SimulatePoolTaskFlowTemplateRelate relate = new SimulatePoolTaskFlowTemplateRelate();
relate.poolName = poolName;
relate.version = version;
relate.poolId = poolId;
relate.taskUuid = taskPoolItem.uuid;
relate.flowCode = template;
flowRelationList.add(relate);
@@ -121,7 +122,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
* @param version
* @param taskPoolItemList
*/
private void addTaskRelationCheckRepeat(String poolName,String version,List<TaskPoolItem> taskPoolItemList)
private void addTaskRelationCheckRepeat(String poolName,String version,List<TaskPoolItem> taskPoolItemList,int poolId)
{
for(TaskPoolItem taskPoolItem:taskPoolItemList) {
String flowTemplate = taskPoolItem.flowTemplate;
@@ -136,6 +137,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
SimulatePoolTaskFlowTemplateRelate templateRelate = new SimulatePoolTaskFlowTemplateRelate();
templateRelate.poolName = poolName;
templateRelate.version = version;
templateRelate.poolId = poolId;
templateRelate.taskUuid = taskPoolItem.uuid;
templateRelate.flowCode = template;
mapper.addTaskFlowRelate(templateRelate);
@@ -173,7 +175,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
}
//将添加和更新task合并一起后一起添加关联关系需要检查关系是否重复绑定
addTasks.addAll(updateTasks);
addTaskRelationCheckRepeat(poolName,currentVersion,addTasks);
addTaskRelationCheckRepeat(poolName,currentVersion,addTasks,currentBrief.id);
}
@@ -1405,6 +1407,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
currPoolBrief.parentVersion = currPoolBrief.currentVersion;
currPoolBrief.currentVersion = poolVersion.poolVersion;
poolVersion.poolId = mapper.addTaskPoolBreif(currPoolBrief);
currPoolBrief.id = poolVersion.poolId;
TaskPoolTree poolTree = (TaskPoolTree) treeRespond.getData();
poolVersion.versionContents = JSONObject.toJSONString(poolTree);
mapper.addTaskPoolVersion(poolVersion);
@@ -1988,6 +1991,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
templateRelate.flowCode = flowCode;
templateRelate.poolName = taskPoolItem.poolName;
templateRelate.version = taskPoolItem.version;
templateRelate.poolId = taskPoolItem.poolId;
templateRelate.taskUuid = taskBaseInfo.uuid;
relations.add(templateRelate);
}