1、导出任务树时,转换流程模板编码为名称
2、对接第三方接口,添加日志 3、查询任务树中分析项指标时,过滤掉算例关联的指标
This commit is contained in:
@@ -8,6 +8,7 @@ import com.sdm.capability.service.ISimulationFlowNodeService;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.capability.FlowNodeDto;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.entity.resp.capability.FlowTemplateResp;
|
||||
import com.sdm.common.feign.inter.capability.ISimulationFlowFeignClient;
|
||||
import com.sdm.common.log.annotation.SysLog;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -141,4 +142,9 @@ public class FlowController implements ISimulationFlowFeignClient {
|
||||
return simulationFlowNodeService.querySimulationFlowNode(req);
|
||||
}
|
||||
|
||||
@GetMapping("/queryFlowTemplateInfoByTemplateCode")
|
||||
public SdmResponse<FlowTemplateResp> queryFlowTemplateInfoByTemplateCode(String templateCode) {
|
||||
return IFlowService.queryFlowTemplateInfoByTemplateCode(templateCode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.sdm.capability.service;
|
||||
import com.sdm.capability.model.entity.SimulationFlowTemplate;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.entity.resp.capability.FlowTemplateResp;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -86,4 +87,12 @@ public interface IFlowService {
|
||||
* @param req
|
||||
*/
|
||||
SdmResponse handleApproveResult(LaunchApproveReq req);
|
||||
|
||||
/**
|
||||
* 根据模板编码获取流程模版详情
|
||||
* @param templateCode
|
||||
* @return
|
||||
*/
|
||||
SdmResponse<FlowTemplateResp> queryFlowTemplateInfoByTemplateCode(String templateCode);
|
||||
|
||||
}
|
||||
|
||||
@@ -509,4 +509,38 @@ public class FlowServiceImpl extends BaseService implements IFlowService {
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过模板编码获取流程模版详情
|
||||
* @param templateCode
|
||||
* @return
|
||||
*/
|
||||
private SimulationFlowTemplate getFlowTemplateInfoByTemplateCode(String templateCode)
|
||||
{
|
||||
String condition = " templateCode='"+templateCode+"'";
|
||||
List<SimulationFlowTemplate> templates = flowMapper.queryFlowTemplateByCondition(condition);
|
||||
if(templates.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return templates.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<FlowTemplateResp> queryFlowTemplateInfoByTemplateCode(String templateCode) {
|
||||
SdmResponse response = SdmResponse.success();
|
||||
SimulationFlowTemplate flowTemplate = getFlowTemplateInfoByTemplateCode(templateCode);
|
||||
if(flowTemplate == null)
|
||||
{
|
||||
response = SdmResponse.failed("流程模版不存在");
|
||||
}
|
||||
else
|
||||
{
|
||||
FlowTemplateResp flowTemplateResp = new FlowTemplateResp();
|
||||
BeanUtils.copyProperties(flowTemplate,flowTemplateResp);
|
||||
response.setData(flowTemplateResp);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,4 +108,19 @@ public class SimulationFlowFeignClientImpl implements ISimulationFlowFeignClient
|
||||
return SdmResponse.failed("查询流程节点信息失败异常");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<FlowTemplateResp> queryFlowTemplateInfoByTemplateCode(String templateCode) {
|
||||
SdmResponse<FlowTemplateResp> response;
|
||||
try {
|
||||
response = flowFeignClient.queryFlowTemplateInfoByTemplateCode(templateCode);
|
||||
if (!response.isSuccess()) {
|
||||
return SdmResponse.failed("查询流程模板信息失败");
|
||||
}
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
log.error("查询流程模板信息失败异常", e);
|
||||
return SdmResponse.failed("查询流程模板信息失败异常");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,4 +33,7 @@ public interface ISimulationFlowFeignClient {
|
||||
@PostMapping("/flow/node/querySimulationFlowNode")
|
||||
SdmResponse<FlowNodeDto> querySimulationFlowNode(@RequestBody FlowNodeDto req);
|
||||
|
||||
@GetMapping("/flow/queryFlowTemplateInfoByTemplateCode")
|
||||
SdmResponse<FlowTemplateResp> queryFlowTemplateInfoByTemplateCode(@RequestParam("templateCode") String templateCode);
|
||||
|
||||
}
|
||||
|
||||
@@ -113,8 +113,8 @@ public class SimulationLyricNodeController {
|
||||
*/
|
||||
@GetMapping("/queryProjectInfo")
|
||||
@Operation(summary = "查询项目信息", description = "查询项目信息")
|
||||
public SdmResponse queryProjectInfo(@RequestParam String projectId,@RequestParam Integer current,@RequestParam Integer size) {
|
||||
return lyricInternalService.queryProjectInfo(projectId,current,size);
|
||||
public SdmResponse queryProjectInfo(@RequestParam String projectId) {
|
||||
return lyricInternalService.queryProjectInfo(projectId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -102,5 +102,6 @@ public class PerformanceNodePo extends NodeAllBase {
|
||||
private String department = "";
|
||||
private String section = "";
|
||||
private String group = "";
|
||||
private String runId;
|
||||
|
||||
}
|
||||
|
||||
@@ -23,5 +23,5 @@ public interface ILyricInternalService {
|
||||
|
||||
SdmResponse queryProjectBatch(String projectId,Integer current,Integer size);
|
||||
|
||||
SdmResponse queryProjectInfo(String projectId,Integer current,Integer size);
|
||||
SdmResponse queryProjectInfo(String projectId);
|
||||
}
|
||||
|
||||
@@ -590,6 +590,7 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
List<LyricVPdtToDM> list = lyricVPdtDmService.lambdaQuery().eq(LyricVPdtToDM::getProjectId, projectId).list();
|
||||
log.info("根据projectId:{},查询到的项目pdt信息为:{}",projectId,list);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
@@ -612,6 +613,7 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
List<LyricVMainPlanDM> list = lyricVMainPlanDMService.lambdaQuery().eq(LyricVMainPlanDM::getProjectId, projectId).list();
|
||||
log.info("根据projectId:{},查询到的主计划信息为:{}",projectId,list);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
@@ -631,6 +633,7 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("data", new ArrayList<>());
|
||||
List<LyricVProductionLineToDM> list = lyricVProductionLineToDmService.lambdaQuery().eq(LyricVProductionLineToDM::getProjectNum, projectNum).list();
|
||||
log.info("根据projectNum:{},查询到的产线信息为:{}",projectNum,list);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
@@ -653,6 +656,7 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
List<LyricVProjectBatchToDM> list = lyricVProjectBatchToDmService.lambdaQuery().eq(LyricVProjectBatchToDM::getProject_id, projectId).list();
|
||||
log.info("根据projectId:{},查询到的批次信息为:{}",projectId,list);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
@@ -668,27 +672,13 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse queryProjectInfo(String projectId,Integer current,Integer size) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("data", new ArrayList<>());
|
||||
public SdmResponse queryProjectInfo(String projectId) {
|
||||
if (!isConvertibleToInt(projectId)) {
|
||||
return SdmResponse.success(jsonObject);
|
||||
return SdmResponse.success();
|
||||
}
|
||||
List<LyricVProjectToDM> list = lyricVProjectToDmService.lambdaQuery().eq(LyricVProjectToDM::getId, projectId).list();
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
list = list.stream().skip((long) (current - 1) * size).limit(size).toList();
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
jsonObject.put("currentPage", current);
|
||||
jsonObject.put("pageSize", size);
|
||||
jsonObject.put("total", list.size());
|
||||
jsonObject.put("data", list);
|
||||
return SdmResponse.success(jsonObject);
|
||||
|
||||
|
||||
LyricVProjectToDM projectNode = lyricVProjectToDmService.lambdaQuery().eq(LyricVProjectToDM::getId, projectId).one();
|
||||
log.info("根据projectId:{},查询到的项目信息为:{}",projectId,projectNode);
|
||||
return SdmResponse.success(projectNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -531,7 +531,7 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
||||
));
|
||||
if (CollectionUtils.isNotEmpty(taskTreePerformanceList)) {
|
||||
List<PerformanceNodePo> eachPerformanceNodeList;
|
||||
List<PerformanceNodePo> currentTaskAssociatedPerformanceList = taskTreePerformanceList.stream().filter(performance -> ObjectUtils.isNotEmpty(taskMap.get(performance.getTaskId()))).toList();
|
||||
List<PerformanceNodePo> currentTaskAssociatedPerformanceList = taskTreePerformanceList.stream().filter(performance -> ObjectUtils.isNotEmpty(taskMap.get(performance.getTaskId())) && performance.getRunId() == null).toList();
|
||||
if (CollectionUtils.isNotEmpty(currentTaskAssociatedPerformanceList)) {
|
||||
Map<String, List<PerformanceNodePo>> performanceMap = currentTaskAssociatedPerformanceList.stream().collect(Collectors.groupingBy(PerformanceNodePo::getTaskId));
|
||||
for (TaskNodePo taskNodePo : currentNodeAssociatedTaskList) {
|
||||
|
||||
@@ -19,8 +19,10 @@ import com.sdm.common.entity.req.task.TaskExportExcelFormat;
|
||||
import com.sdm.common.entity.req.task.TaskExportExcelParam;
|
||||
import com.sdm.common.entity.req.task.TaskTreeExportExcelFormat;
|
||||
import com.sdm.common.entity.req.task.TaskTreeExportExcelParam;
|
||||
import com.sdm.common.entity.resp.capability.FlowTemplateResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.common.feign.impl.capability.SimulationFlowFeignClientImpl;
|
||||
import com.sdm.common.feign.impl.data.DataClientFeignClientImpl;
|
||||
import com.sdm.common.feign.impl.system.SysUserFeignClientImpl;
|
||||
import com.sdm.common.utils.excel.ExcelUtil;
|
||||
@@ -105,6 +107,9 @@ public class TaskServiceImpl implements ITaskService {
|
||||
@Resource
|
||||
private INodeService nodeService;
|
||||
|
||||
@Autowired
|
||||
private SimulationFlowFeignClientImpl flowFeignClient;
|
||||
|
||||
private static final String NODE_NAME_KEY = "nodeName";
|
||||
|
||||
private static final String NODE_CODE_KEY = "nodeCode";
|
||||
@@ -2153,7 +2158,10 @@ public class TaskServiceImpl implements ITaskService {
|
||||
List<PerformanceNodePo> performanceList = projectMapper.getPerformanceListByNodeIdList(taskIdList);
|
||||
Map<String, List<PerformanceNodePo>> performanceMap = Map.of();
|
||||
if (CollectionUtils.isNotEmpty(performanceList)) {
|
||||
performanceMap = performanceList.stream().collect(Collectors.groupingBy(PerformanceNodePo::getTaskId));
|
||||
performanceList = performanceList.stream().filter(performance -> performance.getRunId() == null).toList();
|
||||
if (CollectionUtils.isNotEmpty(performanceList)) {
|
||||
performanceMap = performanceList.stream().collect(Collectors.groupingBy(PerformanceNodePo::getTaskId));
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(allNodeIdList)) {
|
||||
List<SpdmNodeVo> nodeList = nodeMapper.getNodeListByIds(allNodeIdList.stream().distinct().toList());
|
||||
@@ -2323,6 +2331,20 @@ public class TaskServiceImpl implements ITaskService {
|
||||
}
|
||||
spdmExportNewTaskVo.setStandard(String.join(",", fileNameList));
|
||||
}
|
||||
if (StringUtils.isNotBlank(spdmExportNewTaskVo.getFlowTemplate())) {
|
||||
List<String> flowTemplateNameList = new ArrayList<>();
|
||||
String[] flowTemplateArr = spdmExportNewTaskVo.getFlowTemplate().split(";");
|
||||
for (String flowTemplate : flowTemplateArr) {
|
||||
SdmResponse<FlowTemplateResp> flowTemplateResp = flowFeignClient.queryFlowTemplateInfoByTemplateCode(flowTemplate);
|
||||
if (flowTemplateResp.getData() == null) {
|
||||
continue;
|
||||
}
|
||||
flowTemplateNameList.add(flowTemplateResp.getData().getTemplateName());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(flowTemplateNameList)) {
|
||||
spdmExportNewTaskVo.setFlowTemplate(flowTemplateNameList.stream().collect(Collectors.joining(",")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ExcelUtil.exportExcelOneDimensional(JSONArray.from(allExportNewTaskVoList), exportExcelFormats, httpServletResponse,paramList);
|
||||
|
||||
Reference in New Issue
Block a user