潘志宝
2025-03-21 ec50954c8c9d244a2ff259b653aaaa7bfeabe79b
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java
@@ -4,18 +4,20 @@
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.service.impl.BaseServiceImpl;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.framework.common.util.object.ConvertUtils;
import com.iailab.module.model.api.mcs.dto.ScheduleSuggestReqDTO;
import com.iailab.module.model.api.mcs.dto.ScheduleSuggestRespDTO;
import com.iailab.module.model.common.enums.ScheduleSuggestStatusEnum;
import com.iailab.module.model.mcs.sche.dao.StScheduleSuggestDao;
import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity;
import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService;
import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestPageReqVO;
import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestSaveReqVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
/**
 * @author PanZhibao
@@ -69,4 +71,24 @@
    public void cleanScheduleSuggest(Map<String, Date> tMap) {
        baseDao.cleanScheduleSuggest(tMap);
    }
    @Override
    public List<ScheduleSuggestRespDTO> list(ScheduleSuggestReqDTO vo) {
        QueryWrapper<StScheduleSuggestEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(StringUtils.isNotBlank(vo.getScheduleObj()),"schedule_obj", vo.getScheduleObj())
                .ge(null != vo.getStartTime(),"schedule_time",vo.getStartTime())
                .le(null != vo.getEndTime(),"schedule_time",vo.getEndTime());
        return ConvertUtils.sourceToTarget(baseDao.selectList(queryWrapper),ScheduleSuggestRespDTO.class);
    }
    @Override
    public List<StScheduleSuggestEntity> getList(List<String> scheduleObjList, Date predictTime) {
        if (CollectionUtils.isEmpty(scheduleObjList)) {
            return new ArrayList<>();
        }
        QueryWrapper<StScheduleSuggestEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.in("schedule_obj", scheduleObjList);
        queryWrapper.eq("schedule_time", predictTime);
        return baseDao.selectList(queryWrapper);
    }
}