|
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.hutool.core.util.XmlUtil;
|
|
|
|
|
import cn.hutool.http.webservice.SoapClient;
|
|
|
|
|
import com.docus.demo.dto.SyncBasicDataDto;
|
|
|
|
|
import com.docus.demo.dto.SyncLabReportDto;
|
|
|
|
|
import com.docus.demo.entity.CommonResult;
|
|
|
|
|
import com.docus.demo.entity.PatientListResult;
|
|
|
|
|
import com.docus.demo.entity.PatientReportResult;
|
|
|
|
@ -23,6 +24,7 @@ import java.io.File;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
@ -46,14 +48,13 @@ public class WebServiceImpl implements IWebService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public CommonResult<?> syncInspection(SyncBasicDataDto syncBasicDataDto) {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
//页码
|
|
|
|
|
int current;
|
|
|
|
|
//每页1000条数据
|
|
|
|
|
int limit = syncBasicDataDto.getLimit();
|
|
|
|
|
|
|
|
|
|
String StartDate = "2018-01-01 00:00:00";
|
|
|
|
|
String EndDate = "2025-01-01 00:00:00";
|
|
|
|
|
for (current = 1; ; current++) {
|
|
|
|
|
//查询基础数据
|
|
|
|
|
List<Tbasic> tbasicList = basicMapper.getOldBasicListLimit((current - 1) * limit, limit, syncBasicDataDto.getInpatientNoList(), syncBasicDataDto);
|
|
|
|
@ -61,35 +62,66 @@ public class WebServiceImpl implements IWebService {
|
|
|
|
|
if (tbasicList.size() == 0) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
for (int j = 0; j < tbasicList.size(); j++) {
|
|
|
|
|
Tbasic tbasic = tbasicList.get(j);
|
|
|
|
|
syncInspection(tbasic, StartDate, EndDate);
|
|
|
|
|
}
|
|
|
|
|
log.info("业务结束");
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return CommonResult.success("同步检验数据成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < tbasicList.size(); j++) {
|
|
|
|
|
@Override
|
|
|
|
|
public void syncLabReport(SyncLabReportDto syncLabReportDto) {
|
|
|
|
|
//页码
|
|
|
|
|
int offset = 0;
|
|
|
|
|
//每页1000条数据
|
|
|
|
|
int limit = 1000;
|
|
|
|
|
String startDate = syncLabReportDto.getStartDate();
|
|
|
|
|
String endDate = syncLabReportDto.getEndDate();
|
|
|
|
|
|
|
|
|
|
List<SyncLabReportDto.SyncLabReportBasicDto> basicDtoList = syncLabReportDto.getBasicDtoList();
|
|
|
|
|
for (SyncLabReportDto.SyncLabReportBasicDto syncLabReportBasicDto : basicDtoList) {
|
|
|
|
|
String disDate = syncLabReportBasicDto.getDisDate();
|
|
|
|
|
String inpatientNo = syncLabReportBasicDto.getInpatientNo();
|
|
|
|
|
SyncBasicDataDto syncBasicDataDto = new SyncBasicDataDto();
|
|
|
|
|
syncBasicDataDto.setStartDate(disDate + " 00:00:00");
|
|
|
|
|
syncBasicDataDto.setEndDate(disDate + " 23:59:59");
|
|
|
|
|
List<Tbasic> tbasicList = basicMapper.getOldBasicListLimit(offset, limit, Collections.singletonList(inpatientNo), syncBasicDataDto);
|
|
|
|
|
for (Tbasic tbasic : tbasicList) {
|
|
|
|
|
syncInspection(tbasic, startDate, endDate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Tbasic tbasic = tbasicList.get(j);
|
|
|
|
|
log.info("正在同步" + tbasic.getInpatientNo() + " " + tbasic.getAdmissTimes());
|
|
|
|
|
|
|
|
|
|
public void syncInspection(Tbasic tbasic, String startDate, String endDate) {
|
|
|
|
|
log.info("正在同步" + tbasic.getInpatientNo() + " " + tbasic.getAdmissTimes());
|
|
|
|
|
List<ScanAssort> oldScanAssortList = scanAssortMapper.getListByAssortId("A5A7AA6796D1715A2F1E35699C706C84", tbasic.getPatientId());
|
|
|
|
|
log.info("旧数据" + oldScanAssortList.size());
|
|
|
|
|
if (oldScanAssortList.size() > 0) {
|
|
|
|
|
log.info("跳过同步" + tbasic.getInpatientNo() + " " + tbasic.getAdmissTimes());
|
|
|
|
|
continue;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String pNo = tbasic.getInpatientNo();
|
|
|
|
|
String times = tbasic.getAdmissTimes().toString();
|
|
|
|
|
// String StartDate = sdf.format(tbasic.getAdmissDate());
|
|
|
|
|
// String EndDate = sdf.format(tbasic.getDisDate());
|
|
|
|
|
String StartDate = "2018-01-01 00:00:00";
|
|
|
|
|
String EndDate = "2025-01-01 00:00:00";
|
|
|
|
|
|
|
|
|
|
String patientId = tbasic.getPatientId();
|
|
|
|
|
|
|
|
|
|
//获取所有的报告列表
|
|
|
|
|
PatientListResult patientListResult = getCommonResult(pNo, times, StartDate, EndDate);
|
|
|
|
|
PatientListResult patientListResult = getCommonResult(pNo, times, startDate, endDate);
|
|
|
|
|
|
|
|
|
|
// log.info("返回结果"+patientListResult);
|
|
|
|
|
if (patientListResult == null) {
|
|
|
|
|
log.error(pNo + " " + times + "调用失败");
|
|
|
|
|
continue;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<ScanAssort> scanAssortList = new ArrayList<>();
|
|
|
|
@ -143,17 +175,6 @@ public class WebServiceImpl implements IWebService {
|
|
|
|
|
log.info("写入结束" + scanAssortList.size());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
log.info("业务结束");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return CommonResult.success("同步检验数据成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private PatientReportResult getReportResult(String repID) {
|
|
|
|
|
String paramMap =
|
|
|
|
|