| | |
| | | if (!permissionConfig.check(MenuEnum.LED_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | LambdaQueryWrapper<LedPlayerEntity> wrapper = Wrappers.lambdaQuery(LedPlayerEntity.class); |
| | | if (AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())) { |
| | | //wrapper.eq(LedPlayerEntity::get) |
| | | return ResponseUtil.success(""); // todo |
| | | } else { |
| | | wrapper.like(LedPlayerEntity::getPlayerName, keyword) |
| | | .or( |
| | | querywrapper -> { |
| | | querywrapper.like(LedPlayerEntity::getName, keyword); |
| | | } |
| | | ).or( |
| | | sn->{ |
| | | sn.like(LedPlayerEntity::getSn,keyword); |
| | | } |
| | | ); |
| | | List<LedPlayerEntity> list = ledPlayerEntityService.list(wrapper); |
| | | List<LedPlayerEntity> entities = vnnoxService.setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list)); |
| | | entities.forEach( |
| | | led -> { |
| | | PoleBinding binding = bindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class) |
| | | .eq(PoleBinding::getDeviceType, 1).eq(PoleBinding::getDeviceCode, led.getSn())); |
| | | if (binding != null) { |
| | | led.setPoleId(poleService.getById(binding.getPoleId()).getId()); |
| | | led.setPoleName(poleService.getById(binding.getPoleId()).getPoleName()); |
| | | } |
| | | } |
| | | ); |
| | | return ResponseUtil.success(entities); |
| | | } |
| | | return ResponseUtil.successPage(ledPlayerEntityService.ledPlayerEntityList(baseConditionVO, keyword)); |
| | | } |
| | | |
| | | @GetMapping("/onLineList") |