diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgicalScheduleAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgicalScheduleAppServiceImpl.java index 26fee113..b96d2c07 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgicalScheduleAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgicalScheduleAppServiceImpl.java @@ -136,9 +136,11 @@ public class SurgicalScheduleAppServiceImpl implements ISurgicalScheduleAppServi } } - LoginUser loginUser = new LoginUser(); - //获取当前登录用户信息 - loginUser = SecurityUtils.getLoginUser(); + // Bug #432 修复:获取当前登录用户信息,增加null校验防止NPE + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser == null) { + return R.fail("用户未登录或登录已过期"); + } // 当前登录用户ID Long userId = loginUser.getUserId(); 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 aa3a4c6d..e6c26449 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 @@ -1144,7 +1144,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp chargeItem.setQuantityValue(adviceSaveDto.getQuantity()); // 数量 chargeItem.setQuantityUnit(adviceSaveDto.getUnitCode()); // 单位 - chargeItem.setUnitPrice(adviceSaveDto.getUnitPrice()); // 单价 + // #415 价格非负验证 + BigDecimal unitPrice = adviceSaveDto.getUnitPrice(); + if (unitPrice != null && unitPrice.compareTo(BigDecimal.ZERO) < 0) { + unitPrice = unitPrice.abs(); // 负数取绝对值 + } + chargeItem.setUnitPrice(unitPrice); // 单价 chargeItem.setTotalPrice(adviceSaveDto.getTotalPrice()); // 总价 // 显式设置tenantId、createBy和createTime字段,防止自动填充机制失效 @@ -1616,7 +1621,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp chargeItem.setQuantityValue(adviceSaveDto.getQuantity()); // 数量 chargeItem.setQuantityUnit(adviceSaveDto.getUnitCode()); // 单位 - chargeItem.setUnitPrice(adviceSaveDto.getUnitPrice()); // 单价 + // #415 价格非负验证 + BigDecimal unitPrice = adviceSaveDto.getUnitPrice(); + if (unitPrice != null && unitPrice.compareTo(BigDecimal.ZERO) < 0) { + unitPrice = unitPrice.abs(); // 负数取绝对值 + } + chargeItem.setUnitPrice(unitPrice); // 单价 chargeItem.setTotalPrice(adviceSaveDto.getTotalPrice()); // 总价 // 显式设置审计字段,防止自动填充机制失效 @@ -1842,7 +1852,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp chargeItem.setEncounterDiagnosisId(adviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id chargeItem.setQuantityValue(adviceSaveDto.getQuantity()); // 数量 chargeItem.setQuantityUnit(adviceSaveDto.getUnitCode()); // 单位 - chargeItem.setUnitPrice(adviceSaveDto.getUnitPrice()); // 单价 + // #415 价格非负验证 + BigDecimal unitPrice = adviceSaveDto.getUnitPrice(); + if (unitPrice != null && unitPrice.compareTo(BigDecimal.ZERO) < 0) { + unitPrice = unitPrice.abs(); // 负数取绝对值 + } + chargeItem.setUnitPrice(unitPrice); // 单价 chargeItem.setTotalPrice(adviceSaveDto.getTotalPrice()); // 总价 iChargeItemService.saveOrUpdate(chargeItem); diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/datadictionary/ItemDefinitionAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/datadictionary/ItemDefinitionAppMapper.xml index faec20e5..640e3c74 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/datadictionary/ItemDefinitionAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/datadictionary/ItemDefinitionAppMapper.xml @@ -34,13 +34,13 @@ AND T2.delete_flag = '0' WHERE T1.delete_flag = '0' - + AND T1.instance_table = #{MED_MEDICATION_DEFINITION} - + AND T1.instance_table = #{ADM_DEVICE_DEFINITION} - + AND (T1.instance_table = #{WOR_ACTIVITY_DEFINITION} OR T1.instance_table = #{ADM_HEALTHCARE_SERVICE}) GROUP BY T1.tenant_id, diff --git a/openhis-ui-vue3/src/api/public.js b/openhis-ui-vue3/src/api/public.js index 37ec8627..30a900d4 100644 --- a/openhis-ui-vue3/src/api/public.js +++ b/openhis-ui-vue3/src/api/public.js @@ -20,6 +20,15 @@ export function advicePrint(data) { } // 获取全部科室列表 +// 获取科室列表(树形结构) +export function getDepartmentList(data) { + return request({ + url: '/app-common/department-list', + method: 'get', + params: data, + }); +} + export function getOrgList(data) { return request({ url: '/app-common/department-list', diff --git a/openhis-ui-vue3/src/utils/request.js b/openhis-ui-vue3/src/utils/request.js index 4fc4f340..9bead717 100644 --- a/openhis-ui-vue3/src/utils/request.js +++ b/openhis-ui-vue3/src/utils/request.js @@ -26,7 +26,7 @@ const convertIdsToString = (obj) => { } else { const newObj = {} for (const key in obj) { - if (obj.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { const value = obj[key] // 如果key以Id结尾或者是id,且值是数字,转为字符串 if ((key === 'id' || key.endsWith('Id') || key.endsWith('ID')) && typeof value === 'number') { diff --git a/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue b/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue index 4fb56576..f89587b0 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/examination/examinationApplication.vue @@ -306,6 +306,7 @@ v-for="cat in filteredCategoryList" :key="cat.typeId" :name="cat.typeId" + @click="handleCategoryExpand(cat)" >