From b88bb7296f095952efb1078eefad2d79a7b05d16 Mon Sep 17 00:00:00 2001 From: Flow <958079825@qq.com> Date: Fri, 27 Jun 2025 10:16:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E5=A3=B0=E6=8E=A5=E5=8F=A3=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/inspectpatient/InspectPatientController.java | 8 ++++---- .../service/inspectpatient/InspectPatientService.java | 5 +++++ .../inspectpatient/InspectPatientServiceImpl.java | 9 +++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/controller/admin/inspectpatient/InspectPatientController.java b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/controller/admin/inspectpatient/InspectPatientController.java index 7fb4b9c..f467818 100644 --- a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/controller/admin/inspectpatient/InspectPatientController.java +++ b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/controller/admin/inspectpatient/InspectPatientController.java @@ -988,15 +988,15 @@ public class InspectPatientController { @GetMapping("/getUSTj") @Operation(summary = "获取超声报告") public CommonResult GetApiPacsInfo(@RequestParam("medicalSn") String medicalSn) { - // 获取患者信息 - InspectPatientDO patientDO = patientService.getPatientInfo(medicalSn); - if (patientDO == null) { + // 只获取shortid字段,提高查询性能 + String shortid = patientService.getPatientShortid(medicalSn); + if (shortid == null) { return success(false); } ConfigDO config = configService.getConfigByKey("url.ustj"); String url = config.getValue(); - String response = HttpUtils.get(url + "?" + "examid=" + medicalSn + "&" + "orgSN=" + patientDO.getShortid()); + String response = HttpUtils.get(url + "?" + "examid=" + medicalSn + "&" + "orgSN=" + shortid); if (response != null) { // 解析 JSON 响应 ObjectMapper objectMapper = new ObjectMapper(); diff --git a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatient/InspectPatientService.java b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatient/InspectPatientService.java index cfcf556..5469726 100644 --- a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatient/InspectPatientService.java +++ b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatient/InspectPatientService.java @@ -82,6 +82,11 @@ public interface InspectPatientService { * 根据体检编号获取患者信息的json * */ InspectPatientDO getPatientInfo(String medicalSn); + + /* + * 根据体检编号只获取shortid字段 + * */ + String getPatientShortid(String medicalSn); /* * 更新患者的基本信息里的补充信息 高血压、老年人、行政村、卫生院、糖尿病、精神病 * */ diff --git a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatient/InspectPatientServiceImpl.java b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatient/InspectPatientServiceImpl.java index 6a40356..2cc512b 100644 --- a/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatient/InspectPatientServiceImpl.java +++ b/yudao-module-inspect/yudao-module-inspect-biz/src/main/java/cn/iocoder/yudao/module/inspect/service/inspectpatient/InspectPatientServiceImpl.java @@ -172,6 +172,15 @@ public class InspectPatientServiceImpl implements InspectPatientService { return patientDO; } + + @Override + public String getPatientShortid(String medicalSn) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(InspectPatientDO::getMedicalSn, medicalSn) + .select(InspectPatientDO::getShortid); + InspectPatientDO patientDO = patientMapper.selectOne(queryWrapper); + return patientDO != null ? patientDO.getShortid() : null; + } @Override public List getPatientdetails(PatientDetailsVO detailsVO) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();