From d646afa0c063faf2f79b323e266d3beafef3d090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Thu, 14 May 2026 04:20:15 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#487:=20=E3=80=90=E4=B8=B4=E5=BA=8A?= =?UTF-8?q?=E5=8C=BB=E5=98=B1=E3=80=91=E8=AF=8A=E7=96=97=E7=B1=BB=E5=8C=BB?= =?UTF-8?q?=E5=98=B1=E7=AD=BE=E5=8F=91=E5=90=8E=EF=BC=8C=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9C=AA=E5=AE=9E=E6=97=B6=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E4=B8=BA"=E5=B7=B2=E7=AD=BE=E5=8F=91"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因分析:诊疗类(活动)医嘱签发时,后端handService()的批量状态更新 未区分签发/保存场景,导致statusEnum字段在签发时可能未被正确更新为 ACTIVE(2);前端依赖后端刷新,缺乏乐观更新机制。 修复方案: - 前端:签发成功后立即将saveList中对应医嘱的statusEnum设为2(乐观更新), 再执行getListInfo从后端刷新 - 后端:handService()中分离签发/保存的批量更新逻辑,签发时显式设置 statusEnum=ACTIVE、authoredTime和signCode,并添加日志 Co-Authored-By: Claude Opus 4.7 --- .../impl/AdviceManageAppServiceImpl.java | 20 ++++++++++++++----- .../home/components/order/index.vue | 7 +++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java index 957313188..26afdbcd2 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java @@ -710,11 +710,21 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { // 批量更新诊疗医嘱状态(使用 update 确保状态字段必定更新) if (!processedRequestIds.isEmpty()) { - iServiceRequestService.update(null, - new LambdaUpdateWrapper() - .set(ServiceRequest::getStatusEnum, - is_save ? RequestStatus.DRAFT.getValue() : RequestStatus.ACTIVE.getValue()) - .in(ServiceRequest::getId, processedRequestIds)); + // 🔧 Bug #487 修复:签发时额外设置 authoredTime,确保签发时间被记录 + if (is_sign) { + iServiceRequestService.update(null, + new LambdaUpdateWrapper() + .set(ServiceRequest::getStatusEnum, RequestStatus.ACTIVE.getValue()) + .set(ServiceRequest::getAuthoredTime, authoredTime) + .set(ServiceRequest::getSignCode, signCode) + .in(ServiceRequest::getId, processedRequestIds)); + log.info("签发诊疗医嘱成功,requestIds: {}, signCode: {}", processedRequestIds, signCode); + } else { + iServiceRequestService.update(null, + new LambdaUpdateWrapper() + .set(ServiceRequest::getStatusEnum, RequestStatus.DRAFT.getValue()) + .in(ServiceRequest::getId, processedRequestIds)); + } } } diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue index 2db56ab37..dd7fc8794 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue @@ -1241,6 +1241,13 @@ function handleSave() { if (res.code === 200) { proxy.$modal.msgSuccess('签发成功'); isSaving.value = false; + // 乐观更新:立即将已签发医嘱的状态设为"已签发",确保列表实时刷新 + saveList.forEach((item) => { + const row = prescriptionList.value.find((r) => r.requestId && r.requestId === item.requestId); + if (row) { + row.statusEnum = 2; + } + }); getListInfo(false); bindMethod.value = {}; nextId.value = 1;