|
|
|
@ -5,6 +5,7 @@ import com.docus.core.util.Func;
|
|
|
|
|
import com.docus.infrastructure.core.utils.TableJsonRead;
|
|
|
|
|
import com.docus.infrastructure.web.api.CommonResult;
|
|
|
|
|
import com.docus.infrastructure.web.api.ResultCode;
|
|
|
|
|
import com.docus.server.mzsy.entity.MzsyMectReportView;
|
|
|
|
|
import com.docus.server.mzsy.entity.MzsyReportDataView;
|
|
|
|
|
import com.docus.server.mzsy.entity.MzsyShoumaReportDataView;
|
|
|
|
|
import com.docus.server.mzsy.mapper.MzsyReportDataViewMapper;
|
|
|
|
@ -168,6 +169,73 @@ public class MzsyReportCollectJob {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@XxlJob("MzsyMectReportCollectJob")
|
|
|
|
|
public void mectReportCollect() {
|
|
|
|
|
try {
|
|
|
|
|
// 1.获取任务和患者信息 2.查询视图信息 3.上报下载
|
|
|
|
|
String jobParam = XxlJobHelper.getJobParam();
|
|
|
|
|
JSONObject jobParamJsonObject = JSONObject.parseObject(jobParam);
|
|
|
|
|
String collectorId = jobParamJsonObject.getString("collectorId");
|
|
|
|
|
String extraCondition = jobParamJsonObject.getString("extraCondition");
|
|
|
|
|
String assortId = jobParamJsonObject.getString("assortId");
|
|
|
|
|
if (Func.isBlank(collectorId) || Func.isBlank(assortId)) {
|
|
|
|
|
log.warn(">>>>>>>>>>>>>>>>>>>>>> 梅州三院 MECT 报告视图采集,未配置采集器获取任务信息");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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(">>>>>>>>>>>>>>>>>>>>>> 梅州三院 MECT 报告视图采集任务,获取了任务:{}", Func.toJson(task));
|
|
|
|
|
|
|
|
|
|
ReportHospitalTwoDto hospitalTwoDto = downTwoDto.getHospitals().get(0);
|
|
|
|
|
ReportPatientTwoDto reportPatientTwoDto = downTwoDto.getPatient();
|
|
|
|
|
String jzh = downTwoDto.getJzh();
|
|
|
|
|
String inpatientNo = reportPatientTwoDto.getInpatientNo();
|
|
|
|
|
Integer admissTimes = hospitalTwoDto.getAdmissTimes();
|
|
|
|
|
|
|
|
|
|
List<MzsyMectReportView> mzsyMectReportViews = reportDataViewMapper.findByPatIdAndOtherCondition(jzh, extraCondition);
|
|
|
|
|
int size = mzsyMectReportViews.size();
|
|
|
|
|
log.info("MECT 住院号:{},住院次数:{},记账号:{} 采集视图数据:{} 条!数据:{}", inpatientNo, admissTimes, jzh, size, Func.toJson(mzsyMectReportViews));
|
|
|
|
|
if (size <= 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ReportDownPatientDto patient = new ReportDownPatientDto();
|
|
|
|
|
patient.setPatientid(downTwoDto.getPatientId());
|
|
|
|
|
|
|
|
|
|
ReportDownDto reportDownDto = new ReportDownDto();
|
|
|
|
|
reportDownDto.setCollectorid(collectorId);
|
|
|
|
|
reportDownDto.setIp("");
|
|
|
|
|
reportDownDto.setPatient(patient);
|
|
|
|
|
int sort = 0;
|
|
|
|
|
for (MzsyMectReportView mzsyMectReportView : mzsyMectReportViews) {
|
|
|
|
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
|
reportDownScanFileDto.setDownurl(mzsyMectReportView.getPdfReportPath());
|
|
|
|
|
reportDownScanFileDto.setFiletitle(mzsyMectReportView.getModuleName());
|
|
|
|
|
reportDownScanFileDto.setSerialnum(mzsyMectReportView.getApplyId());
|
|
|
|
|
reportDownScanFileDto.setFilesource(1);
|
|
|
|
|
reportDownScanFileDto.setFiletype(1);
|
|
|
|
|
reportDownScanFileDto.setFilestoragetype(1);
|
|
|
|
|
reportDownScanFileDto.setTaskid(task.getTaskId());
|
|
|
|
|
// reportDownScanFileDto.setSort(++sort);
|
|
|
|
|
reportDownScanFileDto.setSort(sort);
|
|
|
|
|
List<ReportDownScanFileDto> scanFiles = Collections.singletonList(reportDownScanFileDto);
|
|
|
|
|
|
|
|
|
|
reportDownDto.setAssortid(assortId);
|
|
|
|
|
reportDownDto.setScanfiles(scanFiles);
|
|
|
|
|
downPlatformService.report(reportDownDto);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error(">>>>>>>>>>>>>>>>>>>>>> 梅州三院 MECT 报告视图采集 错误," + ex.getMessage(), ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
TableJsonRead tableJsonRead = new TableJsonRead();
|
|
|
|
|
JSONObject moduleAlisConfig = tableJsonRead.Read("data-config", "mzsy-module-alis", JSONObject.class);
|
|
|
|
|