| | |
| | | commonPage.setTotalPage(size / baseConditionVO.getPageSize()); |
| | | } |
| | | return ResponseUtil.success(commonPage); |
| | | |
| | | |
| | | // if (!permissionConfig.check(MenuEnum.LED_LIST.getCode())) { |
| | | // return ResponseUtil.fail("缺少对应用户权限"); |
| | | // } |
| | | // PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | // LambdaQueryWrapper<PoleLightemitEntity> wrapper = Wrappers.lambdaQuery(PoleLightemitEntity.class); |
| | | // if (AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())) { |
| | | // boolean clientId = clientService.findClientId(); |
| | | // if (clientId) { |
| | | // wrapper = wrapper.eq(PoleLightemitEntity::getUserId, SecurityUtils.getUserId()); |
| | | // } |
| | | // wrapper = wrapper.eq(PoleLightemitEntity::getClientId, clientService.getClientId()); |
| | | // } |
| | | // wrapper = Wrappers.lambdaQuery(PoleLightemitEntity.class); |
| | | // if (StrUtil.isNotBlank(keyword)) { |
| | | // wrapper.like(PoleLightemitEntity::getLightemitName, keyword).or( |
| | | // lambdaQueryWrapper -> { |
| | | // lambdaQueryWrapper.like(PoleLightemitEntity::getLightemitControlCode, keyword); |
| | | // } |
| | | // ); |
| | | // } |
| | | // List<PoleBinding> bindings = bindingService.list(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceType, 1)); |
| | | // List<PoleLightemitEntity> list = poleLightemitService.list(wrapper); |
| | | // if (isOnLine) { |
| | | // List<PoleLightemitEntity> results = poleLightemitService.ledOnline(list); |
| | | // results.forEach( |
| | | // led -> { |
| | | // bindings.forEach( |
| | | // bind -> { |
| | | // if (bind.getDeviceCode() != null && led.getLightemitControlCode() == bind.getDeviceCode()) { |
| | | // led.setStreetlightId(bind.getPoleId()); |
| | | // System.out.println("有没有运行到这里?---------------" + bind.getPoleId()); |
| | | // led.setStreetlightName(poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getId, bind.getPoleId())).getPoleName()); |
| | | // } |
| | | // } |
| | | // ); |
| | | // } |
| | | // ); |
| | | // CommonPage commonPage = CommonPage.restPage(results); |
| | | // int size = results.size(); |
| | | // commonPage.setTotal((long) size); |
| | | // commonPage.setTotalPage(size / baseConditionVO.getPageSize() + 1); |
| | | // if (size % baseConditionVO.getPageSize() == 0) { |
| | | // commonPage.setTotalPage(size / baseConditionVO.getPageSize()); |
| | | // } |
| | | // return ResponseUtil.success(commonPage); |
| | | // } else { |
| | | // poleLightemitService.ledOnlineCheck(list); |
| | | // list.forEach( |
| | | // led -> { |
| | | // bindings.forEach( |
| | | // bind -> { |
| | | // if (bind.getDeviceCode() != null && led.getLightemitControlCode().equals(bind.getDeviceCode())) { |
| | | // led.setStreetlightId(bind.getPoleId()); |
| | | // System.out.println("有没有运行到这里?---------------" + bind.getPoleId()); |
| | | // led.setStreetlightName(poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getId, bind.getPoleId())).getPoleName()); |
| | | // } |
| | | // } |
| | | // ); |
| | | // } |
| | | // ); |
| | | // CommonPage commonPage = CommonPage.restPage(list); |
| | | // int size = list.size(); |
| | | // commonPage.setTotal((long) size); |
| | | // commonPage.setTotalPage(size / baseConditionVO.getPageSize() + 1); |
| | | // if (size % baseConditionVO.getPageSize() == 0) { |
| | | // commonPage.setTotalPage(size / baseConditionVO.getPageSize()); |
| | | // } |
| | | // return ResponseUtil.success(commonPage); |
| | | // // return ResponseUtil.success(list); |
| | | // } |
| | | //// return ResponseUtil.success(poleLightemitService.list(wrapper)); |
| | | } |
| | | |
| | | /** |