diff --git a/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustmentController.java b/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustmentController.java index e018e4f..c58834f 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustmentController.java +++ b/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustmentController.java @@ -2356,4 +2356,12 @@ public class EntrustmentController { return entrustmentService.isMaterialPhoto(entrustmentId) ? R.ok(path) : R.ok(null); } + + @PutMapping("/editRequirement") + @ApiOperation(value = "修改鉴定要求") + public R editRequirement(@RequestBody Entrustment entrustment){ + Entrustment entst = entrustmentService.getById(entrustment.getId()); + entst.setEntrustRequirement(entrustment.getEntrustRequirement()); + return entrustmentService.updateById(entst) ? R.ok("修改成功") : R.failed("修改失败"); + } } diff --git a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentIdentificationMaterialServiceImpl.java b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentIdentificationMaterialServiceImpl.java index 146afba..49c4f40 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentIdentificationMaterialServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentIdentificationMaterialServiceImpl.java @@ -506,6 +506,7 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl updateWrapper = new UpdateWrapper(); updateWrapper.eq("id", im.getId()); // 查询条件是 id 相等 updateWrapper.set("check_passed", im.getCheckPassed()); updateWrapper.set("check_time", im.getCheckTime()); + updateWrapper.set("approve_passed", im.getApprovePassed()); + updateWrapper.set("approve_time", im.getApproveTime()); if (!this.update(null, updateWrapper)) { throw new RuntimeException("保存检材信息失败"); @@ -611,7 +616,15 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl bizAccept_Save(List materialList, DLPUser dlpUser) { - + boolean flag = false; + for (EntrustmentIdentificationMaterial material : materialList) { + if (material.getAcceptPassed() == 0) { + flag = true; + } + } + if (!flag) { + throw new RuntimeException(String.format("检材均已受理,无法进行修改保存!")); + } for (EntrustmentIdentificationMaterial identificationMaterial : materialList) { // 检查委托原来的状态 @@ -790,6 +803,7 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl list = this.list(Wrappers.lambdaQuery().eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustment.getId())); + entrustment.setEntrustRequirement(entrustmentService.buildEntrustReq(list)); + entrustmentService.updateById(entrustment); return identificationMaterialList; } @@ -1482,7 +1501,7 @@ public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl htmlA = remoteTemplate2htmlService.getManyHtml(templateFileName, maps); htmlList.addAll(htmlA); } diff --git a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentServiceImpl.java b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentServiceImpl.java index 53cb966..5f88520 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustmentServiceImpl.java @@ -495,7 +495,7 @@ public class EntrustmentServiceImpl extends ServiceImpl pis = entrustment.getProcessInfo(); - if (pis == null) { - pis = new ArrayList(); - } - if (opCode == 1) { - UpdateInfo pi = new UpdateInfo(dlpUser.getId(), - dlpUser.getName(), - dlpUser.getOrgId(), - dlpUser.getOrgName(), - "已审批", - opCode, entrustment.getStatus(), true); - pis.add(pi); - } else { - UpdateInfo pi = new UpdateInfo(dlpUser.getId(), - dlpUser.getName(), - dlpUser.getOrgId(), - dlpUser.getOrgName(), - "审批不通过", - opCode, entrustment.getStatus(), false, entrust.getApproveComments()); - pis.add(pi); - } - entrustment.setProcessInfo(pis); +// List pis = entrustment.getProcessInfo(); +// if (pis == null) { +// pis = new ArrayList(); +// } +// if (opCode == 1) { +// UpdateInfo pi = new UpdateInfo(dlpUser.getId(), +// dlpUser.getName(), +// dlpUser.getOrgId(), +// dlpUser.getOrgName(), +// "已审批", +// opCode, entrustment.getStatus(), true); +// pis.add(pi); +// } else { +// UpdateInfo pi = new UpdateInfo(dlpUser.getId(), +// dlpUser.getName(), +// dlpUser.getOrgId(), +// dlpUser.getOrgName(), +// "审批不通过", +// opCode, entrustment.getStatus(), false, entrust.getApproveComments()); +// pis.add(pi); +// } +// entrustment.setProcessInfo(pis); this.updateById(entrustment); @@ -2001,6 +2015,9 @@ public class EntrustmentServiceImpl extends ServiceImpl 0) { + //检查检材是否复秤,不复秤不能受理 + boolean b = this.checkRepeatWeigh(entrustment); + if (b) { + throw new RuntimeException(String.format("有未复秤的样本,请给样本复秤")); + } // 如果是确认受理, 需要检材全部都确认受理 // 检查检材的受理状态 List imList = entrustmentIdentificationMaterialService.list(Wrappers.query()