diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java index bcac163a..3d5e9549 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java @@ -139,4 +139,18 @@ public class DiagnosisTreatmentDto { /** 检验类型名称(用于前端 testType 字段) */ private String testType; + + /** 费用套餐ID(关联 inspection_basic_information) */ + @JsonSerialize(using = ToStringSerializer.class) + private Long feePackageId; + + /** 费用套餐名称(JOIN inspection_basic_information.package_name) */ + private String packageName; + + /** 下级医技类型ID(关联 inspection_type 子类) */ + @JsonSerialize(using = ToStringSerializer.class) + private Long subItemId; + + /** 下级医技类型名称(JOIN inspection_type.name) */ + private String subItemName; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java index 92f77c38..7151dd3a 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java @@ -129,7 +129,15 @@ public class DiagnosisTreatmentUpDto { /** 服务范围 */ private String serviceRange; - /** 检验类型ID */ + /** 检验类型ID(关联 inspection_type 大类,parent_id 为空) */ @JsonSerialize(using = ToStringSerializer.class) private Long inspectionTypeId; + + /** 费用套餐ID(关联 inspection_basic_information) */ + @JsonSerialize(using = ToStringSerializer.class) + private Long feePackageId; + + /** 下级医技类型ID(关联 inspection_type 子类,parent_id 不为空) */ + @JsonSerialize(using = ToStringSerializer.class) + private Long subItemId; } diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml index c19d1f42..98b7a520 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml @@ -31,12 +31,16 @@ T1.sort_order, T1.service_range, T1.inspection_type_id, + T1.fee_package_id, + T1.sub_item_id, T2.type_code as item_type_code, T2.yb_type, T2.price_code, T2.price as retail_price, T4.amount as maximum_retail_price, - T3.name as test_type + T3.name as test_type, + T5.package_name, + T6.name as sub_item_name FROM wor_activity_definition T1 /* 只JOIN必要的价格表,使用INNER JOIN避免笛卡尔积 */ INNER JOIN adm_charge_item_definition T2 @@ -50,6 +54,14 @@ LEFT JOIN adm_charge_item_def_detail T4 ON T4.definition_id = T2.id AND T4.condition_code = '4' + /* 费用套餐关联 */ + LEFT JOIN inspection_basic_information T5 + ON T1.fee_package_id = T5.basic_information_id + AND T5.del_flag = false + /* 下级医技类型关联(inspection_type 子类) */ + LEFT JOIN inspection_type T6 + ON T1.sub_item_id = T6.id + AND T6.valid_flag = 1 T1.delete_flag = '0' @@ -105,11 +117,23 @@ T1.sort_order, T1.service_range, T1.inspection_type_id, - T3.name as test_type + T1.fee_package_id, + T1.sub_item_id, + T3.name as test_type, + T6.package_name, + T7.name as sub_item_name FROM wor_activity_definition T1 LEFT JOIN adm_charge_item_definition T2 ON T1.id = T2.instance_id /* 检验类型关联 */ LEFT JOIN inspection_type T3 ON T1.inspection_type_id = T3.id AND T3.valid_flag = 1 + /* 费用套餐关联 */ + LEFT JOIN inspection_basic_information T6 + ON T1.fee_package_id = T6.basic_information_id + AND T6.del_flag = false + /* 下级医技类型关联(inspection_type 子类) */ + LEFT JOIN inspection_type T7 + ON T1.sub_item_id = T7.id + AND T7.valid_flag = 1 T1.delete_flag = '0' AND T2.instance_table = 'wor_activity_definition' diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/ActivityDefinition.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/ActivityDefinition.java index a70ec378..952e9018 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/ActivityDefinition.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/workflow/domain/ActivityDefinition.java @@ -90,6 +90,12 @@ public class ActivityDefinition extends HisBaseEntity { /** 服务范围 */ private String serviceRange; - /** 检验类型ID(关联 inspection_type 表) */ + /** 检验类型ID(关联 inspection_type 表,parent_id 为空的大类) */ private Long inspectionTypeId; + + /** 费用套餐ID(关联 inspection_basic_information 表) */ + private Long feePackageId; + + /** 下级医技类型ID(关联 inspection_type 表,parent_id 不为空的子类) */ + private Long subItemId; } \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue b/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue index daace2f4..b9946031 100644 --- a/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue +++ b/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue @@ -267,7 +267,9 @@ @@ -1289,14 +1291,16 @@ const loadObservationItems = async (resetPage = false) => { id: item.id, code: item.busNo || '', name: item.name || '', - testType: item.inspectionTypeId_dictText || item.testType || '', // 优先使用字典翻译字段 - inspectionTypeId: item.inspectionTypeId || null, // 检验类型ID - package: '', + testType: item.inspectionTypeId_dictText || item.testType || '', + inspectionTypeId: item.inspectionTypeId || null, + package: item.packageName || '', + feePackageId: item.feePackageId || null, sampleType: item.specimenCode || '', amount: parseFloat(item.retailPrice || 0), sortOrder: item.sortOrder || null, serviceRange: item.serviceRange || '全部', - sub医技Type: '', + subItemName: item.subItemName || '', + subItemId: item.subItemId || null, remark: item.descriptionText || '', status: true })); @@ -1888,8 +1892,8 @@ const editItem = (item) => { }; const updateAmountFromPackage = (item) => { - if (item.package) { - const selectedPackage = feePackages.value.find(pkg => pkg.id === item.package); + if (item.feePackageId) { + const selectedPackage = feePackages.value.find(pkg => pkg.id === item.feePackageId); if (selectedPackage) { // 套餐总金额 = 套餐金额 + 服务费 const packageAmount = parseFloat(selectedPackage.packageAmount || 0); @@ -1949,7 +1953,9 @@ const saveItem = async (item) => { busNo: item.code.trim(), name: item.name.trim(), categoryCode: inspectionCategoryCode.value, - inspectionTypeId: item.inspectionTypeId || null, // 检验类型ID + inspectionTypeId: item.inspectionTypeId || null, + feePackageId: item.feePackageId || null, + subItemId: item.subItemId || null, specimenCode: item.sampleType, retailPrice: item.amount, descriptionText: item.remark, @@ -2035,7 +2041,7 @@ const exportTable = () => { item.amount, item.sortOrder || 999999, `"${item.serviceRange || '全部'}"`, - `"${item.sub医技Type || '-'}"`, + `"${item.subItemName || '-'}"`, `"${item.remark || '-'}"` ].join(',')) ].join('\n');