fix:交付物审批改造
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.sdm.data.model.resp;
|
||||
package com.sdm.common.entity.resp.data;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -2,7 +2,9 @@ package com.sdm.common.feign.impl.data;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.GetSimulationTaskFileReq;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.entity.resp.data.SimulationTaskResultCurveResp;
|
||||
import com.sdm.common.feign.inter.data.IDataAnalysisFeignClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -17,8 +19,8 @@ public class DataAnalysisFeignClientImpl implements IDataAnalysisFeignClient {
|
||||
IDataAnalysisFeignClient dataAnalysisFeignClient;
|
||||
|
||||
@Override
|
||||
public SdmResponse getSimulationTaskFile(GetSimulationTaskFileReq getSimulationTaskFileReq) {
|
||||
SdmResponse response;
|
||||
public SdmResponse<PageDataResp<List<SimulationTaskResultCurveResp>>> getSimulationTaskFile(GetSimulationTaskFileReq getSimulationTaskFileReq) {
|
||||
SdmResponse<PageDataResp<List<SimulationTaskResultCurveResp>>> response;
|
||||
try {
|
||||
response = dataAnalysisFeignClient.getSimulationTaskFile(getSimulationTaskFileReq);
|
||||
log.info("查询文件夹列表响应:"+ response);
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.sdm.common.feign.impl.project;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.feign.inter.project.ISimulationRunFeignClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SimulationRunFeignClientImpl implements ISimulationRunFeignClient {
|
||||
@Autowired
|
||||
ISimulationRunFeignClient simulationRunFeignClient;
|
||||
|
||||
@Override
|
||||
public SdmResponse deliverableApproveCallback(LaunchApproveReq req) {
|
||||
SdmResponse response;
|
||||
try {
|
||||
response = simulationRunFeignClient.deliverableApproveCallback(req);
|
||||
} catch (Exception e) {
|
||||
log.error("交付物审批回调失败", e);
|
||||
return SdmResponse.failed("交付物审批回调失败");
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,16 @@ package com.sdm.common.feign.inter.data;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.GetSimulationTaskFileReq;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.data.SimulationTaskResultCurveResp;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = "data",contextId = "dataAnalysisFeignClient")
|
||||
public interface IDataAnalysisFeignClient {
|
||||
@PostMapping("/dataAnalysis/getSimulationTaskFile")
|
||||
public SdmResponse getSimulationTaskFile(@RequestBody GetSimulationTaskFileReq getSimulationTaskFileReq);
|
||||
public SdmResponse<PageDataResp<List<SimulationTaskResultCurveResp>>> getSimulationTaskFile(@RequestBody GetSimulationTaskFileReq getSimulationTaskFileReq);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = "project")
|
||||
@FeignClient(name = "project",contextId = "nodeFeignClient")
|
||||
public interface ISimulationNodeFeignClient {
|
||||
/**
|
||||
* 根据节点类型获取所有节点
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.sdm.common.feign.inter.project;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
|
||||
@FeignClient(name = "project",contextId = "runFeignClient")
|
||||
public interface ISimulationRunFeignClient {
|
||||
|
||||
@PostMapping("/run/deliverableApproveCallback")
|
||||
SdmResponse deliverableApproveCallback(@RequestBody LaunchApproveReq req);
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import com.sdm.data.model.entity.FileMetadataInfo;
|
||||
import com.sdm.data.model.entity.FileStorage;
|
||||
import com.sdm.common.entity.req.data.GetSimulationTaskFileReq;
|
||||
import com.sdm.data.model.req.QueryBigFileReq;
|
||||
import com.sdm.data.model.resp.SimulationTaskResultCurveResp;
|
||||
import com.sdm.common.entity.resp.data.SimulationTaskResultCurveResp;
|
||||
import com.sdm.data.service.DataStorageAnalysis;
|
||||
import com.sdm.data.service.IDataAnalysisService;
|
||||
import com.sdm.data.service.IFileMetadataInfoService;
|
||||
|
||||
@@ -350,11 +350,11 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
fileInfo.setUploadTaskId(req.getUploadTaskId());
|
||||
fileInfo.setTemplateId(req.getTemplateId());
|
||||
fileInfo.setTemplateName(req.getTemplateName());
|
||||
// 知识库和交付物的文件需要审核
|
||||
// 知识库和交付物的文件需要审核(12月2需求澄清:不在上传这一步审核)
|
||||
// 1 知识库文件夹 2 交付物属于项目文件夹
|
||||
boolean isknowledge = Objects.equals(DirTypeEnum.KNOWLEDGE_BASE_DIR.getValue(), dirMetadataInfo.getDirType());
|
||||
boolean isDeliverable = Objects.equals(DirTypeEnum.PROJECT_NODE_DIR.getValue(), dirMetadataInfo.getDirType());
|
||||
if (isknowledge || isDeliverable) {
|
||||
// boolean isDeliverable = Objects.equals(DirTypeEnum.PROJECT_NODE_DIR.getValue(), dirMetadataInfo.getDirType());
|
||||
if (isknowledge) {
|
||||
fileInfo.setApprovalStatus(ApprovalFileDataStatusEnum.PENDING.getKey());
|
||||
fileInfo.setApproveType(ApproveFileDataTypeEnum.UPLOAD_REVIEWING.getCode());
|
||||
}
|
||||
@@ -2282,26 +2282,18 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
boolean isKnowledge = dirMetadataInfo != null &&
|
||||
Objects.equals(DirTypeEnum.KNOWLEDGE_BASE_DIR.getValue(), dirMetadataInfo.getDirType());
|
||||
|
||||
boolean isDeliverable = dirMetadataInfo != null &&
|
||||
Objects.equals(DirTypeEnum.PROJECT_NODE_DIR.getValue(), dirMetadataInfo.getDirType());
|
||||
|
||||
if (isKnowledge || isDeliverable) {
|
||||
if (isKnowledge) {
|
||||
// 构建审批内容
|
||||
String approveContents = "";
|
||||
if (isKnowledge) {
|
||||
approveContents = getApproveContents(
|
||||
succBusinessIds,"知识库文件批量新增", NumberConstants.ONE,succFileMetadataInfos,null );
|
||||
} else {
|
||||
approveContents = getApproveContents(
|
||||
succBusinessIds,"交付物文件批量新增", NumberConstants.ONE,succFileMetadataInfos,null );
|
||||
}
|
||||
approveContents = getApproveContents(
|
||||
succBusinessIds,"知识库文件批量新增", NumberConstants.ONE,succFileMetadataInfos,null );
|
||||
// 发起审批
|
||||
Pair<Boolean, String> approvePair = launchFileDataApprove(
|
||||
firstFile.getTemplateId(),
|
||||
firstFile.getTemplateName(),
|
||||
approveContents,
|
||||
NumberConstants.ONE,
|
||||
isKnowledge ? ApproveTypeEnum.KNOWLEDGE_APPROVE : ApproveTypeEnum.DELIVERABLE_APPROVE
|
||||
ApproveTypeEnum.KNOWLEDGE_APPROVE
|
||||
);
|
||||
// 审批创建失败:抛出异常
|
||||
if (!approvePair.getLeft() || org.apache.commons.lang3.StringUtils.isBlank(approvePair.getRight())) {
|
||||
@@ -2314,8 +2306,8 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
|
||||
// 3. 批量更新文件状态(上传完成)
|
||||
FileMetadataInfo updateEntity = new FileMetadataInfo();
|
||||
updateEntity.setUploadStatus(NumberConstants.ONE_STR);
|
||||
// 知识库文件 & 交付物文件:关联审批流ID
|
||||
if ((isKnowledge || isDeliverable) && org.apache.commons.lang3.StringUtils.isNotBlank(cidFlowId)) {
|
||||
// 知识库文件:关联审批流ID
|
||||
if ((isKnowledge) && org.apache.commons.lang3.StringUtils.isNotBlank(cidFlowId)) {
|
||||
updateEntity.setCidFlowId(cidFlowId);
|
||||
}
|
||||
// 执行更新
|
||||
|
||||
@@ -6,9 +6,11 @@ import com.sdm.common.entity.req.data.CreateDirReq;
|
||||
import com.sdm.common.entity.req.data.KnowledgeCallBackReq;
|
||||
import com.sdm.common.entity.req.data.QueryDirReq;
|
||||
import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.data.BatchAddFileInfoResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.feign.inter.project.ISimulationRunFeignClient;
|
||||
import com.sdm.project.model.entity.SimulationRun;
|
||||
import com.sdm.project.model.entity.SimulationRunKeyResult;
|
||||
import com.sdm.project.model.req.*;
|
||||
@@ -32,7 +34,7 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequestMapping(value = "/run")
|
||||
@Tag(name = "仿真任务策划管理", description = "仿真任务策划管理管理相关接口")
|
||||
public class SimulationRunController {
|
||||
public class SimulationRunController implements ISimulationRunFeignClient {
|
||||
|
||||
@Resource
|
||||
private ISimulationRunService runService;
|
||||
@@ -138,6 +140,26 @@ public class SimulationRunController {
|
||||
return runService.batchAddSimulationKeyResult(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交交付物审批
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deliverableApprove")
|
||||
public SdmResponse deliverableApprove(@RequestBody DeliverableApproveReq req) {
|
||||
return runService.deliverableApprove(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 交付物审批回调
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deliverableApproveCallback")
|
||||
public SdmResponse deliverableApproveCallback(@RequestBody LaunchApproveReq req) {
|
||||
return runService.deliverableApproveCallback(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 算例关键结果查询
|
||||
*
|
||||
@@ -154,7 +176,7 @@ public class SimulationRunController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/queryKeyResultAndTaskInfo")
|
||||
public SdmResponse<KeyResultAndTaskInfoResp> queryKeyResultAndTaskInfo(@RequestBody KeyResultReq req) {
|
||||
public SdmResponse<PageDataResp<List<KeyResultAndTaskInfoResp>>> queryKeyResultAndTaskInfo(@RequestBody KeyResultReq req) {
|
||||
return runService.queryKeyResultAndTaskInfo(req);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.sdm.project.model.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/* 交付物审批流程,传递给电子流平台内容变化的数据 */
|
||||
@Data
|
||||
public class ApprovalDeliverableContentsModel {
|
||||
/**
|
||||
* 任务uuid
|
||||
*/
|
||||
private String taskId;
|
||||
/**
|
||||
* 难度系数
|
||||
*/
|
||||
private Float difficult;
|
||||
|
||||
}
|
||||
@@ -195,5 +195,8 @@ public class SimulationTask implements Serializable {
|
||||
@TableField("tag10")
|
||||
private String tag10;
|
||||
|
||||
@TableField("cidFlowId")
|
||||
private String cidFlowId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.sdm.project.model.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DeliverableApproveReq {
|
||||
|
||||
@Schema(description = "任务uuid")
|
||||
private String taskId;
|
||||
|
||||
@Schema(description = "难度系数")
|
||||
private Float difficult;
|
||||
|
||||
@Schema(description = "交付物审批模板id")
|
||||
private String templateId;
|
||||
|
||||
@Schema(description = "交付物审批模板名称")
|
||||
private String templateName;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.sdm.project.model.resp;
|
||||
|
||||
import com.sdm.common.entity.resp.data.SimulationTaskResultCurveResp;
|
||||
import com.sdm.project.model.entity.SimulationTask;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -52,4 +53,7 @@ public class KeyResultAndTaskInfoResp {
|
||||
@Schema(description = "任务信息")
|
||||
private SimulationTask simulationTask;
|
||||
|
||||
@Schema(description = "文件信息")
|
||||
private SimulationTaskResultCurveResp fileInfo;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.sdm.common.entity.req.data.CreateDirReq;
|
||||
import com.sdm.common.entity.req.data.KnowledgeCallBackReq;
|
||||
import com.sdm.common.entity.req.data.QueryDirReq;
|
||||
import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.data.BatchAddFileInfoResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
@@ -51,9 +52,13 @@ public interface ISimulationRunService extends IService<SimulationRun> {
|
||||
|
||||
SdmResponse<List<BatchAddFileInfoResp>> batchAddSimulationKeyResult(KeyResultReq req);
|
||||
|
||||
SdmResponse deliverableApprove(DeliverableApproveReq req);
|
||||
|
||||
SdmResponse deliverableApproveCallback(LaunchApproveReq req);
|
||||
|
||||
SdmResponse<PageDataResp<List<SimulationRunKeyResult>>> listSimulationKeyResult(KeyResultReq req);
|
||||
|
||||
SdmResponse<KeyResultAndTaskInfoResp> queryKeyResultAndTaskInfo(KeyResultReq req);
|
||||
SdmResponse<PageDataResp<List<KeyResultAndTaskInfoResp>>> queryKeyResultAndTaskInfo(KeyResultReq req);
|
||||
|
||||
SdmResponse deleteSimulationKeyResult(KeyResultReq req);
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.common.ThreadLocalContext;
|
||||
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.NodeTypeEnum;
|
||||
import com.sdm.common.entity.flowable.dto.FlowElementDTO;
|
||||
@@ -17,17 +19,21 @@ import com.sdm.common.entity.flowable.dto.NodeStructureInfo;
|
||||
import com.sdm.common.entity.flowable.dto.ProcessDefinitionDTO;
|
||||
import com.sdm.common.entity.req.capability.FlowNodeDto;
|
||||
import com.sdm.common.entity.req.data.*;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.entity.req.system.UserQueryReq;
|
||||
import com.sdm.common.entity.resp.PageDataResp;
|
||||
import com.sdm.common.entity.resp.capability.FlowTemplateResp;
|
||||
import com.sdm.common.entity.resp.data.BatchAddFileInfoResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.entity.resp.data.SimulationTaskResultCurveResp;
|
||||
import com.sdm.common.entity.resp.flowable.ProcessInstanceDetailResponse;
|
||||
import com.sdm.common.entity.resp.flowable.ProcessInstanceResp;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.common.feign.impl.capability.SimulationFlowFeignClientImpl;
|
||||
import com.sdm.common.feign.impl.data.DataAnalysisFeignClientImpl;
|
||||
import com.sdm.common.feign.impl.data.DataClientFeignClientImpl;
|
||||
import com.sdm.common.feign.impl.flowable.FlowableClientFeignClientImpl;
|
||||
import com.sdm.common.feign.impl.system.ApproveFeignClientImpl;
|
||||
import com.sdm.common.feign.impl.system.SysUserFeignClientImpl;
|
||||
import com.sdm.common.feign.inter.capability.ISimulationFlowFeignClient;
|
||||
import com.sdm.common.feign.inter.data.IDataFeignClient;
|
||||
@@ -37,8 +43,10 @@ import com.sdm.common.utils.RandomUtil;
|
||||
import com.sdm.project.common.KeyResultTypeEnum;
|
||||
import com.sdm.project.common.MemberTypeEnum;
|
||||
import com.sdm.project.common.RunPerformanceStatusEnum;
|
||||
import com.sdm.project.common.TaskExeStatusEnum;
|
||||
import com.sdm.project.dao.SimulationProjectMapper;
|
||||
import com.sdm.project.dao.SimulationRunMapper;
|
||||
import com.sdm.project.model.bo.ApprovalDeliverableContentsModel;
|
||||
import com.sdm.project.model.bo.TaskNode;
|
||||
import com.sdm.project.model.bo.TaskNodeTag;
|
||||
import com.sdm.project.model.entity.*;
|
||||
@@ -111,6 +119,12 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
@Autowired
|
||||
private SimulationFlowFeignClientImpl flowFeignClient;
|
||||
|
||||
@Autowired
|
||||
private ApproveFeignClientImpl approveFeignClient;
|
||||
|
||||
@Autowired
|
||||
private DataAnalysisFeignClientImpl analysisFeignClient;
|
||||
|
||||
private static final String TEMP_REPORT_PATH = "/opt/report/";
|
||||
|
||||
private int getCurrentNodeDepth(NodeAllBase eachNode) {
|
||||
@@ -781,6 +795,73 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
return SdmResponse.success(new ArrayList<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse deliverableApprove(DeliverableApproveReq req) {
|
||||
SimulationTask simulationTask = simulationTaskService.lambdaQuery().eq(SimulationTask::getUuid, req.getTaskId()).one();
|
||||
if (simulationTask != null) {
|
||||
ApprovalDeliverableContentsModel contentsModel = new ApprovalDeliverableContentsModel();
|
||||
contentsModel.setTaskId(req.getTaskId());
|
||||
contentsModel.setDifficult(req.getDifficult());
|
||||
// 发起审批
|
||||
String cidFlowId = launchParamApprove(req.getTemplateId(),req.getTemplateName(), JSONObject.toJSONString(contentsModel),1);
|
||||
if (StringUtils.isEmpty(cidFlowId)) {
|
||||
return SdmResponse.failed("发起评审失败");
|
||||
}
|
||||
simulationTask.setCidFlowId(cidFlowId);
|
||||
simulationTaskService.updateById(simulationTask);
|
||||
return SdmResponse.success(cidFlowId);
|
||||
}
|
||||
return SdmResponse.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse deliverableApproveCallback(LaunchApproveReq req) {
|
||||
SdmResponse response = SdmResponse.success();
|
||||
int approveStatus = req.approveStatus;
|
||||
String approveContent = req.approveContents;
|
||||
JSONObject contentObj = JSONObject.parseObject(approveContent);
|
||||
if(contentObj != null && contentObj.containsKey("taskId"))
|
||||
{
|
||||
String taskId = contentObj.getString("taskId");
|
||||
Float difficult = contentObj.getFloat("difficult");
|
||||
SimulationTask simulationTask = simulationTaskService.lambdaQuery().eq(SimulationTask::getUuid, taskId).one();
|
||||
if(simulationTask != null)
|
||||
{
|
||||
// 审批通过 部署流程 保存部署流程部署id和流程定义id
|
||||
if (NumberConstants.TWO == approveStatus) {
|
||||
simulationTask.setDifficult(difficult);
|
||||
simulationTask.setProgress(100);
|
||||
simulationTask.setExeStatus(TaskExeStatusEnum.CLOSED.getCode());
|
||||
simulationTaskService.updateById(simulationTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
private String launchParamApprove(String templateId, String templateName,String approveContents,int approveAction) {
|
||||
LaunchApproveReq req = new LaunchApproveReq();
|
||||
req.templateId = templateId;
|
||||
req.templateName = templateName;
|
||||
req.approveContents = approveContents;
|
||||
req.approveAction = approveAction;
|
||||
req.approveStatus = 1;
|
||||
req.approveType = ApproveTypeEnum.DELIVERABLE_APPROVE.getCode();
|
||||
req.approveTitle = "交付物评审";
|
||||
req.tenantId = ThreadLocalContext.getTenantId();
|
||||
req.userId = ThreadLocalContext.getUserId();
|
||||
req.creator = ThreadLocalContext.getUserId();
|
||||
SdmResponse response = approveFeignClient.launchApproval(req);
|
||||
if(response.isSuccess()){
|
||||
// 成功
|
||||
String cidFlowId = Optional.ofNullable(response.getData())
|
||||
.map(Object::toString)
|
||||
.orElse("");
|
||||
return cidFlowId;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<PageDataResp<List<SimulationRunKeyResult>>> listSimulationKeyResult(KeyResultReq req) {
|
||||
PageHelper.startPage(req.getCurrent(), req.getSize());
|
||||
@@ -791,17 +872,30 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<KeyResultAndTaskInfoResp> queryKeyResultAndTaskInfo(KeyResultReq req) {
|
||||
KeyResultAndTaskInfoResp keyResultAndTaskInfoResp = new KeyResultAndTaskInfoResp();
|
||||
SimulationRunKeyResult simulationRunKeyResult = simulationKeyResultService.lambdaQuery().eq(SimulationRunKeyResult::getFileId, req.getFileId()).one();
|
||||
if (simulationRunKeyResult != null) {
|
||||
BeanUtils.copyProperties(simulationRunKeyResult, keyResultAndTaskInfoResp);
|
||||
SimulationRun simulationRun = this.lambdaQuery().eq(SimulationRun::getUuid, simulationRunKeyResult.getRunId()).one();
|
||||
if (simulationRun != null) {
|
||||
keyResultAndTaskInfoResp.setSimulationTask(simulationTaskService.lambdaQuery().eq(SimulationTask::getUuid, simulationRun.getTaskId()).one());
|
||||
public SdmResponse<PageDataResp<List<KeyResultAndTaskInfoResp>>> queryKeyResultAndTaskInfo(KeyResultReq req) {
|
||||
List<KeyResultAndTaskInfoResp> respList = new ArrayList<>();
|
||||
|
||||
GetSimulationTaskFileReq taskFileReq = new GetSimulationTaskFileReq();
|
||||
taskFileReq.setUuid(req.getTaskId());
|
||||
taskFileReq.setFileBizType(req.getFileType());
|
||||
taskFileReq.setCurrent(req.getCurrent());
|
||||
taskFileReq.setSize(req.getSize());
|
||||
SdmResponse<PageDataResp<List<SimulationTaskResultCurveResp>>> sdmResponse = analysisFeignClient.getSimulationTaskFile(taskFileReq);
|
||||
|
||||
if (sdmResponse.getData() != null && sdmResponse.getData().getData() != null) {
|
||||
List<SimulationTaskResultCurveResp> resultCurveResps = sdmResponse.getData().getData();
|
||||
for (SimulationTaskResultCurveResp resultCurveResp : resultCurveResps) {
|
||||
KeyResultAndTaskInfoResp keyResultAndTaskInfoResp = new KeyResultAndTaskInfoResp();
|
||||
keyResultAndTaskInfoResp.setFileInfo(resultCurveResp);
|
||||
SimulationRunKeyResult simulationRunKeyResult = simulationKeyResultService.lambdaQuery().eq(SimulationRunKeyResult::getFileId, resultCurveResp.getId()).one();
|
||||
if (simulationRunKeyResult != null) {
|
||||
BeanUtils.copyProperties(simulationRunKeyResult, keyResultAndTaskInfoResp);
|
||||
}
|
||||
respList.add(keyResultAndTaskInfoResp);
|
||||
}
|
||||
}
|
||||
return SdmResponse.success(keyResultAndTaskInfoResp);
|
||||
PageInfo<KeyResultAndTaskInfoResp> page = new PageInfo<>(respList);
|
||||
return PageUtils.getJsonObjectSdmResponse(respList, page);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.enums.ApproveTypeEnum;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.feign.inter.data.IDataFeignClient;
|
||||
import com.sdm.common.feign.inter.project.ISimulationRunFeignClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -11,7 +12,7 @@ import org.springframework.stereotype.Component;
|
||||
public class TaskDeliverableStrategy extends ApproveAbstractNoticeStrategy {
|
||||
|
||||
@Autowired
|
||||
private IDataFeignClient dataFeignClient;
|
||||
private ISimulationRunFeignClient runFeignClient;
|
||||
// 这个回调场景值和 LaunchApproveReq 类里的 approveType 对应
|
||||
// 审批类型 0.http回调的,replyUrl必须传递,相当于是跨系统的,调用的时候可以不传,replyUrl必须传递 ;1:仿真地图审批(spdm内部feign) 2:知识库审批(spdm内部feign) 4:交付物审批(spdm内部feign)
|
||||
@Override
|
||||
@@ -21,7 +22,7 @@ public class TaskDeliverableStrategy extends ApproveAbstractNoticeStrategy {
|
||||
|
||||
@Override
|
||||
public SdmResponse noticeResult(LaunchApproveReq req) {
|
||||
return dataFeignClient.approveDataFile(req);
|
||||
return runFeignClient.deliverableApproveCallback(req);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user