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

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder;
import io.swagger.annotations.ApiOperation;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public interface IMesWorkOrderExtService {

    @ApiOperation(value = "根据生产工单号集合 查询生产工单数据")
    List<MesWorkOrder> getWorkOrderList(String organizeCode, List<String> workOrderNoList);

    @ApiOperation(value = "根据生产工单ID查询生产工单信息")
    MesWorkOrder getWorkOrder(String organizeCode, Long id);

    @ApiOperation(value = "根据生产工单号查询生产工单信息")
    MesWorkOrder getWorkOrder(String organizeCode, String workOrderNo);

    @ApiOperation(value = "根据生产工单顺序号,生产线代码 查询上一个生产工单信息")
    MesWorkOrder getWorkOrder(String organizeCode, String workCenterCode, Long productSeq);

    @ApiOperation(value = "根据生产工单顺序号,生产线代码,零件号 查询上一个生产工单信息")
    MesWorkOrder getWorkOrderByPart(String organizeCode, String workCenterCode, Long productSeq, String partNo);

    @ApiOperation(value = "根据生产工单顺序号,生产线代码,零件号,需要排除的工单集合 查询上一个生产工单信息")
    MesWorkOrder getWorkOrderByPartAndOrderNo(String organizeCode, String workCenterCode, Long productSeq, String partNo, List<String> workOrderNoList);

    @ApiOperation(value = "根据生产工单顺序号,生产线代码, 零件生产组代码查询上一个生产工单信息【排序】")
    MesWorkOrder getWorkOrder(String organizeCode, String workCenterCode, Long productSeq, String partProdGroupCode);

    @ApiOperation(value = "根据生产线代码, 零件生产组代码查询生产工单信息【排序】")
    List<MesWorkOrder> getWorkOrderList(String organizeCode, String workCenterCode, String partProdGroupCode);

    MesWorkOrder insert(MesWorkOrder item);

    void update(MesWorkOrder item);

    @ApiOperation(value = "保存工单信息")
    void saveAll(List<MesWorkOrder> workOrderList);

    @ApiOperation(value = "根据生产工单ID查询生产工单信息")
    List<MesWorkOrder> getWorkOrderListByShiftCode(String organizeCode, String workCenterCode, String shiftCode);

    @ApiOperation(value = "根据条码集合 查询生产工单/产品条码(排序)")
    Map<String, Map<String, Object>> getWorkOrderMapSort(String organizeCode, List<String> snList);

    @ApiOperation(value = "根据条码集合 查询生产工单/产品条码/队列数据(排序)")
    Map<String, Map<String, Object>> getWorkOrderMapSort(String organizeCode, List<String> snList, MesWorkCell workCell);

    @ApiOperation(value = "根据工单或者客户条码 查询生产工单/产品条码(排序)")
    Map<String, Object> getWorkOrderMapSort(String organizeCode, String sn);

    @ApiOperation(value = "根据工单或者客户条码 查询生产工单/产品条码/队列数据(排序)")
    Map<String, Object> getWorkOrderMapSort(String organizeCode, String sn, MesWorkCell workCell);

    @ApiOperation(value = "根据工单或者客户条码 查询生产工单信息(排序)")
    BaseBean getWorkOrderSort(String organizeCode, String sn, Boolean isBackOrder);

    @ApiOperation(value = "根据工单更新工单状态")
    void updateMesWorkOrderOrderStatusShippingByWorkOrderNo(String organizeCode, List<String> workOrderNoList,String userName);

    @ApiOperation(value = "控制工单数量查询")
    Map<String, Double> getControlOrderQtyMap(String organizeCode, String workCenterCode, List<String> partNoList, String startTime, String endTime);

    @ApiOperation(value = "完成工单数量查询")
    Map<String, Double> getCompleteOrderQtyMap(String organizeCode, String workCenterCode, List<String> partNoList, String lotNo);
}
