fix:bug修复
This commit is contained in:
@@ -5,6 +5,7 @@ import lombok.Getter;
|
||||
@Getter
|
||||
public enum ApprovalStatusEnum {
|
||||
|
||||
NOT_START("未审批", 0),
|
||||
ING("进行中", 1),
|
||||
PASSED("评审通过", 2),
|
||||
REJECTED("评审驳回", 3);
|
||||
|
||||
@@ -134,8 +134,8 @@ public class SimulationRunController implements ISimulationRunFeignClient {
|
||||
}
|
||||
|
||||
@SysLog("编辑算例关键结果属性")
|
||||
@PostMapping(value = "/editSimulationKeyResult")
|
||||
public SdmResponse editSimulationKeyResult(@RequestBody KeyResultReq req) {
|
||||
@PostMapping(value = "/editSimulationKeyResult", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public SdmResponse editSimulationKeyResult(KeyResultReq req) {
|
||||
return runService.editSimulationKeyResult(req);
|
||||
}
|
||||
|
||||
|
||||
@@ -815,6 +815,28 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
public SdmResponse editSimulationKeyResult(KeyResultReq req) {
|
||||
SimulationRunKeyResult simulationRunKeyResult = new SimulationRunKeyResult();
|
||||
BeanUtils.copyProperties(req, simulationRunKeyResult);
|
||||
// 如果编辑了文件
|
||||
if (req.getFile() != null) {
|
||||
// 删掉旧文件
|
||||
if (simulationRunKeyResult.getFileId() != null) {
|
||||
DelFileReq delFileReq = new DelFileReq();
|
||||
delFileReq.setDelFileId(simulationRunKeyResult.getFileId());
|
||||
SdmResponse response = dataFeignClient.delFile(delFileReq);
|
||||
if (!response.isSuccess()) {
|
||||
return response;
|
||||
}
|
||||
}
|
||||
// 上传新文件
|
||||
UploadFilesReq filesReq = new UploadFilesReq();
|
||||
BeanUtils.copyProperties(req, filesReq);
|
||||
SdmResponse response = uploadKeyResultFiles(filesReq);
|
||||
if (response.isSuccess() && response.getData() != null) {
|
||||
JSONObject result = JSONObject.from(response.getData());
|
||||
simulationRunKeyResult.setFileId(Long.valueOf((Integer) result.get("fileId")));
|
||||
} else {
|
||||
return SdmResponse.failed("上传文件失败");
|
||||
}
|
||||
}
|
||||
if (!simulationKeyResultService.updateById(simulationRunKeyResult)) {
|
||||
return SdmResponse.failed("更新关键结果失败");
|
||||
}
|
||||
@@ -1012,12 +1034,10 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
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
|
||||
// 审批通过 设置任务进度为100,状态关闭
|
||||
if (NumberConstants.TWO == approveStatus) {
|
||||
simulationTask.setDifficult(difficult);
|
||||
simulationTask.setProgress(100);
|
||||
simulationTask.setExeStatus(TaskExeStatusEnum.CLOSED.getCode());
|
||||
simulationTask.setApprovalStatus(ApprovalStatusEnum.PASSED.getCode());
|
||||
|
||||
Reference in New Issue
Block a user