1.利元亨标准场景库添加异常库绑定
2.利元亨工况库通过任务编号同步场景库中同编号任务的绑定关系
This commit is contained in:
@@ -176,5 +176,11 @@ public class SimuluationTaskPoolController implements ISimuluationTaskPoolFeignC
|
||||
{
|
||||
return service.statisicNodeTypeConfidence(poolName,"machine");
|
||||
}
|
||||
|
||||
@GetMapping(value = "getSimulationPoolTask")
|
||||
public SdmResponse getSimulationPoolTask(@RequestParam("poolName")String poolName,@RequestParam("version")String version,@RequestParam("taskCode")String taskCode)
|
||||
{
|
||||
return service.getSimulationPoolTask(poolName,version,taskCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ public class TaskPoolItem extends NodeBase{
|
||||
public String standard;
|
||||
public String flowTemplate;
|
||||
public String reportTemplate;
|
||||
public String exceptionFile;
|
||||
public String analyseTarget;
|
||||
public float confidence;
|
||||
public String discipline;
|
||||
|
||||
@@ -36,6 +36,8 @@ public interface ISimulationTaskPoolService {
|
||||
|
||||
SdmResponse<List<TaskPoolPerformance>> getTaskPoolPerformanceWithVersion(String poolName, String version);
|
||||
|
||||
SdmResponse getSimulationPoolTask(String poolName,String version,String taskCode);
|
||||
|
||||
SdmResponse getSimulationPoolTasks(String poolName,String version,String nodeLevel,String nodeName);
|
||||
|
||||
SdmResponse<Map<String, TaskBaseInfo>> getSimulationTasksByPoolId(long poolId);
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
package com.sdm.task.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.task.model.entity.TaskPoolBrief;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@ConditionalOnProperty(name = "simulationPool.chose", havingValue = "lyric")
|
||||
public class SimulationTaskPoolServiceForLyricImpl extends SimulationTaskPoolServiceImpl{
|
||||
|
||||
private final String LYRIC_SCENARIO_LIB_NAME = "标准场景库";
|
||||
@Override
|
||||
public List<String> getSimulationPoolNodeNames(String poolName, String nodeType)
|
||||
{
|
||||
@@ -18,4 +25,175 @@ public class SimulationTaskPoolServiceForLyricImpl extends SimulationTaskPoolSer
|
||||
}
|
||||
return super.getSimulationPoolNodeNames(poolName,nodeType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分析项库包括标准库中某个任务详情
|
||||
* @param poolName
|
||||
* @param version
|
||||
* @param taskCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SdmResponse getSimulationPoolTask(String poolName, String version, String taskCode)
|
||||
{
|
||||
SdmResponse response=SdmResponse.success();
|
||||
SdmResponse poolRespond = getPoolTreeByVersion(poolName,version);
|
||||
if(!poolRespond.isSuccess())
|
||||
{
|
||||
response = SdmResponse.failed("获取库信息失败");
|
||||
return response;
|
||||
}
|
||||
JSONObject poolObject = (JSONObject) poolRespond.getData();
|
||||
JSONArray nodeArray = poolObject.getJSONArray("nodes");
|
||||
JSONObject targetObject = new JSONObject();
|
||||
LOOP: for (Object object : nodeArray)
|
||||
{
|
||||
JSONObject node = (JSONObject) object;
|
||||
JSONArray taskArray = node.getJSONArray("children");
|
||||
for (Object o : taskArray) {
|
||||
JSONObject task = (JSONObject) o;
|
||||
String tCode = task.getString("nodeCode");
|
||||
if(tCode != null && tCode.equals(taskCode))
|
||||
{
|
||||
targetObject = task;
|
||||
break LOOP;
|
||||
}
|
||||
}
|
||||
}
|
||||
response.setData(targetObject);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取库最新版本内容,包含各种绑定关系
|
||||
* @param poolName
|
||||
* @return
|
||||
*/
|
||||
private SdmResponse getStandardPoolContents(String poolName)
|
||||
{
|
||||
|
||||
SdmResponse response = SdmResponse.failed("获取库信息失败");
|
||||
TaskPoolBrief poolBrief = mapper.queryTaskPoolBrief(poolName);
|
||||
if(poolBrief == null) {
|
||||
return response;
|
||||
}
|
||||
SdmResponse poolRespond = getPoolTreeByVersion(poolName,poolBrief.currentVersion);
|
||||
if(!poolRespond.isSuccess())
|
||||
{
|
||||
return response;
|
||||
}
|
||||
return poolRespond;
|
||||
}
|
||||
|
||||
/**
|
||||
* 整理利元亨场景库信息,通过场景编码进行映射
|
||||
* @return
|
||||
*/
|
||||
private Map<String,JSONObject> getScenarioLib()
|
||||
{
|
||||
Map<String,JSONObject> map = new HashMap<>();
|
||||
SdmResponse scenarioRespond = getStandardPoolContents(LYRIC_SCENARIO_LIB_NAME);
|
||||
if(!scenarioRespond.isSuccess())
|
||||
return map;
|
||||
JSONObject scenarioJson = (JSONObject) scenarioRespond.getData();
|
||||
JSONArray nodeArray = scenarioJson.getJSONArray("nodes");
|
||||
for(Object nodeObj : nodeArray)
|
||||
{
|
||||
JSONObject node = (JSONObject) nodeObj;
|
||||
JSONArray taskArray = node.getJSONArray("children");
|
||||
for(Object taskObj : taskArray)
|
||||
{
|
||||
JSONObject task = (JSONObject) taskObj;
|
||||
String tCode = task.getString("nodeCode");
|
||||
map.put(tCode,task);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定分析项库中task的模版信息
|
||||
* @param taskObj
|
||||
* @param scenarioMap
|
||||
*/
|
||||
private void bindTaskRelate(JSONObject taskObj,Map<String,JSONObject> scenarioMap)
|
||||
{
|
||||
String taskCode = taskObj.getString("nodeCode");
|
||||
JSONObject scenarioJson = scenarioMap.get(taskCode);
|
||||
if(scenarioJson == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//绑定流程模版
|
||||
String scenarioFlowTemplate = scenarioJson.getString("flowTemplate") == null ? "" : scenarioJson.getString("flowTemplate");
|
||||
String scenarioFlowTemplateNames = scenarioJson.getString("flowTemplateNames") == null ? "" : scenarioJson.getString("flowTemplateNames");
|
||||
taskObj.put("flowTemplate",scenarioFlowTemplate);
|
||||
taskObj.put("flowTemplateNames",scenarioFlowTemplateNames);
|
||||
//绑定报告模版
|
||||
String scenarioReportTemplate = scenarioJson.getString("reportTemplate") == null ? "" : scenarioJson.getString("reportTemplate");
|
||||
String scenarioReportTemplateNames = scenarioJson.getString("reportTemplateNames") == null ? "" : scenarioJson.getString("reportTemplateNames");
|
||||
taskObj.put("reportTemplate",scenarioReportTemplate);
|
||||
taskObj.put("reportTemplateNames",scenarioReportTemplateNames);
|
||||
//绑定标准库
|
||||
String scenarioStandard = scenarioJson.getString("standard") == null ? "" : scenarioJson.getString("standard");
|
||||
String scenarioStandardName = scenarioJson.getString("standardName") == null ? "" : scenarioJson.getString("standardName");
|
||||
taskObj.put("standard",scenarioStandard);
|
||||
taskObj.put("standardName",scenarioStandardName);
|
||||
///绑定异常库
|
||||
String scenarioExceptionFile = scenarioJson.getString("exceptionFile") == null ? "" : scenarioJson.getString("exceptionFile");
|
||||
String scenarioExceptionFileName = scenarioJson.getString("exceptionFileName") == null ? "" : scenarioJson.getString("exceptionFileName");
|
||||
taskObj.put("exceptionFile",scenarioExceptionFile);
|
||||
taskObj.put("exceptionFileName",scenarioExceptionFileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 深度遍历库节点
|
||||
* @param node
|
||||
* @param scenarioMap
|
||||
*/
|
||||
private void searchPoolNode(JSONObject node,Map<String,JSONObject> scenarioMap)
|
||||
{
|
||||
JSONArray childArray = node.getJSONArray("children");
|
||||
for(Object o : childArray)
|
||||
{
|
||||
JSONObject child = (JSONObject) o;
|
||||
String levelType = child.getString("levelType");
|
||||
if(levelType == null)
|
||||
continue;
|
||||
if(levelType.equalsIgnoreCase("node"))
|
||||
{
|
||||
searchPoolNode(child,scenarioMap);
|
||||
}
|
||||
else if(levelType.equalsIgnoreCase("task"))
|
||||
{
|
||||
bindTaskRelate(child,scenarioMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 为利元亨分析项库依据标准场景库绑定各种模版信息
|
||||
* @param poolName
|
||||
* @param version
|
||||
* @param contents
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String bindTaskpoolRelate(String poolName,String version,String contents)
|
||||
{
|
||||
if(poolName.equalsIgnoreCase(LYRIC_SCENARIO_LIB_NAME))
|
||||
{
|
||||
return super.bindTaskpoolRelate(poolName,version,contents);
|
||||
}
|
||||
JSONObject poolJson = JSONObject.parseObject(contents);
|
||||
Map<String,JSONObject> scenarioMap = getScenarioLib();
|
||||
JSONArray nodeArray = poolJson.getJSONArray("nodes");
|
||||
for(Object nodeObj : nodeArray)
|
||||
{
|
||||
JSONObject node = (JSONObject) nodeObj;
|
||||
searchPoolNode(node,scenarioMap);
|
||||
}
|
||||
return poolJson.toJSONString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.github.pagehelper.util.StringUtil;
|
||||
import com.sdm.common.common.ResultCode;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.common.ThreadLocalContext;
|
||||
import com.sdm.common.entity.enums.DirTypeEnum;
|
||||
import com.sdm.common.entity.pojo.task.FlowBindTaskPoolItem;
|
||||
import com.sdm.common.entity.pojo.task.TaskBaseInfo;
|
||||
import com.sdm.common.entity.req.data.DeleteFileSimulationMappingReq;
|
||||
@@ -100,6 +101,35 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
return relateionList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成文件库(如:标准库,异常库)绑定请求
|
||||
* @param taskId
|
||||
* @param poolVersion
|
||||
* @param poolId
|
||||
* @param bindFiles
|
||||
* @param reqList
|
||||
*/
|
||||
private void bindTaskFileLib(String taskId,String poolVersion,int poolId, String bindFiles, List<SaveFileSimulationMappingReq> reqList)
|
||||
{
|
||||
String[] libItem = bindFiles.split(";");
|
||||
List<Long> fileIdList = new ArrayList<>();
|
||||
for (String item : libItem)
|
||||
{
|
||||
String[] standardIds = item.split(",");
|
||||
if(standardIds.length == 2)
|
||||
{
|
||||
String fileId = standardIds[1].trim();
|
||||
fileIdList.add(Long.valueOf(fileId));
|
||||
}
|
||||
}
|
||||
SaveFileSimulationMappingReq req = new SaveFileSimulationMappingReq();
|
||||
req.setSimulationPoolTaskId(taskId);
|
||||
req.setSimulationPoolVersion(poolVersion);
|
||||
req.setSimulationPoolId(poolId);
|
||||
req.setFileIds(fileIdList);
|
||||
reqList.add(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理绑定仿真分析项流程模版
|
||||
* @param taskPoolItemList
|
||||
@@ -109,7 +139,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
//为分析项库绑定流程模版,知识库
|
||||
List<SimulatePoolTaskFlowTemplateRelate> flowRelationList = new ArrayList<>();
|
||||
List<SimulatePoolTaskFlowTemplateRelate> reportRelationList = new ArrayList<>();
|
||||
List<SaveFileSimulationMappingReq> standardRelationReqs = new ArrayList<>();
|
||||
List<SaveFileSimulationMappingReq> relationReqs = new ArrayList<>();
|
||||
for(TaskPoolItem taskPoolItem:taskPoolItemList)
|
||||
{
|
||||
//绑定流程模版
|
||||
@@ -141,7 +171,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
String standard = taskPoolItem.standard;
|
||||
if(standard != null && !standard.isEmpty())
|
||||
{
|
||||
String[] standardItem = standard.split(";");
|
||||
/*String[] standardItem = standard.split(";");
|
||||
List<Long> fileIdList = new ArrayList<>();
|
||||
for (String item : standardItem)
|
||||
{
|
||||
@@ -157,9 +187,16 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
req.setSimulationPoolVersion(version);
|
||||
req.setSimulationPoolId(poolId);
|
||||
req.setFileIds(fileIdList);
|
||||
standardRelationReqs.add(req);
|
||||
standardRelationReqs.add(req);*/
|
||||
bindTaskFileLib(taskPoolItem.uuid,version,poolId,standard,relationReqs);
|
||||
|
||||
}
|
||||
//绑定异常库
|
||||
String exceptionFile = taskPoolItem.exceptionFile;
|
||||
if(exceptionFile != null && !exceptionFile.isEmpty())
|
||||
{
|
||||
bindTaskFileLib(taskPoolItem.uuid,version,poolId,exceptionFile,relationReqs);
|
||||
}
|
||||
}
|
||||
if(!flowRelationList.isEmpty()) {
|
||||
mapper.batchAddTaskFlowRelate(flowRelationList);
|
||||
@@ -167,9 +204,9 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
if(!reportRelationList.isEmpty()) {
|
||||
mapper.batchAddTaskFlowRelate(reportRelationList);
|
||||
}
|
||||
if(!standardRelationReqs.isEmpty())
|
||||
if(!relationReqs.isEmpty())
|
||||
{
|
||||
simulationMappingFeignClient.batchSaveFileSimulationMapping(standardRelationReqs);
|
||||
simulationMappingFeignClient.batchSaveFileSimulationMapping(relationReqs);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -241,11 +278,11 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
List<SaveFileSimulationMappingReq> saveFileSimulationMappingReq = new ArrayList<>();
|
||||
for(TaskPoolItem taskPoolItem:taskPoolItemList) {
|
||||
String standard = taskPoolItem.standard;
|
||||
if(standard == null || standard.isEmpty())
|
||||
if(standard != null && standard.isEmpty())
|
||||
{
|
||||
continue;
|
||||
bindTaskFileLib(taskPoolItem.uuid,version,poolId,standard,saveFileSimulationMappingReq);
|
||||
}
|
||||
String[] standardItems = standard.split(";");
|
||||
/*String[] standardItems = standard.split(";");
|
||||
List<Long> fileIdList = new ArrayList<>();
|
||||
for(String item: standardItems)
|
||||
{
|
||||
@@ -262,7 +299,12 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
req.setSimulationPoolVersion(version);
|
||||
req.setSimulationPoolId(poolId);
|
||||
req.setFileIds(fileIdList);
|
||||
saveFileSimulationMappingReq.add(req);
|
||||
saveFileSimulationMappingReq.add(req);*/
|
||||
String exceptionFile = taskPoolItem.exceptionFile;
|
||||
if(exceptionFile != null && exceptionFile.isEmpty())
|
||||
{
|
||||
bindTaskFileLib(taskPoolItem.uuid,version,poolId,exceptionFile,saveFileSimulationMappingReq);
|
||||
}
|
||||
}
|
||||
if(!saveFileSimulationMappingReq.isEmpty()) {
|
||||
simulationMappingFeignClient.batchSaveFileSimulationMapping(saveFileSimulationMappingReq);
|
||||
@@ -293,14 +335,29 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
GetFileSimulationMappingReq mappingReq = new GetFileSimulationMappingReq();
|
||||
mappingReq.setSimulationPoolId(oldPoolId);
|
||||
mappingReq.setSimulationPoolVersion(currentBrief.parentVersion);
|
||||
SdmResponse<Map<String, List<FileMetadataInfoResp>>> fileMetaRsp = simulationMappingFeignClient.batchGetFileSimulationMappingBySimulationPoolIdAndVersion(mappingReq);
|
||||
SdmResponse<Map<String, Map<Integer,List<FileMetadataInfoResp>>>> fileMetaRsp = simulationMappingFeignClient.batchGetFileSimulationMappingBySimulationPoolIdAndVersion(mappingReq);
|
||||
if(fileMetaRsp.isSuccess())
|
||||
{
|
||||
Map<String, List<FileMetadataInfoResp>> fileMetaMap = fileMetaRsp.getData();
|
||||
Map<String, Map<Integer,List<FileMetadataInfoResp>>> fileMetaMap = fileMetaRsp.getData();
|
||||
List<SaveFileSimulationMappingReq> saveFileSimulationMappingReq = new ArrayList<>();
|
||||
for(String taskUuid : fileMetaMap.keySet())
|
||||
{
|
||||
List<FileMetadataInfoResp> fileMetadataInfoRespList = fileMetaMap.get(taskUuid);
|
||||
Map<Integer,List<FileMetadataInfoResp>> fileMetadataInfoRespListMap = fileMetaMap.get(taskUuid);
|
||||
if(fileMetadataInfoRespListMap == null)
|
||||
continue;
|
||||
List<FileMetadataInfoResp> fileMetadataInfoRespList = new ArrayList<>();
|
||||
List<FileMetadataInfoResp> knowledgeRespList = fileMetadataInfoRespListMap.get(DirTypeEnum.KNOWLEDGE_BASE_DIR.getValue());
|
||||
if(knowledgeRespList != null && !knowledgeRespList.isEmpty())
|
||||
{
|
||||
fileMetadataInfoRespList.addAll(knowledgeRespList);
|
||||
}
|
||||
|
||||
List<FileMetadataInfoResp> exceptionRespList = fileMetadataInfoRespListMap.get(DirTypeEnum.EXCEPTION_DIR.getValue());
|
||||
if(exceptionRespList != null && !exceptionRespList.isEmpty())
|
||||
{
|
||||
fileMetadataInfoRespList.addAll(exceptionRespList);
|
||||
}
|
||||
|
||||
List<Long> fileIdList = new ArrayList<>();
|
||||
for(FileMetadataInfoResp fileMetadataInfoResp : fileMetadataInfoRespList)
|
||||
{
|
||||
@@ -604,7 +661,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
* @param contents
|
||||
* @return
|
||||
*/
|
||||
private String bindTaskpoolRelate(String poolName,String version,String contents)
|
||||
public String bindTaskpoolRelate(String poolName,String version,String contents)
|
||||
{
|
||||
//获取分析项与流程模版关系
|
||||
JSONObject poolJson = JSONObject.parseObject(contents);
|
||||
@@ -657,14 +714,14 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
|
||||
//获取分析项与知识库关系
|
||||
JSONObject poolBrief = poolJson.getJSONObject("poolBrief");
|
||||
Map<String, List<FileMetadataInfoResp>> stardardMap = new HashMap<>();
|
||||
Map<String, Map<Integer,List<FileMetadataInfoResp>>> bindFileMap = new HashMap<>();
|
||||
if(poolBrief != null) {
|
||||
GetFileSimulationMappingReq req = new GetFileSimulationMappingReq();
|
||||
req.setSimulationPoolId(poolBrief.getInteger("id"));
|
||||
req.setSimulationPoolVersion(version);
|
||||
SdmResponse<Map<String, List<FileMetadataInfoResp>>> feignRsp = simulationMappingFeignClient.batchGetFileSimulationMappingBySimulationPoolIdAndVersion(req);
|
||||
SdmResponse<Map<String, Map<Integer,List<FileMetadataInfoResp>>>> feignRsp = simulationMappingFeignClient.batchGetFileSimulationMappingBySimulationPoolIdAndVersion(req);
|
||||
if (feignRsp.isSuccess())
|
||||
stardardMap = (Map<String, List<FileMetadataInfoResp>>) feignRsp.getData();
|
||||
bindFileMap = (Map<String, Map<Integer,List<FileMetadataInfoResp>>>) feignRsp.getData();
|
||||
}
|
||||
|
||||
JSONArray nodeArray = poolJson.getJSONArray("nodes");
|
||||
@@ -673,7 +730,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
for(int i=0;i<nodeArray.size();i++)
|
||||
{
|
||||
JSONObject node = nodeArray.getJSONObject(i);
|
||||
searchNodeAndBindTasks(node, stardardMap, bindMaps);
|
||||
searchNodeAndBindTasks(node, bindFileMap, bindMaps);
|
||||
}
|
||||
return poolJson.toJSONString();
|
||||
}
|
||||
@@ -681,10 +738,10 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
/**
|
||||
* 搜索节点并绑定分析项下流程模版和标准库
|
||||
* @param nodeObject
|
||||
* @param stardardMap
|
||||
* @param bindFileMap
|
||||
* @param templateBindMaps
|
||||
*/
|
||||
private void searchNodeAndBindTasks(JSONObject nodeObject,Map<String, List<FileMetadataInfoResp>> stardardMap, List<TemplateBindMap> templateBindMaps)
|
||||
private void searchNodeAndBindTasks(JSONObject nodeObject,Map<String, Map<Integer,List<FileMetadataInfoResp>>> bindFileMap, List<TemplateBindMap> templateBindMaps)
|
||||
{
|
||||
JSONArray children = nodeObject.getJSONArray("children");
|
||||
if(children == null || children.isEmpty())
|
||||
@@ -697,11 +754,11 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
continue;
|
||||
if(levelType.equalsIgnoreCase("node"))
|
||||
{
|
||||
searchNodeAndBindTasks(child,stardardMap,templateBindMaps);
|
||||
searchNodeAndBindTasks(child,bindFileMap,templateBindMaps);
|
||||
}
|
||||
else if(levelType.equalsIgnoreCase("task"))
|
||||
{
|
||||
bindTaskRelate(child,stardardMap,templateBindMaps);
|
||||
bindTaskRelate(child,bindFileMap,templateBindMaps);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -709,10 +766,10 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
/**
|
||||
* 绑定分析项库与流程模版和标准库
|
||||
* @param taskObject
|
||||
* @param stardardMap
|
||||
* @param bindFileMap
|
||||
* @param bindMaps
|
||||
*/
|
||||
private void bindTaskRelate(JSONObject taskObject,Map<String, List<FileMetadataInfoResp>> stardardMap,List<TemplateBindMap> bindMaps)
|
||||
private void bindTaskRelate(JSONObject taskObject,Map<String, Map<Integer,List<FileMetadataInfoResp>>> bindFileMap,List<TemplateBindMap> bindMaps)
|
||||
{
|
||||
String taskUuid = taskObject.getString("uuid");
|
||||
if(taskUuid == null)
|
||||
@@ -773,30 +830,50 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
}
|
||||
}
|
||||
//绑定标准库
|
||||
List<FileMetadataInfoResp> fileMetas = stardardMap.get(taskUuid);
|
||||
Map<Integer,List<FileMetadataInfoResp>> fileMetas = bindFileMap.get(taskUuid);
|
||||
//List<FileMetadataInfoResp> standardFileMetas = fileMetas.get(DirTypeEnum.KNOWLEDGE_BASE_DIR.getValue());
|
||||
//List<FileMetadataInfoResp> excelFileMetas = fileMetas.get(DirTypeEnum.EXCEPTION_DIR.getValue());
|
||||
if(fileMetas != null && !fileMetas.isEmpty())
|
||||
{
|
||||
String standard = "";
|
||||
String standardName = "";
|
||||
for(FileMetadataInfoResp fileMetadataInfoResp : fileMetas)
|
||||
for(int key : fileMetas.keySet())
|
||||
{
|
||||
if(fileMetadataInfoResp == null)
|
||||
if(key != DirTypeEnum.KNOWLEDGE_BASE_DIR.getValue() && key != DirTypeEnum.EXCEPTION_DIR.getValue())
|
||||
continue;
|
||||
//long parentId = fileMetadataInfoResp.getParentId();
|
||||
//long fileId = fileMetadataInfoResp.getId();
|
||||
String fileName = fileMetadataInfoResp.getOriginalName();
|
||||
if(!standard.isEmpty())
|
||||
List<FileMetadataInfoResp> fileMetasList = fileMetas.get(key);
|
||||
String fileIds = "";
|
||||
String fileNames = "";
|
||||
String fileIdKey = "";
|
||||
String fileNamesKey = "";
|
||||
if(key == DirTypeEnum.KNOWLEDGE_BASE_DIR.getValue())
|
||||
{
|
||||
standard += ";";
|
||||
fileIdKey = "standard";
|
||||
fileNamesKey = "standardName";
|
||||
}
|
||||
if(!standardName.isEmpty())
|
||||
else if(key == DirTypeEnum.EXCEPTION_DIR.getValue())
|
||||
{
|
||||
standardName += ";";
|
||||
fileIdKey = "exceptionFile";
|
||||
fileNamesKey = "exceptionFileName";
|
||||
}
|
||||
for(FileMetadataInfoResp fileMetadataInfoResp : fileMetasList)
|
||||
{
|
||||
if(fileMetadataInfoResp == null)
|
||||
continue;
|
||||
//long parentId = fileMetadataInfoResp.getParentId();
|
||||
//long fileId = fileMetadataInfoResp.getId();
|
||||
String fileName = fileMetadataInfoResp.getOriginalName();
|
||||
if(!fileIds.isEmpty())
|
||||
{
|
||||
fileIds += ";";
|
||||
}
|
||||
if(!fileNames.isEmpty())
|
||||
{
|
||||
fileNames += ";";
|
||||
}
|
||||
fileIds += fileMetadataInfoResp.getAllParentIds();
|
||||
fileNames += fileName;
|
||||
taskObject.put(fileIdKey,fileIds);
|
||||
taskObject.put(fileNamesKey,fileNames);
|
||||
}
|
||||
standard += fileMetadataInfoResp.getAllParentIds();
|
||||
standardName += fileName;
|
||||
taskObject.put("standard",standard);
|
||||
taskObject.put("standardName",standardName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2268,10 +2345,15 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse getSimulationPoolTasks(String poolName,String version,String nodeType,String nodeName)
|
||||
public SdmResponse getSimulationPoolTask(String poolName,String version,String taskCode)
|
||||
{
|
||||
SdmResponse response = SdmResponse.success();
|
||||
return SdmResponse.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<List<TaskPoolItem>> getSimulationPoolTasks(String poolName,String version,String nodeType,String nodeName)
|
||||
{
|
||||
SdmResponse<List<TaskPoolItem>> response = SdmResponse.success();
|
||||
JSONObject poolJson = null;
|
||||
if(version==null || version.length()==0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user