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.FbReturnReceiptDto;
import com.sw.mes.fb.turnstore.entity.RecheckInspectReceiveDetail;

import java.util.List;

/**
 * @Author
 * @Description：
 * @Date:
 * @Modified By:
 */
public interface RecheckInspectReceiveDetailService extends BaseService<RecheckInspectReceiveDetail> {
    /**
     * 正常退库
     *
     * @param receiptDto
     * @param crystalNoList
     * @return
     */
    Result normal(FbReturnReceiptDto receiptDto, String[] crystalNoList);

    /**
     * 冲销退库
     *
     * @param crystalNoList
     * @return
     */
    Result<String> writeOff(String[] crystalNoList, FbReturnReceiptDto receiptDto);

    /**
     * 根据晶段编号查询
     *
     * @param crystalNo
     * @return
     */
    RecheckInspectReceiveDetail findByCrystalNo(String crystalNo);

    /**
     * 根据晶段编号、状态查询
     *
     * @param crystalNo
     * @return
     */
    RecheckInspectReceiveDetail findByCrystalNoAndState(String crystalNo,Integer state);

    /**
     * 查询该编号或者母编号是否有退库记录
     *
     * @param sectionNo 单晶编号
     * @return 大于0则是有退过库
     */
    Integer isSprework(String sectionNo);

    /**
     * 根据退库复检id查询退库复检明细数据
     * @param id 退库复检id
     * @return 退库复检明细数据
     */
    List<RecheckInspectReceiveDetail> findByRecheckReceiveId(Integer id);
}
