/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.youchain.businessdata.service;

import com.youchain.basicdata.domain.Area;
import com.youchain.basicdata.domain.BillType;
import com.youchain.businessdata.domain.PickTicket;
import com.youchain.businessdata.domain.TaskLog;
import com.youchain.businessdata.domain.XppRecord;
import com.youchain.businessdata.inputJson.IScanPut;
import com.youchain.businessdata.inputJson.buttenJson.PickTicketButton;
import com.youchain.businessdata.returnJson.RPPickList;
import com.youchain.businessdata.service.dto.PickTicketDto;
import com.youchain.businessdata.service.dto.PickTicketQueryCriteria;
import com.youchain.businessdata.service.dto.TaskLogDto;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;

import java.util.Map;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

/**
* @website https://eladmin.vip
* @description 服务接口
* @author JiangKun
* @date 2024-01-11
**/
public interface PickTicketService {

    /**
    * 查询数据分页
    * @param criteria 条件
    * @param pageable 分页参数
    * @return Map<String,Object>
    */
    Map<String,Object> queryAll(PickTicketQueryCriteria criteria, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<PickTicketDto>
    */
    List<PickTicketDto> queryAll(PickTicketQueryCriteria criteria);

    /**
     * 备货列表查询
     * @param t
     * @return
     */
    List<RPPickList> queryPickList(IScanPut t);

    /**
     * 根据ID查询
     * @param id ID
     * @return PickTicketDto
     */
    PickTicketDto findById(Long id);

    /**
     * 根据ID查询
     * @param id ID
     * @return PickTicketDto
     */
    PickTicket getEntity(Long id);

    /**
    * 创建
    * @param resources /
    * @return PickTicketDto
    */
    PickTicketDto create(PickTicket resources);

    /**
    * 编辑
    * @param resources /
    */
    void update(PickTicket resources);

    /**
    * 多选删除
    * @param ids /
    */
    void deleteAll(Long[] ids);

    /**
     * 删除出库单逻辑校验
     * @param ids
     */
    void deletePickTicket(Long[] ids);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws Exception /
    */
    void download(List<PickTicketDto> all, HttpServletResponse response) throws Exception, Exception;

    /***
     * 根据备货计划生成备货操作
     * @param bt
     * @param shArea
     * @param outArea
     * @param bpType
     * @param jhCode
     * @return
     */
    PickTicket storePick( BillType bt, Area shArea, Area outArea, String bpType, String jhCode);

    /**
     * 拣货操作
     */
    void pickingOperation(PickTicketButton pickTicketButton);

    /**
     * 查询已经完成的拣货操作的数据
     */
    List<TaskLog> queryTaskLogDataS(Long pickTicketId);
    /**
     * 拣货取消操作
     */
    void pickingCancel(PickTicketButton pickTicketButton);

    /**
     * 出库退回
     * @param taskLogId
     * @param area
     */
    void backPickOut(Long taskLogId, Area area);

    /**
     * 发货登记
     * @param pickTicketId
     */
    void shipmentRegistration(Long pickTicketId);

    /***
     * 单一拣货确认
     * @param taskId
     * @param stockCode
     * @param pickQty
     * @param xpp
     * @param bhr
     */
    void pickForTask(Long taskId, String stockCode, double pickQty, XppRecord xpp, String bhr);


    /**
     * 线边接收确认
     * @param ids
     */
    void xbjsVerify(Long[] ids);

}