2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-04-18 31c23ba25866604c2688bcef9d1207b7f471e88a
播放计划列表
已修改4个文件
44 ■■■■■ 文件已修改
dao/src/main/java/com/sandu/ximon/dao/domain/PlayPlanNv.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/resources/mapper/PlayPlanNvMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PlayPlanNvController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedScheduleService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/PlayPlanNv.java
@@ -31,6 +31,11 @@
    private Long userId;
    /**
     *
     */
    private Long clientId;
    /**
     * 播放计划名称
     */
    private String name;
dao/src/main/resources/mapper/PlayPlanNvMapper.xml
@@ -7,6 +7,7 @@
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.PlayPlanNv">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="userId" column="user_id" jdbcType="BIGINT"/>
        <result property="clientId" column="client_id" jdbcType="BIGINT"/>
        <result property="name" column="name" jdbcType="VARCHAR"/>
        <result property="ledProgramId" column="led_program_id" jdbcType="BIGINT"/>
        <result property="ledProgramName" column="led_program_name" jdbcType="VARCHAR"/>
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PlayPlanNvController.java
@@ -66,16 +66,17 @@
            return ResponseUtil.fail("缺少对应用户权限");
        }
        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
        LambdaQueryWrapper<PlayPlanNv> wrapper = new LambdaQueryWrapper<>();//
        if (AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())) {
            wrapper = Wrappers.lambdaQuery(PlayPlanNv.class).eq(PlayPlanNv::getUserId, SecurityUtils.getUserId());
        LambdaQueryWrapper<PlayPlanNv> wrapper = Wrappers.lambdaQuery(PlayPlanNv.class);
        if (SecurityUtils.getClientId() != null) {
            wrapper = wrapper.eq(PlayPlanNv::getUserId, SecurityUtils.getUserId()).or(w -> {
                w.eq(PlayPlanNv::getClientId, SecurityUtils.getUserId());
            });
        }
        wrapper = Wrappers.lambdaQuery(PlayPlanNv.class);
        if (StrUtil.isNotBlank(keyword)) {
            wrapper.like(PlayPlanNv::getName, keyword);
        if (!keyword.isEmpty()) {
            wrapper = wrapper.like(PlayPlanNv::getName, keyword);
        }
        List<PlayPlanNv> list = playPlanNvService.list(wrapper);
        //PlayPlanParam param=new PlayPlanParam();
        list.forEach(plan -> {
            plan.setPlan(JSON.parseObject(plan.getSchedule(), Map.class));
        });
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedScheduleService.java
@@ -136,20 +136,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()) {
            eq = eq.like(LedScheduleEntity::getName, keyword);
        }
        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
        return list(eq);
    }