From f7263120770b87000dbda41f552a2b217dfa83f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= <关羽@gentronhealth.com> Date: Mon, 11 May 2026 00:23:59 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#475:=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=E3=80=91=E5=BC=80?= =?UTF-8?q?=E7=AB=8B=E6=A3=80=E6=9F=A5=E7=94=B3=E8=AF=B7=E5=8D=95=E6=8A=A5?= =?UTF-8?q?=E9=94=99"=E8=AF=B7=E5=85=88=E9=85=8D=E7=BD=AE=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E6=97=B6=E9=97=B4=E6=AE=B5=E7=9A=84=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=A7=91=E5=AE=A4"=E5=90=8E=EF=BC=8C=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=BB=8D=E7=94=9F=E6=88=90=E7=94=B3=E8=AF=B7=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将执行科室配置校验提前到数据库写入操作之前,避免校验失败时已写入RequestForm记录 Co-Authored-By: Claude Opus 4.7 --- .../impl/RequestFormManageAppServiceImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java index deeefb98..d07df036 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java @@ -95,6 +95,13 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer prescriptionNo = assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_PSYCHOTROPIC_NO.getPrefix(), 8); } + // 诊疗执行科室配置校验(必须在数据库操作之前执行) + List activityOrganizationConfig = + requestFormManageAppMapper.getActivityOrganizationConfig(typeCode); + if (activityOrganizationConfig.isEmpty()) { + throw new ServiceException("请先配置当前时间段的执行科室"); + } + // 当前时间 Date curDate = new Date(); // 请求类型 @@ -139,12 +146,6 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer // 诊疗集合 List activityList = requestFormSaveDto.getActivityList(); log.info("保存申请单,typeCode={}, activityListSize={}, encounterId={}", typeCode, activityList != null ? activityList.size() : 0, encounterId); - // 诊疗执行科室配置 - List activityOrganizationConfig = - requestFormManageAppMapper.getActivityOrganizationConfig(typeCode); - if (activityOrganizationConfig.isEmpty()) { - throw new ServiceException("请先配置当前时间段的执行科室"); - } for (ActivitySaveDto activitySaveDto : activityList) { serviceRequest = new ServiceRequest();