|
|
|
|
@@ -434,6 +434,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
|
|
|
|
JSONObject poolJson = JSONObject.parseObject(contents);
|
|
|
|
|
List<SimulatePoolTaskFlowTemplateRelate> templateRelates = mapper.queryTaskFlowRelateByPoolVersion(poolName,version);
|
|
|
|
|
Map<String,String> taskFlowMap = new HashMap<>();
|
|
|
|
|
Map<String,String> taskFlowNameMap = new HashMap<>();
|
|
|
|
|
Map<String,FlowTemplateResp> validFlowTemplateMap = new HashMap<>();
|
|
|
|
|
SdmResponse<List<FlowTemplateResp>> validFlowTemplates = simulationFlowFeignClient.queryValidFlowTemplateInfo();
|
|
|
|
|
if(validFlowTemplates.isSuccess()) {
|
|
|
|
|
@@ -448,15 +449,20 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
|
|
|
|
{
|
|
|
|
|
if(!validFlowTemplateMap.containsKey(relate.flowCode))
|
|
|
|
|
continue;
|
|
|
|
|
FlowTemplateResp flowTemplate = validFlowTemplateMap.get(relate.flowCode);
|
|
|
|
|
String flowTemplates = taskFlowMap.get(relate.taskUuid);
|
|
|
|
|
String flowTemplateNames = taskFlowNameMap.get(relate.taskUuid);
|
|
|
|
|
if(flowTemplates == null)
|
|
|
|
|
{
|
|
|
|
|
taskFlowMap.put(relate.taskUuid,relate.flowCode);
|
|
|
|
|
taskFlowNameMap.put(relate.taskUuid,flowTemplate.templateName);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
flowTemplates += ";"+relate.flowCode;
|
|
|
|
|
flowTemplateNames += ";"+flowTemplate.templateName;
|
|
|
|
|
taskFlowMap.put(relate.taskUuid,flowTemplates);
|
|
|
|
|
taskFlowNameMap.put(relate.taskUuid,flowTemplateNames);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//获取分析项与知识库关系
|
|
|
|
|
@@ -477,7 +483,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
|
|
|
|
for(int i=0;i<nodeArray.size();i++)
|
|
|
|
|
{
|
|
|
|
|
JSONObject node = nodeArray.getJSONObject(i);
|
|
|
|
|
searchNodeAndBindTasks(node, stardardMap, taskFlowMap);
|
|
|
|
|
searchNodeAndBindTasks(node, stardardMap, taskFlowMap,taskFlowNameMap);
|
|
|
|
|
}
|
|
|
|
|
return poolJson.toJSONString();
|
|
|
|
|
}
|
|
|
|
|
@@ -488,7 +494,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
|
|
|
|
* @param stardardMap
|
|
|
|
|
* @param taskFlowMap
|
|
|
|
|
*/
|
|
|
|
|
private void searchNodeAndBindTasks(JSONObject nodeObject,Map<String, List<FileMetadataInfoResp>> stardardMap,Map<String,String> taskFlowMap)
|
|
|
|
|
private void searchNodeAndBindTasks(JSONObject nodeObject,Map<String, List<FileMetadataInfoResp>> stardardMap,Map<String,String> taskFlowMap,Map<String,String> taskFlowNameMap)
|
|
|
|
|
{
|
|
|
|
|
JSONArray children = nodeObject.getJSONArray("children");
|
|
|
|
|
if(children == null || children.isEmpty())
|
|
|
|
|
@@ -501,11 +507,11 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
|
|
|
|
continue;
|
|
|
|
|
if(levelType.equalsIgnoreCase("node"))
|
|
|
|
|
{
|
|
|
|
|
searchNodeAndBindTasks(child,stardardMap,taskFlowMap);
|
|
|
|
|
searchNodeAndBindTasks(child,stardardMap,taskFlowMap,taskFlowNameMap);
|
|
|
|
|
}
|
|
|
|
|
else if(levelType.equalsIgnoreCase("task"))
|
|
|
|
|
{
|
|
|
|
|
bindTaskRelate(child,stardardMap,taskFlowMap);
|
|
|
|
|
bindTaskRelate(child,stardardMap,taskFlowMap,taskFlowNameMap);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -516,16 +522,21 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
|
|
|
|
* @param stardardMap
|
|
|
|
|
* @param taskFlowMap
|
|
|
|
|
*/
|
|
|
|
|
private void bindTaskRelate(JSONObject taskObject,Map<String, List<FileMetadataInfoResp>> stardardMap,Map<String,String> taskFlowMap)
|
|
|
|
|
private void bindTaskRelate(JSONObject taskObject,Map<String, List<FileMetadataInfoResp>> stardardMap,Map<String,String> taskFlowMap,Map<String,String> taskFlowNameMap)
|
|
|
|
|
{
|
|
|
|
|
String taskUuid = taskObject.getString("uuid");
|
|
|
|
|
if(taskUuid == null)
|
|
|
|
|
return;
|
|
|
|
|
String flowTemplate = taskFlowMap.get(taskUuid);
|
|
|
|
|
String flowTemplateNames = taskFlowNameMap.get(taskUuid);
|
|
|
|
|
if(flowTemplate != null)
|
|
|
|
|
{
|
|
|
|
|
taskObject.put("flowTemplate",flowTemplate);
|
|
|
|
|
}
|
|
|
|
|
if(flowTemplateNames != null)
|
|
|
|
|
{
|
|
|
|
|
taskObject.put("flowTemplateNames",flowTemplateNames);
|
|
|
|
|
}
|
|
|
|
|
List<FileMetadataInfoResp> fileMetas = stardardMap.get(taskUuid);
|
|
|
|
|
if(fileMetas != null && !fileMetas.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
@@ -1029,6 +1040,22 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据版本删除分析项库
|
|
|
|
|
* @param poolName
|
|
|
|
|
* @param version
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public SdmResponse cleanTaskPool(String poolName,String version)
|
|
|
|
|
{
|
|
|
|
|
SdmResponse response = SdmResponse.success();
|
|
|
|
|
if(mapper.deleteTaskPoolSingleVersion(poolName,version) < 0)
|
|
|
|
|
{
|
|
|
|
|
response = SdmResponse.failed("删除分析项库版本失败");
|
|
|
|
|
}
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*清理分析项库
|
|
|
|
|
* @param poolName
|
|
|
|
|
@@ -1512,7 +1539,6 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
response.setData(poolBriefs);
|
|
|
|
|
return response;
|
|
|
|
|
|