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