package com.bonus.material.lease.service;

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

import com.bonus.common.biz.domain.lease.LeaseOutDetails;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.material.basic.domain.BmQrcodeInfo;
import com.bonus.material.lease.domain.LeaseApplyDetails;
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
import com.bonus.common.biz.domain.lease.LeaseOutRequestVo;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletResponse;

/**
 * 领料任务Service接口
 *
 * @author xsheng
 * @date 2024-10-16
 */
public interface ILeaseApplyInfoService {

    /**
     * 查询领料任务
     *
     * @param id 领料任务主键
     * @param keyword keyword 关键字
     * @param publishTask 发布批次
     * @return 领料任务
     */
    LeaseApplyRequestVo selectLeaseApplyInfoById(Long id, String keyword, String publishTask);

    /**
     * 查询领料任务列表
     *
     * @param leaseApplyInfo 领料任务
     * @return 领料任务集合
     */
    List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo);

    /**
     * 材料员确认service

     * @return
     */
    int confirmLeaseTask(LeaseApplyDetails details);


    /**
     * 查询已完成出库任务
     *
     * @param leaseApplyInfo 领料任务
     * @return 领料任务集合
     */
    List<LeaseApplyInfo> getCompleteOutTaskList(LeaseApplyInfo leaseApplyInfo);


    /**
     * 新增领料任务
     *
     * @param leaseApplyRequestVo 领料任务
     * @return 结果
     */
    AjaxResult insertLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo);

    /**
     * 发布任务
     */
    AjaxResult publish(LeaseApplyInfo leaseApplyInfo);

    /**
     * 修改领料任务
     *
     * @param leaseApplyRequestVo 领料任务
     * @return 结果
     */
    boolean updateLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo);

    /**
     * 领料任务电子签名
     */
    int updateLeaseApplyInfoSign(LeaseApplyInfo leaseApplyInfo);

    /**
     * 领料：出库
     *
     * @param leaseOutRequestVo 领料：出库
     * @return 结果
     */
    AjaxResult leaseOut(LeaseOutRequestVo leaseOutRequestVo);


    /**
     * 批量删除领料任务
     *
     * @param ids 需要删除的领料任务主键集合
     * @return 结果
     */
    int deleteLeaseApplyInfoByIds(Long[] ids);

    /**
     * 删除领料任务信息
     *
     * @param id 领料任务主键
     * @return 结果
     */
    int deleteLeaseApplyInfoById(Long id);

    /**
     * 领料任务详情
     * @param leaseApplyInfo
     * @return
     */
    List<LeaseApplyDetails> selectLeaseApplyDetailsList(LeaseApplyInfo leaseApplyInfo);

    /**
     * 根据qrcode查询在库机具信息
     * @param bmQrcodeInfo
     * @return
     */
    AjaxResult getInfoByQrcode(BmQrcodeInfo bmQrcodeInfo);

    /**
     * 获取领料任务详情
     * @param leaseApplyInfo
     * @return
     */
    LeaseApplyRequestVo getInfo(LeaseApplyInfo leaseApplyInfo);

    /**
     * 导出领料出库详细
     * @param leaseApplyInfo
     * @param leaseApplyRequestVo
     * @param response
     */
    void exportInfo(LeaseApplyInfo leaseApplyInfo, LeaseApplyRequestVo leaseApplyRequestVo, HttpServletResponse response);

    /**
     * 根据id查询内部领料任务详情
     * @param leaseApplyDetails
     * @return
     */
    LeaseApplyDetails getInnerById(LeaseApplyDetails leaseApplyDetails);

    /**
     * 根据id查询领料任务详情
     * @param leaseApplyDetails
     * @return
     */
    List<LeaseApplyDetails> getDetailsById(LeaseApplyDetails leaseApplyDetails);

    /**
     * 领料任务出库回退
     * @param leaseOutDetails
     * @return
     */
    AjaxResult leaseOutBack(LeaseOutDetails leaseOutDetails);

    /**
     * 领用任务批量审核
     * @param leaseApplyInfo
     * @return
     */
    AjaxResult useExamine(LeaseApplyInfo leaseApplyInfo);


    /**
     * 信息采集领料出库
     * @param leaseOutRequestVo
     * @return
     */
    AjaxResult leaseOutByInfo(LeaseOutRequestVo leaseOutRequestVo);

    List<LeaseApplyDetails> selectLeaseApplyInfoByIdTwo(LeaseApplyInfo bean);

    LeaseApplyRequestVo getLeaseRequestVo(LeaseApplyDetails bean);

    List<LeaseApplyInfo> getConfirmTaskList(LeaseApplyInfo leaseApplyInfo);

    /**
     * 统计时间段出库总数量
     * @param leaseApplyInfo
     * @return
     */
    LeaseApplyInfo getOutNum(LeaseApplyInfo leaseApplyInfo);

    /**
     * 修改领料任务数量
     * @param leaseApplyDetails
     * @return
     */
    AjaxResult updateLeaseNum(LeaseApplyDetails leaseApplyDetails);

    /**
     * 获取领料出库详细信息
     * @param bean
     * @return
     */
    List<LeaseApplyDetails> getOutInfo(LeaseApplyInfo bean);
}
