| | |
| | | if(datas.size() > 0){ |
| | | for (TChargingPile data : datas) { |
| | | if(data.getStatus() == 1){ |
| | | TFaultMessage faultMessage = new TFaultMessage(); |
| | | faultMessage.setSiteId(data.getSiteId()); |
| | | faultMessage.setChargingPileId(data.getId()); |
| | | faultMessage.setStatus(1); |
| | | faultMessage.setDownTime(LocalDateTime.now()); |
| | | faultMessage.setCreateTime(LocalDateTime.now()); |
| | | faultMessage.setDelFlag(false); |
| | | faultMessage.setContent("设备离线"); |
| | | faultMessageService.save(faultMessage); |
| | | TFaultMessage faultMessage = faultMessageService.getOne(new LambdaQueryWrapper<TFaultMessage>().eq(TFaultMessage::getChargingPileId, data.getId()) |
| | | .eq(TFaultMessage::getStatus, 1).eq(TFaultMessage::getDelFlag, 0).isNull(TFaultMessage::getEndTime)); |
| | | if(null == faultMessage){ |
| | | faultMessage = new TFaultMessage(); |
| | | faultMessage.setSiteId(data.getSiteId()); |
| | | faultMessage.setChargingPileId(data.getId()); |
| | | faultMessage.setStatus(1); |
| | | faultMessage.setDownTime(LocalDateTime.now()); |
| | | faultMessage.setCreateTime(LocalDateTime.now()); |
| | | faultMessage.setDelFlag(false); |
| | | faultMessage.setContent("设备离线"); |
| | | faultMessageService.save(faultMessage); |
| | | } |
| | | } |
| | | } |
| | | this.updateBatchById(datas); |