diff --git a/src/main/java/com/docus/server/collection/mapper/TBasicMapper.java b/src/main/java/com/docus/server/collection/mapper/TBasicMapper.java index e9c5ee2..4e8d0b7 100644 --- a/src/main/java/com/docus/server/collection/mapper/TBasicMapper.java +++ b/src/main/java/com/docus/server/collection/mapper/TBasicMapper.java @@ -46,4 +46,6 @@ public interface TBasicMapper{ String getSdRyIndexByPatientId(@Param("patientId")String patientId); List selectBasicListByCreateOrUpdateTime(@Param("startDate")String queryBasicStartDate, @Param("endDate")String queryBasicEndDate, @Param("offset") int offset,@Param("size") int size); + + List selectBasicListByPatientIds(@Param("patientIds") List patientIds); } diff --git a/src/main/java/com/docus/server/report/controller/ReportDownController.java b/src/main/java/com/docus/server/report/controller/ReportDownController.java index b11933c..d184b68 100644 --- a/src/main/java/com/docus/server/report/controller/ReportDownController.java +++ b/src/main/java/com/docus/server/report/controller/ReportDownController.java @@ -3,6 +3,8 @@ package com.docus.server.report.controller; import com.alibaba.fastjson.JSONObject; import com.docus.core.util.Func; import com.docus.infrastructure.web.api.CommonResult; +import com.docus.server.collection.entity.TBasic; +import com.docus.server.collection.mapper.TBasicMapper; import com.docus.server.report.job.ReportJob; import com.docus.server.report.service.ReportService; import io.swagger.annotations.Api; @@ -25,9 +27,11 @@ import java.util.Map; public class ReportDownController { @Resource private ReportService reportService; - + @Resource + private TBasicMapper tBasicMapper; @Resource ReportJob reportJob; + @ApiOperation(value = "report lis job 测试") @PostMapping("/lisreportJobTest") public CommonResult LisreportJobTest(){ @@ -43,6 +47,34 @@ public class ReportDownController { } + @ApiOperation(value = " inspectReport 根据病案主键补偿") + @PostMapping("/inspectReportMakeup") + public CommonResult inspectReportMakeup(@RequestBody List patientIds){ + if(Func.isEmpty(patientIds)){ + return CommonResult.failed("病案主键不能为空!"); + } + List tBasics =tBasicMapper.selectBasicListByPatientIds(patientIds); + if(Func.isEmpty(tBasics)){ + return CommonResult.failed("未查询到病案基础数据!"); + } + reportJob.queryInspectReport(tBasics); + return CommonResult.success("成功"); + } + + @ApiOperation(value = "lisReport 根据病案主键补偿") + @PostMapping("/lisReportMakeup") + public CommonResult lisReportMakeup(@RequestBody List patientIds){ + if(Func.isEmpty(patientIds)){ + return CommonResult.failed("病案主键不能为空!"); + } + List tBasics =tBasicMapper.selectBasicListByPatientIds(patientIds); + if(Func.isEmpty(tBasics)){ + return CommonResult.failed("未查询到病案基础数据!"); + } + reportJob.queryLisReport(tBasics); + return CommonResult.success("成功"); + } + @ApiOperation(value = "根据任务id补偿报告下载") @PostMapping("/makeupReportByTaskIds") diff --git a/src/main/java/com/docus/server/report/job/ReportJob.java b/src/main/java/com/docus/server/report/job/ReportJob.java index 29b033f..dfb0dd4 100644 --- a/src/main/java/com/docus/server/report/job/ReportJob.java +++ b/src/main/java/com/docus/server/report/job/ReportJob.java @@ -86,16 +86,8 @@ public class ReportJob { if (basicList.size() < pageSize) { loopCondition = false; } - for (TBasic tBasic : basicList) { - List reportDtoList = getLisReportList(tBasic); - if (reportDtoList.isEmpty()) { - log.warn("病案主键 patientId {} 未查询 LIS 检验报告!", tBasic.getPatientId()); - continue; - } - reportDtoList.forEach(reportDto -> { - reportService.report(reportDto); - }); - } + queryLisReport(basicList); + offset += pageSize; } while (loopCondition); } catch (Exception ex) { @@ -107,6 +99,19 @@ public class ReportJob { log.info("LIS检验报告报告查询 任务结束了,本次查询出院时间段 {} - {}", "", ""); } + public void queryLisReport(List basicList) { + for (TBasic tBasic : basicList) { + List reportDtoList = getLisReportList(tBasic); + if (reportDtoList.isEmpty()) { + log.warn("病案主键 patientId {} 未查询 LIS 检验报告!", tBasic.getPatientId()); + continue; + } + reportDtoList.forEach(reportDto -> { + reportService.report(reportDto); + }); + } + } + /** * 检查报告查询,查询入院时间前 3天的检验报告 @@ -136,16 +141,7 @@ public class ReportJob { if (basicList.size() < pageSize) { loopCondition = false; } - for (TBasic tBasic : basicList) { - List reportDtoList = getInspectReportList(tBasic); - if (reportDtoList.isEmpty()) { - log.warn("病案主键 patientId {} 未查询 检查报告!", tBasic.getPatientId()); - continue; - } - reportDtoList.forEach(reportDto -> { - reportService.report(reportDto); - }); - } + queryInspectReport(basicList); offset += pageSize; } while (loopCondition); } catch (Exception ex) { @@ -157,6 +153,19 @@ public class ReportJob { log.info("检查报告报告查询 任务结束了,本次查询出院时间段 {} - {}", "", ""); } + public void queryInspectReport(List basicList) { + for (TBasic tBasic : basicList) { + List reportDtoList = getInspectReportList(tBasic); + if (reportDtoList.isEmpty()) { + log.warn("病案主键 patientId {} 未查询 检查报告!", tBasic.getPatientId()); + continue; + } + reportDtoList.forEach(reportDto -> { + reportService.report(reportDto); + }); + } + } + private List getInspectReportList(TBasic tBasic) { // 根据基础信息查顺德报告业务系统索引,查 交叉索引 List sdRyReportPatientIds = getSdRyReportPatientIds(tBasic.getPatientId()); diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml index 40cc8f1..122e47d 100644 --- a/src/main/resources/bootstrap.yml +++ b/src/main/resources/bootstrap.yml @@ -40,6 +40,8 @@ spring: file-extension: yml shared-configs: - comm.${spring.cloud.nacos.config.file-extension} + profiles: + active: dev sdry: # 顺德人医查询检查、检验报告之前查患者交叉索引的wsdl配置 diff --git a/src/main/resources/mapper/TBasicMapper.xml b/src/main/resources/mapper/TBasicMapper.xml index c224847..6f91abb 100644 --- a/src/main/resources/mapper/TBasicMapper.xml +++ b/src/main/resources/mapper/TBasicMapper.xml @@ -105,7 +105,7 @@ +