|
@@ -101,7 +101,9 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
|
|
|
//补充申请人姓名
|
|
|
item.setCreateByName(userIdNameCache.getNicknameByUserId(Long.parseLong(item.getCreateBy())));
|
|
|
//查询下载链接
|
|
|
- item.setFileUrl(fileVersionService.getLatestFileUrl(item.getId()));
|
|
|
+ FileVo latestFile = fileVersionService.getLatestFile(item.getId());
|
|
|
+ item.setFileUrl(latestFile.getUrl());
|
|
|
+ item.setFilename(latestFile.getName());
|
|
|
item.setStatusLabel(Objects.requireNonNull(GeneStatusEnum.getByStatus(item.getStatus())).getDescription());
|
|
|
});
|
|
|
|
|
@@ -125,7 +127,9 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
|
|
|
detail.setPurification(Optional.ofNullable(purificationInfoDto).orElse(new StrainPurificationInfoDto()));
|
|
|
|
|
|
//查询下载链接
|
|
|
- detail.setFileUrl(fileVersionService.getLatestFileUrl(id));
|
|
|
+ FileVo latestFile = fileVersionService.getLatestFile(id);
|
|
|
+ detail.setFileUrl(latestFile.getUrl());
|
|
|
+ detail.setFilename(latestFile.getName());
|
|
|
|
|
|
return detail;
|
|
|
}
|
|
@@ -172,7 +176,7 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
|
|
|
customInfoService.remove(new LambdaQueryWrapper<>(StrainCustomInfo.class).eq(StrainCustomInfo::getFlowId, id));
|
|
|
} else {
|
|
|
vo.getCustom().setFlowId(id);
|
|
|
- customInfoService.updateForm(id, vo.getCustom());
|
|
|
+ customInfoService.updateForm(vo.getCustom());
|
|
|
target.append(GeneTargetEnum.CUSTOM);
|
|
|
}
|
|
|
|
|
@@ -180,7 +184,7 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
|
|
|
purificationInfoService.remove(new LambdaQueryWrapper<>(StrainPurificationInfo.class).eq(StrainPurificationInfo::getFlowId, id));
|
|
|
} else {
|
|
|
vo.getPurification().setFlowId(id);
|
|
|
- purificationInfoService.updateForm(id, vo.getPurification());
|
|
|
+ purificationInfoService.updateForm(vo.getPurification());
|
|
|
|
|
|
if (target.length() > 0) {
|
|
|
target.append(",");
|
|
@@ -214,42 +218,19 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
|
|
|
Assert.notNull(flowInfo, "基因定制流程不存在");
|
|
|
Assert.isFalse(GeneStatusEnum.SUBMIT_STATUS.contains(flowInfo.getStatus()), "流程状态错误");
|
|
|
|
|
|
- //审核不通过
|
|
|
- if (StrConstant.NO.equals(vo.getAuditResult())) {
|
|
|
- log.info("流程项目 ({}) 审核不通过", flowInfo.getProjectName());
|
|
|
-
|
|
|
- new FlowAudit()
|
|
|
- .setFlowId(id)
|
|
|
- .setFlowStatus(flowInfo.getStatus())
|
|
|
- .setAuditResult(vo.getAuditResult())
|
|
|
- .setRemarks(vo.getRemarks())
|
|
|
- .setCreateSign(userIdNameCache.getSignPic(UserUtil.getUserId()))
|
|
|
- .insert();
|
|
|
-
|
|
|
- new FlowInfo()
|
|
|
- .setId(id)
|
|
|
- .setStatus(GeneStatusEnum.REJECTED.getStatus())
|
|
|
- .updateById();
|
|
|
-
|
|
|
- notifyService.notify(id);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- Assert.isTrue(StrConstant.YES.equals(vo.getAuditResult()), "审核结果错误");
|
|
|
-
|
|
|
- //审核通过
|
|
|
- log.info("流程项目 ({}) 审核通过", flowInfo.getProjectName());
|
|
|
-
|
|
|
String nextStatus = "";
|
|
|
GeneStatusEnum statusEnum = Objects.requireNonNull(GeneStatusEnum.getByStatus(flowInfo.getStatus()));
|
|
|
switch (statusEnum) {
|
|
|
case GENE_EDITING:
|
|
|
+ Assert.isTrue(UserUtil.getUserId().equals(flowInfo.getGeneEditPlId()), "抱歉,您不能审核本条记录");
|
|
|
nextStatus = GeneStatusEnum.PROJECT_LEADER.getStatus();
|
|
|
break;
|
|
|
case PROJECT_LEADER:
|
|
|
+ Assert.isTrue(UserUtil.getUserId().equals(flowInfo.getProjectLeaderId()), "抱歉,您不能审核本条记录");
|
|
|
nextStatus = GeneStatusEnum.PROJECT_MANAGEMENT.getStatus();
|
|
|
break;
|
|
|
case PROJECT_MANAGEMENT:
|
|
|
+ Assert.isTrue(UserUtil.getUserId().equals(flowInfo.getProjectManageId()), "抱歉,您不能审核本条记录");
|
|
|
nextStatus = GeneStatusEnum.COMPLETED.getStatus();
|
|
|
break;
|
|
|
default:
|
|
@@ -257,13 +238,36 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
|
|
|
throw new IllegalArgumentException("流程状态错误");
|
|
|
}
|
|
|
|
|
|
- new FlowAudit()
|
|
|
+ //保存审批节点
|
|
|
+ FlowAudit flowAudit = new FlowAudit()
|
|
|
.setFlowId(id)
|
|
|
.setFlowStatus(flowInfo.getStatus())
|
|
|
.setAuditResult(vo.getAuditResult())
|
|
|
.setRemarks(vo.getRemarks())
|
|
|
- .setCreateSign(userIdNameCache.getSignPic(UserUtil.getUserId()))
|
|
|
- .insert();
|
|
|
+ .setCreateSign(userIdNameCache.getSignPic(UserUtil.getUserId()));
|
|
|
+ if (StrUtil.isNotBlank(vo.getLeaderResult())) {
|
|
|
+ JSONObject dataObj = new JSONObject().fluentPut("leaderResult", vo.getLeaderResult());
|
|
|
+ flowAudit.setAdditionalData(dataObj.toJSONString());
|
|
|
+ }
|
|
|
+ flowAudit.insert();
|
|
|
+
|
|
|
+ //审核不通过
|
|
|
+ if (StrConstant.NO.equals(vo.getAuditResult())) {
|
|
|
+ log.info("流程项目 ({}) 审核不通过", flowInfo.getProjectName());
|
|
|
+
|
|
|
+ new FlowInfo()
|
|
|
+ .setId(id)
|
|
|
+ .setStatus(GeneStatusEnum.REJECTED.getStatus())
|
|
|
+ .updateById();
|
|
|
+
|
|
|
+ notifyService.notify(id);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Assert.isTrue(StrConstant.YES.equals(vo.getAuditResult()), "审核结果错误");
|
|
|
+
|
|
|
+ //审核通过
|
|
|
+ log.info("流程项目 ({}) 审核通过", flowInfo.getProjectName());
|
|
|
|
|
|
flowInfo = new FlowInfo();
|
|
|
//更新项目批准编号、修订号等
|
|
@@ -328,4 +332,12 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void copyFlow(Long id) {
|
|
|
+ FlowDetailDto detail = getDetail(id);
|
|
|
+ FlowDetailVo vo = BeanUtil.copyProperties(detail, FlowDetailVo.class);
|
|
|
+ vo.setProjectName(vo.getProjectName() + "(1)");
|
|
|
+ saveFlow(vo);
|
|
|
+ }
|
|
|
}
|