package com.gic.haoban.manage.service.service.notify;

import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.service.pojo.bo.PendingTaskBO;

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

/**
 * Created 2021/12/15.
 *
 * @author hua
 */
public interface PendingTaskService {
    /**
     * 新增或更新
     *
     * @param task
     * @return
     */
    public boolean addOrUpdatePendingTask(PendingTaskBO task);

    /**
     * 新增或更新
     *
     * @param task
     * @return
     */
    public boolean addOrUpdateBatchPendingTask(List<PendingTaskBO> task);

    /**
     * 分页查询待办任务表
     *
     * @param enterpriseId 企业id
     * @param storeId      门店id
     * @param clerkId      导购id
     * @param finishFlag   完成状态
     * @param overdueFlag  逾期状态
     * @param pageInfo     分页参数
     * @return
     */
    public Page<PendingTaskBO> pagePendingTask(String enterpriseId, String storeId, String clerkId, int taskType,
                                               int finishFlag, int overdueFlag, BasePageInfo pageInfo);

    /**
     * 列表
     *
     * @param enterpriseId
     * @param storeId
     * @param clerkId
     * @param startDate
     * @param endDate
     * @return
     */
    public List<PendingTaskBO> listPendingTaskByCreateTime(String enterpriseId, String storeId, String clerkId, String startDate, String endDate);

    /**
     * 删除执行人列表
     *
     * @param relationIds
     * @return
     */
    public boolean deletePendingTask(List<String> relationIds);


    /**
     * 删除执行人列表
     *
     * @param businessId
     * @return
     */
    public boolean deletePendingTaskByBusinessId(String businessId);

    /**
     * 更新失效时间
     *
     * @param businessId
     * @param time
     * @return
     */
    public boolean updateInvalidTimeByBusinessId(String businessId, Date time);

    /**
     * 完成
     * @param relationId
     * @return
     */
    public boolean updateFinish(String relationId);

    /**
     * 完成
     * @param task
     * @return
     */
    public boolean changeByRelationId(PendingTaskBO task);

    public void insertPendingTaskBatch(List<PendingTaskBO> list);


}
