Commit b53c0e34 authored by caotao's avatar caotao

17826:【小程序端-电站监控】报警信息>电站报警列表,未处理报警列表没有一条数据

parent a9365470
...@@ -69,7 +69,7 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -69,7 +69,7 @@ public class TdHygfJpInverterWarnServiceImpl
// } // }
List<TdHygfJpInverterWarnDto> list = new ArrayList<>(); List<TdHygfJpInverterWarnDto> list = new ArrayList<>();
if (tdHygfJpInverterWarnDto.getStationIds().isEmpty()) { if (tdHygfJpInverterWarnDto.getStationIds().isEmpty()) {
list = this.baseMapper.list(tdHygfJpInverterWarnDto);
} else { } else {
list = this.baseMapper.list(tdHygfJpInverterWarnDto); list = this.baseMapper.list(tdHygfJpInverterWarnDto);
...@@ -90,16 +90,23 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -90,16 +90,23 @@ public class TdHygfJpInverterWarnServiceImpl
} }
} }
List<Long> waringIds = list.stream().map(tdHygfJpInverterWarnDto1 -> tdHygfJpInverterWarnDto1.getCreatedTime()).collect(Collectors.toList()); List<Long> waringIds = list.stream().map(tdHygfJpInverterWarnDto1 -> tdHygfJpInverterWarnDto1.getCreatedTime()).collect(Collectors.toList());
if(waringIds.size()==0){ if (waringIds.size() == 0) {
waringIds =Arrays.asList(0L); waringIds = Arrays.asList(0L);
} }
List<HYGFMaintenanceTickets> hygfMaintenanceTicketsList = hygfMaintenanceTicketsMapper.selectList(new QueryWrapper<HYGFMaintenanceTickets>().in("warning_id",waringIds)); List<HYGFMaintenanceTickets> hygfMaintenanceTicketsList = hygfMaintenanceTicketsMapper.selectList(new QueryWrapper<HYGFMaintenanceTickets>().in("warning_id", waringIds));
Set<String> status = hygfMaintenanceTicketsList.stream().filter(hygfmaintenanceTickets -> tdHygfJpInverterWarnDto.getCreatedTime().equals(hygfmaintenanceTickets.getWarningId())).map(HYGFMaintenanceTickets::getHandlerStatus).collect(Collectors.toSet()); if (hygfMaintenanceTicketsList.size() > 0) {
if(status.contains("未处理")){ list.forEach(i -> {
tdHygfJpInverterWarnDto.setTicketStatus("处理中"); List<HYGFMaintenanceTickets> ticketsList = hygfMaintenanceTicketsList.stream().filter(hygfmaintenanceTickets -> i.getCreatedTime().equals(hygfmaintenanceTickets.getWarningId())).collect(Collectors.toList());
if (ObjectUtil.isNotEmpty(ticketsList)) {
Set<String> status = ticketsList.stream().map(HYGFMaintenanceTickets::getHandlerStatus).collect(Collectors.toSet());
if (status.contains("未处理")) {
i.setTicketStatus("处理中");
} }
if(status.contains("已处理")&&status.size()==1){ if (status.contains("已处理") && status.size() == 1) {
tdHygfJpInverterWarnDto.setTicketStatus("已处理"); i.setTicketStatus("已处理");
}
}
});
} }
PageInfo<TdHygfJpInverterWarnDto> page = new PageInfo(list); PageInfo<TdHygfJpInverterWarnDto> page = new PageInfo(list);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto>(); com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto>();
...@@ -125,8 +132,8 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -125,8 +132,8 @@ public class TdHygfJpInverterWarnServiceImpl
.eq(JpStation::getThirdStationId, tdHygfJpInverterWarnDto.getThirdStationId())); .eq(JpStation::getThirdStationId, tdHygfJpInverterWarnDto.getThirdStationId()));
List<HYGFMaintenanceTickets> hygfMaintenanceTickets = hygfMaintenanceTicketsMapper. List<HYGFMaintenanceTickets> hygfMaintenanceTickets = hygfMaintenanceTicketsMapper.
selectList(new QueryWrapper<HYGFMaintenanceTickets>() selectList(new QueryWrapper<HYGFMaintenanceTickets>()
.eq("warning_id",String.valueOf(tdHygfJpInverterWarnDto.getCreatedTime())) .eq("warning_id", String.valueOf(tdHygfJpInverterWarnDto.getCreatedTime()))
.eq("inverter_sn",String.valueOf(tdHygfJpInverterWarnDto.getSnCode()))); .eq("inverter_sn", String.valueOf(tdHygfJpInverterWarnDto.getSnCode())));
if (jpStation != null) { if (jpStation != null) {
tdHygfJpInverterWarnDto.setStationName(jpStation.getName()); tdHygfJpInverterWarnDto.setStationName(jpStation.getName());
tdHygfJpInverterWarnDto.setStationContact(jpStation.getStationContact()); tdHygfJpInverterWarnDto.setStationContact(jpStation.getStationContact());
...@@ -145,12 +152,12 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -145,12 +152,12 @@ public class TdHygfJpInverterWarnServiceImpl
tdHygfJpInverterWarnDto.setStartTimeFormat(TimeUtil.dateFormat(tdHygfJpInverterWarnDto.getStartTime())); tdHygfJpInverterWarnDto.setStartTimeFormat(TimeUtil.dateFormat(tdHygfJpInverterWarnDto.getStartTime()));
} }
} }
if(hygfMaintenanceTickets.size()>0){ if (hygfMaintenanceTickets.size() > 0) {
Set<String> status = hygfMaintenanceTickets.stream().filter(hygfmaintenanceTickets -> tdHygfJpInverterWarnDto.getCreatedTime().equals(hygfmaintenanceTickets.getWarningId())).map(HYGFMaintenanceTickets::getHandlerStatus).collect(Collectors.toSet()); Set<String> status = hygfMaintenanceTickets.stream().filter(hygfmaintenanceTickets -> tdHygfJpInverterWarnDto.getCreatedTime().equals(hygfmaintenanceTickets.getWarningId())).map(HYGFMaintenanceTickets::getHandlerStatus).collect(Collectors.toSet());
if(status.contains("未处理")){ if (status.contains("未处理")) {
tdHygfJpInverterWarnDto.setTicketStatus("处理中"); tdHygfJpInverterWarnDto.setTicketStatus("处理中");
} }
if(status.contains("已处理")&&status.size()==1){ if (status.contains("已处理") && status.size() == 1) {
tdHygfJpInverterWarnDto.setTicketStatus("已处理"); tdHygfJpInverterWarnDto.setTicketStatus("已处理");
} }
tdHygfJpInverterWarnDto.setListTickets(hygfMaintenanceTickets); tdHygfJpInverterWarnDto.setListTickets(hygfMaintenanceTickets);
...@@ -158,19 +165,20 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -158,19 +165,20 @@ public class TdHygfJpInverterWarnServiceImpl
return tdHygfJpInverterWarnDto; return tdHygfJpInverterWarnDto;
} }
public List<TdHygfJpInverterWarnDto> selectWarnList(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, Integer current, Integer size,String handlerStatus){ public List<TdHygfJpInverterWarnDto> selectWarnList(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, Integer current, Integer size, String handlerStatus) {
List<TdHygfJpInverterWarnDto> list = this.getBaseMapper().selectWarnList(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content,(current-1)*size,size,handlerStatus); List<TdHygfJpInverterWarnDto> list = this.getBaseMapper().selectWarnList(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content, (current - 1) * size, size, handlerStatus);
list.forEach(i -> { list.forEach(i -> {
JpStation jpStation = jpStationServiceImpl.getOne(new LambdaQueryWrapper<JpStation>() JpStation jpStation = jpStationServiceImpl.getOne(new LambdaQueryWrapper<JpStation>()
.eq(JpStation::getThirdStationId, i.getThirdStationId())); .eq(JpStation::getThirdStationId, i.getThirdStationId()));
if(ObjectUtil.isNotNull(jpStation)){ if (ObjectUtil.isNotNull(jpStation)) {
i.setAddress(jpStation.getAddress()); i.setAddress(jpStation.getAddress());
i.setArea(jpStation.getArea()); i.setArea(jpStation.getArea());
} }
}); });
return list; return list;
} }
public int selectWarnListTotal(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content,String handlerStatus){
return this.getBaseMapper().selectWarnListTotal(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content,handlerStatus); public int selectWarnListTotal(String state, String level, String minvalue, String maxValue, String snCode, List<String> stationId, String startTime, String endTime, String content, String handlerStatus) {
return this.getBaseMapper().selectWarnListTotal(state, level, minvalue, maxValue, snCode, stationId, startTime, endTime, content, handlerStatus);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment