| | |
| | | /** |
| | | * 删除灯杆 |
| | | */ |
| | | public boolean deletePole(Long poleId) { |
| | | Pole pole = getById(poleId); |
| | | if (pole == null) { |
| | | public boolean deletePole(List<Long> poleIds) { |
| | | List<Pole> poles = listByIds(poleIds); |
| | | if (poles.isEmpty()) { |
| | | throw new BusinessException("未找到该灯杆"); |
| | | } |
| | | // 删除灯杆绑定关系 |
| | | poleBindingService.remove(Wrappers.<PoleBinding>lambdaQuery().eq(PoleBinding::getPoleId, poleId)); |
| | | poleBindingService.remove(Wrappers.<PoleBinding>lambdaQuery().in(PoleBinding::getPoleId, poleIds)); |
| | | SpringContextHolder.getBean(LightTaskPoleRelationService.class) |
| | | .remove(Wrappers.lambdaQuery(LightTaskPoleRelation.class).in(LightTaskPoleRelation::getPoleId, poleIds)); |
| | | |
| | | /** |
| | | * 删除灯杆日志记录开始 |
| | | */ |
| | | String content = "{灯杆Code:" + pole.getDeviceCode() + ", 灯杆名称:" + pole.getPoleName() + " }"; |
| | | String content = "{灯杆id:" + poles + " }"; |
| | | |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "删除灯杆", content); |
| | | /** |
| | | * 删除灯杆日志记录结束 |
| | | */ |
| | | return removeById(poleId); |
| | | return removeByIds(poleIds); |
| | | } |
| | | |
| | | |
| | |
| | | DeviceOnLineCountVO air = new DeviceOnLineCountVO(); |
| | | airEquipments.forEach( |
| | | device -> { |
| | | String s = redisUtils.get(DeviceRedisKey.AIR + device.getAirMac()); |
| | | String s = redisUtils.get(DeviceRedisKey.AIR + device.getMac()); |
| | | if (s != null) { |
| | | RedisDeviceStatus redisDeviceStatus = JSON.parseObject(s, RedisDeviceStatus.class); |
| | | if (redisDeviceStatus.getStatus() == 0) { |
| | |
| | | // } |
| | | // return list; |
| | | // } |
| | | |
| | | public List<Pole> isTrue(List<Pole> list, PoleStatesParam param) { |
| | | //实体灯杆 |
| | | List<Pole> isTrue = new ArrayList<>(); |
| | |
| | | * |
| | | * @return 是否成功 |
| | | */ |
| | | public boolean unBindPole(Long poleId, String deviceCode) { |
| | | return poleBindingService.unBindPole(poleId, deviceCode); |
| | | public boolean unBindPole(Long poleId, String deviceCode, Integer deviceType) { |
| | | return poleBindingService.unBindPole(poleId, deviceCode, deviceType); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | String deviceName = byId.getDeviceCode(); |
| | | if (deviceName.isEmpty()) { |
| | | throw new BusinessException("该灯杆Mca为空"); |
| | | throw new BusinessException("该灯杆Mac为空"); |
| | | } |
| | | IRequestFrame build = FrameBuilder.builderA5().orderType(A5OrderEnum.REQUEST_LIGHT_DATA.getCode()).innerFrame(new A5LightResetReqInnerFrame()).build(); |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(deviceName, build); |
| | |
| | | Long poleId = param.getPoleId(); |
| | | Pole pole = getById(poleId); |
| | | PoleBinding air = poleBindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, poleId).eq(PoleBinding::getDeviceType, 3)); |
| | | PoleBinding nova = poleBindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, poleId).eq(PoleBinding::getDeviceType, 1)); |
| | | LedPlayerEntity LED = SpringContextHolder.getBean(LedPlayerEntityService.class).getOne(Wrappers.lambdaQuery(LedPlayerEntity.class).eq(LedPlayerEntity::getSn, nova.getDeviceCode())); |
| | | if (pole == null) { |
| | | throw new BusinessException("灯杆不存在"); |
| | | } |
| | | if (air == null) { |
| | | throw new BusinessException("未绑定大气监测设备"); |
| | | } |
| | | PoleBinding nova = poleBindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, poleId).eq(PoleBinding::getDeviceType, 1)); |
| | | if (nova == null) { |
| | | throw new BusinessException("未绑定nova设备"); |
| | | } |
| | | LedPlayerEntity LED = SpringContextHolder.getBean(LedPlayerEntityService.class).getOne(Wrappers.lambdaQuery(LedPlayerEntity.class).eq(LedPlayerEntity::getSn, nova.getDeviceCode())); |
| | | if (pole == null) { |
| | | throw new BusinessException("灯杆不存在"); |
| | | } |
| | | //获取大气监测数据 |
| | | A5AtmosphereHeartbeatReportInnerFrame.HeartBeatDataPackage data = SpringContextHolder.getBean(AirDataService.class).getDataByPoleid(poleId); |
| | | //推送数据 |