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

import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPartContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsOutContext;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
import cn.estsh.i3plus.pojo.mes.bean.MesQueueOrderPush;
import cn.estsh.i3plus.pojo.mes.bean.MesQueueOrderPushCellCfg;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrder;
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
import io.swagger.annotations.ApiOperation;

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

public interface IMesQueueOrderPushService {

    @ApiOperation(value = "根据生产线代码,工位代码查询生产队列推送工位配置信息")
    List<MesQueueOrderPushCellCfg> getQueueOrderPushCellCfgList(String organizeCode, String workCenterCode, String workCellCode);

    @ApiOperation(value = "根据生产线代码查询生产队列推送工位配置信息")
    List<MesQueueOrderPushCellCfg> getQueueOrderPushCellCfgList(String organizeCode, String workCenterCode);

    //递增步长10,取整10位; 例如:查询=10 >> 返回=20 ;  查询=29 >> 返回=30
    @ApiOperation(value = "获取当前生产线推单代码中最大的顺序号")
    Integer getQueueOrderPushMaxSeq(String organizeCode, MesQueueOrderPushCellCfg queueOrderPushCellCfg);

    @ApiOperation(value = "根据条件顺序号查询上一个顺序号,返回加一")
    Integer getQueueOrderPushCalcSeq(String organizeCode, MesQueueOrderPushCellCfg queueOrderPushCellCfg, Integer processSeqUp);

    @ApiOperation(value = "写入工位工单推送信息")
    void insertQueueOrderPush(String organizeCode, String userInfo, List<MesQueueOrderPushCellCfg> queueOrderPushCellCfgList,
                              MesProductionPsOutContext productionPsOutContext, MesProductionPartContext productionPartContext);

    @ApiOperation(value = "写入工位工单推送信息")
    void insertQueueOrderPush(StationRequestBean reqBean, MesWorkOrder workOrder, MesQueueOrderPushCellCfg queueOrderPushCellCfg, String processSeqUp);

    @ApiOperation(value = "根据ID查询生产队列工位推送信息")
    MesQueueOrderPush getQueueOrderPush(String organizeCode, Long id);

    @ApiOperation(value = "根据配置查询创建状态的生产队列工位推送信息")
    List<MesQueueOrderPush> getQueueOrderPushList(String organizeCode, List<MesQueueOrderPushCellCfg> queueOrderPushCellCfgList);

    @ApiOperation(value = "根据配置查询生产队列工位推送信息")
    List<MesQueueOrderPush> getQueueOrderPushListByStatus(String organizeCode, List<MesQueueOrderPushCellCfg> queueOrderPushCellCfgList, Integer ascOrDesc, Integer... queueStatusArr);

    @ApiOperation(value = "根据分页条件查询生产队列工位推送信息")
    ListPager<MesQueueOrderPush> queryQueueOrderPushListPager(Map<String, String> paramMap, List<String> pushSourceCodeList, Pager pager);

    @ApiOperation(value = "根据条件修改生产队列工位推送信息状态")
    void saveQueueOrderPushStatusByDdlPackBean(DdlPackBean packBean, String userInfo, Integer queueStatus, String targerWorkCellCode);

    @ApiOperation(value = "根据条件修改生产队列工位推送信息")
    void saveQueueOrderPushByCondition(String[] conditionName, Object[] conditionValue, String[] propertyName, Object[] propertyValue);

}
