package com.jwipc.order.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jwipc.order.entity.PurchaseOrderDetail;
import com.jwipc.order.model.po.PurchaseOrderDetailPO;
import com.jwipc.order.model.query.PurchaseOrderDetailQuery;
import com.jwipc.order.model.query.PurchaseOrderDetailsQuery;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * 采购订单明细 服务类
 * </p>
 *
 * @author zhangjie
 * @since 2024-03-05
 */
public interface IPurchaseOrderDetailService extends IService<PurchaseOrderDetail> {

    List<PurchaseOrderDetailPO> findList(Page<PurchaseOrderDetailPO> page, PurchaseOrderDetailQuery wrapper);

    List<PurchaseOrderDetailPO> findDetails(Page<PurchaseOrderDetailPO> page, PurchaseOrderDetailsQuery wrapper);


    List<PurchaseOrderDetailPO> findListUnlockForDeliveryCreate(List<String> ids);

    List<PurchaseOrderDetailPO> findList(PurchaseOrderDetailQuery query);

    PurchaseOrderDetail findForMark(Set<Integer> poStatus, String orderCode, String orderRow);

    List<PurchaseOrderDetail> findForVerCount(String materialCode, Set<Integer> poStatus, String factoryCode);

    Long findCountForPage(PurchaseOrderDetailQuery query);

    /**
     * 查询采购订单明细数据
     * @param query
     * @return
     */
    List<PurchaseOrderDetail> getPurchaseOrderDetailListByList(List<PurchaseOrderDetail> query);

    List<PurchaseOrderDetail> findByMaterialCodeAndFactoryWithStatus(String materialCode, String factory, ArrayList<Integer> status, int delFlag,String type);
    /**
     * 查询模具产品关系表中的产品下单数量(按照物料编码分组合计的下单量)
     * @return
     */
    List<PurchaseOrderDetailPO> findNumByMaterialCodeList();
    List<PurchaseOrderDetailPO> findNumByMaterialCodeList1(String productCode);

    String getNewestForShortagePlan(String matnr, String werks);

    List<PurchaseOrderDetail> findBysupplierCodeAndFactoryCode(String supplierCode, String factoryCode,String orderCode);
}
