Fix Bug #489-regression: [住院护士站-医嘱处理] UNION加SELECT DISTINCT后NULL列类型推断失败导致接口异常

Root cause: Bug #489修复为UNION添加SELECT DISTINCT后,PostgreSQL无法将
服务侧无类型NULL文字自动匹配药品侧对应列的类型,报错"UNION types integer
and text cannot be matched"(错误位置: skin_test_flag列,第9列)。

Fix:
- InpatientAdviceDto.categoryCode: Integer → String,与DB varchar对齐
- AdviceProcessAppMapper.xml: 服务侧UNION 13处NULL添加PostgreSQL显式类型
  强转(::integer / ::bigint / ::numeric / ::varchar),同时part_percent
  的'1'改为'1::numeric'以安全匹配药品侧numeric类型
This commit is contained in:
wangjian963
2026-05-14 17:53:31 +08:00
committed by 关羽
parent 08b2247071
commit bacb4d43d3
3 changed files with 14 additions and 24 deletions

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env sh
# ============================================================
# Husky Pre-commit Hook - HIS项目
# 配置: 关羽 | 日期: 2026-04-24
# 功能: 提交前检查(已禁用)
# ============================================================
# 🔧 已禁用所有检查,直接允许提交
echo "⏭️ [Pre-commit] 检查已禁用,允许提交"
exit 0

View File

@@ -245,7 +245,7 @@ public class InpatientAdviceDto {
/**
* 药品/服务类型
*/
private Integer categoryCode;
private String categoryCode;
/**
* 执行科室
*/

View File

@@ -306,28 +306,28 @@
T1.occurrence_end_time AS end_time,
T1.requester_id AS requester_id,
T1.create_time AS request_time,
NULL AS skin_test_flag,
NULL AS inject_flag,
NULL AS group_id,
NULL::integer AS skin_test_flag,
NULL::integer AS inject_flag,
NULL::bigint AS group_id,
T1.performer_check_id,
T2."name" AS advice_name,
T2.id AS item_id,
NULL AS volume,
NULL AS lot_number,
NULL::varchar AS volume,
NULL::varchar AS lot_number,
T1.quantity AS quantity,
T1.unit_code AS unit_code,
T1.status_enum AS request_status,
NULL AS method_code,
NULL AS rate_code,
NULL AS dose,
NULL AS dose_unit_code,
NULL::varchar AS method_code,
NULL::varchar AS rate_code,
NULL::numeric AS dose,
NULL::varchar AS dose_unit_code,
ao1.id AS position_id,
ao1."name" AS position_name,
NULL AS dispense_per_duration,
1 AS part_percent,
NULL::integer AS dispense_per_duration,
1::numeric AS part_percent,
ccd."name" AS condition_definition_name,
T1.therapy_enum AS therapy_enum,
NULL AS sort_number,
NULL::integer AS sort_number,
T1.quantity AS execute_num,
af.day_times,
ae.bus_no,
@@ -342,7 +342,7 @@
personal_account.balance_amount,
personal_account.id AS account_id,
T2.category_code,
NULL AS dispense_status
NULL::integer AS dispense_status
FROM wor_service_request AS T1
LEFT JOIN wor_activity_definition AS T2
ON T2.id = T1.activity_id