diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductDetailAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductDetailAppServiceImpl.java index 8444356f..1390a86f 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductDetailAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductDetailAppServiceImpl.java @@ -108,9 +108,9 @@ public class ProductDetailAppServiceImpl extends ServiceImpl accountIdList = chargeItemList.stream().map(ChargeItem::getAccountId).collect(Collectors.toList()); + // 获取所有的账户id(过滤掉null值,防止groupingBy时空指针异常) + List accountIdList = chargeItemList.stream() + .map(ChargeItem::getAccountId) + .filter(Objects::nonNull) + .collect(Collectors.toList()); // account去重 List distinctAccountIdList = accountIdList.stream().distinct().collect(Collectors.toList()); + // 检查是否存在accountId为null的收费项 + long nullAccountIdCount = chargeItemList.stream() + .map(ChargeItem::getAccountId) + .filter(Objects::isNull) + .count(); + if (nullAccountIdCount > 0) { + throw new ServiceException("部分收费项缺少账户信息,请检查收费项数据"); + } + if (distinctAccountIdList.isEmpty()) { + throw new ServiceException("未找到有效的账户信息"); + } List accountList = iAccountService.list(new LambdaQueryWrapper() .in(Account::getId, distinctAccountIdList).eq(Account::getEncounterId, prePaymentDto.getEncounterId())); if (accountList.size() != distinctAccountIdList.size()) { @@ -503,9 +517,15 @@ public class PaymentRecServiceImpl implements IPaymentRecService { // } // } - // 收费详情按照收费批次进行分组 + // 收费详情按照收费批次进行分组(过滤掉payTransNo为null的记录) Map> payTransNoMap - = paymentRecDetails.stream().collect(Collectors.groupingBy(PaymentRecDetail::getPayTransNo)); + = paymentRecDetails.stream() + .filter(detail -> detail.getPayTransNo() != null) + .collect(Collectors.groupingBy(PaymentRecDetail::getPayTransNo)); + + if (payTransNoMap.isEmpty()) { + throw new ServiceException("收费详情缺少批次号信息"); + } com.openhis.financial.model.PaymentResult paymentResult; List paymentResultList = new ArrayList<>(); diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/PendingMedicationDetailsAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/PendingMedicationDetailsAppServiceImpl.java index f3584448..2e703a4a 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/PendingMedicationDetailsAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/PendingMedicationDetailsAppServiceImpl.java @@ -48,10 +48,11 @@ public class PendingMedicationDetailsAppServiceImpl implements IPendingMedicatio QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper( pendingMedicationSearchParam, searchKey, new HashSet<>(Arrays.asList("medicine_name", "medicine_no", "py_str")), request); - // 查询待发药明细列表 + // 查询待发药明细列表(包含待配药、待发药、已配药三种状态,与门诊发药界面一致) Page pendingMedicationPage = pendingMedicationDetailsMapper .selectPendingMedicationDetailsPage(new Page<>(pageNo, pageSize), queryWrapper, - DispenseStatus.IN_PROGRESS.getValue(), EncounterClass.AMB.getValue(), EncounterClass.IMP.getValue()); + DispenseStatus.IN_PROGRESS.getValue(), DispenseStatus.PREPARATION.getValue(), + DispenseStatus.PREPARED.getValue(), EncounterClass.AMB.getValue(), EncounterClass.IMP.getValue()); pendingMedicationPage.getRecords().forEach(e -> { // 发药类型 diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/PendingMedicationDetailsMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/PendingMedicationDetailsMapper.java index 469ca84f..6ff972bf 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/PendingMedicationDetailsMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/PendingMedicationDetailsMapper.java @@ -20,11 +20,19 @@ public interface PendingMedicationDetailsMapper { * @param page 分页 * @param queryWrapper 查询条件 * @param inProgress 发药类型:待发药 + * @param preparation 发药类型:待配药 + * @param prepared 发药类型:已配药 + * @param amb 门诊类型 + * @param imp 住院类型 * @return 待发药明细 */ Page selectPendingMedicationDetailsPage( @Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, - @Param("inProgress") Integer inProgress, @Param("amb") Integer amb, @Param("imp") Integer imp); + @Param("inProgress") Integer inProgress, + @Param("preparation") Integer preparation, + @Param("prepared") Integer prepared, + @Param("amb") Integer amb, + @Param("imp") Integer imp); } diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/PendingMedicationDetailsMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/PendingMedicationDetailsMapper.xml index 3d261cde..a8b01b22 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/PendingMedicationDetailsMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/PendingMedicationDetailsMapper.xml @@ -1,7 +1,7 @@ - diff --git a/openhis-ui-vue3/src/utils/request.js b/openhis-ui-vue3/src/utils/request.js index a3a3aa18..ebf30473 100644 --- a/openhis-ui-vue3/src/utils/request.js +++ b/openhis-ui-vue3/src/utils/request.js @@ -107,15 +107,32 @@ service.interceptors.request.use(config => { if (code === 401) { if (!isRelogin.show) { isRelogin.show = true; - ElMessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { - isRelogin.show = false; + // 判断是否在登录页面 + const isLoginPage = window.location.pathname === '/login' || window.location.pathname === '/'; + + if (isLoginPage) { + // 登录页面直接清理token,不弹窗 useUserStore().logOut().then(() => { - location.href = '/index'; - }) - }).catch(() => { - isRelogin.show = false; - }); - } + isRelogin.show = false; + }).catch(() => { + isRelogin.show = false; + }); + return Promise.reject('登录已过期,请重新登录。') + } + + // 其他页面:显示提示后自动跳转 + ElMessage.warning('登录已过期,正在跳转到登录页面...'); + useUserStore().logOut().then(() => { + isRelogin.show = false; + // 跳转到登录页,保留当前路径作为redirect参数 + const currentPath = window.location.pathname; + const redirectUrl = currentPath !== '/login' ? `/login?redirect=${encodeURIComponent(currentPath)}` : '/login'; + location.href = redirectUrl; + }).catch(() => { + isRelogin.show = false; + location.href = '/login'; + }); + } return Promise.reject('无效的会话,或者会话已过期,请重新登录。') } else if (code === 500) { // 检查是否需要跳过错误提示 diff --git a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/diagnosis.vue b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/diagnosis.vue index 263fdca3..bb1fe405 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/diagnosis.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/diagnosis.vue @@ -714,11 +714,11 @@ function handleNodeClick(data) { ? Math.max(...form.value.diagnosisList.map(item => item.diagSrtNo || 0)) : 0; - form.value.diagnosisList.push({ +form.value.diagnosisList.push({ ybNo: data.ybNo, name: data.name, verificationStatusEnum: 4, - medTypeCode: '11', + medTypeCode: '初诊诊断', diagSrtNo: maxSortNo + 1, definitionId: data.definitionId, classification: '西医', // 默认为西医 diff --git a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue index 68ca515d..f23aad91 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue @@ -230,6 +230,67 @@ + +