package cn.wisenergy.service;

import cn.wisenergy.model.app.WorkCollect;
import cn.wisenergy.model.app.WorkTimeOrder;
import cn.wisenergy.model.dto.CalendarMonthDto;
import cn.wisenergy.model.dto.SubtotalDto;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author chenqi
 * @since 2021-01-19
 */

public interface WorkCollectService {

    /**
     * 功能： 查询某年月的填报情况
     * @param userId 用户id
     * @param workMonth 查询年月
     * @return List<CalendarDto>
     */
    CalendarMonthDto calendarMonth(Integer userId, Date workMonth);


    /**
     * 功能： 查询某日的填报小计
     * @param userId 用户id
     * @param workDay 某日
     * @return List<CalendarDto>
     */
    SubtotalDto calendarDay(Integer userId, Date workDay);

    /**
     * 功能：插入
     * @param workCollect
     * @return
     */
    Boolean insertCollect(WorkCollect workCollect);

    /**
     * 功能：判断当日是否已经填报
     * @param userId
     * @param workDay
     * @return
     */
    WorkCollect getByUserIdAndWorkDay(Integer userId, Date workDay);


    /**
     *
     * 功能：修改某日的审批工时情况
     * @param workCollect 实体类
     * @return 是否成功
     */
    Boolean update(WorkCollect workCollect);

    Boolean updateByWorkTimeOrder(List<WorkTimeOrder> workTimeOrders);

    Boolean deleteByUserIdAndWorkDay(Integer userId, Date workDay);
}
