feat:查询需求待办附件/算例结果归档/编辑报告上传报告结果/任务文件查询修改
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.sdm.project.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 客户定制化查询需求附件配置
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "project")
|
||||
@Component
|
||||
public class CustomDemandFileConfig {
|
||||
/**
|
||||
* 客户配置映射
|
||||
*/
|
||||
private Map<String, CustomerProperties> customers = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 当前活跃客户配置
|
||||
*/
|
||||
private String activeCustomer;
|
||||
|
||||
@Data
|
||||
public static class CustomerProperties {
|
||||
private boolean enabled = false;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.sdm.project.controller;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.QueryDirReq;
|
||||
import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
import com.sdm.common.entity.req.task.DemandExportExcelFormat;
|
||||
import com.sdm.common.entity.req.task.TaskExportExcelFormat;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.feign.inter.data.IDataFeignClient;
|
||||
import com.sdm.common.log.annotation.SysLog;
|
||||
import com.sdm.project.model.bo.ModifyProjectNode;
|
||||
@@ -19,6 +22,8 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/demand")
|
||||
@@ -116,4 +121,10 @@ public class SimulationDemandController {
|
||||
return demandService.detail(demandId);
|
||||
}
|
||||
|
||||
@PostMapping("/queryDemandFiles")
|
||||
@Operation(summary = "查询需求待办附件")
|
||||
public SdmResponse<PageDataResp<List<FileMetadataInfoResp>>> queryDemandFiles(@RequestBody QueryDirReq req) {
|
||||
return demandService.queryDemandFiles(req);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -365,4 +365,12 @@ public class SimulationRunController implements ISimulationRunFeignClient {
|
||||
return runService.detail(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 归档算例下指标图片报告等结果数据到任务下
|
||||
*/
|
||||
@PostMapping("/synKeyResultToTask")
|
||||
public SdmResponse synKeyResultToTask(@RequestBody KeyResultReq req) {
|
||||
return runService.synKeyResultToTask(req);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -96,4 +96,8 @@ public class KeyResultReq extends BaseReq {
|
||||
@Schema(description = "所属任务uuid")
|
||||
private String taskId;
|
||||
|
||||
// ------------------归档关键结果使用-----------------
|
||||
@Schema(description = "关键结果uuid列表")
|
||||
private List<String> keyResultIdList;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.sdm.project.service;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.QueryDirReq;
|
||||
import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
import com.sdm.common.entity.req.task.DemandExportExcelFormat;
|
||||
import com.sdm.common.entity.req.task.TaskExportExcelFormat;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.project.model.req.*;
|
||||
import com.sdm.project.model.vo.SpdmDemandVo;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
@@ -40,4 +43,6 @@ public interface IDemandService {
|
||||
|
||||
List<SpdmDemandVo> getAllList();
|
||||
|
||||
SdmResponse<PageDataResp<List<FileMetadataInfoResp>>> queryDemandFiles(QueryDirReq req);
|
||||
|
||||
}
|
||||
|
||||
@@ -104,4 +104,6 @@ public interface ISimulationRunService extends IService<SimulationRun> {
|
||||
|
||||
SdmResponse<TaskRunPo> detail(SpdmTaskRunReq req);
|
||||
|
||||
SdmResponse synKeyResultToTask(KeyResultReq req);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.sdm.project.service.handle;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.QueryDirReq;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.feign.impl.data.DataClientFeignClientImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BasicQueryDemandFileHandler implements IQueryDemandFileHandler {
|
||||
|
||||
@Autowired
|
||||
private DataClientFeignClientImpl dataFeignClient;
|
||||
|
||||
@Override
|
||||
public SdmResponse<PageDataResp<List<FileMetadataInfoResp>>> queryDemandFile(QueryDirReq req) {
|
||||
log.info("BasicQueryDemandFileSender start....");
|
||||
return dataFeignClient.queryDir(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supports(String customerCode) {
|
||||
return "basic".equals(customerCode);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.sdm.project.service.handle;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.QueryDirReq;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IQueryDemandFileHandler {
|
||||
/**
|
||||
* 查询需求附件
|
||||
*/
|
||||
SdmResponse<PageDataResp<List<FileMetadataInfoResp>>> queryDemandFile(QueryDirReq req);
|
||||
|
||||
/**
|
||||
* 是否支持该客户
|
||||
*/
|
||||
boolean supports(String customerCode);
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.sdm.project.service.handle;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.enums.FileBizTypeEnum;
|
||||
import com.sdm.common.entity.req.data.QueryDirReq;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.utils.PageUtils;
|
||||
import com.sdm.outbridge.mode.LyricAttachmentInfo;
|
||||
import com.sdm.outbridge.service.lyric.LyricIntegrateService;
|
||||
import com.sdm.project.model.entity.SimulationDemand;
|
||||
import com.sdm.project.service.ISimulationLyricDemandService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LyricQueryDemandFileHandler implements IQueryDemandFileHandler {
|
||||
|
||||
@Autowired
|
||||
private LyricIntegrateService lyricIntegrateService;
|
||||
|
||||
@Autowired
|
||||
private BasicQueryDemandFileHandler basicSender;
|
||||
|
||||
@Autowired
|
||||
private ISimulationLyricDemandService lyricDemandService;
|
||||
|
||||
@Override
|
||||
public SdmResponse<PageDataResp<List<FileMetadataInfoResp>>> queryDemandFile(QueryDirReq req) {
|
||||
log.info("LyricQueryDemandFileSender start....");
|
||||
List<FileMetadataInfoResp> resultList = new ArrayList<>();
|
||||
// 1、先调用基础查询文件接口
|
||||
QueryDirReq newReq = new QueryDirReq();
|
||||
BeanUtils.copyProperties(req,newReq);
|
||||
newReq.setCurrent(1);
|
||||
newReq.setSize(999);
|
||||
SdmResponse<PageDataResp<List<FileMetadataInfoResp>>> basicResp = basicSender.queryDemandFile(newReq);
|
||||
if (basicResp.isSuccess() && basicResp.getData() != null && basicResp.getData().getData() != null) {
|
||||
resultList.addAll(basicResp.getData().getData());
|
||||
}
|
||||
|
||||
SimulationDemand demand = lyricDemandService.lambdaQuery().eq(SimulationDemand::getUuid, req.getUuid()).one();
|
||||
if (demand != null) {
|
||||
// 2、再调用利元亨查询待办接口
|
||||
SdmResponse sdmResponse = lyricIntegrateService.queryTodoAttachments(Integer.valueOf(demand.getDemandCode()));
|
||||
if (sdmResponse.isSuccess() && sdmResponse.getData() != null) {
|
||||
JSONArray jsonArray = (JSONArray) sdmResponse.getData();
|
||||
List<LyricAttachmentInfo> attachmentInfos = jsonArray.toJavaList(LyricAttachmentInfo.class);
|
||||
if (CollectionUtils.isNotEmpty(attachmentInfos)) {
|
||||
for (LyricAttachmentInfo attachmentInfo : attachmentInfos) {
|
||||
FileMetadataInfoResp fileMetadataInfoResp = new FileMetadataInfoResp();
|
||||
fileMetadataInfoResp.setFileResource("EP");
|
||||
fileMetadataInfoResp.setOriginalName(attachmentInfo.getName());
|
||||
fileMetadataInfoResp.setFileUrl(attachmentInfo.getFilePath());
|
||||
fileMetadataInfoResp.setFileType(FileBizTypeEnum.DEMAND_FILE.getValue());
|
||||
fileMetadataInfoResp.setFileSize(attachmentInfo.getFileSize());
|
||||
fileMetadataInfoResp.setCreatorName(StringUtils.isNotBlank(attachmentInfo.getCreateBy()) ? attachmentInfo.getCreateBy() : "EPUser");
|
||||
fileMetadataInfoResp.setCreateTime(LocalDateTime.parse(attachmentInfo.getCreateTime()));
|
||||
fileMetadataInfoResp.setUpdateTime(LocalDateTime.parse(attachmentInfo.getModifyTime()));
|
||||
resultList.add(fileMetadataInfoResp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 手动分页
|
||||
int pageSize = req.getSize();
|
||||
int currentPage = req.getCurrent();
|
||||
int fromIndex = (currentPage - 1) * pageSize;
|
||||
int toIndex = Math.min(fromIndex + pageSize, resultList.size());
|
||||
|
||||
List<FileMetadataInfoResp> pagedResults = new ArrayList<>();
|
||||
if (fromIndex < resultList.size()) {
|
||||
pagedResults = resultList.subList(fromIndex, toIndex);
|
||||
}
|
||||
|
||||
PageInfo<FileMetadataInfoResp> pageInfo = new PageInfo<>(pagedResults);
|
||||
pageInfo.setTotal(resultList.size());
|
||||
pageInfo.setPageNum(currentPage);
|
||||
pageInfo.setPageSize(pageSize);
|
||||
|
||||
return PageUtils.getJsonObjectSdmResponse(pagedResults, pageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supports(String customerCode) {
|
||||
return "lyric".equals(customerCode);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.sdm.project.service.handle;
|
||||
|
||||
import com.sdm.project.config.CustomDemandFileConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class QueryDemandFileSelector {
|
||||
|
||||
@Autowired
|
||||
private List<IQueryDemandFileHandler> handlers;
|
||||
|
||||
@Autowired
|
||||
private BasicQueryDemandFileHandler basicHandler;
|
||||
|
||||
@Autowired
|
||||
private CustomDemandFileConfig demandFileConfig;
|
||||
|
||||
/**
|
||||
* 根据客户选择发送策略
|
||||
*/
|
||||
public IQueryDemandFileHandler selectHandler() {
|
||||
String customerCode = demandFileConfig.getActiveCustomer();
|
||||
if (customerCode == null) {
|
||||
return basicHandler;
|
||||
}
|
||||
CustomDemandFileConfig.CustomerProperties config = demandFileConfig.getCustomers().get(customerCode);
|
||||
// 如果配置不存在或未启用,直接返回基础策略
|
||||
if (config == null || !config.isEnabled()) {
|
||||
return basicHandler;
|
||||
}
|
||||
for (IQueryDemandFileHandler sender : handlers) {
|
||||
if (sender.supports(customerCode)) {
|
||||
return sender;
|
||||
}
|
||||
}
|
||||
return basicHandler;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,12 +12,15 @@ import com.sdm.common.entity.enums.FilePermissionEnum;
|
||||
import com.sdm.common.entity.enums.MessageTemplateEnum;
|
||||
import com.sdm.common.entity.enums.ValueTypeEnum;
|
||||
import com.sdm.common.entity.req.data.CreateDirReq;
|
||||
import com.sdm.common.entity.req.data.QueryDirReq;
|
||||
import com.sdm.common.entity.req.data.UpdatePermissionReq;
|
||||
import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
import com.sdm.common.entity.req.system.SendMsgReq;
|
||||
import com.sdm.common.entity.req.system.UserQueryReq;
|
||||
import com.sdm.common.entity.req.task.DemandExportExcelFormat;
|
||||
import com.sdm.common.entity.req.task.DemandExportExcelParam;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.entity.resp.project.SpdmTaskVo;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.common.feign.impl.data.DataClientFeignClientImpl;
|
||||
@@ -41,6 +44,8 @@ import com.sdm.project.model.po.TaskNodePo;
|
||||
import com.sdm.project.model.req.*;
|
||||
import com.sdm.project.model.vo.*;
|
||||
import com.sdm.project.service.IDemandService;
|
||||
import com.sdm.project.service.handle.IQueryDemandFileHandler;
|
||||
import com.sdm.project.service.handle.QueryDemandFileSelector;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -86,6 +91,9 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
@Autowired
|
||||
private MessageFeignClientImpl messageFeignClient;
|
||||
|
||||
@Autowired
|
||||
private QueryDemandFileSelector queryDemandFileSelector;
|
||||
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
@@ -1008,6 +1016,12 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
||||
return mapper.getAllList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<PageDataResp<List<FileMetadataInfoResp>>> queryDemandFiles(QueryDirReq req) {
|
||||
IQueryDemandFileHandler queryDemandFileHandler = queryDemandFileSelector.selectHandler();
|
||||
return queryDemandFileHandler.queryDemandFile(req);
|
||||
}
|
||||
|
||||
private String getLastNodeId(TaskNode taskNode) {
|
||||
List<String> tagListProperty;
|
||||
String lastNodeId = "";
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.sdm.project.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sdm.project.dao.SimulationDemandMapper;
|
||||
import com.sdm.project.model.entity.SimulationDemand;
|
||||
import com.sdm.project.service.ISimulationLyricDemandService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ISimulationLyricDemandServiceImpl extends ServiceImpl<SimulationDemandMapper, SimulationDemand> implements ISimulationLyricDemandService {
|
||||
|
||||
}
|
||||
@@ -477,6 +477,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
phaseNode.setUuid(RandomUtil.generateString(32));
|
||||
phaseNode.setNodeCode(currentPhase);
|
||||
phaseNode.setNodeName(currentPhase);
|
||||
phaseNode.setNodeType(NodeTypeEnum.PHASE.getValue());
|
||||
phaseNode.setCreateTime(curDateStr);
|
||||
phaseNode.setCreator(jobNumber);
|
||||
phaseNode.setTenantId(tenantId);
|
||||
@@ -492,6 +493,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
machineNode.setUuid(RandomUtil.generateString(32));
|
||||
machineNode.setNodeCode(machineNumber);
|
||||
machineNode.setNodeName(projectStationByMachineNumberList.get(0).getMachineName());
|
||||
machineNode.setNodeType(NodeTypeEnum.MACHINE.getValue());
|
||||
machineNode.setCreateTime(curDateStr);
|
||||
machineNode.setCreator(jobNumber);
|
||||
machineNode.setTenantId(tenantId);
|
||||
@@ -503,6 +505,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
workspaceNode.setUuid(RandomUtil.generateString(32));
|
||||
workspaceNode.setNodeCode(lyricVProjectStationToDM.getStationNum());
|
||||
workspaceNode.setNodeName(lyricVProjectStationToDM.getStationName());
|
||||
workspaceNode.setNodeType(NodeTypeEnum.WORKSPACE.getValue());
|
||||
workspaceNode.setCreateTime(curDateStr);
|
||||
workspaceNode.setCreator(jobNumber);
|
||||
workspaceNode.setTenantId(tenantId);
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.sdm.common.config.FlowableConfig;
|
||||
import com.sdm.common.entity.constants.NumberConstants;
|
||||
import com.sdm.common.entity.enums.ApproveTypeEnum;
|
||||
import com.sdm.common.entity.enums.DirTypeEnum;
|
||||
import com.sdm.common.entity.enums.FileBizTypeEnum;
|
||||
import com.sdm.common.entity.enums.NodeTypeEnum;
|
||||
import com.sdm.common.entity.flowable.dto.FlowElementDTO;
|
||||
import com.sdm.common.entity.flowable.dto.ProcessDefinitionDTO;
|
||||
@@ -64,6 +65,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -1421,8 +1423,28 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
try {
|
||||
// 获取临时路径中脚本生成的报告
|
||||
String reportName = "report_" +
|
||||
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) +
|
||||
LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) +
|
||||
".docx";
|
||||
// 上传到算例下的报告文件夹下
|
||||
KeyResultReq resultReq = new KeyResultReq();
|
||||
resultReq.setKeyResultType(KeyResultTypeEnum.DOCUMENT.getKeyResultType());
|
||||
resultReq.setRunId(req.getRunId());
|
||||
resultReq.setName(reportName);
|
||||
// 创建临时MultipartFile
|
||||
MockMultipartFile multipartFile = new MockMultipartFile(
|
||||
reportName,
|
||||
reportName,
|
||||
"application/json",
|
||||
fileData);
|
||||
resultReq.setFile(multipartFile);
|
||||
resultReq.setFileName(reportName);
|
||||
resultReq.setFileType(FileBizTypeEnum.REPORT_FILE.getValue());
|
||||
SdmResponse sdmResponse = addSimulationKeyResult(resultReq);
|
||||
if (!sdmResponse.isSuccess()) {
|
||||
throw new RuntimeException("生成自动化报告上传报告结果目录失败");
|
||||
}
|
||||
|
||||
// 下载到本地
|
||||
FileInputStream fileInputStream = new FileInputStream(TEMP_REPORT_PATH + randomId + File.separator + reportName);
|
||||
fileData = fileInputStream.readAllBytes();
|
||||
// 设置响应头
|
||||
@@ -1900,4 +1922,49 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
return SdmResponse.success(taskRunPo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse synKeyResultToTask(KeyResultReq req) {
|
||||
SimulationRun simulationRun = this.lambdaQuery().eq(SimulationRun::getUuid, req.getRunId()).one();
|
||||
if (simulationRun == null) {
|
||||
return SdmResponse.failed("算例不存在");
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(req.getKeyResultIdList())) {
|
||||
for (String keyResultId : req.getKeyResultIdList()) {
|
||||
SimulationRunKeyResult keyResult = simulationKeyResultService.lambdaQuery().eq(SimulationRunKeyResult::getUuid, keyResultId).one();
|
||||
if (keyResult == null) {
|
||||
return SdmResponse.failed("关键结果不存在");
|
||||
}
|
||||
// 将算例下的指标分析值同步到任务指标
|
||||
if (KeyResultTypeEnum.VALUE.getKeyResultType().equals(keyResult.getKeyResultType())) {
|
||||
List<SimulationPerformance> runPerformanceList = simulationPerformanceService.lambdaQuery()
|
||||
.eq(SimulationPerformance::getRunId, req.getRunId())
|
||||
.list();
|
||||
Map<String, String> resultValueMap = new HashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(runPerformanceList)) {
|
||||
resultValueMap = runPerformanceList.stream().collect(Collectors.toMap(SimulationPerformance::getNodeCode, SimulationPerformance::getResultValue));
|
||||
}
|
||||
List<SimulationPerformance> simulationTaskPerformances = simulationPerformanceService.lambdaQuery()
|
||||
.eq(SimulationPerformance::getTaskId, simulationRun.getTaskId())
|
||||
.isNull(SimulationPerformance::getRunId)
|
||||
.list();
|
||||
if (CollectionUtils.isNotEmpty(simulationTaskPerformances)) {
|
||||
for (SimulationPerformance simulationTaskPerformance : simulationTaskPerformances) {
|
||||
simulationTaskPerformance.setResultValue(resultValueMap.get(simulationTaskPerformance.getNodeCode()));
|
||||
}
|
||||
simulationPerformanceService.updateBatchById(simulationTaskPerformances);
|
||||
}
|
||||
} else {
|
||||
// 图片/曲线/报告结果同步
|
||||
CopyFileToTaskReq copyFileToTaskReq = new CopyFileToTaskReq();
|
||||
copyFileToTaskReq.setSourceFileId(keyResult.getFileId());
|
||||
copyFileToTaskReq.setParentUuid(simulationRun.getTaskId());
|
||||
SdmResponse response = dataFeignClient.copyFileToTask(copyFileToTaskReq);
|
||||
if (!response.isSuccess()) {
|
||||
return SdmResponse.failed("归档文件失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return SdmResponse.success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,4 +141,12 @@ YA:
|
||||
|
||||
scheduler:
|
||||
todo: 10.10.00
|
||||
project: 10.11.00
|
||||
project: 10.11.00
|
||||
|
||||
project:
|
||||
active-customer: basic
|
||||
customers:
|
||||
basic:
|
||||
enabled: true
|
||||
lyric:
|
||||
enabled: false
|
||||
@@ -141,4 +141,12 @@ YA:
|
||||
|
||||
scheduler:
|
||||
todo: 10.10.00
|
||||
project: 10.11.00
|
||||
project: 10.11.00
|
||||
|
||||
project:
|
||||
active-customer: basic
|
||||
customers:
|
||||
basic:
|
||||
enabled: true
|
||||
lyric:
|
||||
enabled: false
|
||||
@@ -145,4 +145,12 @@ YA:
|
||||
|
||||
scheduler:
|
||||
todo: 20.00.00
|
||||
project: 20.00.00
|
||||
project: 20.00.00
|
||||
|
||||
project:
|
||||
active-customer: basic
|
||||
customers:
|
||||
basic:
|
||||
enabled: true
|
||||
lyric:
|
||||
enabled: false
|
||||
@@ -142,4 +142,12 @@ YA:
|
||||
|
||||
scheduler:
|
||||
todo: 20.00.00
|
||||
project: 20.00.00
|
||||
project: 20.00.00
|
||||
|
||||
project:
|
||||
active-customer: lyric
|
||||
customers:
|
||||
basic:
|
||||
enabled: false
|
||||
lyric:
|
||||
enabled: true
|
||||
@@ -141,4 +141,12 @@ YA:
|
||||
|
||||
scheduler:
|
||||
todo: 10.10.00
|
||||
project: 10.11.00
|
||||
project: 10.11.00
|
||||
|
||||
project:
|
||||
active-customer: basic
|
||||
customers:
|
||||
basic:
|
||||
enabled: true
|
||||
lyric:
|
||||
enabled: false
|
||||
Reference in New Issue
Block a user