| | |
| | | * @param isOnLine |
| | | * @return |
| | | */ |
| | | public List<PoleLightemitEntity> listLed(String keyword,Integer order,Integer seq, boolean isOnLine) { |
| | | public List<PoleLightemitEntity> listLed(String keyword, Integer order, Integer seq, boolean isOnLine) { |
| | | List<PoleLightemitEntity> poleLightemitEntityList; |
| | | //排序字段 |
| | | String orderByResult = "id"; |
| | |
| | | |
| | | //超管 |
| | | if (SecurityUtils.getClientId() == null) { |
| | | poleLightemitEntityList = poleLightemitDao.listLed(keyword, null,orderBy); |
| | | poleLightemitEntityList = poleLightemitDao.listLed(keyword, null, orderBy); |
| | | } else { |
| | | poleLightemitEntityList = poleLightemitDao.listLed(keyword, SecurityUtils.getUserId(),orderBy); |
| | | poleLightemitEntityList = poleLightemitDao.listLed(keyword, SecurityUtils.getUserId(), orderBy); |
| | | } |
| | | |
| | | List<PoleLightemitEntity> temp = new ArrayList<>(); |
| | |
| | | } |
| | | } |
| | | return temp; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 绑定使用 |
| | | * |
| | | * @param keyword |
| | | * @return |
| | | */ |
| | | public List<PoleLightemitEntity> listLedOnBinding(String keyword) { |
| | | List<PoleLightemitEntity> poleLightemitEntityList; |
| | | |
| | | |
| | | //超管 |
| | | if (SecurityUtils.getClientId() == null) { |
| | | poleLightemitEntityList = poleLightemitDao.listLedOnBinding(keyword, null); |
| | | } else { |
| | | poleLightemitEntityList = poleLightemitDao.listLedOnBinding(keyword, SecurityUtils.getUserId()); |
| | | } |
| | | |
| | | for (PoleLightemitEntity poleLightemitEntity : poleLightemitEntityList) { |
| | | //查询设备在线状态 |
| | | boolean onLine = lightemitUtils.getLedOnLine(poleLightemitEntity.getLightemitControlCode()); |
| | | //查询屏幕的开启状态 |
| | | String isOpen = lightemitUtils.getIsScreenOpen(poleLightemitEntity.getLightemitControlCode()); |
| | | poleLightemitEntity.setIsOpen(String.valueOf(isOpen)); |
| | | poleLightemitEntity.setOnLine(onLine); |
| | | } |
| | | return poleLightemitEntityList; |
| | | } |
| | | |
| | | /** |
| | |
| | | boolean save = this.save(poleLightemit); |
| | | // 绑定灯杆 |
| | | |
| | | if (save && poleLightemit.getPoleId() != null) { |
| | | if (save && poleLightemit.getStreetlightId() != null) { |
| | | PoleBindingParam poleBindingParam = new PoleBindingParam(); |
| | | poleBindingParam.setDeviceCode(poleLightemit.getLightemitControlCode()); |
| | | poleBindingParam.setDeviceType(1); |
| | | poleBindingParam.setDeviceName(poleLightemit.getLightemitName()); |
| | | poleBindingService.bindPole(poleLightemit.getPoleId(), poleBindingParam); |
| | | poleBindingService.bindPole(poleLightemit.getStreetlightId(), poleBindingParam); |
| | | } |
| | | |
| | | /** |
| | |
| | | throw new BusinessException("未找到LED屏"); |
| | | } |
| | | |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getLightemitControlCode(), PoleBindingEnums.XIXUN); |
| | | if (!belong) { |
| | | throw new BusinessException("该设备不属于您,不能修改设备信息"); |
| | | if (SecurityUtils.getClientId() != null) { |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getLightemitControlCode(), PoleBindingEnums.XIXUN); |
| | | if (!belong) { |
| | | throw new BusinessException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | } |
| | | poleLightemit.setLightemitId(ledId); |
| | | boolean b = this.updateById(poleLightemit); |
| | | // 绑定灯杆 |
| | | |
| | | if (b && poleLightemit.getPoleId() != null) { |
| | | if (b && poleLightemit.getStreetlightId() != null) { |
| | | //先删除绑定关系 |
| | | poleBindingService.unBindPole(null, poleLightemit.getLightemitControlCode()); |
| | | //再绑定 |
| | |
| | | poleBindingParam.setDeviceCode(poleLightemit.getLightemitControlCode()); |
| | | poleBindingParam.setDeviceType(10); |
| | | poleBindingParam.setDeviceName(poleLightemit.getLightemitName()); |
| | | poleBindingService.bindPole(poleLightemit.getPoleId(), poleBindingParam); |
| | | poleBindingService.bindPole(poleLightemit.getStreetlightId(), poleBindingParam); |
| | | } |
| | | |
| | | /** |