前置联调
This commit is contained in:
@@ -67,35 +67,46 @@ public class DataRecallController extends BaseController {
|
||||
RecallMessage message = new RecallMessage();
|
||||
|
||||
if(CollectionUtils.isEmpty(param.getData())){
|
||||
LocalDate localDate = Objects.isNull(param.getReCallTime())?LocalDate.now().plusDays(-1):param.getReCallTime();
|
||||
List<String> runMonitorIds = commTerminalGeneralClient.getRunMonitorIds().getData();
|
||||
List<RecallMessage.RecallDTO> recallDTOList = new ArrayList<>();
|
||||
runMonitorIds.forEach(temp->{
|
||||
LineDevGetDTO data = commTerminalGeneralClient.getMonitorDetail(temp).getData();
|
||||
Integer timeInterval = data.getTimeInterval();
|
||||
List<LocalDateTime> localDateTimeList = generateTimeIntervals(localDate, timeInterval);
|
||||
List<LocalDateTime> data1 = dataVQuery.monitoringTime(temp, LocalDateTimeUtil.format(localDate, DatePattern.NORM_DATE_PATTERN));
|
||||
localDateTimeList.removeAll(data1);
|
||||
if(!CollectionUtils.isEmpty(localDateTimeList)){
|
||||
List<String> timePeriod = mergeTimeIntervals(localDateTimeList, timeInterval);
|
||||
RecallMessage.RecallDTO recallDTO = new RecallMessage.RecallDTO();
|
||||
recallDTO.setDataType("0");
|
||||
recallDTO.setMonitorId(Stream.of(temp).collect(Collectors.toList()));
|
||||
recallDTO.setTimeInterval(timePeriod);
|
||||
|
||||
recallDTOList.add(recallDTO);
|
||||
}
|
||||
});
|
||||
List<String> runMonitorIds = new ArrayList<>();
|
||||
List<RecallMessage.RecallDTO> recallDTOList = new ArrayList<>();
|
||||
if(CollectionUtils.isEmpty(param.getMonitorId())){
|
||||
runMonitorIds = commTerminalGeneralClient.getRunMonitorIds().getData();
|
||||
}else {
|
||||
runMonitorIds = param.getMonitorId();
|
||||
}
|
||||
LocalDate currentDate = param.getReCallStartTime();
|
||||
//循环每一天
|
||||
while (!currentDate.isAfter(param.getReCallEndTime())) {
|
||||
LocalDate finalCurrentDate = currentDate;
|
||||
runMonitorIds.forEach(temp->{
|
||||
LineDevGetDTO data = commTerminalGeneralClient.getMonitorDetail(temp).getData();
|
||||
Integer timeInterval = data.getTimeInterval();
|
||||
List<LocalDateTime> localDateTimeList = generateTimeIntervals(finalCurrentDate, timeInterval);
|
||||
List<LocalDateTime> data1 = dataVQuery.monitoringTime(temp, LocalDateTimeUtil.format(finalCurrentDate, DatePattern.NORM_DATE_PATTERN));
|
||||
localDateTimeList.removeAll(data1);
|
||||
if(!CollectionUtils.isEmpty(localDateTimeList)){
|
||||
List<String> timePeriod = mergeTimeIntervals(localDateTimeList, timeInterval);
|
||||
RecallMessage.RecallDTO recallDTO = new RecallMessage.RecallDTO();
|
||||
recallDTO.setDataType("0");
|
||||
recallDTO.setMonitorId(Stream.of(temp).collect(Collectors.toList()));
|
||||
recallDTO.setTimeInterval(timePeriod);
|
||||
|
||||
recallDTOList.add(recallDTO);
|
||||
}
|
||||
});
|
||||
currentDate = currentDate.plusDays(1);
|
||||
}
|
||||
|
||||
|
||||
if(!CollectionUtils.isEmpty(recallDTOList)){
|
||||
|
||||
message.setData(recallDTOList);
|
||||
// baseMessage.setMessageBody(JSONObject.toJSONString(message));
|
||||
|
||||
produceFeignClient.recall(message);
|
||||
}
|
||||
}else {
|
||||
message.setData(param.getData());
|
||||
// baseMessage.setMessageBody(JSONObject.toJSONString(message));
|
||||
produceFeignClient.recall(message);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user