| | |
| | | .eq(TChargingPile::getCode, code).eq(TChargingPile::getDelFlag, 0)); |
| | | if(null != chargingPile){ |
| | | if(chargingPile.getStatus() == 1){ |
| | | TFaultMessage faultMessage = new TFaultMessage(); |
| | | faultMessage.setSiteId(chargingPile.getSiteId()); |
| | | faultMessage.setChargingPileId(chargingPile.getId()); |
| | | faultMessage.setStatus(1); |
| | | faultMessage.setDownTime(LocalDateTime.now()); |
| | | faultMessage.setCreateTime(LocalDateTime.now()); |
| | | faultMessage.setDelFlag(false); |
| | | faultMessage.setContent("设备离线"); |
| | | faultMessageService.save(faultMessage); |
| | | |
| | | chargingPile.setStatus(0 == status ? 1 : 3); |
| | | chargingPileService.updateById(chargingPile); |
| | | TFaultMessage faultMessage = faultMessageService.getOne(new LambdaQueryWrapper<TFaultMessage>().eq(TFaultMessage::getChargingPileId, chargingPile.getId()) |
| | | .eq(TFaultMessage::getStatus, 2).eq(TFaultMessage::getDelFlag, 0).isNull(TFaultMessage::getEndTime)); |
| | | if(null == faultMessage){ |
| | | faultMessage = new TFaultMessage(); |
| | | faultMessage.setSiteId(chargingPile.getSiteId()); |
| | | faultMessage.setChargingPileId(chargingPile.getId()); |
| | | faultMessage.setStatus(2); |
| | | faultMessage.setDownTime(LocalDateTime.now()); |
| | | faultMessage.setCreateTime(LocalDateTime.now()); |
| | | faultMessage.setDelFlag(false); |
| | | faultMessage.setContent("设备故障"); |
| | | faultMessageService.save(faultMessage); |
| | | |
| | | chargingPile.setStatus(0 == status ? 1 : 3); |
| | | chargingPileService.updateById(chargingPile); |
| | | } |
| | | } |
| | | if(chargingPile.getStatus() != 1 && 0 == status){ |
| | | TFaultMessage one = faultMessageService.getOne(new LambdaQueryWrapper<TFaultMessage>().eq(TFaultMessage::getChargingPileId, chargingPile.getId()).isNull(TFaultMessage::getEndTime)); |
| | | TFaultMessage one = faultMessageService.getOne(new LambdaQueryWrapper<TFaultMessage>().eq(TFaultMessage::getChargingPileId, chargingPile.getId()) |
| | | .isNull(TFaultMessage::getEndTime)); |
| | | if(null != one){ |
| | | one.setEndTime(LocalDateTime.now()); |
| | | faultMessageService.updateById(one); |