From e8bd9408971d3032a51d792f251b65fd69a5807c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E=E4=BD=97?= <华佗@gentronhealth.com> Date: Tue, 12 May 2026 23:07:32 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#442:=20=E6=89=8B=E6=9C=AF=E8=AE=A1?= =?UTF-8?q?=E8=B4=B9=EF=BC=9A=E7=82=B9=E5=87=BB"=E5=88=A0=E9=99=A4"?= =?UTF-8?q?=E5=BE=85=E7=AD=BE=E5=8F=91=E8=80=97=E6=9D=90=E6=97=B6=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=8A=A5=E9=94=99=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:DoctorStationAdviceAppMapper.xml 中 getRequestBaseInfo SQL 的第二个 UNION 查询(手术计费耗材从 adm_charge_item 关联 wor_device_request)中,biz_request_flag 和 requester_id 使用了 CI.enterer_id(计费录入人),而非 DR.requester_id(设备申请创建人)。当录入人与当前操作人不一致时,biz_request_flag 为 '0',导致删除操作被后端拒绝。 修复:将 CI.enterer_id 改为 COALESCE(DR.requester_id, CI.enterer_id),优先使用 DeviceRequest 的 requester_id,确保 biz_request_flag 基于正确的创建人计算。 Co-Authored-By: Claude Opus 4.7 --- .../mapper/doctorstation/DoctorStationAdviceAppMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml index 1c5f440c..feea0f6f 100755 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml @@ -541,9 +541,9 @@ CI.service_id AS request_id, CI.service_id || '-ci-dev' AS unique_key, '' AS prescription_no, - CI.enterer_id AS requester_id, + COALESCE(DR.requester_id, CI.enterer_id) AS requester_id, CI.entered_date AS request_time, - CASE WHEN CI.enterer_id = #{practitionerId} THEN '1' ELSE '0' END AS biz_request_flag, + CASE WHEN COALESCE(DR.requester_id, CI.enterer_id) = #{practitionerId} THEN '1' ELSE '0' END AS biz_request_flag, DR.content_json AS content_json, NULL AS skin_test_flag, NULL AS inject_flag,