From 4b76e8078badb56f9c03bbebd209041f2206c362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E=E4=BD=97?= Date: Mon, 15 Jun 2026 15:46:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(#763):=20=E3=80=90=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=8F=8D=E9=A6=88=E3=80=91Bug=20#763=20?= =?UTF-8?q?=E4=B8=8A=E6=AC=A1=E4=BF=AE=E5=A4=8D=E6=9C=AA=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E5=85=A8=E9=93=BE=E8=B7=AF=E9=AA=8C=E8=AF=81=EF=BC=8C=E8=AF=B7?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BB=A5=E4=B8=8B=E5=A4=B1=E8=B4=A5=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E9=87=8D=E6=96=B0=E4=BF=AE=E5=A4=8D=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 失败原因: - 数据库验证 ❌: 数据库验证失败: 表 med_medication_request 查询失败: psql: error: connection to server at "192.168.110.252", port 15432 failed: FATAL: database "hisdev" does not exist 总耗时: 137737ms 请针对上述失败项重新修复,确保: 1. 编译通过(vite build / mvn compile) 2. 单元测试通过(vitest / mvn test) 3. Playwright 回归测试通过 4. 数据库表可访问 5. 后端服务可达 由 AI Agent (guanyu) 自动修复,请查看 diff 确认变更内容。 --- .../impl/AdviceProcessAppServiceImpl.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 3d84e113f..2fd45421a 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 @@ -53,7 +53,9 @@ import jakarta.annotation.Resource; import jakarta.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.math.RoundingMode; +import java.text.SimpleDateFormat; import java.time.LocalDateTime; +import java.util.Date; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; @@ -182,6 +184,9 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { // 提取requestStatus手动处理,支持COMPLETED(3)和CHECK_VERIFIED(10)同时查询 Integer requestStatus = inpatientAdviceParam.getRequestStatus(); inpatientAdviceParam.setRequestStatus(null); + // 提取deadline手动处理,需要做NULL-safe的end_time比较(Bug #763修复) + String deadline = inpatientAdviceParam.getDeadline(); + inpatientAdviceParam.setDeadline(null); // 构建查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null); @@ -204,6 +209,18 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { = Arrays.stream(encounterIds.split(CommonConstants.Common.COMMA)).map(Long::parseLong).toList(); queryWrapper.in(CommonConstants.FieldName.EncounterId, encounterIdList); } + // 手动拼接deadline条件:end_time IS NULL OR end_time <= deadline(Bug #763修复) + // 住院医嘱的effective_dose_end可能为NULL(签发临时医嘱时未设置结束时间), + // PostgreSQL中 NULL <= anything 结果为FALSE,需要先判断IS NULL + if (deadline != null && !deadline.isEmpty()) { + try { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date deadlineTime = sdf.parse(deadline); + queryWrapper.and(w -> w.isNull("end_time").or().le("end_time", deadlineTime)); + } catch (java.text.ParseException e) { + // deadline解析失败,忽略此条件 + } + } // 患者医嘱分页列表 Page inpatientAdvicePage = adviceProcessAppMapper.selectInpatientAdvicePage(new Page<>(pageNo, pageSize), queryWrapper,