package cn.estsh.i3plus.ext.mes.pcn.api.base;

import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesJobBookingPart;
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesPackageExt;
import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesWorkOrderExt;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.mes.bean.MesBom;

import java.util.List;

/**
 * @author yumingxing
 * @version 1.0
 * @date 2021/2/26 14:24
 **/
public interface IJobBookingService {

    MesWorkOrderExt queryDefaultWorkOrder(String workCenterCode, String organizeCode);

    /**
     * 根据产线查询出为启动状态工单类型为返工工单,且seq最大的工单信息
     *
     * @param workCenterCode 工作中心代码
     * @return {@link MesWorkOrderExt}
     */
    ListPager<MesWorkOrderExt> queryWorkOrder(String workCenterCode, String organizeCode, String workOrderStatus, String partNo, String startTime, String endTime, Pager pager);

    /**
     * 查询包装内容
     *
     * @param workCenterCode 工作中心代码
     * @param cnNo           容器编号
     * @return {@link MesPackageExt}
     */
    MesPackageExt queryContainerInfo(String workCenterCode, String cnNo, String partNo, String organizeCode);


    /**
     * 确认按钮
     *
     * @return int
     */
    void insertContainerJobBooking(MesPackageExt mesPackage);


    List<MesBom> queryPartBom(String partNo, String organizeCode);


    MesJobBookingPart insertJobBookingPart(MesJobBookingPart detail);


    void deleteJobBookingPart(long id);

    List<MesJobBookingPart> queryJobBookingPart(MesJobBookingPart detail);

    void updateContainer(String workCenterCode, String ctNo, String partNo, String organizeCode);

    void doMesWorkOver(List<MesJobBookingPart> jobBookingParts, String userName, String organizeCode);


}
