package com.shkj.wms.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.shkj.common.core.domain.Result;
import com.shkj.wms.bo.*;
import com.shkj.wms.domain.BaseBarcodesIn;
import com.shkj.wms.domain.BaseBarcodesOut;
import com.shkj.wms.domain.BusinDataTask;
import com.shkj.wms.domain.BusinDataTaskGoods;
import com.shkj.wms.vo.*;

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

/**
 * 任务管理Service接口
 *
 * @author zjx
 * @date 2023-04-07
 */
public interface IBusinDataTaskService extends IService<BusinDataTask> {


    Result<Boolean> insertBusinTask(BaseBarcodesIn baseBarcodesIn, String taskCode) ;

    Result<Boolean>  insertBusinTask(BaseContainerCallBo pointNo);

    Result<Boolean> insertBusinTask(BusinDataTask businDataTask);

    Result<Boolean> insertBusinTask(List<BaseBarcodesOutAddBo> baseBarcodesOutList);

    /**
     * 紧急出库-确认出库方式2
     * @param baseGoodsDervieBos
     * @return
     */
    Result<Boolean> insertBusinTaskByDervie(List<BaseGoodsDervieBo> baseGoodsDervieBos);

    /**
     * 指定货位出库
     * @param locationCode
     * @return
     */
    Result<Boolean>  insertBusinTask(String  locationCode);

    /**
     *人工入库点位
     */
    Result<BasePointDeviceVo>  getManualWarehousingPoint();


    /**
     *新增入库条码信息
     */

    Result<Boolean> insertByAddBo(BusinTaskAddBo bo);

    /**
     * 补货治具出库
     */
    Result<Boolean> getReplenishmentAndOutbound(BusinOutboundQueryBo bo);

    Long insertBusinDataTask(BusinDataTask businDataTask);

    BusinDataTask getBusinDataTaskByQrCode(String qrCode);

    BusinDataTask getBusinDataTaskByTraverseDate(Date traverseDate);


    List<BusinDataTaskVo> selectBusinDataTask(BusinTaskQueryBo bo);
    List<BusinDataTaskVo> selectBusinDataTask1(BusinTaskQueryBo bo);
    List<BusinDataTaskVo> selectOutBusinDataTask(BusinTaskQueryBo bo);

    /**
     * 出库分配库位信息
     * */
    BusinTaskExeBo outboundInfo(List<BusinDataTaskGoodsVo> goods,String id);


    /**
     * 查询待出库的出库单据
     */
    List<BusinDataTaskOutVo> selectOutBoundDataTask(String goods);

    /**
     * 任务管理页面查询列表数据
     * @param bo
     * @return
     */
    List<BusinDataTaskManageVo> selectTaskManagement(BusinTaskManageQueryBo bo);

    /**
     * 取消任务
     * @param bo
     * @return
     */
    Result<Boolean> cancelTask(BusinTaskManageDistributeBo bo);

    /**
     * 重新下发任务
     * @param bo
     * @return
     */
    Result<Boolean> reissueTask(BusinTaskManageDistributeBo bo);

    /**
     * 立即下发任务
     * @param bo
     * @return
     */
    Result<Boolean> instantlyTask(BusinTaskManageDistributeBo bo);

    /**
     * 提升优先级
     * @param bo
     * @return
     */
    Result<Boolean> elevatePriorityTask(BusinTaskManageDistributeBo bo);
    Result<Boolean> pauseTask(BusinTaskManageDistributeBo bo);
    Result<Boolean> activeTask(BusinTaskManageDistributeBo bo);

    List<BusinDataTask> queryinTask();

    /**
     * 批量更新任务信息
     * @param businDataTasks
     * @return
     */
    Boolean updateBatchById(List<BusinDataTask> businDataTasks);

    /**
     * 呼叫AGV数量
     * @return
     */
    Integer callContainerCount();

    Result goAbnormal(Map map);

    /**
     * 获取紧急出库的物料明细
     * @return
     */
    List<BusinDataTaskGoodsVo> getEmergencyOutboundDtl();

    /**
     * 紧急出库到达接驳口时，确认按钮
     * @param bo
     * @return
     */
    Result<Boolean> confirmEmergencyOutboundDtl(EmergencyOutboundAddBo bo);


    /**
     * 出库放货:呼叫空治具
     */
    Result CallAirFixture(String taskId);

    /**
     * 出库放货:呼叫agv
     */
    Result CallRcs(BaseDeriveTraverseVo baseDeriveTraverseVo);

    /**
     *
     */
    Result QueryBarCode(String qrCode);

    Result runReplenishIn(BusinDataTask businDataTask,String agvno);


    /**
     * 可视化大屏统计出入任务数量
     * @param
     * @return
     */
      List<DataScreeTaskqtyVo> getCurDateTaskQty();


    /**
     * 创建移库申请任务
     * @param bo
     * @return
     */
    Result<Boolean> addMoveTask(BusinStockMoveDAddBo bo);

}
