From f6d9321f95b33617bbfda41698f0389c012c2397 Mon Sep 17 00:00:00 2001 From: nanyangbreeze <1955231298@qq.com> Date: Fri, 23 Jan 2026 11:08:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DiagTreatMAppServiceImpl.java | 30 +++++++++++++++++++ .../OutpatientChargeAppMapper.xml | 2 -- .../DoctorStationAdviceAppMapper.xml | 5 +--- .../sql/diagnose_treatment_items_issue.sql | 2 ++ 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java index 3cbda035..8b5e511a 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.core.common.core.domain.R; import com.core.common.core.domain.entity.SysDictData; +import com.core.common.core.domain.model.LoginUser; import com.core.common.utils.*; import com.core.common.utils.bean.BeanUtils; import com.core.common.utils.poi.ExcelUtil; @@ -400,6 +401,21 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService { // 新增外来诊疗目录 activityDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue()); + // 显式设置创建者和租户ID,确保插入时不为null + String createBy = "system"; + Integer tenantId = null; + try { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + createBy = loginUser.getUsername(); + tenantId = loginUser.getTenantId(); + } + } catch (Exception e) { + // 如果获取失败,使用默认值 + } + activityDefinition.setCreateBy(createBy); + activityDefinition.setTenantId(tenantId != null ? tenantId : 1); // 默认租户ID为1 + // 检查编码是否已存在 List existingDefinitions = activityDefinitionMapper.selectList( new LambdaQueryWrapper() @@ -624,6 +640,20 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService { .setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag())) .setStatusEnum(PublicationStatus.ACTIVE.getValue()) .setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv())); + // 显式设置创建者和租户ID,确保插入时不为null + String createBy = "system"; + Integer tenantId = null; + try { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null) { + createBy = loginUser.getUsername(); + tenantId = loginUser.getTenantId(); + } + } catch (Exception e) { + // 如果获取失败,使用默认值 + } + activityDefinition.setCreateBy(createBy); + activityDefinition.setTenantId(tenantId != null ? tenantId : 1); // 默认租户ID为1 return activityDefinition; } } diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/chargemanage/OutpatientChargeAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/chargemanage/OutpatientChargeAppMapper.xml index 59923679..a14229d4 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/chargemanage/OutpatientChargeAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/chargemanage/OutpatientChargeAppMapper.xml @@ -112,7 +112,6 @@ ON T1.context_enum = #{activity} AND T1.product_id = T2.id AND T2.delete_flag = '0' - AND T2.status_enum = 1 LEFT JOIN med_medication_definition AS T3 ON T1.context_enum = #{medication} AND T1.product_id = T3.id @@ -206,7 +205,6 @@ ON T1.context_enum = #{activity} AND T1.product_id = T2.id AND T2.delete_flag = '0' - AND T2.status_enum = 1 LEFT JOIN med_medication_definition AS T3 ON T1.context_enum = #{medication} AND T1.product_id = T3.id diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml index c1b16c22..ebde3570 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml @@ -231,16 +231,13 @@ AND T3.organization_id = #{organizationId} WHERE T1.delete_flag = '0' - - AND (T1.pricing_flag = #{pricingFlag} OR T1.pricing_flag IS NULL) - + AND (T1.pricing_flag = 1 OR T1.pricing_flag IS NULL) AND T1.id IN #{itemId} - AND T1.status_enum = #{statusEnum} ) diff --git a/openhis-server-new/sql/diagnose_treatment_items_issue.sql b/openhis-server-new/sql/diagnose_treatment_items_issue.sql index a3670c28..582fac6d 100644 --- a/openhis-server-new/sql/diagnose_treatment_items_issue.sql +++ b/openhis-server-new/sql/diagnose_treatment_items_issue.sql @@ -90,3 +90,5 @@ WHERE aci.context_enum = 'ACTIVITY' + +