From bd471223a455f4b6d691da3094e7d75f196af95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= <关羽@gentronhealth.com> Date: Sat, 16 May 2026 15:14:54 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#478:=20=E3=80=90=E4=BD=8F=E9=99=A2?= =?UTF-8?q?=E5=8C=BB=E7=94=9F=E5=B7=A5=E4=BD=9C=E7=AB=99-=E6=A3=80?= =?UTF-8?q?=E9=AA=8C=E7=94=B3=E8=AF=B7=E3=80=91=E7=82=B9=E5=87=BB"?= =?UTF-8?q?=E8=AF=A6=E6=83=85"=E6=9F=A5=E7=9C=8B=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E5=8D=95=E6=97=B6=EF=BC=8C"=E5=8F=91=E5=BE=80=E7=A7=91?= =?UTF-8?q?=E5=AE=A4"=E5=AD=97=E6=AE=B5=E5=9B=9E=E6=98=BE=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=EF=BC=88=E6=98=BE=E7=A4=BA=E4=B8=BA"-"=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:desc_json 中 targetDepartment 存为空字符串,实际执行科室保存在 wor_service_request.org_id 中 修复:在 getRequestForm SQL 中用 CASE 表达式将 org_id 注入 desc_json,当前端已有值时不覆盖 Co-Authored-By: Claude Opus 4.7 --- .../mapper/regdoctorstation/RequestFormManageAppMapper.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml index 0b0351431..698f1ea62 100755 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml @@ -15,7 +15,11 @@ WHERE wsr2.prescription_no = drf.prescription_no AND wsr2.delete_flag = '0'), drf.name ) AS name, - drf.desc_json, + CASE + WHEN drf.desc_json::jsonb ->> 'targetDepartment' = '' AND MIN(wsr.org_id) IS NOT NULL THEN + (drf.desc_json::jsonb || jsonb_build_object('targetDepartment', MIN(wsr.org_id)::text))::text + ELSE drf.desc_json + END AS desc_json, drf.requester_id, drf.create_time, ap.NAME AS patient_name,