2021与蓝度共同重构项目,服务端
liuhaonan
2022-03-14 228d1be133e0fd2f1f46a29af8bc9cbda3d18d74
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/XiXunController.java
@@ -65,7 +65,7 @@
    public ResponseVO<Object> update(@RequestBody ProgramPro programPro) {
        PoleXixunPlayerEntity byId = xiXunPlayerService.getById(programPro.getProgramId());
        if (byId == null) {
            throw new BusinessException("参数错误");
            throw new BusinessException("未选择LED屏");
        }
//        QueryWrapper<PoleXixunPlayerEntity> queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("program_code", programPro.get_id());
@@ -236,6 +236,7 @@
                                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());
                                    }
                                }
@@ -258,6 +259,7 @@
                                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());
                                    }
                                }
@@ -272,7 +274,7 @@
                commonPage.setTotalPage(size / baseConditionVO.getPageSize());
            }
            return ResponseUtil.success(commonPage);
           // return ResponseUtil.success(list);
            // return ResponseUtil.success(list);
        }
//        return ResponseUtil.success(poleLightemitService.list(wrapper));
    }
@@ -353,7 +355,7 @@
    public ResponseVO<Object> setVolume(@RequestBody SetVolumeParam setVolumeEntity) {
        if (setVolumeEntity == null || setVolumeEntity.getIds() == null || setVolumeEntity.getVolume() > 15) {
            throw new BusinessException("参数错误");
            throw new BusinessException("音量范围为0---15");
        }
        Collection poleLightemitControllers = poleLightemitService.listByIds(Arrays.asList(setVolumeEntity.getIds()));
@@ -384,6 +386,21 @@
        return ResponseUtil.success(scheduleService.getSchedule(id));
    }
    @GetMapping("/listSchedule")
    public ResponseVO<Object> listSchedule(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) {
        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
        return ResponseUtil.success(scheduleService.listSchedule(baseConditionVO, keyword));
    }
    /**
     * 设置定时
     *
     * @param id
     * @param lightemitIds
     * @return
     */
    @PostMapping("/pushSchedule/{id}")
    public ResponseVO<Object> pushSchedule(@PathVariable Integer id, @RequestBody Long[] lightemitIds) {
        scheduleService.ledschedulepush(id, lightemitIds);