From bacb4d43d34d5043d1537f6a0dfb721ce3f29aa7 Mon Sep 17 00:00:00 2001 From: wangjian963 <15215920+aprilry@user.noreply.gitee.com> Date: Thu, 14 May 2026 17:53:31 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#489-regression:=20[=E4=BD=8F?= =?UTF-8?q?=E9=99=A2=E6=8A=A4=E5=A3=AB=E7=AB=99-=E5=8C=BB=E5=98=B1?= =?UTF-8?q?=E5=A4=84=E7=90=86]=20UNION=E5=8A=A0SELECT=20DISTINCT=E5=90=8EN?= =?UTF-8?q?ULL=E5=88=97=E7=B1=BB=E5=9E=8B=E6=8E=A8=E6=96=AD=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=AF=BC=E8=87=B4=E6=8E=A5=E5=8F=A3=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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类型 --- .husky/pre-commit | 10 ------- .../dto/InpatientAdviceDto.java | 2 +- .../AdviceProcessAppMapper.xml | 26 +++++++++---------- 3 files changed, 14 insertions(+), 24 deletions(-) delete mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 34afcfb17..000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh -# ============================================================ -# Husky Pre-commit Hook - HIS项目 -# 配置: 关羽 | 日期: 2026-04-24 -# 功能: 提交前检查(已禁用) -# ============================================================ - -# 🔧 已禁用所有检查,直接允许提交 -echo "⏭️ [Pre-commit] 检查已禁用,允许提交" -exit 0 diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/InpatientAdviceDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/InpatientAdviceDto.java index c923652f5..bcb4fa5ce 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/InpatientAdviceDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/dto/InpatientAdviceDto.java @@ -245,7 +245,7 @@ public class InpatientAdviceDto { /** * 药品/服务类型 */ - private Integer categoryCode; + private String categoryCode; /** * 执行科室 */ diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml index 2ac571880..b71d5d6f4 100755 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/inhospitalnursestation/AdviceProcessAppMapper.xml @@ -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