package com.foreverwin.mesnac.dispatch.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.dispatch.dto.ProductionCalendarDTO;
import com.foreverwin.mesnac.dispatch.dto.WorkCenterWorkTimeDTO;
import com.foreverwin.mesnac.dispatch.model.ProductionCalendar;
import com.foreverwin.modular.core.util.FrontPage;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 生产日历  服务类
 * </p>
 *
 * @author syngna
 * @since 2020-08-18
 */
public interface ProductionCalendarService extends IService<ProductionCalendar> {

    /**
     *  分页查询
     * @param frontPage
     * @return
     */
    IPage<ProductionCalendar> selectPage(FrontPage<ProductionCalendar> frontPage, ProductionCalendar productionCalendar);

    List<ProductionCalendar> selectList(ProductionCalendar productionCalendar);

    /**
     * 根据站点、工作中心、年、月检索工作日历数据接口
     * @param site
     * @param workCenter
     * @param year
     * @param month
     * @return
     */
    List<ProductionCalendarDTO> listByWorkCenterYearMonth(String site, String workCenter, String year, String month);

    /**
     * 批量新增或更新
     * @param productionCalendarList
     * @return
     */
    boolean saveOrUpdateBatch(List<ProductionCalendar> productionCalendarList, int batchSize);

    List<WorkCenterWorkTimeDTO> listWorkCenterWorkTimeByDateRange(String site, String workCenter, String startDate, String endDate);

    List<WorkCenterWorkTimeDTO> listWorkTimeByRange(String site, String startDate, String endDate);

    List<WorkCenterWorkTimeDTO> listWorkTime(String site, Set<String> workCenterList, String startDate, String endDate);
}