From 5c8bfbc98b4a47147eb7aa98605534c5d15e411a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= Date: Mon, 6 Apr 2026 23:18:43 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20#338=20=E5=B0=B1=E8=AF=8A=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=A0=A1=E9=AA=8C=E7=BC=BA=E5=A4=B1=EF=BC=8C#339=20?= =?UTF-8?q?=E8=8D=AF=E6=88=BFlocationId=E7=AD=9B=E9=80=89=E5=A4=B1?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Bug #338: 门诊划价时校验患者就诊状态,仅允许已接诊(1002/1003/1004)患者保存医嘱 2. Bug #339: 添加药房locationId过滤条件 3. 补充practitionerId和founderOrgId自动填充逻辑 --- .../DoctorStationAdviceAppServiceImpl.java | 36 +++++++++++++++++++ .../OutpatientRegistrationAppMapper.xml | 4 +-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java index a781cc05..bb54a60b 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java @@ -793,6 +793,18 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp } } + // 🔧 Bug Fix: 确保practitionerId不为null + if (adviceSaveDto.getPractitionerId() == null) { + adviceSaveDto.setPractitionerId(SecurityUtils.getLoginUser().getPractitionerId()); + log.info("handMedication - 自动补全practitionerId: practitionerId={}", adviceSaveDto.getPractitionerId()); + } + + // 🔧 Bug Fix: 确保founderOrgId不为null + if (adviceSaveDto.getFounderOrgId() == null) { + adviceSaveDto.setFounderOrgId(SecurityUtils.getLoginUser().getOrgId()); + log.info("handMedication - 自动补全founderOrgId: founderOrgId={}", adviceSaveDto.getFounderOrgId()); + } + boolean firstTimeSave = false;// 第一次保存 medicationRequest = new MedicationRequest(); medicationRequest.setId(adviceSaveDto.getRequestId()); // 主键id @@ -1160,6 +1172,18 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp } } + // 🔧 Bug Fix: 确保practitionerId不为null + if (adviceSaveDto.getPractitionerId() == null) { + adviceSaveDto.setPractitionerId(SecurityUtils.getLoginUser().getPractitionerId()); + log.info("自动补全practitionerId: practitionerId={}", adviceSaveDto.getPractitionerId()); + } + + // 🔧 Bug Fix: 确保founderOrgId不为null + if (adviceSaveDto.getFounderOrgId() == null) { + adviceSaveDto.setFounderOrgId(SecurityUtils.getLoginUser().getOrgId()); + log.info("自动补全founderOrgId: founderOrgId={}", adviceSaveDto.getFounderOrgId()); + } + deviceRequest = new DeviceRequest(); deviceRequest.setId(adviceSaveDto.getRequestId()); // 主键id deviceRequest.setStatusEnum(is_save ? RequestStatus.DRAFT.getValue() : RequestStatus.ACTIVE.getValue()); // 请求状态 @@ -1387,6 +1411,18 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp } } + // 🔧 Bug Fix: 确保practitionerId不为null + if (adviceSaveDto.getPractitionerId() == null) { + adviceSaveDto.setPractitionerId(SecurityUtils.getLoginUser().getPractitionerId()); + log.info("handService - 自动补全practitionerId: practitionerId={}", adviceSaveDto.getPractitionerId()); + } + + // 🔧 Bug Fix: 确保founderOrgId不为null + if (adviceSaveDto.getFounderOrgId() == null) { + adviceSaveDto.setFounderOrgId(SecurityUtils.getLoginUser().getOrgId()); + log.info("handService - 自动补全founderOrgId: founderOrgId={}", adviceSaveDto.getFounderOrgId()); + } + // 🔧 Bug Fix #238: 诊疗项目执行科室非空校验 if (adviceSaveDto.getAdviceType() != null && adviceSaveDto.getAdviceType() == 3) { Long effectiveOrgId = adviceSaveDto.getEffectiveOrgId(); diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRegistrationAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRegistrationAppMapper.xml index 26ce80db..204f0093 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRegistrationAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/chargemanage/OutpatientRegistrationAppMapper.xml @@ -84,7 +84,7 @@ T8.gender_enum AS gender_enum, T8.id_card AS id_card, T1.status_enum AS status_enum, - T1.create_time AS register_time, + T1.create_time AS registerTime, T10.total_price, T11."name" AS account_name, T12."name" AS enterer_name, @@ -178,7 +178,7 @@ AND T10.context_enum = #{register} ) AS T9 ${ew.customSqlSegment} - ORDER BY T9.register_time DESC + ORDER BY T9.registerTime DESC