1.标准场景库增加场景负责人功能

2.修复应用中配置参数参数类型为字符串导致配置失败bug
This commit is contained in:
daiqy88
2026-04-15 15:01:46 +08:00
parent 798dc7143e
commit 0ebf76c03c
2 changed files with 47 additions and 23 deletions

View File

@@ -20,7 +20,7 @@ public class AppConfigureBean extends BaseBean {
public String configValue; //配置内容
public int configType;//配置类型
public String configType;//配置类型
public long creator; //创建者

View File

@@ -18,6 +18,7 @@ import com.sdm.common.entity.req.task.BindTaskAndFlowTemplateReq;
import com.sdm.common.entity.resp.capability.FlowTemplateResp;
import com.sdm.common.entity.resp.capability.ReportTemplateResp;
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
import com.sdm.common.entity.resp.system.CIDUserResp;
import com.sdm.common.feign.impl.system.ApproveFeignClientImpl;
import com.sdm.common.feign.inter.capability.ISimulationFlowFeignClient;
import com.sdm.common.feign.inter.capability.ISimulationReportFeignClient;
@@ -726,13 +727,15 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
bindFileMap = (Map<String, Map<Integer,List<FileMetadataInfoResp>>>) feignRsp.getData();
}
Map<Long,String> userMap = getSystemAllUserMap();
JSONArray nodeArray = poolJson.getJSONArray("nodes");
if(nodeArray == null || nodeArray.isEmpty())
return contents;
for(int i=0;i<nodeArray.size();i++)
{
JSONObject node = nodeArray.getJSONObject(i);
searchNodeAndBindTasks(node, bindFileMap, bindMaps);
searchNodeAndBindTasks(node, bindFileMap, bindMaps,userMap);
}
return poolJson.toJSONString();
}
@@ -743,7 +746,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
* @param bindFileMap
* @param templateBindMaps
*/
private void searchNodeAndBindTasks(@NotNull JSONObject nodeObject, Map<String, Map<Integer,List<FileMetadataInfoResp>>> bindFileMap, List<TemplateBindMap> templateBindMaps)
private void searchNodeAndBindTasks(@NotNull JSONObject nodeObject, Map<String, Map<Integer,List<FileMetadataInfoResp>>> bindFileMap, List<TemplateBindMap> templateBindMaps, Map<Long,String> userMap)
{
JSONArray children = nodeObject.getJSONArray("children");
if(children == null || children.isEmpty())
@@ -756,11 +759,11 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
continue;
if(levelType.equalsIgnoreCase("node"))
{
searchNodeAndBindTasks(child,bindFileMap,templateBindMaps);
searchNodeAndBindTasks(child,bindFileMap,templateBindMaps,userMap);
}
else if(levelType.equalsIgnoreCase("task"))
{
bindTaskRelate(child,bindFileMap,templateBindMaps);
bindTaskRelate(child,bindFileMap,templateBindMaps,userMap);
}
}
}
@@ -771,29 +774,34 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
* @param bindFileMap
* @param bindMaps
*/
private void bindTaskRelate(JSONObject taskObject,Map<String, Map<Integer,List<FileMetadataInfoResp>>> bindFileMap,List<TemplateBindMap> bindMaps)
private void bindTaskRelate(JSONObject taskObject,Map<String, Map<Integer,List<FileMetadataInfoResp>>> bindFileMap,List<TemplateBindMap> bindMaps, Map<Long,String> userMap)
{
String taskUuid = taskObject.getString("uuid");
if(taskUuid == null)
return;
/*String flowTemplate = taskFlowMap.get(taskUuid);
String flowTemplateNames = taskFlowNameMap.get(taskUuid);
if(flowTemplate != null)
String responsibleStr = taskObject.getString("responsible");
if(responsibleStr != null && !responsibleStr.isEmpty())
{
taskObject.put("flowTemplate",flowTemplate);
String responsibleName = "";
String[] responsibleNames = responsibleStr.split(",");
for(String responsible : responsibleNames)
{
long userId = Long.parseLong(responsible);
String userName = userMap.get(userId);
if(userName != null && !userName.isEmpty())
{
if(responsibleName.isEmpty())
{
responsibleName += userName;
}
else
{
responsibleName += ","+ userName;
}
}
}
taskObject.put("responsibleName",responsibleName);
}
else
{
taskObject.put("flowTemplate","");
}
if(flowTemplateNames != null)
{
taskObject.put("flowTemplateNames",flowTemplateNames);
}
else
{
taskObject.put("flowTemplateNames","");
}*/
for(TemplateBindMap templateMap : bindMaps)
{
Map<String,String> codeMaps = templateMap.taskCodeMap;
@@ -1317,7 +1325,6 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
}
if(response.getCode() == ResultCode.SUCCESS.getCode())
{
SdmResponse treeRespond = getCurrentPoolTree(poolName);
@@ -3044,6 +3051,23 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
SdmResponse response = SdmResponse.success();
return response;
}
/**
* 获取系统所有用户ID与用户名映射
* @return
*/
protected Map<Long,String> getSystemAllUserMap()
{
List<CIDUserResp> userResps = userNameCacheService.getAllUsers();
Map<Long,String> userMap = new HashMap<>();
for(CIDUserResp userResp : userResps)
{
long userId = userResp.getUserId();
String userName = userResp.getNickname();
userMap.put(userId,userName);
}
return userMap;
}
}