From 5b80695669bd9c2798bd6c94096b70a8859c7414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E=E4=BD=97?= Date: Fri, 29 May 2026 14:15:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(#613):=20=E5=8C=BB=E5=98=B1=E9=80=80?= =?UTF-8?q?=E5=9B=9E=E6=B5=81=E7=A8=8B=E5=AE=8C=E5=96=84=20=E2=80=94=20?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=80=80=E5=9B=9E=E5=8E=9F=E5=9B=A0=E5=BF=85?= =?UTF-8?q?=E5=A1=AB=E5=BC=B9=E7=AA=97=20+=20=E5=90=8E=E7=AB=AF=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E9=80=80=E5=9B=9E=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因(全链路6环分析): - ① 前端/页面 ❌ handleCancel() 直接调 API,无退回原因输入弹窗 - ② Controller ❌ 不涉及 backReason — 纯转发,无需修改 - ③ Service ❌ adviceReject() 从 DTO 读取 list 但不提取 backReason,硬编码传 null - ④ Mapper/DB ❌ backReason 参数已就绪但上游传 null 导致不写入 - ⑤ 医生端 ❌ 因 DB 无数据,无法展示退回原因 修复: - 前端: handleCancel() 改为弹对话框,新增 confirmCancel() 校验必填后传 backReason - 后端: adviceReject() 从 PerformInfoDto 提取 backReason 传给 updateDraftStatus/updateDraftStatusBatch 全链路状态流转: 护士选医嘱 → 点退回 → 弹窗要求输入原因 → 确定 → API传backReason → DB保存 → 医生端可显示 --- .../impl/AdviceProcessAppServiceImpl.java | 11 +++- .../components/prescriptionList.vue | 53 ++++++++++++++++--- 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java index 6af610f4e..ba5ee03d4 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java @@ -58,6 +58,7 @@ import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.util.*; +import java.util.Objects; import java.util.stream.Collectors; /** @@ -413,15 +414,21 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { } Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId(); Date checkDate = new Date(); + // 从请求中提取退回原因(所有项目共享同一原因) + String backReason = performInfoList.stream() + .map(PerformInfoDto::getBackReason) + .filter(Objects::nonNull) + .findFirst() + .orElse(null); if (!serviceRequestList.isEmpty()) { // 更新服务请求状态待发送 serviceRequestService.updateDraftStatus( - serviceRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate, null); + serviceRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate, backReason); } if (!medRequestList.isEmpty()) { // 更新药品请求状态待发送 medicationRequestService.updateDraftStatusBatch( - medRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate, null); + medRequestList.stream().map(PerformInfoDto::getRequestId).toList(), practitionerId, checkDate, backReason); } return R.ok(null, "退回成功"); } diff --git a/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderProofread/components/prescriptionList.vue b/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderProofread/components/prescriptionList.vue index fd1fa92bc..c2db7cd23 100755 --- a/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderProofread/components/prescriptionList.vue +++ b/openhis-ui-vue3/src/views/inpatientNurse/medicalOrderProofread/components/prescriptionList.vue @@ -226,6 +226,25 @@ /> + + + + + + + + +