diff --git a/doc/assets/2025-01-15-10-04-01-image.png b/doc/assets/2025-01-15-10-04-01-image.png new file mode 100644 index 0000000..69e0bbb Binary files /dev/null and b/doc/assets/2025-01-15-10-04-01-image.png differ diff --git a/doc/assets/2025-01-15-10-06-29-image.png b/doc/assets/2025-01-15-10-06-29-image.png new file mode 100644 index 0000000..2cae94e Binary files /dev/null and b/doc/assets/2025-01-15-10-06-29-image.png differ diff --git a/doc/assets/2025-01-15-10-06-52-image.png b/doc/assets/2025-01-15-10-06-52-image.png new file mode 100644 index 0000000..583fe68 Binary files /dev/null and b/doc/assets/2025-01-15-10-06-52-image.png differ diff --git a/doc/assets/2025-01-15-10-07-23-image.png b/doc/assets/2025-01-15-10-07-23-image.png new file mode 100644 index 0000000..c488281 Binary files /dev/null and b/doc/assets/2025-01-15-10-07-23-image.png differ diff --git a/doc/贵阳禁毒送检受理委托新增需求文档.md b/doc/贵阳禁毒送检受理委托新增需求文档.md index 5012dbf..652926a 100644 --- a/doc/贵阳禁毒送检受理委托新增需求文档.md +++ b/doc/贵阳禁毒送检受理委托新增需求文档.md @@ -299,6 +299,22 @@ DESC LIMIT 1; ## 20250102 在受理页面添加可以录入检材检出结果的功能 +## 20250103 新增接口-判断当前委托保存的检材是否和用户当前页面填写的检材数量是否匹配,是则返回true,否返回false -## 20250103 新增接口-判断当前委托保存的检材是否和用户当前页面填写的检材数量是否匹配,是则返回true,否返回false + +## 20250114 受理编号生成,有受理成功后在受理改为委托单位提交后,受理单位审核通过就生成 + +### 实现 + +修改了审核委托bizChecker_Apply的方法(digital.laboratory.platform.entrustment.service.impl.EntrustmentServiceImpl) + +![](assets/2025-01-15-10-04-01-image.png) + +受理成功的方法bizAccept_Apply注释了部分代码: + +![](assets/2025-01-15-10-06-29-image.png) + +![](assets/2025-01-15-10-06-52-image.png) + +![](assets/2025-01-15-10-07-23-image.png) 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 d537975..763cf22 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustmentController.java +++ b/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustmentController.java @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import digital.laboratory.platform.common.core.constant.OSSDirectoryConstants; +import digital.laboratory.platform.common.core.exception.CheckedException; import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.mybatis.security.service.DLPUser; @@ -1342,7 +1343,11 @@ public class EntrustmentController { // System.out.println(String.format("theHttpServletRequest.toString()=%s", theHttpServletRequest.toString())); Principal principal = theHttpServletRequest.getUserPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); - return R.ok(entrustmentService.bizSubmitter_Apply(entrust, dlpUser), "委托提交成功"); + try { + return R.ok(entrustmentService.bizSubmitter_Apply(entrust, dlpUser), "委托提交成功"); + } catch (CheckedException e) { + return R.failed(e.getMessage()); + } } diff --git a/src/main/java/digital/laboratory/platform/entrustment/convert/DrugLiteConvert.java b/src/main/java/digital/laboratory/platform/entrustment/convert/DrugLiteConvert.java index 823c764..fc1379e 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/convert/DrugLiteConvert.java +++ b/src/main/java/digital/laboratory/platform/entrustment/convert/DrugLiteConvert.java @@ -27,4 +27,17 @@ public class DrugLiteConvert { return drugLiteList; } + /** + * 将药物列表名称连接成字符串。 + * + * @param drugLitesJson 药物列表(JSON格式) + * @param delimiter 分隔符 + * @return 连接后的字符串 + */ + public static String joiningDrugListNameToStr(List drugLitesJson, String delimiter) { + return convertDirtyLiteByJSON(drugLitesJson) + .stream() + .map(DrugLite::getName) + .collect(Collectors.joining(delimiter)); + } } diff --git a/src/main/java/digital/laboratory/platform/entrustment/service/impl/AcceptServiceImpl.java b/src/main/java/digital/laboratory/platform/entrustment/service/impl/AcceptServiceImpl.java index 60a1940..c715bb9 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/service/impl/AcceptServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/entrustment/service/impl/AcceptServiceImpl.java @@ -11,6 +11,7 @@ import digital.laboratory.platform.entrustment.service.AcceptService; import digital.laboratory.platform.entrustment.service.EntrustmentIdentificationMaterialService; import digital.laboratory.platform.entrustment.service.EntrustmentService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.List; @@ -34,6 +35,7 @@ public class AcceptServiceImpl implements AcceptService { * @return */ @Override + @Transactional(rollbackFor = Exception.class) public Boolean alertMaterialAcceptNo(EntrustmentIdentificationMaterial material) { EntrustmentIdentificationMaterial identificationMaterial = entrustmentIdentificationMaterialService.getById(material.getId()); if (identificationMaterial == null) { @@ -70,6 +72,12 @@ public class AcceptServiceImpl implements AcceptService { } if (entrustmentIdentificationMaterialService.update(Wrappers.lambdaUpdate() .eq(EntrustmentIdentificationMaterial::getId, material.getId()).set(EntrustmentIdentificationMaterial::getAcceptNo, materialAcceptNo))) { + // 更新成功后,判断委托的受理编号是否和修改的检材受理后一致,不一致则更新 + if (!entrustAcceptNo.equals(entrustment.getAcceptNo())) { + entrustmentService.update(Wrappers.lambdaUpdate() + .eq(Entrustment::getId, entrustment.getId()) + .set(Entrustment::getAcceptNo, entrustAcceptNo)); + } // 查询该委托下面的其他已经受理的检材 List materialList = entrustmentIdentificationMaterialService.list(Wrappers.lambdaQuery() .eq(EntrustmentIdentificationMaterial::getEntrustmentId, identificationMaterial.getEntrustmentId()) diff --git a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustAlterApplyServiceImpl.java b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustAlterApplyServiceImpl.java index 40649e0..bd4e915 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustAlterApplyServiceImpl.java +++ b/src/main/java/digital/laboratory/platform/entrustment/service/impl/EntrustAlterApplyServiceImpl.java @@ -260,7 +260,7 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl split = StrUtil.split(entrustment.getAcceptNo(), "-"); + dm.put("identificationNo", String.format("[%s]%s号", split.get(0), split.get(1)));//受理编号 + } +// dm.put("identificationNo", entrustment.getAcceptNo());//受理编号 dm.put("year", entrustment.getEntrustmentTime() != null ? entrustment.getEntrustmentTime().getYear() : LocalDate.now().getYear()); dm.put("materialDes", buildMaterialDes(materialList));//检材描述 @@ -799,11 +805,7 @@ public class EntrustmentServiceImpl extends ServiceImpl item.getAnalysisOption() + "_" + - DrugLiteConvert.convertDirtyLiteByJSON(item.getCandidateDrugs()) - .stream() - .map(DrugLite::getName) - .collect(Collectors.joining("")), + DrugLiteConvert.joiningDrugListNameToStr(item.getCandidateDrugs(), ""), LinkedHashMap::new, // 返回有序map Collectors.toList()) ); @@ -827,11 +826,7 @@ public class EntrustmentServiceImpl extends ServiceImpl materialList = entrustmentIdentificationMaterialService -// .list(Wrappers.lambdaQuery() -// .eq(EntrustmentIdentificationMaterial::getEntrustmentId, entrustment.getId())); -// List materialIds = new ArrayList<>(); -// materialList.forEach(item -> { -// materialIds.add(item.getId()); -// }); -// String path = remoteGenerateWordService.genMaterialPhoto(entrustId, materialIds, caseEvent.getCaseName(), entrustment.getAcceptNo(), groupCount); -// -// return path; -// } - // @Override public Boolean historyDataToTransSys(String status, List entrustIds) { @@ -1231,21 +1208,6 @@ public class EntrustmentServiceImpl extends ServiceImpl pis = entrustment.getProcessInfo(); -// if (pis == null) { -// pis = new ArrayList(); -// } -// if (pis.size() == 0) { -// UpdateInfo pi = new UpdateInfo(dlpUser.getId(), -// dlpUser.getName(), -// dlpUser.getOrgId(), -// dlpUser.getOrgName(), -// "已创建", -// 1, entrustment.getStatus()); -// pis.add(pi); -// } -// entrustment.setProcessInfo(pis); - System.out.println(String.format("保存委托, entrust.getCandidateDrugs()=%s", entrust.getCandidateDrugs())); @@ -1273,13 +1235,6 @@ public class EntrustmentServiceImpl extends ServiceImpl updateWrapper = new UpdateWrapper(); updateWrapper.eq("id", entrust.getId()); // 查询条件是 id 相等 -// updateWrapper.set("case_id", entrust.getCaseId()); // CaseId 不能修改 -// updateWrapper.set("entrustment_no", entrust.getEntrustmentNo()); // EntrustmentNo 不能修改 -// updateWrapper.set("process_instance_id", entrust.getProcessInstanceId()); // 不能修改 -// updateWrapper.set("entrustment_time", entrust.getEntrustmentTime()); // 不能修改 -// updateWrapper.set("client_org_id", entrust.getClientOrgId()); -// updateWrapper.set("submitter", entrust.getSubmitter()); -// updateWrapper.set("submit_time", entrust.getsubmitTime()); updateWrapper.set("client_org_id", entrust.getClientOrgId()); updateWrapper.set("client_org_name", entrust.getClientOrgName()); updateWrapper.set("client_address", entrust.getClientAddress()); @@ -1364,17 +1319,17 @@ public class EntrustmentServiceImpl extends ServiceImpl pis = entrustment.getProcessInfo(); if (pis == null) { @@ -1647,28 +1610,28 @@ public class EntrustmentServiceImpl extends ServiceImpl updateWrapper = new UpdateWrapper(); updateWrapper.eq("id", entrustment.getId()); // 查询条件是 id 相等 - updateWrapper.set("destructive_analysis", entrustment.getDestructiveAnalysis()); - updateWrapper.set("other_identification_notes", entrustment.getOtherIdentificationNotes()); + updateWrapper.set("destructive_analysis", entrust.getDestructiveAnalysis()); + updateWrapper.set("other_identification_notes", entrust.getOtherIdentificationNotes()); updateWrapper.set("other_agreement", entrustment.getOtherAgreement()); - updateWrapper.set("avoid_identifier", entrustment.getAvoidIdentifier(), "typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"); - updateWrapper.set("comments", entrustment.getComments()); + updateWrapper.set("avoid_identifier", entrust.getAvoidIdentifier(), "typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"); + updateWrapper.set("comments", entrust.getComments()); updateWrapper.set("return_or_not", entrustment.getReturnOrNot()); - updateWrapper.set("check_user", entrustment.getCheckUser()); - updateWrapper.set("check_time", entrustment.getCheckTime()); - updateWrapper.set("check_comments", entrustment.getCheckComments()); - updateWrapper.set("check_times", entrustment.getCheckTimes()); + updateWrapper.set("check_user", dlpUser.getId()); + updateWrapper.set("check_time", LocalDateTime.now()); + updateWrapper.set("check_comments", entrust.getCheckComments()); + updateWrapper.set("check_times", entrustment.getCheckTimes() + 1); // 审核次数加 1 updateWrapper.set("approve_candidate_user", entrustment.getApproveCandidateUser()); - updateWrapper.set("status", entrustment.getStatus()); - updateWrapper.set("previous_status", entrustment.getPreviousStatus()); + updateWrapper.set("status", newStatus); // 新的状态(环节), 可能会是审批或提交前 + updateWrapper.set("previous_status", entrustment.getStatus()); // 可能是从其他环节转过来的, 一旦提交, 保存上一个状态 // updateWrapper.set("process_info", entrustment.getProcessInfo(), "javaType=String,jdbcType=VARCHAR,typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"); - updateWrapper.set("process_info", entrustment.getProcessInfo(), "javaType=String,jdbcType=VARCHAR,typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"); - + updateWrapper.set("process_info", pis, "javaType=String,jdbcType=VARCHAR,typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"); + updateWrapper.set(StrUtil.isNotBlank(currentAcceptNo), "accept_no", currentAcceptNo); if (!this.update(null, updateWrapper)) { throw new RuntimeException("保存委托信息失败"); } @@ -2120,8 +2083,8 @@ public class EntrustmentServiceImpl extends ServiceImpl split = StrUtil.split(ev.getAcceptNo(), "-"); + dm.put("acceptNo", String.format("[%s]%s号", split.get(0), split.get(1))); + } String oldIdentificationResult = ev.getOldIdentificationResult(); String oldIdentification = ""; switch (oldIdentificationResult) { @@ -2328,28 +2296,19 @@ public class EntrustmentServiceImpl extends ServiceImpl updateWrapper = new UpdateWrapper(); updateWrapper.eq("id", entrustment.getId()); // 查询条件是 id 相等 - updateWrapper.set("destructive_analysis", entrustment.getDestructiveAnalysis()); - updateWrapper.set("other_identification_notes", entrustment.getOtherIdentificationNotes()); - updateWrapper.set("avoid_identifier", entrustment.getAvoidIdentifier(), "typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"); - updateWrapper.set("other_agreement", entrustment.getOtherAgreement()); - updateWrapper.set("comments", entrustment.getComments()); + updateWrapper.set("destructive_analysis", entrust.getDestructiveAnalysis()); + updateWrapper.set("other_identification_notes", entrust.getOtherIdentificationNotes()); + updateWrapper.set("avoid_identifier", entrust.getAvoidIdentifier(), "typeHandler=com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"); + updateWrapper.set("other_agreement", entrust.getOtherAgreement()); + updateWrapper.set("comments", entrust.getComments()); - updateWrapper.set("accept_user", entrustment.getAcceptUser()); - updateWrapper.set("accept_time", entrustment.getAcceptTime()); - updateWrapper.set("accept_comments", entrustment.getAcceptComments()); + updateWrapper.set("accept_user", null); // 之前可能受理过, 现在后悔了, 置 null + updateWrapper.set("accept_time", null); + updateWrapper.set("accept_comments", entrust.getAcceptComments()); if (!this.update(null, updateWrapper)) { @@ -2367,7 +2326,8 @@ public class EntrustmentServiceImpl extends ServiceImpl caseEvidenceList; + @ApiModelProperty("受理编号") + private String acceptNo; + @ApiModelProperty(value="委托类型: 0=常规毒品, 1=生物样本") private Integer entrustmentType; } diff --git a/src/main/resources/mapper/CaseEventMapper.xml b/src/main/resources/mapper/CaseEventMapper.xml index 849a142..2e48a30 100644 --- a/src/main/resources/mapper/CaseEventMapper.xml +++ b/src/main/resources/mapper/CaseEventMapper.xml @@ -82,40 +82,29 @@