From 91b3a0a4baf933338860198582b5328d44b207b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=80=E5=BD=A7?= <荀彧@gentronhealth.com> Date: Fri, 15 May 2026 16:25:51 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#535:=20=E3=80=90=E4=BD=8F=E9=99=A2?= =?UTF-8?q?=E6=8A=A4=E5=A3=AB=E7=AB=99-=E5=8C=BB=E5=98=B1=E6=A0=A1?= =?UTF-8?q?=E5=AF=B9=E3=80=91=E5=B7=B2=E6=A0=A1=E9=AA=8C=E8=BF=87=E7=9A=84?= =?UTF-8?q?=E5=8C=BB=E5=98=B1=E9=94=99=E8=AF=AF=E6=98=BE=E7=A4=BA=E4=BA=8E?= =?UTF-8?q?"=E6=9C=AA=E6=A0=A1=E5=AF=B9"=E5=88=97=E8=A1=A8=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=95=B0=E6=8D=AE=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E8=81=94=E5=8A=A8=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:后端 getInpatientAdvicePage 方法中将 requestStatus 置为 null, 未按前端 tab 传入的状态值过滤,导致无论切换哪个 tab 都返回全部医嘱。 SQL 中的 CASE 条件仅处理 DRAFT 状态的 performer_check_id 校验, 并未按 request_status 字段过滤。 修复:保存 requestStatus 后,在查询结果集上按 requestStatus 手动过滤, 与 exeStatus 的过滤方式保持一致。 Co-Authored-By: Claude Opus 4.7 --- .../impl/AdviceProcessAppServiceImpl.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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..0a55610b0 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,8 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { inpatientAdviceParam.setEncounterIds(null); Integer exeStatus = inpatientAdviceParam.getExeStatus(); inpatientAdviceParam.setExeStatus(null); - // requestStatus由前端tab控制,后端SQL已通过CASE条件处理校对状态过滤,无需再作为SQL条件 + // requestStatus由前端tab控制,需在后端过滤 + Integer requestStatus = inpatientAdviceParam.getRequestStatus(); inpatientAdviceParam.setRequestStatus(null); // 构建查询条件 QueryWrapper queryWrapper @@ -292,6 +293,16 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { inpatientAdvicePage.setTotal(filteredList.size()); } } + + // 按请求状态(tab切换)过滤医嘱 + if (requestStatus != null) { + List statusFilteredList = inpatientAdvicePage.getRecords().stream() + .filter(advice -> requestStatus.equals(advice.getRequestStatus())) + .collect(Collectors.toList()); + inpatientAdvicePage.setRecords(statusFilteredList); + inpatientAdvicePage.setTotal(statusFilteredList.size()); + } + return R.ok(inpatientAdvicePage); }