2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-04-20 c00a73b74e67dbeb508865c3da4ed8d57c8631db
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedScheduleService.java
@@ -83,6 +83,12 @@
        String json = JSON.toJSONString(taskSchedules, SerializerFeature.WriteMapNullValue);
//         String json = new Gson().toJson(taskSchedules);
        ledScheduleEntity.setSchedule(json);
        if (SecurityUtils.getClientId() != null) {
            ledScheduleEntity.setUserId(SecurityUtils.getUserId());
            if (clientService.findClientId()) {
                ledScheduleEntity.setClientId(clientService.getClientId());
            }
        }
        return this.save(ledScheduleEntity);
    }
@@ -136,20 +142,27 @@
    }
    /**
     * 播放计划列表(熙讯)
     *
     * @param baseConditionVO
     * @param keyword
     * @return
     */
    public List listSchedule(BaseConditionVO baseConditionVO, String keyword) {
        LambdaQueryWrapper<LedScheduleEntity> eq = new LambdaQueryWrapper<>();
        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
        if (SecurityUtils.getClientId() != null && clientService.findClientId()) {
            eq = Wrappers.lambdaQuery(LedScheduleEntity.class).eq(LedScheduleEntity::getUserId, SecurityUtils.getUserId());
        } else if (SecurityUtils.getClientId() != null && !clientService.findClientId()) {
            eq = Wrappers.lambdaQuery(LedScheduleEntity.class).eq(LedScheduleEntity::getClientId, SecurityUtils.getUserId());
        } else {
            eq = Wrappers.lambdaQuery(LedScheduleEntity.class);
        LambdaQueryWrapper<LedScheduleEntity> eq = Wrappers.lambdaQuery(LedScheduleEntity.class);
        //用户类型判断
        if (SecurityUtils.getClientId() != null) {
            eq = eq.eq(LedScheduleEntity::getUserId, SecurityUtils.getUserId()).or(w -> {
                w.eq(LedScheduleEntity::getClientId, SecurityUtils.getUserId());
            });
        }
        if (!keyword.isEmpty()) {
        //模糊查询关键字判断
        if (keyword != null && !keyword.isEmpty()) {
            eq = eq.like(LedScheduleEntity::getName, keyword);
        }
        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
        return list(eq);
    }