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

import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
import cn.estsh.i3plus.pojo.mes.model.StationKvBean;
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import io.swagger.annotations.ApiOperation;

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

/**
 * 获取生产过程上下文对象接口【BUSI】
 */
public interface IMesProductionCustomContextStepService {

    @ApiOperation(value = "验证上下文工位加工锁是否存在")
    Boolean checkProductionLockIsExistContext(StationRequestBean reqBean);

    @ApiOperation(value = "保存上下文加工锁")
    Boolean dispatchProductionLockContext(StationRequestBean reqBean, String value);

    @ApiOperation(value = "删除上下文加工锁")
    void removeProductionLockContext(StationRequestBean reqBean);

    @ApiOperation(value = "发送设备质量信息")
    void sendEquipQualityMessage(StationRequestBean reqBean, MesCellEquipContext cellEquipContext);

    @ApiOperation(value = "存储上个扫描/读取信息")
    Boolean dispatchLastScanContext(StationRequestBean reqBean, List<StationKvBean> dataList);

    @ApiOperation(value = "获取上个扫描/读取信息")
    List<StationKvBean> getLastScanContext(StationRequestBean reqBean);

    @ApiOperation(value = "发送工步内容")
    void sendStepContextMessage(StationRequestBean reqBean);

    @ApiOperation(value = "发送工步内容")
    void sendStepContextMessage(StationRequestBean reqBean, String scanInfo, MesExtEnumUtil.CELL_MESSAGE_SOURCE source);

    @ApiOperation(value = "发送工步内容")
    void sendStepContextMessage(StationRequestBean reqBean, List<StationKvBean> resultList);

    @ApiOperation(value = "获取上下文班次班组信息")
    List<StationKvBean> getProdShiftDataContext(String orgainzeCode, String workCenterCode);

    @ApiOperation(value = "验证上下文班次班组信息是否存在")
    Boolean checkProdShiftDataIsExistContext(String orgainzeCode, String workCenterCode);

    @ApiOperation(value = "保存上下文班次班组信息", notes = "[JSON]List<StationKvBean>")
    Boolean dispatchProdShiftDataContext(String orgainzeCode, String workCenterCode, List<StationKvBean> prodShiftDatList);

    @ApiOperation(value = "删除上下文班次班组信息")
    void removeProdShiftDataContext(String orgainzeCode, String workCenterCode);

    @ApiOperation(value = "获取上下文工位加工数统计信息")
    List<StationKvBean> getProductionStatisticsContext(StationRequestBean reqBean);

    @ApiOperation(value = "封装加工数信息")
    List<StationKvBean> getProductionStatisticsContext(MesProdShiftContext mesProdShiftKvBean, String countStr);

    @ApiOperation(value = "保存上下文工位加工数统计信息", notes = "[JSON]List<StationKvBean>")
    Boolean dispatchProductionStatisticsContext(StationRequestBean reqBean, List<StationKvBean> prodShiftDatList);

    @ApiOperation(value = "新增上下文工位加工数统计信息")
    Integer dispatchProductionStatisticsContext(StationRequestBean reqBean, int count, MesProdShiftContext mesProdShiftKvBean);

    @ApiOperation(value = "删除上下文工位加工数统计信息")
    void removeProductionStatisticsContext(StationRequestBean reqBean);

    @ApiOperation(value = "根据装配件信息获取可复用条码")
    String getRepeatAssemblySn(String organizeCode, String workCenterCode, String workCellCode, MesProductionAssemblyContext productionAssemblyContext);

    @ApiOperation(value = "根据装配件信息获取可复用条码")
    String getRepeatAssemblySn(String organizeCode, String workCenterCode, String workCellCode, String repeatKey);

    @ApiOperation(value = "根据设备代码获取可复用条码的个数")
    Integer getRepeatAssemblySnCount(String organizeCode, String workCenterCode, String workCellCode, String equipmentCode);

    @ApiOperation(value = "保存可复用条码到上下文")
    Boolean dispatchRepeatAssemblySn(String organizeCode, String workCenterCode, String workCellCode, MesProductionAssemblyContext productionAssemblyContext);

    @ApiOperation(value = "删除上下文可复用条码信息")
    void removeRepeatAssemblySn(StationRequestBean reqBean);

    @ApiOperation(value = "删除上下文可复用条码信息")
    void removeRepeatAssemblySn(String organizeCode, String workCenterCode, String workCellCode);

    @ApiOperation(value = "获取设备计数")
    Integer getShortCounter(StationRequestBean reqBean);

    @ApiOperation(value = "保存设备计数")
    void dispatchShortCounter(StationRequestBean reqBean, Integer shortCounter);

    @ApiOperation(value = "保存打包数据")
    Boolean dispatchPackageDataContext(StationRequestBean reqBean, Map<String, String> packageDataContextMap);

    @ApiOperation(value = "获取打包数据")
    Map<String, String> getPackageDataContext(StationRequestBean reqBean);

    @ApiOperation(value = "删除打包数据")
    void removePackageDataContext(StationRequestBean reqBean);

    @ApiOperation(value = "获取选择/扫描零件发运组信息上下文")
    List<StationKvBean> getFunctionChooseShippingGroupContext(StationRequestBean reqBean);

    @ApiOperation(value = "保存选择/扫描零件发运组信息上下文", notes = "[StationKvBean(key=shippingGroupCode, name=零件发运组代码, value=xxx, seq=0), StationKvBean(key=cellMessageSource, name=工位信息来源, value=10, seq=1)]")
    Boolean dispatchFunctionChooseShippingGroupContext(StationRequestBean reqBean, List<StationKvBean> resultList);

    @ApiOperation(value = "删除选择/扫描零件发运组信息上下文")
    void removeFunctionChooseShippingGroupContext(StationRequestBean reqBean);

    @ApiOperation(value = "获取排序线工单队列推送锁数据, 返回的值是工位代码")
    String getSortQueuePushLockContext(StationRequestBean reqBean, String queuePushId);

    @ApiOperation(value = "获取排序线工单队列推送锁数据, 返回的值是工单队列ID集合")
    List<String> getSortQueuePushLockContext(StationRequestBean reqBean);

    @ApiOperation(value = "保存排序线工单队列推送锁数据【保存LOCK信息:item=id,value=工位】【保存当前工位锁定的信息:item=工位,value=idList】")
    Boolean dispatchSortQueuePushLockContext(StationRequestBean reqBean, List<String> queuePushIdList);

    @ApiOperation(value = "删除排序线工单队列推送锁数据")
    void removeSortQueuePushLockContext(StationRequestBean reqBean, String queuePushId);

    @ApiOperation(value = "获取生产线维度的工单完成数上下文[查询]")
    MesWorkOrderCompleteQtyContext getWorkOrderCompleteQtyContext(StationRequestBean reqBean, MesProductionPartContext productionPartContext);

    @ApiOperation(value = "根据noCalcOrderQty判断维度处理工单完成数上下文[查询]")
    MesWorkOrderCompleteQtyContext dispatchWorkOrderCompleteQtyContext(StationRequestBean reqBean, Boolean noCalcOrderQty, MesProductionPartContext productionPartContext);

    @ApiOperation(value = "根据noCalcOrderQty判断维度处理处理工单完成数上下文[保存]")
    MesWorkOrderCompleteQtyContext dispatchWorkOrderCompleteQtyContext(StationRequestBean reqBean, Boolean noCalcOrderQty, String workOrderNo, Double calcCompleteQty);

}
