package com.hzs.scm.po.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.scm.po.PoOrder;
import com.hzs.common.domain.scm.po.ext.PoOrderExt;
import com.hzs.common.domain.scm.purchase.ext.IcPurchaseInBExt;
import com.hzs.scm.po.param.PoOrderItemsParam;
import com.hzs.scm.po.param.PoOrderParam;
import com.hzs.scm.pub.param.ScmApproveParam;
import com.hzs.system.sys.dto.ApprovalBusinessResultDTO;
import com.hzs.system.sys.dto.LoginUser;

import java.util.List;

/**
 * <p>
 * 采购订单表头 服务类
 * </p>
 *
 * @author hzs
 * @since 2023-11-17
 */
public interface IPoOrderService extends IService<PoOrder> {

    /*
     * @description: 保存采购订单
     * @author: sui q
     * @date: 2023/11/20 15:54
     * @param: null null
     **/
    void insertSavePoOrderByOrderParam(PoOrderParam poOrderParam, Long pkMember);

    /*
     * @description: 修改保存采购订单
     * @author: sui q
     * @date: 2023/11/21 11:51
     * @param: null null
     **/
    void updatePorOrderByOrderParam(PoOrderExt poOrderExt, PoOrderParam poOrderParam, Long pkMember);

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

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

    /*
     * @description: 根据查询条件查询采购订单
     * @author: sui q
     * @date: 2023/11/21 15:01
     * @param: null null
     **/
    List<PoOrderExt> queryPoOrderByCondition(PoOrderParam poOrderParam);

    /*
     * @description: 删除采购订单
     * @author: sui q
     * @date: 2023/11/21 14:54
     * @param: null null
     **/
    void deletePoOrder(Long pkOrder, Long pkMember);

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

    /*
     * @description: 查询待入库的采购订单,第一条带明细表，其他的没有明细表
     * @author: sui q
     * @date: 2023/11/23 13:53
     * @param: null null
     **/
    List<PoOrderExt> queryPoOrderToStoreByCondition(PoOrderParam poOrderParam);

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