|
|
|
@ -5,6 +5,7 @@ import com.docus.core.util.Func;
|
|
|
|
import com.docus.infrastructure.core.utils.TableJsonRead;
|
|
|
|
import com.docus.infrastructure.core.utils.TableJsonRead;
|
|
|
|
import com.docus.infrastructure.web.api.CommonResult;
|
|
|
|
import com.docus.infrastructure.web.api.CommonResult;
|
|
|
|
import com.docus.infrastructure.web.api.ResultCode;
|
|
|
|
import com.docus.infrastructure.web.api.ResultCode;
|
|
|
|
|
|
|
|
import com.docus.server.archive.entity.TBasic;
|
|
|
|
import com.docus.server.archive.mapper.TBasicMapper;
|
|
|
|
import com.docus.server.archive.mapper.TBasicMapper;
|
|
|
|
import com.docus.server.mzsy.entity.MzsyMectReportView;
|
|
|
|
import com.docus.server.mzsy.entity.MzsyMectReportView;
|
|
|
|
import com.docus.server.mzsy.entity.MzsyReportDataView;
|
|
|
|
import com.docus.server.mzsy.entity.MzsyReportDataView;
|
|
|
|
@ -13,15 +14,26 @@ import com.docus.server.mzsy.mapper.MzsyReportDataViewMapper;
|
|
|
|
import com.docus.server.mzsy.mapper.MzsyShoumaReportDataViewMapper;
|
|
|
|
import com.docus.server.mzsy.mapper.MzsyShoumaReportDataViewMapper;
|
|
|
|
import com.docus.server.rpc.DownPlatformService;
|
|
|
|
import com.docus.server.rpc.DownPlatformService;
|
|
|
|
import com.docus.server.rpc.TaskDistributeService;
|
|
|
|
import com.docus.server.rpc.TaskDistributeService;
|
|
|
|
import com.docus.server.rpc.dto.*;
|
|
|
|
import com.docus.server.rpc.dto.ReportDownDto;
|
|
|
|
|
|
|
|
import com.docus.server.rpc.dto.ReportDownPatientDto;
|
|
|
|
|
|
|
|
import com.docus.server.rpc.dto.ReportDownScanFileDto;
|
|
|
|
|
|
|
|
import com.docus.server.rpc.dto.ReportDownTwoDto;
|
|
|
|
|
|
|
|
import com.docus.server.rpc.dto.ReportHospitalTwoDto;
|
|
|
|
|
|
|
|
import com.docus.server.rpc.dto.ReportPatientTwoDto;
|
|
|
|
|
|
|
|
import com.docus.server.rpc.dto.ReportTaskTwoDto;
|
|
|
|
import com.xxl.job.core.context.XxlJobHelper;
|
|
|
|
import com.xxl.job.core.context.XxlJobHelper;
|
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.Collections;
|
|
|
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @author YongBin Wen
|
|
|
|
* @author YongBin Wen
|
|
|
|
@ -64,8 +76,32 @@ public class MzsyReportCollectJob {
|
|
|
|
ReportHospitalTwoDto hospitalTwoDto = downTwoDto.getHospitals().get(0);
|
|
|
|
ReportHospitalTwoDto hospitalTwoDto = downTwoDto.getHospitals().get(0);
|
|
|
|
ReportPatientTwoDto reportPatientTwoDto = downTwoDto.getPatient();
|
|
|
|
ReportPatientTwoDto reportPatientTwoDto = downTwoDto.getPatient();
|
|
|
|
String jzh = downTwoDto.getJzh();
|
|
|
|
String jzh = downTwoDto.getJzh();
|
|
|
|
|
|
|
|
String patientId = downTwoDto.getPatientId();
|
|
|
|
|
|
|
|
List<TBasic> basicList = tBasicMapper.getTbasicByPatientIds(Collections.singletonList(patientId));
|
|
|
|
|
|
|
|
TBasic tBasic = basicList.get(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<MzsyReportDataView> mzsyReportDataViewList = new ArrayList<>();
|
|
|
|
|
|
|
|
List<MzsyReportDataView> mzsyReportDataViewListByJzh = reportDataViewMapper.findByPatJzhAndOtherCondition(jzh, extraCondition);
|
|
|
|
|
|
|
|
List<MzsyReportDataView> mzsyReportDataViewListByInpatNoTime = reportDataViewMapper.findByPatNoTimeAndOtherCondition(tBasic.getInpatientNo(), Func.formatDateTime(tBasic.getAdmissDate()), Func.formatDateTime(tBasic.getDisDate()), extraCondition);
|
|
|
|
|
|
|
|
Map<String, String> fileIdDistinct = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (MzsyReportDataView mzsyReportDataView : mzsyReportDataViewListByJzh) {
|
|
|
|
|
|
|
|
mzsyReportDataViewList.add(mzsyReportDataView);
|
|
|
|
|
|
|
|
fileIdDistinct.put(mzsyReportDataView.getFfileId(), "0");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (MzsyReportDataView mzsyReportDataView : mzsyReportDataViewListByInpatNoTime) {
|
|
|
|
|
|
|
|
if (fileIdDistinct.containsKey(mzsyReportDataView.getFfileId())) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mzsyReportDataViewList.add(mzsyReportDataView);
|
|
|
|
|
|
|
|
fileIdDistinct.put(mzsyReportDataView.getFfileId(), "0");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mzsyReportDataViewList = mzsyReportDataViewList.stream()
|
|
|
|
|
|
|
|
.sorted(Comparator.comparing(MzsyReportDataView::getFpatModule)
|
|
|
|
|
|
|
|
.thenComparing(MzsyReportDataView::getFfileTime))
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<MzsyReportDataView> mzsyReportDataViewList = reportDataViewMapper.findByPatJzhAndOtherCondition(jzh, extraCondition);
|
|
|
|
|
|
|
|
int size = mzsyReportDataViewList.size();
|
|
|
|
int size = mzsyReportDataViewList.size();
|
|
|
|
log.info("住院号:{},住院次数:{},记账号:{} 采集视图数据:{} 条!数据:{}", reportPatientTwoDto.getInpatientNo(), hospitalTwoDto.getAdmissTimes(), jzh, size, Func.toJson(mzsyReportDataViewList));
|
|
|
|
log.info("住院号:{},住院次数:{},记账号:{} 采集视图数据:{} 条!数据:{}", reportPatientTwoDto.getInpatientNo(), hospitalTwoDto.getAdmissTimes(), jzh, size, Func.toJson(mzsyReportDataViewList));
|
|
|
|
if (size <= 0) {
|
|
|
|
if (size <= 0) {
|
|
|
|
@ -75,14 +111,14 @@ public class MzsyReportCollectJob {
|
|
|
|
JSONObject moduleAlisConfig = tableJsonRead.Read("data-config", "mzsy-module-alis", JSONObject.class);
|
|
|
|
JSONObject moduleAlisConfig = tableJsonRead.Read("data-config", "mzsy-module-alis", JSONObject.class);
|
|
|
|
|
|
|
|
|
|
|
|
ReportDownPatientDto patient = new ReportDownPatientDto();
|
|
|
|
ReportDownPatientDto patient = new ReportDownPatientDto();
|
|
|
|
patient.setPatientid(downTwoDto.getPatientId());
|
|
|
|
patient.setPatientid(patientId);
|
|
|
|
|
|
|
|
|
|
|
|
ReportDownDto reportDownDto = new ReportDownDto();
|
|
|
|
ReportDownDto reportDownDto = new ReportDownDto();
|
|
|
|
reportDownDto.setCollectorid(collectorId);
|
|
|
|
reportDownDto.setCollectorid(collectorId);
|
|
|
|
reportDownDto.setIp("");
|
|
|
|
reportDownDto.setIp("");
|
|
|
|
reportDownDto.setPatient(patient);
|
|
|
|
reportDownDto.setPatient(patient);
|
|
|
|
int sort = 0;
|
|
|
|
int sort = 0;
|
|
|
|
tBasicMapper.invalidFileBySource(downTwoDto.getPatientId(),collectorId);
|
|
|
|
tBasicMapper.invalidFileBySource(patientId, collectorId);
|
|
|
|
for (MzsyReportDataView mzsyReportDataView : mzsyReportDataViewList) {
|
|
|
|
for (MzsyReportDataView mzsyReportDataView : mzsyReportDataViewList) {
|
|
|
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
reportDownScanFileDto.setDownurl(mzsyReportDataView.getFfilePath());
|
|
|
|
reportDownScanFileDto.setDownurl(mzsyReportDataView.getFfilePath());
|
|
|
|
@ -154,7 +190,7 @@ public class MzsyReportCollectJob {
|
|
|
|
reportDownDto.setIp("");
|
|
|
|
reportDownDto.setIp("");
|
|
|
|
reportDownDto.setPatient(patient);
|
|
|
|
reportDownDto.setPatient(patient);
|
|
|
|
int sort = 0;
|
|
|
|
int sort = 0;
|
|
|
|
tBasicMapper.invalidFileBySource(downTwoDto.getPatientId(),collectorId);
|
|
|
|
tBasicMapper.invalidFileBySource(downTwoDto.getPatientId(), collectorId);
|
|
|
|
for (MzsyShoumaReportDataView mzsyShouMaReportDataView : shoumaReportDataViewList) {
|
|
|
|
for (MzsyShoumaReportDataView mzsyShouMaReportDataView : shoumaReportDataViewList) {
|
|
|
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
reportDownScanFileDto.setDownurl(mzsyShouMaReportDataView.getFilePath());
|
|
|
|
reportDownScanFileDto.setDownurl(mzsyShouMaReportDataView.getFilePath());
|
|
|
|
@ -217,7 +253,7 @@ public class MzsyReportCollectJob {
|
|
|
|
reportDownDto.setIp("");
|
|
|
|
reportDownDto.setIp("");
|
|
|
|
reportDownDto.setPatient(patient);
|
|
|
|
reportDownDto.setPatient(patient);
|
|
|
|
int sort = 0;
|
|
|
|
int sort = 0;
|
|
|
|
tBasicMapper.invalidFileBySource(downTwoDto.getPatientId(),collectorId);
|
|
|
|
tBasicMapper.invalidFileBySource(downTwoDto.getPatientId(), collectorId);
|
|
|
|
for (MzsyMectReportView mzsyMectReportView : mzsyMectReportViews) {
|
|
|
|
for (MzsyMectReportView mzsyMectReportView : mzsyMectReportViews) {
|
|
|
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
reportDownScanFileDto.setDownurl(mzsyMectReportView.getPdfReportPath());
|
|
|
|
reportDownScanFileDto.setDownurl(mzsyMectReportView.getPdfReportPath());
|
|
|
|
@ -243,8 +279,28 @@ public class MzsyReportCollectJob {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
TableJsonRead tableJsonRead = new TableJsonRead();
|
|
|
|
MzsyReportDataView mzsyReportDataView1 = new MzsyReportDataView();
|
|
|
|
JSONObject moduleAlisConfig = tableJsonRead.Read("data-config", "mzsy-module-alis", JSONObject.class);
|
|
|
|
mzsyReportDataView1.setFfileTime(Func.parseDate("2025-11-13 01:01:02","yyyy-MM-dd HH:mm:ss"));
|
|
|
|
System.out.println(moduleAlisConfig);
|
|
|
|
mzsyReportDataView1.setFpatModule("ct");
|
|
|
|
|
|
|
|
MzsyReportDataView mzsyReportDataView2 = new MzsyReportDataView();
|
|
|
|
|
|
|
|
mzsyReportDataView2.setFfileTime(Func.parseDate("2025-11-13 05:01:02","yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
|
|
|
mzsyReportDataView2.setFpatModule("ecg");
|
|
|
|
|
|
|
|
MzsyReportDataView mzsyReportDataView3 = new MzsyReportDataView();
|
|
|
|
|
|
|
|
mzsyReportDataView3.setFfileTime(Func.parseDate("2025-11-13 04:01:02","yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
|
|
|
mzsyReportDataView3.setFpatModule("ecg");
|
|
|
|
|
|
|
|
MzsyReportDataView mzsyReportDataView4 = new MzsyReportDataView();
|
|
|
|
|
|
|
|
mzsyReportDataView4.setFfileTime(Func.parseDate("2025-11-12 04:01:02","yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
|
|
|
mzsyReportDataView4.setFpatModule("ct");
|
|
|
|
|
|
|
|
List<MzsyReportDataView> mzsyReportDataViewList = new ArrayList<>();
|
|
|
|
|
|
|
|
mzsyReportDataViewList.add(mzsyReportDataView1);
|
|
|
|
|
|
|
|
mzsyReportDataViewList.add(mzsyReportDataView2);
|
|
|
|
|
|
|
|
mzsyReportDataViewList.add(mzsyReportDataView3);
|
|
|
|
|
|
|
|
mzsyReportDataViewList.add(mzsyReportDataView4);
|
|
|
|
|
|
|
|
System.out.println("排序前:"+Func.toJson(mzsyReportDataViewList));
|
|
|
|
|
|
|
|
mzsyReportDataViewList = mzsyReportDataViewList.stream()
|
|
|
|
|
|
|
|
.sorted(Comparator.comparing(MzsyReportDataView::getFpatModule)
|
|
|
|
|
|
|
|
.thenComparing(MzsyReportDataView::getFfileTime))
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
System.out.println("排序后:"+Func.toJson(mzsyReportDataViewList));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|