package com.bonus.sgzb.app.service;

import com.bonus.sgzb.app.domain.LeaseApplyInfo;
import com.bonus.sgzb.app.domain.TmTask;
import com.bonus.sgzb.base.api.domain.MaMachine;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import org.apache.ibatis.annotations.Param;

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

/**
 * Description: 任务表Task
 * @Author 阮世耀
 * @Create 2023/12/13 15:14
 * @Version 1.0
 */

public interface TmTaskService{

    /**
     * 审批流领料申请
     * @param task
     * @return
     */
    AjaxResult createFlowLeaseApply(TmTask task);

    List<TmTask> getLeaseAuditList(TmTask record);
    List<TmTask> getLeaseAuditListByOne(TmTask record);
    List<TmTask> getLeaseOutDetailRecord(TmTask record);

    List<TmTask> getLeaseAuditListByAdmin(TmTask record);

    List<TmTask> getLeaseAuditManageList(TmTask record);

    List<TmTask> getLeaseAuditListForApp(TmTask record);

    /** 领料任务审核通过状态修改 */
    int updateLeaseTaskAuditInfo(TmTask record);
    int updateLeaseTaskAuditInfoCq(TmTask record);

    /**
     * 领料任务审核通过状态修改,只修改tmTask表状态
     * @param record 任务信息
     * @return 结果
     */
    int updateLeaseTaskStatusConfirmByCq(TmTask record);

    /** 领料任务审核驳回状态修改 */
    int updateLeaseTaskRejectInfo(TmTask record);
    int updateLeaseTaskRejectInfoCq(TmTask record);

    String genderLeaseCode();

    AjaxResult deleteByPrimaryKey(String taskId);
    int deleteLeaseInfoByTaskId(String taskId);

    int deleteDetailsByTaskId(@Param("id") String id);

    int deleteDetailsByParentId(String parentId);

    int createTask(TmTask record);

    int insertOrUpdate(TmTask record);

    int insertOrUpdateSelective(TmTask record);

    int insertSelective(TmTask record);

    TmTask selectByPrimaryKey(Long taskId);

    int updateByPrimaryKeySelective(TmTask record);

    int edit(TmTask tmTask) throws Exception;
    int editCq(TmTask tmTask);

    Integer getAgreementIdByUnit(TmTask task);

    int updateAgreementByTask(TmTask record);

    int updateByPrimaryKey(TmTask record);

    int updateBatch(List<TmTask> list);

    int updateBatchSelective(List<TmTask> list);

    int batchInsert(List<TmTask> list);

    int insertAgreement(TmTask record);

    List<TmTask> getLeaseListAll(TmTask task);
    List<TmTask> getLeaseApplyListAll(TmTask task);

    void updateLeaseInfo(LeaseApplyInfo task);

    List<LeaseApplyInfo> getListSome(Long taskId);


    LeaseApplyInfo getListSomeol(LeaseApplyInfo info);

    List<TmTask> getLeaseAuditManageListCq(TmTask task);

    List<TmTask> getLeaseListAllCq(TmTask task);

    List<TmTask> getLeaseOutListByUser(TmTask task);

    /**
     * 获取任务编号
     *
     * @param nowDate
     * @param taskType
     * @return
     */
    String selectTaskNumByMonths(@Param("date") Date nowDate, @Param("taskType") Integer taskType);

    AjaxResult pushToIntelligentProject(List<TmTask> tmTasks);
}
