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

import com.sw.mes.core.base.BaseService;
import com.sw.mes.core.entity.TurnstoreTrayItem;
import com.sw.mes.core.response.Result;
import com.sw.mes.yb.turnstore.dto.TurnstoreTrayItemDto;

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

/**
 * @Author
 * @Description：
 * @Date:
 * @Modified By:
 */
public interface TurnstoreTrayItemService extends BaseService<TurnstoreTrayItem> {
    List<TurnstoreTrayItem> getItemsByTrayNo(String trayNo);

    List<TurnstoreTrayItem> getItemsByTrayId(Integer trayId);


    // 获取圆棒物料卡的信息
    Result<List<TurnstoreTrayItemDto>> getTurnstoreTrayItemDto(Integer trayId);

    /**
     * 导出
     *
     * @param request
     * @param resp
     */
    void exportExcel(HttpServletRequest request, HttpServletResponse resp);

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

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

    /**
     * 根据组托主表ID删除
     *
     * @param id
     */
    void deleteByTrayId(Integer id);

    List<TurnstoreTrayItem> findItemsByTrayId(Integer id);

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

    TurnstoreTrayItem findByTrayNoAndSectionNo(String trayNo, String sectionNo);

    List<TurnstoreTrayItem> findBySectionNoValidate(String sectionNo);

    void updateOrderNoBySectionNo(String sectionNo, String orderNo);

    List<TurnstoreTrayItem> getData();

    void updateOrderNoById(Integer id, String orderNo);
}
