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

import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyNosortContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblySortContext;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.mes.bean.*;
import io.swagger.annotations.ApiOperation;

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

public interface IMesAssemblyExtService {

    @ApiOperation(value = "【排序线】获取生产工单装配件绑定记录 -同时- 关联不可用规则 ; 判断是否剔除平行工位")
    List<MesProductionAssemblySortContext> getProductionAssemblySortContextList(MesProdRuleContext prodRuleContext, Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap, Boolean isFilterParallel);

    @ApiOperation(value = "【排序线】获取生产工单装配件绑定记录 [前道所有装配件] -同时- 关联不可用规则 ; 判断是否剔除平行工位 ; 判断是否根据工序顺序号过滤后道")
    List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap,
                                                                                        Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap, Boolean isFilterParallel, Boolean isFilterAfterCraft);

    @ApiOperation(value = "【排序线】获取生产工单装配件清单")
    List<MesWorkOrderAssembly> getWorkOrderAssemblyList(MesProdRuleContext prodRuleContext, Boolean isShowAll);

    @ApiOperation(value = "【排序线】获取生产工单装配件清单[前道所有装配件] 判断是否剔除平行工位 ; 判断是否过滤后道")
    List<MesWorkOrderAssembly> getWorkOrderAssemblyListPreCraft(MesProdRuleContext prodRuleContext, Boolean isParallel, Boolean isFilterAfterCraft);

    @ApiOperation(value = "获取装配件绑定记录【排序】")
    List<MesProductionAssembly> getProductionAssemblySortList(String organizeCode, String productSn);

    @ApiOperation(value = "获取装配件绑定记录")
    List<MesProductionAssembly> getProductionAssemblyList(String organizeCode, String assemblySn);

    @ApiOperation(value = "获取装配件规则且唯一绑定记录")
    List<MesProductionAssemblyUnique> getProductionAssemblyUniqueList(String organizeCode, String assemblySn);

    @ApiOperation(value = "根据零件条码或者加工单获取装配件规则且唯一绑定记录")
    List<MesProductionAssemblyUnique> getProductionAssemblyUniqueListByProductSn(String organizeCode, String productSn);

    @ApiOperation(value = "获取非排序装配件配置信息 -同时- 关联不可用规则")
    List<MesProductionAssemblyNosortContext> getProductionAssemblyNosortContextList(MesProdRuleContext prodRuleContext, Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap);

    @ApiOperation(value = "获取非排序装配件配置信息")
    List<MesAssemblyNosortCfg> getAssemblyNosortCfgList(String organizeCode, Long pid);

    @ApiOperation(value = "获取设备的装配件规则清单")
    List<MesAssemblyNosortCfg> getAssemblyNosortCfgList(String organizeCode, String equipmentCode);

    @ApiOperation(value = "获取设备的装配件规则清单 -同时- 关联不可用规则")
    List<MesProductionAssemblyNosortContext> getProductionAssemblyNosortContextList(String organizeCode, String equipmentCode, Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap);

    @ApiOperation(value = "获取不可用规则")
    String getProdRuleIgnoreCfg(Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap, Long id, String equipmentCode, String dataSorce);

    @ApiOperation(value = "【排序线】获取生产工单装配件清单")
    List<MesWorkOrderAssembly> getWorkOrderAssemblyList(String organizeCode, String workOrderNo, String productSn, String craftCode);

    @ApiOperation(value = "【排序线】获取生产工单装配件清单")
    List<MesWorkOrderAssembly> getWorkOrderAssemblyList(String organizeCode, String workCenterCode, String workCellCode, String workOrderNo, List<String> productSnList);

    @ApiOperation(value = "获取工单装配件记录")
    List<MesWorkOrderAssembly> getWorkOrderAssemblyList(String organizeCode, String workOrderNo);

    @ApiOperation(value = "根据条件修改装配件绑定记录的装配状态")
    void saveProductionAssemblyStatusByDdlPackBean(DdlPackBean packBean, String userInfo, Integer assemblyStatus);

    @ApiOperation(value = "根据条件修改装配件绑定唯一性记录的装配状态")
    void saveProductionAssemblyUniqueStatusByDdlPackBean(DdlPackBean packBean, String userInfo, Integer assemblyStatus);

    @ApiOperation(value = "根据条件修改工单装配件记录的装配状态")
    void saveWorkOrderAssemblyStatusByDdlPackBean(DdlPackBean packBean, String userInfo, Integer assemblyStatus);

    @ApiOperation(value = "根据ID查询工单装配件信息")
    MesWorkOrderAssembly getWorkOrderAssembly(String organizeCode, Long id);

}
