package com.sw.mes.fb.turnstore.service;

import com.sw.mes.core.base.BaseService;
import com.sw.mes.core.dto.TurnstoreTrayPostDto;
import com.sw.mes.core.response.Result;
import com.sw.mes.fb.turnstore.dto.FbTurnstoreTrayPostDto;
import com.sw.mes.fb.turnstore.entity.RawMaterialReceiving;
import com.sw.mes.fb.turnstore.entity.RawMaterialReceivingDetail;

import java.util.List;

/**
 * @Author
 * @Description：
 * @Date:
 * @Modified By:
 */
public interface RawMaterialReceivingService extends BaseService<RawMaterialReceiving> {

    /**
     * 保存原料
     *
     * @param trayPostDto
     */
    void saveRawMaterial(TurnstoreTrayPostDto trayPostDto);

    void saveFbRawMaterial(FbTurnstoreTrayPostDto trayPostDto);

    /**
     * 更新详情
     *
     * @param receivingDetailList
     */
    void saveDetailDto(List<RawMaterialReceivingDetail> receivingDetailList,String hasGone);

    TurnstoreTrayPostDto initTurnstoreTrayPostDto(RawMaterialReceiving entity, List<RawMaterialReceivingDetail> receivingDetailList);

    void updateFbTrayState(RawMaterialReceiving entity, List<RawMaterialReceivingDetail> receivingDetailList);

    Result<String> cancelState(String trayNo, String user);

    RawMaterialReceiving findByTrayNo(String trayNo);

    RawMaterialReceiving findByTrayNoAndState(String trayNo, int state);
}
