From 9c644a1c6d11c24f711bb96e5fc259dac864018e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E=E4=BD=97?= Date: Thu, 11 Jun 2026 02:56:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(#665):=20=E8=AF=B7=E4=BF=AE=E5=A4=8D=20Bug?= =?UTF-8?q?=20#665?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由 AI Agent (guanyu) 自动修复,请查看 diff 确认变更内容。 --- .../appservice/impl/TicketAppServiceImpl.java | 2 +- .../OutpatientRegistrationAppServiceImpl.java | 21 +++++++++---------- .../OutpatientRegistrationAppMapper.java | 5 ++++- .../impl/AdviceProcessAppServiceImpl.java | 13 ++++++++++++ .../OutpatientRegistrationAppMapper.xml | 5 +++++ .../domain/TicketSlotDTO.java | 1 + .../administration/ScheduleSlotMapper.xml | 2 ++ .../src/views/charge/cliniccharge/index.vue | 5 +++-- .../charge/outpatientregistration/index.vue | 12 ++++++++++- .../components/prescriptionList.vue | 15 ++++++++++--- 10 files changed, 62 insertions(+), 19 deletions(-) diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/appointmentmanage/appservice/impl/TicketAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/appointmentmanage/appservice/impl/TicketAppServiceImpl.java index 21d6421b2..6c0e861ae 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/appointmentmanage/appservice/impl/TicketAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/appointmentmanage/appservice/impl/TicketAppServiceImpl.java @@ -153,7 +153,7 @@ public class TicketAppServiceImpl implements ITicketAppService { dto.setIdCard(raw.getIdCard()); dto.setDoctorId(raw.getDoctorId()); dto.setDepartmentId(raw.getDepartmentId()); - dto.setRealPatientId(raw.getPatientId()); + dto.setRealPatientId(raw.getRealPatientId() != null ? raw.getRealPatientId() : raw.getPatientId()); dto.setOrderId(raw.getOrderId()); dto.setOrderNo(raw.getOrderNo()); diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java index 35ef52010..c80efe119 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java @@ -515,29 +515,28 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra // 构建查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey, new HashSet<>(Arrays.asList("patient_name", "organization_name", "practitioner_name", "healthcare_name", "identifier_no")), - request); + null); // registerTimeSTime/ETime 已下推到 SQL 内层 WHERE,跳过 buildQueryWrapper 的自动 *STime/*ETime 处理 - // 手动处理 statusEnum 参数(用于过滤退号记录) + // 提取statusEnum参数,下推到内层WHERE(避免外层重复过滤) + Integer statusFilter = null; String statusEnumParam = request.getParameter("statusEnum"); if (statusEnumParam != null && !statusEnumParam.isEmpty()) { try { - Integer statusEnum = Integer.parseInt(statusEnumParam); - if (statusEnum == -1) { - // -1 表示排除退号记录(正常挂号) - queryWrapper.ne("status_enum", 6); - } else { - // 其他值表示精确匹配 - queryWrapper.eq("status_enum", statusEnum); - } + statusFilter = Integer.parseInt(statusEnumParam); } catch (NumberFormatException e) { // 忽略无效的参数值 } } + // 提取日期范围参数,下推到内层WHERE以优化性能(避免全表JOIN后再过滤) + String registerTimeSTime = request.getParameter("registerTimeSTime"); + String registerTimeETime = request.getParameter("registerTimeETime"); + IPage currentDayEncounter = outpatientRegistrationAppMapper.getCurrentDayEncounter( new Page<>(pageNo, pageSize), EncounterClass.AMB.getValue(), EncounterStatus.IN_PROGRESS.getValue(), ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode(), queryWrapper, - ChargeItemContext.REGISTER.getValue(), PaymentStatus.SUCCESS.getValue()); + ChargeItemContext.REGISTER.getValue(), PaymentStatus.SUCCESS.getValue(), + registerTimeSTime, registerTimeETime, statusFilter); // 过滤候选池排除列表 // 仅当调用方显式传 excludeFromCandidatePool=true 时才过滤,避免非分诊场景(挂号/收费) diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/chargemanage/mapper/OutpatientRegistrationAppMapper.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/chargemanage/mapper/OutpatientRegistrationAppMapper.java index bae16d09c..b364f58aa 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/chargemanage/mapper/OutpatientRegistrationAppMapper.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/chargemanage/mapper/OutpatientRegistrationAppMapper.java @@ -54,7 +54,10 @@ public interface OutpatientRegistrationAppMapper { @Param("classEnum") Integer classEnum, @Param("statusEnum") Integer statusEnum, @Param("participantType1") String participantType1, @Param("participantType2") String participantType2, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, - @Param("register") Integer register, @Param("paymentStatus") Integer paymentStatus); + @Param("register") Integer register, @Param("paymentStatus") Integer paymentStatus, + @Param("registerTimeSTime") String registerTimeSTime, + @Param("registerTimeETime") String registerTimeETime, + @Param("statusFilter") Integer statusFilter); /** * 查询item绑定的信息(耗材或诊疗) diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java index 220666c5e..c76b12cd0 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java @@ -185,6 +185,9 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { // 提取requestStatus手动处理,支持COMPLETED(3)和CHECK_VERIFIED(10)同时查询 Integer requestStatus = inpatientAdviceParam.getRequestStatus(); inpatientAdviceParam.setRequestStatus(null); + // Bug #714: 提取deadline手动处理,UNION子查询列名为end_time + String deadline = inpatientAdviceParam.getDeadline(); + inpatientAdviceParam.setDeadline(null); // 构建查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null); @@ -211,6 +214,16 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { if (therapyEnum != null) { queryWrapper.and(w -> w.eq("therapy_enum", therapyEnum).or().isNull("therapy_enum")); } + // Bug #714: 手动拼接deadline条件,按医嘱截止时间筛选 + if (deadline != null && !deadline.isEmpty()) { + try { + LocalDateTime deadlineTime = LocalDateTime.parse(deadline, + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + queryWrapper.le("end_time", deadlineTime); + } catch (DateTimeParseException e) { + // 忽略无效的日期格式 + } + } // 患者医嘱分页列表 Page inpatientAdvicePage = adviceProcessAppMapper.selectInpatientAdvicePage(new Page<>(pageNo, pageSize), queryWrapper, diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/chargemanage/OutpatientRegistrationAppMapper.xml b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/chargemanage/OutpatientRegistrationAppMapper.xml index 3f0642c6c..441bba15e 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/chargemanage/OutpatientRegistrationAppMapper.xml +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/chargemanage/OutpatientRegistrationAppMapper.xml @@ -217,6 +217,11 @@ WHERE T1.delete_flag = '0' AND T1.class_enum = #{classEnum} AND T10.context_enum = #{register} + AND (#{registerTimeSTime} IS NULL OR T1.create_time >= CAST(#{registerTimeSTime} AS TIMESTAMP)) + AND (#{registerTimeETime} IS NULL OR T1.create_time <= CAST(#{registerTimeETime} AS TIMESTAMP)) + AND (#{statusFilter} IS NULL + OR (#{statusFilter} >= 0 AND T1.status_enum = #{statusFilter}) + OR (#{statusFilter} = -1 AND T1.status_enum != 6)) ) AS T9 ${ew.customSqlSegment} ORDER BY T9.register_time DESC diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/appointmentmanage/domain/TicketSlotDTO.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/appointmentmanage/domain/TicketSlotDTO.java index 9a7f859cc..23ea73e6d 100755 --- a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/appointmentmanage/domain/TicketSlotDTO.java +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/appointmentmanage/domain/TicketSlotDTO.java @@ -21,6 +21,7 @@ public class TicketSlotDTO { private String patientName; private String medicalCard; private Long patientId; + private Long realPatientId; private String phone; private Integer orderStatus; private Long orderId; diff --git a/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/administration/ScheduleSlotMapper.xml b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/administration/ScheduleSlotMapper.xml index 393207c15..21a1fefb4 100755 --- a/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/administration/ScheduleSlotMapper.xml +++ b/healthlink-his-server/healthlink-his-domain/src/main/resources/mapper/administration/ScheduleSlotMapper.xml @@ -111,6 +111,7 @@ o.order_no AS orderNo, COALESCE(CAST(o.gender AS VARCHAR), CAST(pinfo.gender_enum AS VARCHAR)) AS patientGender, pinfo.gender_enum AS genderEnum, + pinfo.id AS realPatientId, pinfo.id_card AS idCard, o.appointment_time AS appointmentTime, AS orderStatus, @@ -230,6 +231,7 @@ o.order_no AS orderNo, COALESCE(CAST(o.gender AS VARCHAR), CAST(pinfo.gender_enum AS VARCHAR)) AS patientGender, pinfo.gender_enum AS genderEnum, + pinfo.id AS realPatientId, pinfo.id_card AS idCard, o.appointment_time AS appointmentTime, AS orderStatus, diff --git a/healthlink-his-ui/src/views/charge/cliniccharge/index.vue b/healthlink-his-ui/src/views/charge/cliniccharge/index.vue index b7391a383..d5d7c2f9d 100755 --- a/healthlink-his-ui/src/views/charge/cliniccharge/index.vue +++ b/healthlink-his-ui/src/views/charge/cliniccharge/index.vue @@ -61,7 +61,7 @@ ref="patientListRef" height="620" :data="patientList" - :row-config="{ keyField: 'encounterId', keyField: 'id' }" + :row-config="{ keyField: 'encounterId' }" @cell-click="clickRow" > - + 全部 @@ -26,6 +26,14 @@ 临时 + {