|
|
@ -257,58 +257,63 @@ public class MzZyyReportCollectJob {
|
|
|
|
@XxlJob("MzZyyXinDianCollectJob")
|
|
|
|
@XxlJob("MzZyyXinDianCollectJob")
|
|
|
|
public void xinDianCollectJob() {
|
|
|
|
public void xinDianCollectJob() {
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院心电视图采集任务开始!");
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院心电视图采集任务开始!");
|
|
|
|
// 1.获取任务和患者信息 2.查询视图信息 3.上报下载
|
|
|
|
try {
|
|
|
|
String jobParam = XxlJobHelper.getJobParam();
|
|
|
|
// 1.获取任务和患者信息 2.查询视图信息 3.上报下载
|
|
|
|
JSONObject jobParamJsonObject = JSONObject.parseObject(jobParam);
|
|
|
|
String jobParam = XxlJobHelper.getJobParam();
|
|
|
|
String assortId = jobParamJsonObject.getString("assortId");
|
|
|
|
JSONObject jobParamJsonObject = JSONObject.parseObject(jobParam);
|
|
|
|
String collectorId = jobParamJsonObject.getString("collectorId");
|
|
|
|
String assortId = jobParamJsonObject.getString("assortId");
|
|
|
|
String extraCondition = jobParamJsonObject.getString("extraCondition");
|
|
|
|
String collectorId = jobParamJsonObject.getString("collectorId");
|
|
|
|
if (Func.isBlank(assortId) || Func.isBlank(collectorId)) {
|
|
|
|
String extraCondition = jobParamJsonObject.getString("extraCondition");
|
|
|
|
log.warn(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院心电视图采集任务,未配置心电采集器和采集文件分段");
|
|
|
|
if (Func.isBlank(assortId) || Func.isBlank(collectorId)) {
|
|
|
|
return;
|
|
|
|
log.warn(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院心电视图采集任务,未配置心电采集器和采集文件分段");
|
|
|
|
}
|
|
|
|
|
|
|
|
CommonResult<ReportDownTwoDto> commonResult = taskDistributeService.getNoViewTaskByCollectorId(collectorId);
|
|
|
|
|
|
|
|
if (ResultCode.SUCCESS.getCode().equals(commonResult.getCode())
|
|
|
|
|
|
|
|
&& commonResult.getData() != null) {
|
|
|
|
|
|
|
|
ReportDownTwoDto downTwoDto = commonResult.getData();
|
|
|
|
|
|
|
|
ReportTaskTwoDto task = downTwoDto.getTasks().get(0);
|
|
|
|
|
|
|
|
log.info("获取了任务:{}", Func.toJson(task));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String patientId = downTwoDto.getPatientId();
|
|
|
|
|
|
|
|
String jzh = downTwoDto.getJzh();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<MzZyyXinDianView> xinDianViews = xinDianViewMapper.getPatientXinDianView(jzh, extraCondition);
|
|
|
|
|
|
|
|
int size = xinDianViews.size();
|
|
|
|
|
|
|
|
log.info("记账号:{} 采集心电数据:{} 条!", jzh, size);
|
|
|
|
|
|
|
|
if (size <= 0) {
|
|
|
|
|
|
|
|
determineAndCancelTask(patientId, collectorId);
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tBasicMapper.invalidFileBySource(patientId, collectorId);
|
|
|
|
CommonResult<ReportDownTwoDto> commonResult = taskDistributeService.getNoViewTaskByCollectorId(collectorId);
|
|
|
|
|
|
|
|
if (ResultCode.SUCCESS.getCode().equals(commonResult.getCode())
|
|
|
|
|
|
|
|
&& commonResult.getData() != null) {
|
|
|
|
|
|
|
|
ReportDownTwoDto downTwoDto = commonResult.getData();
|
|
|
|
|
|
|
|
ReportTaskTwoDto task = downTwoDto.getTasks().get(0);
|
|
|
|
|
|
|
|
log.info("梅州中医院心电视图采集,获取了任务:{}", Func.toJson(task));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String patientId = downTwoDto.getPatientId();
|
|
|
|
|
|
|
|
String jzh = downTwoDto.getJzh();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<MzZyyXinDianView> xinDianViews = xinDianViewMapper.getPatientXinDianView(jzh, extraCondition);
|
|
|
|
|
|
|
|
int size = xinDianViews.size();
|
|
|
|
|
|
|
|
log.info("梅州中医院心电视图采集,记账号:{} 采集心电数据:{} 条!", jzh, size);
|
|
|
|
|
|
|
|
if (size <= 0) {
|
|
|
|
|
|
|
|
determineAndCancelTask(patientId, collectorId);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
tBasicMapper.invalidFileBySource(patientId, collectorId);
|
|
|
|
|
|
|
|
|
|
|
|
ReportDownPatientDto patient = new ReportDownPatientDto();
|
|
|
|
ReportDownPatientDto patient = new ReportDownPatientDto();
|
|
|
|
patient.setPatientid(patientId);
|
|
|
|
patient.setPatientid(patientId);
|
|
|
|
|
|
|
|
|
|
|
|
ReportDownDto reportDownDto = new ReportDownDto();
|
|
|
|
ReportDownDto reportDownDto = new ReportDownDto();
|
|
|
|
reportDownDto.setAssortid(assortId);
|
|
|
|
reportDownDto.setAssortid(assortId);
|
|
|
|
reportDownDto.setCollectorid(collectorId);
|
|
|
|
reportDownDto.setCollectorid(collectorId);
|
|
|
|
reportDownDto.setIp("");
|
|
|
|
reportDownDto.setIp("");
|
|
|
|
reportDownDto.setPatient(patient);
|
|
|
|
reportDownDto.setPatient(patient);
|
|
|
|
|
|
|
|
|
|
|
|
for (MzZyyXinDianView result : xinDianViews) {
|
|
|
|
for (MzZyyXinDianView result : xinDianViews) {
|
|
|
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
reportDownScanFileDto.setDownurl(result.getBgdz());
|
|
|
|
reportDownScanFileDto.setDownurl(result.getBgdz());
|
|
|
|
reportDownScanFileDto.setFiletitle(result.getBgmc());
|
|
|
|
reportDownScanFileDto.setFiletitle(result.getBgmc());
|
|
|
|
reportDownScanFileDto.setSerialnum(result.getBgid());
|
|
|
|
reportDownScanFileDto.setSerialnum(result.getBgid());
|
|
|
|
reportDownScanFileDto.setFilesource(1);
|
|
|
|
reportDownScanFileDto.setFilesource(1);
|
|
|
|
reportDownScanFileDto.setFiletype(1);
|
|
|
|
reportDownScanFileDto.setFiletype(1);
|
|
|
|
reportDownScanFileDto.setFilestoragetype(1);
|
|
|
|
reportDownScanFileDto.setFilestoragetype(1);
|
|
|
|
reportDownScanFileDto.setTaskid(task.getTaskId());
|
|
|
|
reportDownScanFileDto.setTaskid(task.getTaskId());
|
|
|
|
List<ReportDownScanFileDto> scanFiles = Collections.singletonList(reportDownScanFileDto);
|
|
|
|
List<ReportDownScanFileDto> scanFiles = Collections.singletonList(reportDownScanFileDto);
|
|
|
|
reportDownDto.setScanfiles(scanFiles);
|
|
|
|
reportDownDto.setScanfiles(scanFiles);
|
|
|
|
downPlatformService.report(reportDownDto);
|
|
|
|
downPlatformService.report(reportDownDto);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
|
|
log.error(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院心电视图采集任务出错了!" + ex.getMessage(), ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院心电视图采集任务结束!");
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院心电视图采集任务结束!");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|