bugfix:修复体温计不能正确查询到结果的问题

dev_2.0.0
liu 2 years ago
parent 3d741b282e
commit ef4a3fc96b

@ -54,27 +54,26 @@ public class AskPhysicalServiceImpl implements AskPhysicalService {
ConfigPhysicalTool tool = Optional.ofNullable(toolService.getById(reqVO.getToolId())).orElseThrow(() -> new BusinessException("工具不支持")); ConfigPhysicalTool tool = Optional.ofNullable(toolService.getById(reqVO.getToolId())).orElseThrow(() -> new BusinessException("工具不支持"));
// 是否需要具体的部位,0否1是 // 是否需要具体的部位,0否1是
ConfigPhysicalLocation location = new ConfigPhysicalLocation(); ConfigPhysicalLocation location = new ConfigPhysicalLocation();
DiseasePhysical result = new DiseasePhysical();
if (1 == tool.getRequireLocation() && StrUtil.isBlank(reqVO.getLocationCode())) {
throw new BusinessException("请选择对应的位置");
}
if (1 == tool.getRequireLocation()) { if (1 == tool.getRequireLocation()) {
location = locationService.lambdaQuery().eq(ConfigPhysicalLocation::getCode, reqVO.getLocationCode()).last("limit 1") if (StrUtil.isBlank(reqVO.getLocationCode())) {
.oneOpt().orElseGet(ConfigPhysicalLocation::new); throw new BusinessException("请选择对应的位置");
} } else {
if (1 == tool.getRequireLocation() && StrUtil.isEmpty(location.getId())) { location = locationService.lambdaQuery().eq(ConfigPhysicalLocation::getCode, reqVO.getLocationCode()).last("limit 1")
result.setResult("无相关资讯"); .oneOpt().orElseGet(ConfigPhysicalLocation::new);
} else { }
result = diseasePhysicalService.lambdaQuery().eq(DiseasePhysical::getDiseaseId, 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;
});
} }
DiseasePhysical result = diseasePhysicalService.lambdaQuery().eq(DiseasePhysical::getDiseaseId, process.getDiseaseId())
.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 diagnosisPhysicalRecord = new DiagnosisPhysicalRecord();
diagnosisPhysicalRecord.setProcessId(process.getId()); diagnosisPhysicalRecord.setProcessId(process.getId());
@ -87,7 +86,7 @@ public class AskPhysicalServiceImpl implements AskPhysicalService {
diagnosisPhysicalRecord.insert(); diagnosisPhysicalRecord.insert();
// 保存初步诊断 // 保存初步诊断
if (CollUtil.isNotEmpty(reqVO.getPrimaryIdList())){ if (CollUtil.isNotEmpty(reqVO.getPrimaryIdList())) {
for (String primaryId : reqVO.getPrimaryIdList()) { for (String primaryId : reqVO.getPrimaryIdList()) {
DiagnosisPrimaryRelation diagnosisPrimaryRelation = new DiagnosisPrimaryRelation(); DiagnosisPrimaryRelation diagnosisPrimaryRelation = new DiagnosisPrimaryRelation();
diagnosisPrimaryRelation.setProcessId(process.getId()); diagnosisPrimaryRelation.setProcessId(process.getId());

Loading…
Cancel
Save