2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-04-20 f78a9e03ae3f455a85dfd4d8a258dc0fbbb9e694
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/VnnoxController.java
@@ -140,50 +140,13 @@
        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")
    public ResponseVO<Object> onLineList(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) {
//    public ResponseVO<Object> onLineList(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) {
        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);
            List<LedPlayerEntity> list = ledPlayerEntityService.list(wrapper);
            List<LedPlayerEntity> list = ledPlayerEntityService.ledPlayerEntityList(baseConditionVO, keyword);
            List<LedPlayerEntity> entities = vnnoxService.setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list));
            List<LedPlayerEntity> online = new ArrayList<>();
            for (LedPlayerEntity ledPlayer : entities) {
@@ -192,7 +155,7 @@
                }
            }
            return ResponseUtil.success(online);
        }
    }
    @GetMapping("/getVnnoxInfo/{sn}")