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

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

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Author
 * @Description：
 * @Date:
 * @Modified By:
 */
public interface FbTurnstoreTrayItemService extends BaseService<FbTurnstoreTrayItem> {
    List<FbTurnstoreTrayItem> getItemsByTrayId(Integer trayId);


    List<FbTurnstoreTrayItem> getItemsByAllTrayId(List<Integer> trayIdList);

    /**
     * 根据单晶编号查询
     *
     * @param crystalNo
     * @return
     */
    FbTurnstoreTrayItem findBySectionNo(String crystalNo);

    FbTurnstoreTrayItem findBySectionNo1(String crystalNo);

    FbTurnstoreTrayItem findBySectionNo2(String crystalNo);

    /**
     * 根据单晶编号,状态查询
     *
     * @param crystalNo
     * @return
     */
    FbTurnstoreTrayItem findBySectionNoAndState(String crystalNo, int state);

    void exportExcel(HttpServletRequest request, HttpServletResponse resp);

    void exportExcel1(HttpServletRequest request, HttpServletResponse resp);

    void deleteByTrayId(Integer id);

    FbTurnstoreTrayPostDto cancelStock(Integer id);

    /**
     * 退料时更新组托数据
     *
     * @param sectionNoList 晶段编号列表
     */
    void updateTrayItemState(List<String> sectionNoList);

    FbTurnstoreTrayItem findByTrayNoAndSectionNo(String trayNo, String sectionNo);

    List<FbTurnstoreTrayItem> findBySectionNoValidate(String sectionNo);

    List<FbTurnstoreTrayItem> findBySectionNoValidateAll(String sectionNo);

    List<FbTurnstoreTrayItem> getData(String trayNos);

    List<FbTurnstoreTrayItem> findByTrayId(Integer id);

    public List<FbTurnstoreTrayItem> getItemsByTrayIdByOrder(Integer trayId);
    /**
     * 根据晶编号去检验数据库同步检验数据
     *
     * @param sectionNo
     * @return
     */
    int syncCheckData(String sectionNo);

    FbTurnstoreTrayItem findBySectionNo3(String crystalNo);

    FbTurnstoreTrayItem findBySectionNoAndReturnInspectionStatus(String sectionNo, int returnInspectionStatus);
}
