| | |
| | | } |
| | | TChargingGun tChargingGun = chargingGunService.getOne(new LambdaQueryWrapper<TChargingGun>().eq(TChargingGun::getFullNumber, (pile_code + gun_code)).eq(TChargingGun::getDelFlag, 0)); |
| | | if(null != tChargingGun){ |
| | | charging_pile_online.put(tChargingGun.getFullNumber(), System.currentTimeMillis()); |
| | | redisService.setCacheMap("charging_gun_online", charging_pile_online); |
| | | |
| | | TChargingPile chargingPile = chargingPileService.getById(tChargingGun.getChargingPileId()); |
| | | //枪处于离线或者故障,返回状态为正常,则修改其状态 |
| | | if(0 == status && tChargingGun.getStatus() != 2){ |
| | |
| | | faultMessage.setContent("设备故障"); |
| | | faultMessageService.save(faultMessage); |
| | | } |
| | | |
| | | if(1 != status){ |
| | | charging_pile_online.put(tChargingGun.getFullNumber(), System.currentTimeMillis()); |
| | | redisService.setCacheMap("charging_gun_online", charging_pile_online); |
| | | } |
| | | if(2 == status){ |
| | | TChargingOrderVo order = new TChargingOrderVo(); |
| | | order.setChargingPileId(tChargingGun.getChargingPileId()); |
| | |
| | | tChargingGun1.setStatus(3); |
| | | chargingGunService.updateById(tChargingGun1); |
| | | } |
| | | |
| | | List<TFaultMessage> list = faultMessageService.list(new LambdaQueryWrapper<TFaultMessage>().eq(TFaultMessage::getChargingGunId, tChargingGun.getId()) |
| | | .isNull(TFaultMessage::getEndTime)); |
| | | if(!list.isEmpty()){ |
| | | list.forEach(s->s.setEndTime(LocalDateTime.now())); |
| | | faultMessageService.updateBatchById(list); |
| | | } |
| | | } |
| | | } |
| | | } |