2021与蓝度共同重构项目,服务端
liuhaonan
2022-06-06 15fe445c820f28139e4e7e1a4cb286ad6ae37e6e
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedScheduleService.java
@@ -22,6 +22,7 @@
import com.sandu.ximon.admin.vo.LedScheduleVO;
import com.sandu.ximon.dao.domain.LedScheduleEntity;
import com.sandu.ximon.dao.domain.PoleLightemitEntity;
import com.sandu.ximon.dao.enums.OrderByEnums;
import com.sandu.ximon.dao.mapper.LedScheduleEntityMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
@@ -95,12 +96,12 @@
        }
        /**
         * 熙汛定时更改
         * 熙汛定时更改 日志记录开始
         */
        String content = "{熙汛定时id:" + ledScheduleEntity.getId() + ",熙汛定时名称:" + ledScheduleEntity.getName() + "熙汛定时内容:" + JSON.toJSONString(ledScheduleEntity.getSchedule()) + " }";
        StoreOperationRecordsUtils.storeOperationData(null, null, "熙汛定时更改", content);
        StoreOperationRecordsUtils.storeOperationData(null, null, "熙汛定时任务更改", content);
        /**
         * 熙汛定时更改
         * 熙汛定时更改 日志记录结束
         */
        return this.save(ledScheduleEntity);
    }
@@ -132,7 +133,7 @@
        }
        /**
         * 熙汛定时新增
         * 熙汛定时推送 日志记录开始
         */
        String message = "";
        List<String> listCode = new ArrayList<>();
@@ -143,9 +144,9 @@
            message += "[屏幕Code:" + entity.getLightemitControlCode() + "屏幕名称:" + entity.getLightemitName() + "],";
        }
        String content = "{熙汛定时id:" + ledScheduleEntity.getId() + ",熙汛定时名称:" + ledScheduleEntity.getName() + "熙汛屏幕信息:" + message + " }";
        StoreOperationRecordsUtils.storeOperationData(listCode, null, "熙汛定时更改", content);
        StoreOperationRecordsUtils.storeOperationData(listCode, null, "推送熙汛定时任务", content);
        /**
         * 熙汛定时新增
         * 熙汛定时任务推送 日志记录结束
         */
    }
@@ -184,7 +185,7 @@
     * @param keyword
     * @return
     */
    public List listSchedule(BaseConditionVO baseConditionVO, String keyword) {
    public List listSchedule(BaseConditionVO baseConditionVO,Integer order,Integer seq, String keyword) {
        LambdaQueryWrapper<LedScheduleEntity> eq = Wrappers.lambdaQuery(LedScheduleEntity.class);
        //用户类型判断
        if (SecurityUtils.getClientId() != null) {
@@ -197,7 +198,34 @@
            eq = eq.like(LedScheduleEntity::getName, keyword);
        }
        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
        //排序字段
        String orderByResult = "id";
        //正序、倒叙
        String orderBySeq = OrderByEnums.ASC.getCode();
        if (order != null) {
            switch (order) {
                case 1:
                    orderByResult = OrderByEnums.LED_S_PLAY_PLAN_CREATE_TIME.getCode();
                    break;
                default:
            }
        }
        if (seq != null) {
            switch (seq) {
                case 1:
                    orderBySeq = " ASC";
                    break;
                case 2:
                    orderBySeq = " DESC";
                    break;
                default:
                    break;
            }
        }
        //排序方式
        String orderBy = orderByResult + " " + orderBySeq;
        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(),orderBy);
        return list(eq);
    }