|
|
|
@ -35,6 +35,7 @@ import java.time.LocalDate;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.ZoneId;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -356,7 +357,10 @@ public class ReportJob {
|
|
|
|
|
List<ReportDto> reportDtos = new ArrayList<>();
|
|
|
|
|
int pageNum = 1;
|
|
|
|
|
final int pageSize = 5;
|
|
|
|
|
boolean loopCondition = true;
|
|
|
|
|
// 报告接口返回的总数
|
|
|
|
|
AtomicInteger reportTotalCount = new AtomicInteger(0);
|
|
|
|
|
// 已经查询的条数
|
|
|
|
|
int alreadyQrCount = 0;
|
|
|
|
|
do {
|
|
|
|
|
Date admissDate = tBasic.getAdmissDate();
|
|
|
|
|
Date disDate = tBasic.getDisDate();
|
|
|
|
@ -383,17 +387,15 @@ public class ReportJob {
|
|
|
|
|
sdJxReportDto.setPatentTypeCode("1");
|
|
|
|
|
sdJxReportDto.setOrgCode("4560886379");
|
|
|
|
|
String respBody = shunDePeopleService.getInspectReportByJxId(sdJxReportDto);
|
|
|
|
|
|
|
|
|
|
List<ReportDto> reportDtoList = parseQuerySdRyInspectReport(respBody, tBasic);
|
|
|
|
|
if (reportDtoList.isEmpty()) {
|
|
|
|
|
alreadyQrCount += pageSize;
|
|
|
|
|
List<ReportDto> reportDtoList = parseQuerySdRyInspectReport(respBody, tBasic, reportTotalCount);
|
|
|
|
|
reportDtos.addAll(reportDtoList);
|
|
|
|
|
// 解析之后,总数已经赋值了,判断已经查询的数量是否已经满足总数
|
|
|
|
|
if (reportTotalCount.get() == 0 || alreadyQrCount >= reportTotalCount.get()) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (reportDtoList.size() < pageSize) {
|
|
|
|
|
loopCondition = false;
|
|
|
|
|
}
|
|
|
|
|
reportDtos.addAll(reportDtoList);
|
|
|
|
|
pageNum++;
|
|
|
|
|
} while (loopCondition);
|
|
|
|
|
} while (true);
|
|
|
|
|
return reportDtos;
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error("查询门诊检查报告出错啦!", ex);
|
|
|
|
@ -406,7 +408,10 @@ public class ReportJob {
|
|
|
|
|
List<ReportDto> reportDtos = new ArrayList<>();
|
|
|
|
|
int pageNum = 1;
|
|
|
|
|
final int pageSize = 5;
|
|
|
|
|
boolean loopCondition = true;
|
|
|
|
|
// 报告接口返回的总数
|
|
|
|
|
AtomicInteger reportTotalCount = new AtomicInteger(0);
|
|
|
|
|
// 已经查询的条数
|
|
|
|
|
int alreadyQrCount = 0;
|
|
|
|
|
do {
|
|
|
|
|
Date admissDate = tBasic.getAdmissDate();
|
|
|
|
|
Date disDate = tBasic.getDisDate();
|
|
|
|
@ -433,16 +438,15 @@ public class ReportJob {
|
|
|
|
|
sdJxReportDto.setPatentTypeCode("3");
|
|
|
|
|
sdJxReportDto.setOrgCode("4560886379");
|
|
|
|
|
String respBody = shunDePeopleService.getInspectReportByJxId(sdJxReportDto);
|
|
|
|
|
List<ReportDto> reportDtoList = parseQuerySdRyInspectReport(respBody, tBasic);
|
|
|
|
|
if (reportDtoList.isEmpty()) {
|
|
|
|
|
alreadyQrCount += pageSize;
|
|
|
|
|
List<ReportDto> reportDtoList = parseQuerySdRyInspectReport(respBody, tBasic, reportTotalCount);
|
|
|
|
|
reportDtos.addAll(reportDtoList);
|
|
|
|
|
// 解析之后,总数已经赋值了,判断已经查询的数量是否已经满足总数
|
|
|
|
|
if (reportTotalCount.get() == 0 || alreadyQrCount >= reportTotalCount.get()) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (reportDtoList.size() < pageSize) {
|
|
|
|
|
loopCondition = false;
|
|
|
|
|
}
|
|
|
|
|
reportDtos.addAll(reportDtoList);
|
|
|
|
|
pageNum++;
|
|
|
|
|
} while (loopCondition);
|
|
|
|
|
} while (true);
|
|
|
|
|
return reportDtos;
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error("查询住院检查报告出错啦!", ex);
|
|
|
|
@ -454,13 +458,22 @@ public class ReportJob {
|
|
|
|
|
System.out.println(createBase64SaveDir());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<ReportDto> parseQuerySdRyInspectReport(String respBody, TBasic tBasic) {
|
|
|
|
|
private List<ReportDto> parseQuerySdRyInspectReport(String respBody, TBasic tBasic, AtomicInteger reportTotalCount) {
|
|
|
|
|
JSONObject jsonObject = Func.readJson(respBody, JSONObject.class);
|
|
|
|
|
Object resultCode = jsonObject.get("ResultCode");
|
|
|
|
|
String successCode = "0";
|
|
|
|
|
if (!successCode.equals(String.valueOf(resultCode))) {
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
Object countObj = jsonObject.get("count");
|
|
|
|
|
if (countObj != null) {
|
|
|
|
|
int count = Integer.parseInt(countObj.toString());
|
|
|
|
|
reportTotalCount.set(count);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error("解析count出错了!", ex);
|
|
|
|
|
}
|
|
|
|
|
TableJsonRead jsonRead = new TableJsonRead();
|
|
|
|
|
SdPacsServerConfig config = jsonRead.Read("data-config", "sdry-pacs-server.json", SdPacsServerConfig.class);
|
|
|
|
|
try {
|
|
|
|
@ -614,7 +627,11 @@ public class ReportJob {
|
|
|
|
|
List<ReportDto> reportDtos = new ArrayList<>();
|
|
|
|
|
int pageNum = 1;
|
|
|
|
|
final int pageSize = 5;
|
|
|
|
|
boolean loopCondition = true;
|
|
|
|
|
|
|
|
|
|
// 报告接口返回的总数
|
|
|
|
|
AtomicInteger reportTotalCount = new AtomicInteger(0);
|
|
|
|
|
// 已经查询的条数
|
|
|
|
|
int alreadyQrCount = 0;
|
|
|
|
|
do {
|
|
|
|
|
Date admissDate = tBasic.getAdmissDate();
|
|
|
|
|
Date disDate = tBasic.getDisDate();
|
|
|
|
@ -640,18 +657,17 @@ public class ReportJob {
|
|
|
|
|
sdJxReportDto.setEndTime(endTime);
|
|
|
|
|
sdJxReportDto.setPatentTypeCode("3");
|
|
|
|
|
sdJxReportDto.setOrgCode("4560886379");
|
|
|
|
|
|
|
|
|
|
String respBody = shunDePeopleService.getLisReportByJxId(sdJxReportDto);
|
|
|
|
|
List<ReportDto> reportDtoList = parseQuerySdRyLisReport(respBody, tBasic);
|
|
|
|
|
if (reportDtoList.isEmpty()) {
|
|
|
|
|
alreadyQrCount += pageSize;
|
|
|
|
|
List<ReportDto> reportDtoList = parseQuerySdRyLisReport(respBody, tBasic, reportTotalCount);
|
|
|
|
|
reportDtos.addAll(reportDtoList);
|
|
|
|
|
// 解析之后,总数已经赋值了,判断已经查询的数量是否已经满足总数
|
|
|
|
|
if (reportTotalCount.get() == 0 || alreadyQrCount >= reportTotalCount.get()) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (reportDtoList.size() < pageSize) {
|
|
|
|
|
loopCondition = false;
|
|
|
|
|
}
|
|
|
|
|
reportDtos.addAll(reportDtoList);
|
|
|
|
|
|
|
|
|
|
pageNum++;
|
|
|
|
|
} while (loopCondition);
|
|
|
|
|
} while (true);
|
|
|
|
|
return reportDtos;
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error("查询Lis报告出错啦!", ex);
|
|
|
|
@ -667,7 +683,10 @@ public class ReportJob {
|
|
|
|
|
List<ReportDto> reportDtos = new ArrayList<>();
|
|
|
|
|
int pageNum = 1;
|
|
|
|
|
final int pageSize = 5;
|
|
|
|
|
boolean loopCondition = true;
|
|
|
|
|
// 报告接口返回的总数
|
|
|
|
|
AtomicInteger reportTotalCount = new AtomicInteger(0);
|
|
|
|
|
// 已经查询的条数
|
|
|
|
|
int alreadyQrCount = 0;
|
|
|
|
|
do {
|
|
|
|
|
Date admissDate = tBasic.getAdmissDate();
|
|
|
|
|
Date disDate = tBasic.getDisDate();
|
|
|
|
@ -695,16 +714,15 @@ public class ReportJob {
|
|
|
|
|
sdJxReportDto.setOrgCode("4560886379");
|
|
|
|
|
|
|
|
|
|
String respBody = shunDePeopleService.getLisReportByJxId(sdJxReportDto);
|
|
|
|
|
List<ReportDto> reportDtoList = parseQuerySdRyLisReport(respBody, tBasic);
|
|
|
|
|
if (reportDtoList.isEmpty()) {
|
|
|
|
|
alreadyQrCount = +pageSize;
|
|
|
|
|
List<ReportDto> reportDtoList = parseQuerySdRyLisReport(respBody, tBasic, reportTotalCount);
|
|
|
|
|
reportDtos.addAll(reportDtoList);
|
|
|
|
|
// 解析之后,总数已经赋值了,判断已经查询的数量是否已经满足总数
|
|
|
|
|
if (reportTotalCount.get() == 0 || alreadyQrCount >= reportTotalCount.get()) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (reportDtoList.size() < pageSize) {
|
|
|
|
|
loopCondition = false;
|
|
|
|
|
}
|
|
|
|
|
reportDtos.addAll(reportDtoList);
|
|
|
|
|
pageNum++;
|
|
|
|
|
} while (loopCondition);
|
|
|
|
|
} while (true);
|
|
|
|
|
return reportDtos;
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error("查询Lis报告出错啦!", ex);
|
|
|
|
@ -712,13 +730,22 @@ public class ReportJob {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<ReportDto> parseQuerySdRyLisReport(String respBody, TBasic tBasic) {
|
|
|
|
|
private List<ReportDto> parseQuerySdRyLisReport(String respBody, TBasic tBasic, AtomicInteger reportTotalCount) {
|
|
|
|
|
JSONObject jsonObject = Func.readJson(respBody, JSONObject.class);
|
|
|
|
|
Object resultCode = jsonObject.get("ResultCode");
|
|
|
|
|
String successCode = "0";
|
|
|
|
|
if (!successCode.equals(String.valueOf(resultCode))) {
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
Object countObj = jsonObject.get("count");
|
|
|
|
|
if (countObj != null) {
|
|
|
|
|
int count = Integer.parseInt(countObj.toString());
|
|
|
|
|
reportTotalCount.set(count);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error("解析count出错了!", ex);
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
Object data = jsonObject.get("data");
|
|
|
|
|
String dataJsonStr = Func.toJson(data);
|
|
|
|
|