| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.integration.api.feignClient.IotInterfaceClient; |
| | | import com.ruoyi.integration.api.feignClient.UploadRealTimeMonitoringDataClient; |
| | |
| | | |
| | | @Resource |
| | | private IotInterfaceClient iotInterfaceClient; |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | return pageInfo.setRecords(chargingGunMonitoring); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时任务修改充电桩状态 |
| | | */ |
| | | @Override |
| | | public void updateStatus() { |
| | | List<TChargingPile> list = this.list(new LambdaQueryWrapper<TChargingPile>().eq(TChargingPile::getDelFlag, 0)); |
| | | List<TChargingPile> datas = new ArrayList(); |
| | | Map<String, Object> charging_pile_online = redisService.getCacheMap("charging_pile_online"); |
| | | for (TChargingPile chargingPile : list) { |
| | | Long time = (Long) charging_pile_online.get(chargingPile.getCode()); |
| | | if(null != time && System.currentTimeMillis() - time > 60000){ |
| | | chargingPile.setStatus(2); |
| | | datas.add(chargingPile); |
| | | } |
| | | } |
| | | |
| | | if(datas.size() > 0){ |
| | | this.updateBatchById(datas); |
| | | } |
| | | } |
| | | } |