package com.hzs.scm.trans.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.scm.trans.TransferOrder;
import com.hzs.common.domain.scm.trans.ext.IcTransInBExt;
import com.hzs.common.domain.scm.trans.ext.IcTransOutBExt;
import com.hzs.common.domain.scm.trans.ext.TransferOrderExt;
import com.hzs.scm.pub.param.ScmApproveParam;
import com.hzs.scm.trans.param.TransferItemParam;
import com.hzs.scm.trans.param.TransferParam;
import com.hzs.system.sys.dto.ApprovalBusinessResultDTO;
import com.hzs.system.sys.dto.LoginUser;

import java.util.List;

/**
 * <p>
 * 调拨订单表头 服务类
 * </p>
 *
 * @author hzs
 * @since 2023-12-04
 */
public interface ITransferOrderService extends IService<TransferOrder> {

    /*
     * @description: 保存调拨订单
     * @author: sui q
     * @date: 2023/11/20 15:54
     * @param: null null
     **/
    void insertSaveTransferOrderByOrderParam(TransferParam transferParam, Long pkMember);

    /*
     * @description: 修改保存调拨订单
     * @author: sui q
     * @date: 2023/11/21 11:51
     * @param: null null
     **/
    void updateTransferOrderByOrderParam(TransferOrderExt transferOrderExt, TransferParam transferParam, Long pkMember);

    /*
     * @description: 根据订单主键查询调拨订单
     * @author: sui q
     * @date: 2023/11/21 10:47
     * @param: null null
     **/
    TransferOrderExt queryTransferOrderById(Long pkOrder, Integer orderStatus);

    /*
     * @description: 查询签呈显示的调拨订单
     * @author: sui q
     * @date: 2023/11/28 15:00
     * @param: null null
     **/
    TransferOrderExt queryDisTransferOrderById(Long pkOrder, Integer orderStatus);

    /*
     * @description: 根据查询条件查询调拨订单
     * @author: sui q
     * @date: 2023/11/21 15:01
     * @param: null null
     **/
    List<TransferOrderExt> queryTransferOrderByCondition(TransferParam transferParam);

    /*
     * @description: 删除调拨订单
     * @author: sui q
     * @date: 2023/11/21 14:54
     * @param: null null
     **/
    void deleteTransferOrder(Long pkTransfer, Long pkMember);

    /*
     * @description: 参照生成采购入库单，可能存在多个调拨订单生成一个入库单，支持1对多 多对1
     * @author: sui q
     * @date: 2023/11/21 17:47
     * @param: null null
     **/
    List<TransferOrderExt> queryTransferOrderByOrderItems(List<TransferItemParam> orderItemsParamList);

    /*
     * @description: 查询待入库的调拨订单,第一条带明细表，其他的没有明细表
     * @author: sui q
     * @date: 2023/11/23 13:53
     * @param: null null
     **/
    List<TransferOrderExt> queryTransferOrderToStoreByCondition(TransferParam transferParam);

    /*
     * @description: 根据入库数量更新累计入库数量
     * @author: sui q
     * @date: 2023/11/25 17:23
     * @param: null null
     **/
    void updateTransferOrderItemsTotalInNum(List<IcTransInBExt> transferInbList, Long pkMember);

    /*
     * @description: 根据入库数量更新累计入库数量
     * @author: sui q
     * @date: 2023/11/25 17:23
     * @param: null null
     **/
    void updateTransferOrderItemsTotalOutNum(List<IcTransOutBExt> transferOutbList, Long pkMember);
}
