fix: 分批查询

collector-LIS
wyb 4 months ago
parent 0f710b61d2
commit 4a84c6e685

@ -21,6 +21,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.TimeUnit;
/** /**
* *
@ -44,6 +45,9 @@ public class LisSystemCollector {
@Autowired @Autowired
private FileReportService fileReportService; private FileReportService fileReportService;
@Value("${docus.report.lis.incrDays:}")
private String incrDays;
/** /**
* *
* *
@ -62,11 +66,44 @@ public class LisSystemCollector {
LocalDateTime endLocalDateTime = Func.parseDateTime(disDate).plusDays(15L); LocalDateTime endLocalDateTime = Func.parseDateTime(disDate).plusDays(15L);
String endDateTime = Func.formatDateTime(endLocalDateTime); String endDateTime = Func.formatDateTime(endLocalDateTime);
// 普通的检验报告和 微生物检验报告 // 普通的检验报告和 微生物检验报告
String collectDataNormal = collectData(new Jzh(jzh), beginDateTime, endDateTime, 0);
String collectDataMtf = collectData(new Jzh(jzh), beginDateTime, endDateTime, 1); List<ReportFileInfoDTO> reportFileInfoDTOList = new ArrayList<>();
List<ReportFileInfoDTO> reportFileInfoDTOList = LisSystemCollectConverter.convert(collectDataNormal); if (Func.isNotBlank(incrDays)) {
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf); LocalDateTime qrBeginLocalDateTime = Func.parseDateTime(beginDateTime);
reportFileInfoDTOList.addAll(reportFileInfoDtoList2); int limitDays = Integer.parseInt(incrDays);
while (true) {
LocalDateTime qrEndLocalDateTime = qrBeginLocalDateTime.plusDays(limitDays);
if (qrBeginLocalDateTime.isAfter(endLocalDateTime)) {
break;
}
boolean endFlag = false;
if (qrEndLocalDateTime.isAfter(endLocalDateTime)) {
qrEndLocalDateTime = endLocalDateTime;
endFlag = true;
}
String qrBeginDateTime = Func.formatDateTime(qrBeginLocalDateTime);
String qrEndDateTime = Func.formatDateTime(qrEndLocalDateTime);
String collectDataNormal = collectData(new Jzh(jzh), qrBeginDateTime, qrEndDateTime, 0);
String collectDataMtf = collectData(new Jzh(jzh), qrBeginDateTime, qrEndDateTime, 1);
List<ReportFileInfoDTO> reportFileInfoDtoList1 = LisSystemCollectConverter.convert(collectDataNormal);
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf);
reportFileInfoDTOList.addAll(reportFileInfoDtoList1);
reportFileInfoDTOList.addAll(reportFileInfoDtoList2);
if (endFlag) {
break;
}
qrBeginLocalDateTime = qrEndLocalDateTime;
}
} else {
String collectDataNormal = collectData(new Jzh(jzh), beginDateTime, endDateTime, 0);
String collectDataMtf = collectData(new Jzh(jzh), beginDateTime, endDateTime, 1);
List<ReportFileInfoDTO> reportFileInfoDtoList1 = LisSystemCollectConverter.convert(collectDataNormal);
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf);
reportFileInfoDTOList.addAll(reportFileInfoDtoList1);
reportFileInfoDTOList.addAll(reportFileInfoDtoList2);
}
for (ReportFileInfoDTO reportFileInfoDTO : reportFileInfoDTOList) { for (ReportFileInfoDTO reportFileInfoDTO : reportFileInfoDTOList) {
if (!isBelongToPatient(reportFileInfoDTO, basic)) { if (!isBelongToPatient(reportFileInfoDTO, basic)) {
continue; continue;
@ -101,12 +138,44 @@ public class LisSystemCollector {
LocalDateTime endLocalDateTime = Func.parseDateTime(disDateStr).plusDays(15L); LocalDateTime endLocalDateTime = Func.parseDateTime(disDateStr).plusDays(15L);
endDateTime = Func.formatDateTime(endLocalDateTime); endDateTime = Func.formatDateTime(endLocalDateTime);
} }
LocalDateTime endLocalDateTime = Func.parseDateTime(endDateTime);
// 普通的检验报告和 微生物检验报告 // 普通的检验报告和 微生物检验报告
String collectDataNormal = collectData(new Jzh(jzh), beginDateTime, endDateTime, 0); List<ReportFileInfoDTO> reportFileInfoDTOList = new ArrayList<>();
String collectDataMtf = collectData(new Jzh(jzh), beginDateTime, endDateTime, 1); if (Func.isNotBlank(incrDays)) {
List<ReportFileInfoDTO> reportFileInfoDTOList = LisSystemCollectConverter.convert(collectDataNormal); LocalDateTime qrBeginLocalDateTime = Func.parseDateTime(beginDateTime);
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf); int limitDays = Integer.parseInt(incrDays);
reportFileInfoDTOList.addAll(reportFileInfoDtoList2); while (true) {
LocalDateTime qrEndLocalDateTime = qrBeginLocalDateTime.plusDays(limitDays);
if (qrBeginLocalDateTime.isAfter(endLocalDateTime)) {
break;
}
boolean endFlag = false;
if (qrEndLocalDateTime.isAfter(endLocalDateTime)) {
qrEndLocalDateTime = endLocalDateTime;
endFlag = true;
}
String qrBeginDateTime = Func.formatDateTime(qrBeginLocalDateTime);
String qrEndDateTime = Func.formatDateTime(qrEndLocalDateTime);
String collectDataNormal = collectData(new Jzh(jzh), qrBeginDateTime, qrEndDateTime, 0);
String collectDataMtf = collectData(new Jzh(jzh), qrBeginDateTime, qrEndDateTime, 1);
List<ReportFileInfoDTO> reportFileInfoDtoList1 = LisSystemCollectConverter.convert(collectDataNormal);
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf);
reportFileInfoDTOList.addAll(reportFileInfoDtoList1);
reportFileInfoDTOList.addAll(reportFileInfoDtoList2);
if (endFlag) {
break;
}
qrBeginLocalDateTime = qrEndLocalDateTime;
}
} else {
String collectDataNormal = collectData(new Jzh(jzh), beginDateTime, endDateTime, 0);
String collectDataMtf = collectData(new Jzh(jzh), beginDateTime, endDateTime, 1);
List<ReportFileInfoDTO> reportFileInfoDtoList1 = LisSystemCollectConverter.convert(collectDataNormal);
List<ReportFileInfoDTO> reportFileInfoDtoList2 = LisSystemCollectConverter.convert(collectDataMtf);
reportFileInfoDTOList.addAll(reportFileInfoDtoList1);
reportFileInfoDTOList.addAll(reportFileInfoDtoList2);
}
for (ReportFileInfoDTO reportFileInfoDTO : reportFileInfoDTOList) { for (ReportFileInfoDTO reportFileInfoDTO : reportFileInfoDTOList) {
reportFileInfoDTO.setPatientId(tSeal.getPatientId()); reportFileInfoDTO.setPatientId(tSeal.getPatientId());
reportFileInfoDTO.setAssortId(assortId); reportFileInfoDTO.setAssortId(assortId);
@ -282,54 +351,36 @@ public class LisSystemCollector {
} }
public static void main(String[] args) { public static void main(String[] args) {
String param1 = "<ESBEntry>" +
" <AccessControl>" +
" <SysFlag>1</SysFlag>" + String beginDateTime = "2025-02-06 19:48:52";
" <UserName>WZHBAGL</UserName>" + LocalDateTime endLocalDateTime = Func.parseDateTime("2025-04-04 12:00:00").plusDays(15L);
" <Password>WZHBAGL_1127</Password>" + String endDateTime = Func.formatDateTime(endLocalDateTime);
" <Fid>BS03102</Fid>" + // 普通的检验报告和 微生物检验报告
" <OrderNo>BS03102S51001</OrderNo>" + LocalDateTime qrBeginLocalDateTime = Func.parseDateTime(beginDateTime);
" <SUBOR_HOSPITAL_DISTRICT>GZ</SUBOR_HOSPITAL_DISTRICT>" + int limitDays = 10;
" </AccessControl>" + List<ReportFileInfoDTO> reportFileInfoDTOList = new ArrayList<>();
" <MessageHeader>" + while (true) {
" <Fid>BS03102</Fid>" + LocalDateTime qrEndLocalDateTime = qrBeginLocalDateTime.plusDays(limitDays);
" <OrderNo>BS03102S51001</OrderNo>" + if (qrBeginLocalDateTime.isAfter(endLocalDateTime)) {
" <SourceSysCode>S51</SourceSysCode>" + break;
" <TargetSysCode>S00</TargetSysCode>" + }
" <MsgDate>" + "2025-03-14 00:50:29" + "</MsgDate>" + boolean endFlag = false;
" </MessageHeader>" + if (qrEndLocalDateTime.isAfter(endLocalDateTime)) {
" <RequestOption>" + qrEndLocalDateTime = endLocalDateTime;
" <triggerData>0</triggerData>" + endFlag = true;
" <dataAmount>500</dataAmount>" + }
" </RequestOption>" + System.out.println(Func.formatDateTime(qrBeginLocalDateTime) + ">>>>>>>" + Func.formatDateTime(qrEndLocalDateTime));
" <MsgInfo flag=\"1\">" + if (endFlag) {
" <Msg/>" + break;
" <distinct value=\"0\"/>" + }
" <query item=\"WS_INPUT\" compy=\" = \" value=\" 1 \" splice=\"AND\"/>" + qrBeginLocalDateTime = qrEndLocalDateTime;
" <query_ws action=\"Q_WS_JYBGLBCX\">" + try {
" <content>" + TimeUnit.MILLISECONDS.sleep(500);
" <Request>" + } catch (InterruptedException e) {
" <Msg>" + e.printStackTrace();
" <VUID/>" + }
" <OUTHOSP_INDEX_NO/>" + }
" <OUTHOSP_NO/>" +
" <INHOSP_INDEX_NO/>" +
" <INHOSP_NO>" + "17762804477" + "</INHOSP_NO>" +
" <EMPI_ID/>" +
" <TEST_PAT_SOURCE_CODE/>" +
" <MICROBE_TEST_FLAG>" + 0 + "</MICROBE_TEST_FLAG>" +
" <BEGIN_DATETIME>" + "2025-01-21 12:10:54" + "</BEGIN_DATETIME>" +
" <END_DATETIME>" + "2025-03-14 10:00:00" + "</END_DATETIME>" +
" </Msg>" +
" </Request>" +
" </content>" +
" </query_ws>" +
" </MsgInfo>" +
" <GroupInfo flag=\"0\">" +
" <AS ID=\"\" linkField=\"\"/>" +
" </GroupInfo>" +
"</ESBEntry>";
System.out.println(param1);
} }
public static class LisSystemCollectConverter { public static class LisSystemCollectConverter {

@ -56,6 +56,7 @@ docus:
url: http://192.168.198.101:7827/Ewell_WS_S51?wsdl url: http://192.168.198.101:7827/Ewell_WS_S51?wsdl
method: OperationA method: OperationA
namespaceUri: namespaceUri:
incrDays: 10
mybatis-plus: mybatis-plus:

Loading…
Cancel
Save