|
|
|
@ -3,6 +3,7 @@ package com.docus.server.archive.job;
|
|
|
|
|
import com.docus.core.util.Func;
|
|
|
|
|
import com.docus.infrastructure.web.api.CommonResult;
|
|
|
|
|
import com.docus.infrastructure.web.api.ResultCode;
|
|
|
|
|
import com.docus.server.archive.mapper.TBasicMapper;
|
|
|
|
|
import com.docus.server.archive.rpc.DownPlatformService;
|
|
|
|
|
import com.docus.server.archive.rpc.TaskDistributeService;
|
|
|
|
|
import com.docus.server.archive.rpc.dto.ReportDownDto;
|
|
|
|
@ -10,10 +11,10 @@ import com.docus.server.archive.rpc.dto.ReportDownTwoDto;
|
|
|
|
|
import com.docus.server.archive.rpc.dto.ReportHospitalTwoDto;
|
|
|
|
|
import com.docus.server.archive.rpc.dto.ReportPatientTwoDto;
|
|
|
|
|
import com.docus.server.fsy.api.LisReportService;
|
|
|
|
|
import com.docus.server.fsy.api.dto.LisPatientGroupReportRequest;
|
|
|
|
|
import com.docus.server.fsy.api.dto.LisPatientGroupReportResponse;
|
|
|
|
|
import com.docus.server.fsy.api.dto.LisPatientListRequest;
|
|
|
|
|
import com.docus.server.fsy.api.dto.LisPatientListResponse;
|
|
|
|
|
import com.docus.server.fsy.api.dto.LisPatientReportRequest;
|
|
|
|
|
import com.docus.server.fsy.api.dto.LisPatientReportResponse;
|
|
|
|
|
import com.docus.server.fsy.converter.LisReportConverter;
|
|
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@ -23,6 +24,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author YongBin Wen
|
|
|
|
@ -42,6 +44,8 @@ public class LisPatientReportCollectJob {
|
|
|
|
|
private DownPlatformService downPlatformService;
|
|
|
|
|
@Resource
|
|
|
|
|
private TaskDistributeService taskDistributeService;
|
|
|
|
|
@Resource
|
|
|
|
|
private TBasicMapper tBasicMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -80,21 +84,35 @@ public class LisPatientReportCollectJob {
|
|
|
|
|
LisPatientListResponse patientListResponse = lisReportService.getPatientList(lisPatientListRequest);
|
|
|
|
|
List<LisPatientListResponse.Patient> patientList = patientListResponse.getPatientList();
|
|
|
|
|
if (Func.isEmpty(patientList)) {
|
|
|
|
|
log.info("佛山三院Lis检验报告采集任务,采集任务id:{} 未查询到List患者文件数据", taskId);
|
|
|
|
|
log.info("佛山三院Lis检验报告采集任务,采集任务id:{} 未查询到Lis患者文件数据", taskId);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 文件列表查询每个文件,进行上报下载服务
|
|
|
|
|
for (LisPatientListResponse.Patient patient : patientList) {
|
|
|
|
|
LisPatientReportRequest lisPatientReportRequest = new LisPatientReportRequest();
|
|
|
|
|
lisPatientReportRequest.setRepId(patient.getRepId());
|
|
|
|
|
lisPatientReportRequest.setCustomReportSuffix("");
|
|
|
|
|
LisPatientReportResponse lisReportServicePatientReport = lisReportService.getPatientReport(lisPatientReportRequest);
|
|
|
|
|
ReportDownDto reportDownDto = LisReportConverter.convertDownloadPlatform(reportDownTwoDto, patient, lisReportServicePatientReport);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// 文件列表查询每个文件,进行上报下载服务 ,于 2025-3-11 更换为 合并获取接口
|
|
|
|
|
// for (LisPatientListResponse.Patient patient : patientList) {
|
|
|
|
|
// LisPatientReportRequest lisPatientReportRequest = new LisPatientReportRequest();
|
|
|
|
|
// lisPatientReportRequest.setRepId(patient.getRepId());
|
|
|
|
|
// lisPatientReportRequest.setCustomReportSuffix("");
|
|
|
|
|
// LisPatientReportResponse lisReportServicePatientReport = lisReportService.getPatientReport(lisPatientReportRequest);
|
|
|
|
|
// ReportDownDto reportDownDto = LisReportConverter.convertDownloadPlatform(reportDownTwoDto, patient, lisReportServicePatientReport);
|
|
|
|
|
// reportDownDto.setCollectorid(lisCollectorId);
|
|
|
|
|
// reportDownDto.setAssortid(lisAssortId);
|
|
|
|
|
// downPlatformService.report(reportDownDto);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// 合并获取接口
|
|
|
|
|
String repIds = patientList.stream().map(LisPatientListResponse.Patient::getRepId).collect(Collectors.joining(","));
|
|
|
|
|
LisPatientGroupReportRequest request = new LisPatientGroupReportRequest();
|
|
|
|
|
request.setReportCode("GroupPrint");
|
|
|
|
|
request.setRepIds(repIds);
|
|
|
|
|
LisPatientGroupReportResponse groupReport = lisReportService.getPatientGroupReport(request);
|
|
|
|
|
ReportDownDto reportDownDto = LisReportConverter.convertDownloadPlatform(reportDownTwoDto, groupReport);
|
|
|
|
|
reportDownDto.setCollectorid(lisCollectorId);
|
|
|
|
|
reportDownDto.setAssortid(lisAssortId);
|
|
|
|
|
tBasicMapper.cancelFileBySource(lisCollectorId, reportDownTwoDto.getPatientId());
|
|
|
|
|
downPlatformService.report(reportDownDto);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error("====================> 佛山三院Lis检验报告采集任务出现异常_" + ex.getMessage(), ex);
|
|
|
|
|
}
|
|
|
|
|