2021与蓝度共同重构项目,服务端
liuhaonan
2022-05-07 b63079723d7a5fdc5660ba7064a9306ce35f0f3d
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PlayPlanNvController.java
@@ -13,9 +13,7 @@
import com.sandu.ximon.admin.security.SecurityUtils;
import com.sandu.ximon.admin.service.PlayPlanNvService;
import com.sandu.ximon.admin.vo.NovaPushResultVO;
import com.sandu.ximon.dao.bo.SchedulesDTO;
import com.sandu.ximon.dao.domain.PlayPlanNv;
import com.sandu.ximon.dao.enums.MenuEnum;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -34,11 +32,13 @@
    private final PlayPlanNvService playPlanNvService;
    private PermissionConfig permissionConfig;
    @AnonymousAccess
    @PostMapping("/add")
    public ResponseVO<Object> addLEDPlan(@RequestBody @Validated PlayPlanParam param) {
        return ResponseUtil.success(playPlanNvService.addPlan(param));
    }
    @AnonymousAccess
    @GetMapping("/getByPlanId/{planId}")
    public ResponseVO<Object> getPlan(@PathVariable Long planId) {
        return ResponseUtil.success(playPlanNvService.getByPlanId(planId));
@@ -60,11 +60,19 @@
        return ResponseUtil.success(playPlanNvService.pushToLed(plianId, playerIds));
    }
    @AnonymousAccess
    @PostMapping(value = "/pushSchedule/{plianId}", produces = "application/json;charset=UTF-8")
    public ResponseVO<Object> pushSchedule(@PathVariable Long plianId, @RequestBody List<NovaPushResultVO> playerIds) {
        return ResponseUtil.success(playPlanNvService.pushSchedule(plianId, playerIds));
    }
    @AnonymousAccess
    @GetMapping("/listPlan")
    public ResponseVO<Object> list(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) {
        if (!permissionConfig.check(MenuEnum.PLAYPLAN_LIST.getCode())) {
            return ResponseUtil.fail("缺少对应用户权限");
        }
//        if (!permissionConfig.check(MenuEnum.PLAYPLAN_LIST.getCode())) {
//            return ResponseUtil.fail("缺少对应用户权限");
//        }
        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
        LambdaQueryWrapper<PlayPlanNv> wrapper = Wrappers.lambdaQuery(PlayPlanNv.class);
@@ -79,7 +87,8 @@
        List<PlayPlanNv> list = playPlanNvService.list(wrapper);
        list.forEach(plan -> {
//            plan.setPlan(JSON.parseObject(plan.getSchedule(), Map.class));
            plan.setPlan(JSON.parseArray(plan.getSchedule(), SchedulesDTO.class));
            plan.setPlan(JSON.parseObject(plan.getSchedules(), List.class));
//            plan.setPlan(JSON.parseArray(plan.getSchedule(), SchedulesDTO.class));
        });
        return ResponseUtil.successPage(list);
    }