Commit 2d420d25 by lijingjing

样品处理逻辑修改

parent 39100e1c
...@@ -982,17 +982,25 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -982,17 +982,25 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
RestAssert.fail(null == nextStatus, String.format("编号为【%s】的委托,未配置下一流程状态信息!", entrust.getCode())); RestAssert.fail(null == nextStatus, String.format("编号为【%s】的委托,未配置下一流程状态信息!", entrust.getCode()));
// 当前委托状态 // 当前委托状态
EntrustStatusEnum status = entrust.getStatus(); EntrustStatusEnum status = entrust.getStatus();
// 是否特殊需求
boolean isSpecAsk = null != entrust.getSpecialAsk() && ("是".equals(entrust.getSpecialAsk()));
// 是否需要修改样品和检测项目(由于报告处只会修改部分样品) // 是否需要修改样品和检测项目(由于报告处只会修改部分样品)
boolean isUpdateSampleInfo = nextFlowValue < 9 || nextFlowValue > 13; boolean isUpdateSampleInfo = nextFlowValue < 9 || nextFlowValue > 13;
// 处理样品以及检测项目的流程状态 // 处理样品以及检测项目的流程状态
if (!isUpdateSampleInfo) { if (!isUpdateSampleInfo) {
return true; return true;
} }
// 修改样品信息及其样品附属信息
entrustSampleService.updateSampleNextFlowInfo(entrust, nextFlowStatus, account);
// 修改委托状态信息
entrust.setStatus(nextStatus);
entrust.setProgress(nextStatus);
entrust.setFlowStatus(nextFlowStatus.getName());
updateById(entrust);
// 若为特殊需求,必须要走评审 // 若为特殊需求,必须要走评审
String uri = ""; String uri = "";
// 是否特殊需求
boolean isSpecAsk = null != entrust.getSpecialAsk() && ("是".equals(entrust.getSpecialAsk()));
List<Long> sendUidList = new ArrayList<>(); List<Long> sendUidList = new ArrayList<>();
if (isSpecAsk || nextStatus == EntrustStatusEnum.CHECK) { if (isSpecAsk || nextStatus == EntrustStatusEnum.CHECK) {
uri = "/hmhj/entrust_manage/entrust_review"; uri = "/hmhj/entrust_manage/entrust_review";
...@@ -1008,13 +1016,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -1008,13 +1016,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
uri = "/hmhj/quality_manage/quality_decide"; uri = "/hmhj/quality_manage/quality_decide";
} }
entrustSampleService.updateSampleNextFlowInfo(entrust, nextFlowStatus, account);
entrust.setStatus(nextStatus);
entrust.setProgress(nextStatus);
entrust.setFlowStatus(nextFlowStatus.getName());
updateById(entrust);
String remark = "提交至" + nextFlowStatus.getDisplay(), String remark = "提交至" + nextFlowStatus.getDisplay(),
title = String.format("新的%s任务!", nextFlowStatus.getDisplay()), title = String.format("新的%s任务!", nextFlowStatus.getDisplay()),
content = String.format("有%s提交过来,请及时%s", EntrustFlowEnum.convert(flowStatus).getDisplay(), nextFlowStatus.getDisplay()); content = String.format("有%s提交过来,请及时%s", EntrustFlowEnum.convert(flowStatus).getDisplay(), nextFlowStatus.getDisplay());
...@@ -1562,6 +1563,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -1562,6 +1563,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
List<Long> specialIds = new ArrayList<>(), normalIds = new ArrayList<>(); List<Long> specialIds = new ArrayList<>(), normalIds = new ArrayList<>();
List<Long> sendUserIdList = new ArrayList<>(); List<Long> sendUserIdList = new ArrayList<>();
for (Entrust entrust : entrustList) { for (Entrust entrust : entrustList) {
RestAssert.fail(!Objects.equals(entrust.getFlowStatus(), EntrustFlowEnum.DRAFT.name()), "只能提交草稿状态的委托!");
List<EntrustSample> sampleList = entrustSampleService.getByEntrustId(entrust.getId()); List<EntrustSample> sampleList = entrustSampleService.getByEntrustId(entrust.getId());
RestAssert.fail(CollectionUtils.isEmpty(sampleList), String.format("委托编号为的【%s】样品为空!", entrust.getCode())); RestAssert.fail(CollectionUtils.isEmpty(sampleList), String.format("委托编号为的【%s】样品为空!", entrust.getCode()));
// 若存在任何一个样品的编号为空,那么需要自动生成其编号 // 若存在任何一个样品的编号为空,那么需要自动生成其编号
...@@ -1573,16 +1575,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -1573,16 +1575,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
} }
entrustSampleService.updateBatchById(sampleList); entrustSampleService.updateBatchById(sampleList);
// if (sampleList.stream().anyMatch(t -> StringUtils.isBlank(t.getCode()))) {
// for (EntrustSample sample : sampleList) {
// handleSampleCode(entrust, sample);
// if (StringUtils.isNotBlank(sample.getCode())) {
// RestAssert.fail(entrustSampleService.isRepeatSampleCode(sample), String.format("样品编号【%s】重复!", sample.getCode()));
// }
// }
// entrustSampleService.updateBatchById(sampleList);
// }
if ("是".equals(entrust.getSpecialAsk())) { if ("是".equals(entrust.getSpecialAsk())) {
specialIds.add(entrust.getId()); specialIds.add(entrust.getId());
} else { } else {
...@@ -1598,6 +1590,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -1598,6 +1590,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
} }
} }
} }
// 更新委托,发送消息
Entrust updateModel = new Entrust(); Entrust updateModel = new Entrust();
if (CollectionUtils.isNotEmpty(specialIds)) { if (CollectionUtils.isNotEmpty(specialIds)) {
updateModel.setStatus(EntrustStatusEnum.CHECK); updateModel.setStatus(EntrustStatusEnum.CHECK);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment