From c6f58596c070c5dca3a37f21daaf3c7bd62b1eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= <关羽@gentronhealth.com> Date: Thu, 14 May 2026 14:14:39 +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 Root cause: In getInpatientAdvicePage(), encounterIds and exeStatus were nullified before buildQueryWrapper to prevent auto-generated SQL conditions, but requestStatus was NOT nullified. HisQueryUtils.buildQueryWrapper uses reflection to add eq conditions for ALL non-null fields, so requestStatus: 3 became an extra SQL filter "AND request_status = 3" that was not intended for the 医嘱执行 page. The 医嘱执行 page uses exeStatus (not requestStatus) for execution state filtering. The SQL already handles verified/unverified order filtering via a CASE condition on status_enum and performer_check_id. The requestStatus parameter is only meant for frontend tab selection and should not be used as a SQL filter here. Fix: Nullify requestStatus before buildQueryWrapper, same as encounterIds/exeStatus. Co-Authored-By: Claude Opus 4.7 --- .../appservice/impl/AdviceProcessAppServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) 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 7aa6c4377..d4cba14b6 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,6 +178,8 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { inpatientAdviceParam.setEncounterIds(null); Integer exeStatus = inpatientAdviceParam.getExeStatus(); inpatientAdviceParam.setExeStatus(null); + // requestStatus由前端tab控制,后端SQL已通过CASE条件处理校对状态过滤,无需再作为SQL条件 + inpatientAdviceParam.setRequestStatus(null); // 构建查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null);