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

import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesWorkOrderExtModel;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.mes.bean.*;
import io.swagger.annotations.ApiOperation;

import java.util.List;

/**
 * @Description :
 * @Reference :
 * @Author :
 * @CreateDate : 2024-04-26 15:37
 * @Modify:
 **/
public interface IMesWorkOrderService {
    @ApiOperation(value = "查询工单")
    MesWorkOrder queryMesWorkOrder(MesWorkOrder workOrder);

    @ApiOperation(value = "查询工单")
    MesWorkOrder findMesWorkOrderList(String organizeCode,String workOrderNo);

    @ApiOperation(value = "查询工单")
    List<MesWorkOrder> queryMesWorkOrderList(MesWorkOrder workOrder);

    @ApiOperation(value = "查询工单")
    ListPager<MesWorkOrder> queryMesWorkOrderListByPager(MesWorkOrder workOrder, Pager pager);

    /**
     * 获取未报工
     * @param organizeCode
     * @return
     */
    List<MesProductionRecord> getUnReportMesProduceSn(String organizeCode);

    List<MesProductionRecord> getPreDayReportMesProductionRecord(String organizeCode , List<MesShift> mesShiftList, String  workCenterCode);

    @ApiOperation("新增工单")
    MesWorkOrder insertMesWorkOrder(List<MesProductionRecord> mesProductionRecordList,List<MesShift> mesShiftList,String organizeCode, String userName );

    @ApiOperation(value = "根据前一天待报工记录数插入工单并报工JOB(工单报工)")
    void doPcnJobProductReport(List<MesProductionRecord> mesProductionRecordList,List<MesShift> mesShiftList,String organizeCode, String userName, MesWorkOrder mesWorkOrder);

    @ApiOperation("非排序报工JOB-处理无工单")
    void doProductReportByRecord(MesProductionRecord productionRecord, String organizeCode, String userName);

    @ApiOperation("非排序报工JOB-处理有工单")
    void doProductHasOrderReportByRecord(MesProductionRecord productionRecord, String organizeCode, String userName);

    /**
     * 获取未报工
     * @param organizeCode
     * @return
     */
    List<MesProductionRecord> getUnReportHasOrderMesProduceSn(String organizeCode);

    @ApiOperation(value = "生产报工")
    void doProductReport(MesWorkOrderExtModel mesWorkOrder, String userName);

    @ApiOperation(value = "报工调整")
    void doProductReportReversal(MesWorkOrder mesWorkOrder,MesProductVersion mesProductVersion,String userName);

    @ApiOperation("排序汇报job")
    void doMesWorkOrderSortReport(String organizeCode, Integer pageSize, String userName);

    @ApiOperation("非排序汇报job")
    void doMesWorkOrderNoSortReport(String organizeCode, Integer pageSize, String userName);

    @ApiOperation("根据工单查询工单零件信息")
    List<MesWorkOrderPart> findMesWorkOrderPartByOrderNo(String organizeCode,List<String> workOrderNoList);

    @ApiOperation("根据客户条码查询工单信息")
    MesWorkOrder getWorkOrderNoByCustSn(String organizeCode,String custSn);

    @ApiOperation("根据客户条码查询工单信息")
    MesWorkOrder getWorkOrderNoByWorkOrderNo(String organizeCode,String workOrderNo);
}
