From de095723b1628ed540e69d6f66a47196652cf2bd Mon Sep 17 00:00:00 2001 From: xueqingkun Date: Thu, 16 Nov 2023 13:09:14 +0800 Subject: [PATCH] =?UTF-8?q?web=20:=201.=20=E6=9F=A5=E8=AF=A2=E4=BD=93?= =?UTF-8?q?=E6=A0=BC=E6=A3=80=E6=9F=A5=E7=9A=84=E7=BB=93=E6=9E=9C=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=9C=AA=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=88=B0=E6=A3=80=E6=9F=A5=E9=83=A8=E4=BD=8D=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E7=A9=BA=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AskPhysicalServiceImpl.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/virtual-patient-web/src/main/java/com/supervision/service/impl/AskPhysicalServiceImpl.java b/virtual-patient-web/src/main/java/com/supervision/service/impl/AskPhysicalServiceImpl.java index f90c1d7e..06226ade 100644 --- a/virtual-patient-web/src/main/java/com/supervision/service/impl/AskPhysicalServiceImpl.java +++ b/virtual-patient-web/src/main/java/com/supervision/service/impl/AskPhysicalServiceImpl.java @@ -57,21 +57,27 @@ public class AskPhysicalServiceImpl implements AskPhysicalService { ConfigPhysicalTool tool = Optional.ofNullable(toolService.getById(reqVO.getToolId())).orElseThrow(() -> new BusinessException("工具不支持")); // 是否需要具体的部位,0否1是 ConfigPhysicalLocation location = new ConfigPhysicalLocation(); + DiseasePhysical result = new DiseasePhysical(); + if (1 == tool.getRequireLocation() && StrUtil.isBlank(reqVO.getLocationCode())) { + throw new BusinessException("请选择对应的位置"); + } if (1 == tool.getRequireLocation()) { - if (StrUtil.isBlank(reqVO.getLocationCode())){ - throw new BusinessException("请选择对应的位置"); - } location = locationService.lambdaQuery().eq(ConfigPhysicalLocation::getCode, reqVO.getLocationCode()).last("limit 1") .oneOpt().orElseGet(ConfigPhysicalLocation::new); } - DiseasePhysical result = diseasePhysicalService.lambdaQuery().eq(DiseasePhysical::getMedicalRecId, process.getMedicalRecId()) - .eq(DiseasePhysical::getToolId, tool.getId()).eq(StrUtil.isNotBlank(location.getId()), DiseasePhysical::getLocationId, location.getId()).last("limit 1") - .oneOpt() - .orElseGet(() -> { - DiseasePhysical diseasePhysical = new DiseasePhysical(); - diseasePhysical.setResult("无相关资讯"); - return diseasePhysical; - }); + if (1 == tool.getRequireLocation() && StrUtil.isEmpty(location.getId())) { + result.setResult("无相关资讯"); + } else { + result = diseasePhysicalService.lambdaQuery().eq(DiseasePhysical::getMedicalRecId, process.getMedicalRecId()) + .eq(DiseasePhysical::getToolId, tool.getId()).eq(StrUtil.isNotBlank(location.getId()), DiseasePhysical::getLocationId, location.getId()).last("limit 1") + .oneOpt() + .orElseGet(() -> { + DiseasePhysical diseasePhysical = new DiseasePhysical(); + diseasePhysical.setResult("无相关资讯"); + return diseasePhysical; + }); + } + // 检查记录保存到数据库中 DiagnosisPhysicalRecord diagnosisPhysicalRecord = new DiagnosisPhysicalRecord(); diagnosisPhysicalRecord.setProcessId(process.getId());