feat(doctorstation): 优化医生工作站处方列表功能

- 调整诊疗定义表结构,添加序号和服务范围字段
- 修改费用项目查询逻辑,使用INNER JOIN替代LEFT JOIN并优化排序
- 增加批处理批次大小从500到1000,提升查询性能
- 修复处方类型筛选中的诊疗和耗材顺序错误
- 优化处方行数据重置逻辑,避免残留数据问题
- 移除不必要的README标题元素
This commit is contained in:
2026-01-19 11:39:29 +08:00
parent f3eeee7405
commit 7e76083c37
5 changed files with 26 additions and 33 deletions

View File

@@ -1,2 +0,0 @@
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">OpenHis v0.0.1</h1>

View File

@@ -1,12 +0,0 @@
-- 为诊疗定义表添加序号和服务范围字段
-- 执行前请先备份数据库
ALTER TABLE wor_activity_definition ADD COLUMN IF NOT EXISTS sort_order INTEGER DEFAULT NULL;
ALTER TABLE wor_activity_definition ADD COLUMN IF NOT EXISTS service_range VARCHAR(50) DEFAULT '全部';
-- 添加注释
COMMENT ON COLUMN wor_activity_definition.sort_order IS '序号';
COMMENT ON COLUMN wor_activity_definition.service_range IS '服务范围';
-- 为现有数据设置默认值
UPDATE wor_activity_definition SET service_range = '全部' WHERE service_range IS NULL;

View File

@@ -191,8 +191,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
// 费用定价子表信息 - 使用分批处理避免大量参数问题
List<AdvicePriceDto> childCharge = new ArrayList<>();
if (chargeItemDefinitionIdList != null && !chargeItemDefinitionIdList.isEmpty()) {
// 分批处理,每批最多500个ID
int batchSize = 500;
// 分批处理,每批最多1000个ID,增加批次大小以减少查询次数
int batchSize = 1000;
for (int i = 0; i < chargeItemDefinitionIdList.size(); i += batchSize) {
int endIndex = Math.min(i + batchSize, chargeItemDefinitionIdList.size());
List<Long> batch = chargeItemDefinitionIdList.subList(i, endIndex);

View File

@@ -395,20 +395,18 @@
T1.condition_value,
T1.condition_code,
T1.amount AS price
FROM
adm_charge_item_def_detail AS T1
LEFT JOIN adm_charge_item_definition AS T2 ON T2.ID = T1.definition_id
AND T2.delete_flag = '0'
WHERE
T1.delete_flag = '0'
AND T1.condition_code = #{conditionCode}
FROM adm_charge_item_def_detail AS T1
INNER JOIN adm_charge_item_definition AS T2 ON T2.ID = T1.definition_id
WHERE T1.delete_flag = '0'
AND T2.delete_flag = '0'
AND T1.condition_code = #{conditionCode}
<if test="chargeItemDefinitionIdList != null and !chargeItemDefinitionIdList.isEmpty()">
AND T1.definition_id IN
<foreach collection="chargeItemDefinitionIdList" item="itemId" open="(" separator="," close=")">
#{itemId}
</foreach>
</if>
ORDER BY T1.priority DESC
ORDER BY T1.priority DESC, T1.definition_id
</select>
<select id="getMainCharge" resultType="com.openhis.web.doctorstation.dto.AdvicePriceDto">

View File

@@ -788,10 +788,10 @@
adviceQueryParams.categoryCode = '2';
} else if (value == 2) { // 中成药
adviceQueryParams.categoryCode = '1';
} else if (value == 3) { // 耗材
adviceQueryParams.categoryCode = ''; // 耗材不需要categoryCode筛选
} else if (value == 4) { // 诊疗
} else if (value == 3) { // 诊疗
adviceQueryParams.categoryCode = ''; // 诊疗不需要categoryCode筛选
} else if (value == 4) { // 耗材
adviceQueryParams.categoryCode = ''; // 耗材不需要categoryCode筛选
} else {
adviceQueryParams.categoryCode = ''; // 全部类型
}
@@ -1124,6 +1124,7 @@ const { method_code, unit_code, rate_code, distribution_category_code, drord_doc
);
// 删除硬编码的adviceTypeList直接使用drord_doctor_type字典
// drord_doctor_type: 1=西药, 2=中成药, 3=诊疗, 4=耗材, 5=全部
const adviceTypeList = ref([
{
label: '西药',
@@ -1133,13 +1134,12 @@ const adviceTypeList = ref([
label: '中成药',
value: 2,
},
{
label: '耗材',
label: '诊疗',
value: 3,
},
{
label: '诊疗',
label: '耗材',
value: 4,
},
{
@@ -1781,6 +1781,7 @@ function handleFocus(row, index) {
adviceQueryParams.value = {
adviceType: adviceType,
adviceTypes: adviceType ? adviceType.toString() : '1,2,3', // 根据当前类型设置查询类型,避免显示其他类型的数据
categoryCode: categoryCode,
searchKey: adviceQueryParams.value.searchKey || ''
};
@@ -1850,12 +1851,16 @@ function selectAdviceBase(key, row) {
}
function setNewRow(key, row) {
// 每次选择药品时,将当前行数据初始化为最初状态
prescriptionList.value[rowIndex.value] = {
// 每次选择药品时,将当前行数据完全重置,清空所有旧数据
const preservedData = {
uniqueKey: prescriptionList.value[rowIndex.value].uniqueKey,
isEdit: true,
statusEnum: 1,
};
// 完全替换整个对象,只保留必要的初始字段
prescriptionList.value[rowIndex.value] = preservedData;
setValue(row);
expandOrder.value = [key];
nextTick(() => {
@@ -2497,13 +2502,17 @@ function setValue(row) {
? (typeof row.skinTestFlag === 'number' ? row.skinTestFlag : (row.skinTestFlag ? 1 : 0))
: 0;
// 创建一个新的对象,而不是合并旧数据,以避免残留数据问题
prescriptionList.value[rowIndex.value] = {
...prescriptionList.value[rowIndex.value],
...JSON.parse(JSON.stringify(row)),
// 确保adviceType为数字类型避免类型不匹配导致的显示问题
adviceType: Number(row.adviceType),
skinTestFlag: skinTestFlag, // 确保皮试字段是数字类型
skinTestFlag_enumText: skinTestFlag == 1 ? '是' : '否', // 更新显示文本
// 保留原来设置的初始状态值
uniqueKey: prescriptionList.value[rowIndex.value].uniqueKey,
isEdit: prescriptionList.value[rowIndex.value].isEdit,
statusEnum: prescriptionList.value[rowIndex.value].statusEnum,
};
prescriptionList.value[rowIndex.value].orgId = undefined;
prescriptionList.value[rowIndex.value].dose = undefined;