From 86f12b425ab4f71db84f96fa9f3daf8b58ea8afd Mon Sep 17 00:00:00 2001 From: guanyu Date: Fri, 19 Jun 2026 19:57:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(#782):=20guanyu=20(=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=88=E5=85=A5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AdviceManageAppServiceImpl.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java index 6f4c4029a..1a9677f64 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java @@ -1154,14 +1154,17 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { .orElse(new Date()); // 获取当前操作用户昵称作为停嘱医生 String stopUserName = SecurityUtils.getNickName(); - // 药品 + // 药品(包含出院带药adviceType=7,与handleDeleteOperations保持一致) List medicineList = paramList.stream() - .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); + .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType()) + || (e.getAdviceType() != null && e.getAdviceType() == 7)) + .collect(Collectors.toList()); List medicineRequestIds = medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList()); - // 诊疗(包含护理adviceType=26、文字医嘱adviceType=8) + // 诊疗(包含护理adviceType=26、手术adviceType=6、文字医嘱adviceType=8,与saveRegAdvice保持一致) List activityList = paramList.stream() .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType()) + || ItemType.SURGERY.getValue().equals(e.getAdviceType()) || ItemType.TEXT.getValue().equals(e.getAdviceType()) || (e.getAdviceType() != null && e.getAdviceType() == 26)) .collect(Collectors.toList()); @@ -1194,9 +1197,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { .set(DeviceRequest::getUpdateBy, stopUserName)); } - // 🔧 Bug #782 修复:兜底处理未被以上任何类型过滤器捕获的医嘱 - // 当批量停嘱包含非标准 adviceType(如 type=31、type=7 等)时,这些医嘱 - // 不会被药品/诊疗/耗材任一组捕获,导致状态未更新为 PENDING_STOP,造成状态不一致 + // 🔧 Bug #782 兜底处理:未被以上类型过滤器捕获的未知医嘱类型 // 将所有未匹配类型的医嘱统一按诊疗请求(ServiceRequest)处理 Set handledIds = new HashSet<>(); handledIds.addAll(medicineRequestIds); @@ -1235,14 +1236,17 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { */ @Override public R cancelStopRegAdvice(List paramList) { - // 药品 + // 药品(包含出院带药adviceType=7,与handleDeleteOperations保持一致) List medicineList = paramList.stream() - .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); + .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType()) + || (e.getAdviceType() != null && e.getAdviceType() == 7)) + .collect(Collectors.toList()); List medicineRequestIds = medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList()); - // 诊疗(包含护理adviceType=26、文字医嘱adviceType=8) + // 诊疗(包含护理adviceType=26、手术adviceType=6、文字医嘱adviceType=8,与saveRegAdvice保持一致) List activityList = paramList.stream() .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType()) + || ItemType.SURGERY.getValue().equals(e.getAdviceType()) || ItemType.TEXT.getValue().equals(e.getAdviceType()) || (e.getAdviceType() != null && e.getAdviceType() == 26)) .collect(Collectors.toList());