package com.foreverwin.mesnac.dispatch.service;

import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.dispatch.dto.IssueItemDto;
import com.foreverwin.mesnac.dispatch.model.CallItem;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Leon.L
 * @since 2021-06-30
 */
public interface CallItemService extends IService<CallItem> {

    /**
     * 派工叫料数据
     *
     * @param site
     * @param user
     * @param sfcDispatchList
     */
    void sfcDispatchCallItem(String site, String user, List<SfcDispatchDto> sfcDispatchList);

    /**
     * 查询已经生效的叫料明细(非新建和取消状态)
     *
     * @param sfcDispatchBo
     * @return
     */
    List<CallItem> getEffectedCallItemByDispatchBo(String sfcDispatchBo);

    /**
     * 生产叫料查询
     *
     * @param paramMap
     */
    List<CallItem> findCallItemList(Map paramMap);

    /**
     * 叫料明细查询
     *
     * @param callItem
     * @return
     */
    List<CallItem> findCallItemDetailList(CallItem callItem);


    /**
     * 叫料明细查询
     *
     * @param site
     * @param dispatchBoList
     * @return
     */
    List<CallItem> findCallItemDetailListByDispatchBo(String site, List<String> dispatchBoList);

    /**
     * 生产叫料PDA
     *
     * @param callItem
     * @return
     */
    List<CallItem> findCallItemListPda(CallItem callItem);


    /**
     * 叫料
     *
     * @param site
     * @param user
     * @param callItemList
     */
    void callItem(String site, String user, List<CallItem> callItemList);

    /**
     * 叫料PDA
     */
    void callOrConfirmItemPda(Map<String,Object> map);

    /**
     *  确认到料
     *  ----需要校验叫料明细行中不允许存在叫料类型为材料，且组件物料类型为原材料的行
     *
     * @param site
     * @param user
     * @param callItemList
     */
    void confirmReceive(String site, String user, List<CallItem> callItemList);

    /**
     * 取消叫料
     *
     * @param site
     * @param user
     * @param callItemNoList
     */
    void cancelCallItem(String site, String user, List<CallItem> callItemNoList);

    /**
     * 刷新叫料明细
     *
     * @param site
     * @param user
     * @param callItemList
     */
    void refreshCallItem(String site, String user, List<CallItem> callItemList);

    /**
     * 刷新叫料明细PDA
     * @param callItemList
     */
    void refreshCallItemPda(List<CallItem> callItemList);

    /**
     * 刷新需求时间
     *
     * @param site
     * @param user
     * @param callItemNoList
     */
    void refreshRequiredTime(String site, String user, List<String> callItemNoList);

    /**
     * 更新叫料单状态
     *
     * @param user
     * @param status
     * @param list
     */
    void updateCallItemStatusByDispatchBo(String status, String user, List<String> list);

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /**
     * 查询发料匹配的叫料数据
     *
     * @param site
     * @param workOrder
     * @param item
     * @param blankingSize
     * @param resource
     * @return
     */
    List<CallItem> findIssueMatchCallItemList(String site, String workOrder, String blankingSize, String resource, String item);

    /**
     * 查询发料组件清单
     *
     * @param issueItemDto
     * @return
     */
    List<CallItem> findIssueItemList(IssueItemDto issueItemDto);

    /**
     * 查询发料组件清单
     *
     * @param issueItemDto
     * @return
     */
    List<CallItem> findIssueItemListPda(IssueItemDto issueItemDto);




}