From 58f9947a4976a1db07758c6eac735025933a1866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= <关羽@gentronhealth.com> Date: Fri, 15 May 2026 00:21:32 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#495:=20=E3=80=90=E5=8C=BB=E5=98=B1?= =?UTF-8?q?=E9=97=AD=E7=8E=AF=E3=80=91=E5=B7=B2=E6=A0=A1=E5=AF=B9=E5=8C=BB?= =?UTF-8?q?=E5=98=B1=E6=97=A0=E6=B3=95=E6=B5=81=E8=BD=AC=E8=87=B3"?= =?UTF-8?q?=E5=8C=BB=E5=98=B1=E6=89=A7=E8=A1=8C"=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E8=B4=B9=E7=94=A8=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 后端SQL查询未过滤requestStatus(医嘱请求状态),导致医嘱执行页面的"待执行"tab 返回所有状态医嘱而非仅返回已校对(status=3)的医嘱。修复方式: 1. AdviceProcessAppMapper.java: 新增requestStatus参数 2. AdviceProcessAppMapper.xml: 在med_medication_request和wor_service_request子查询的 WHERE条件中增加 AND T1.status_enum = #{requestStatus} 过滤 3. AdviceProcessAppServiceImpl.java: 保存requestStatus并传递给mapper, 替代原注释"后端SQL已通过CASE条件处理"的错误假设 Co-Authored-By: Claude Opus 4.7 --- .../appservice/impl/AdviceProcessAppServiceImpl.java | 4 ++-- .../inhospitalnursestation/mapper/AdviceProcessAppMapper.java | 3 ++- .../mapper/inhospitalnursestation/AdviceProcessAppMapper.xml | 2 ++ 3 files changed, 6 insertions(+), 3 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 d4cba14b6..f800b3925 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 @@ -178,7 +178,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { inpatientAdviceParam.setEncounterIds(null); Integer exeStatus = inpatientAdviceParam.getExeStatus(); inpatientAdviceParam.setExeStatus(null); - // requestStatus由前端tab控制,后端SQL已通过CASE条件处理校对状态过滤,无需再作为SQL条件 + Integer requestStatus = inpatientAdviceParam.getRequestStatus(); inpatientAdviceParam.setRequestStatus(null); // 构建查询条件 QueryWrapper queryWrapper @@ -198,7 +198,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { ParticipantType.ADMITTING_DOCTOR.getCode(), AccountType.PERSONAL_CASH_ACCOUNT.getCode(), ChargeItemStatus.BILLABLE.getValue(), ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDED.getValue(), EncounterClass.IMP.getValue(), - GenerateSource.DOCTOR_PRESCRIPTION.getValue()); + GenerateSource.DOCTOR_PRESCRIPTION.getValue(), requestStatus); inpatientAdvicePage.getRecords().forEach(e -> { // 是否皮试 e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag())); diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/mapper/AdviceProcessAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/mapper/AdviceProcessAppMapper.java index 95dd6bb3d..c56d5d2a3 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/mapper/AdviceProcessAppMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/mapper/AdviceProcessAppMapper.java @@ -69,5 +69,6 @@ public interface AdviceProcessAppMapper { @Param("active") Integer active, @Param("bed") Integer bed, @Param("admittingDoctor") String admittingDoctor, @Param("personalCashAccount") String personalCashAccount, @Param("billable") Integer billable, @Param("billed") Integer billed, @Param("refunded") Integer refunded, @Param("imp") Integer imp, - @Param("doctorPrescription") Integer doctorPrescription); + @Param("doctorPrescription") Integer doctorPrescription, + @Param("requestStatus") Integer requestStatus); } diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml index ef073303a..2ac571880 100755 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml @@ -290,6 +290,7 @@ WHERE T1.delete_flag = '0' AND T1.refund_medicine_id IS NULL AND T1.generate_source_enum = #{doctorPrescription} + AND T1.status_enum = #{requestStatus} AND CASE WHEN T1.status_enum = #{draft} THEN T1.performer_check_id IS NOT NULL ELSE 1=1 END @@ -422,6 +423,7 @@ AND af.delete_flag = '0' WHERE T1.delete_flag = '0' AND T1.generate_source_enum = #{doctorPrescription} + AND T1.status_enum = #{requestStatus} AND CASE WHEN T1.status_enum = #{draft} THEN T1.performer_check_id IS NOT NULL ELSE 1=1 END