Merge branch 'uat-temp-wj-chongqingdaqu-dev' into uat-temp-wj-chongqingdaqu-dev-craft-check

uat-temp-wj-chongqingdaqu-dev-craft-check
王杰 4 months ago
commit 3684f7bbf5

@ -15,14 +15,15 @@ public interface IMesAssemblyExtService {
@ApiOperation(value = "【排序线】获取生产工单装配件绑定记录 -同时- 关联不可用规则")
List<MesProductionAssemblySortContext> getProductionAssemblySortContextList(MesProdRuleContext prodRuleContext, Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap);
@ApiOperation(value = "【排序线】获取生产工单装配件绑定记录 [前道所有装配件] -同时- 关联不可用规则")
List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap);
@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> getWorkOrderAssemblyListAllCell(MesProdRuleContext prodRuleContext, List<MesWorkCell> workCellList);
@ApiOperation(value = "【排序线】获取生产工单装配件清单[前道所有装配件] 判断是否剔除平行工位 ; 判断是否过滤后道")
List<MesWorkOrderAssembly> getWorkOrderAssemblyListPreCraft(MesProdRuleContext prodRuleContext, Boolean isParallel, Boolean isFilterAfterCraft);
@ApiOperation(value = "获取装配件绑定记录【排序】")
List<MesProductionAssembly> getProductionAssemblySortList(String organizeCode, String productSn);

@ -35,7 +35,8 @@ public interface IMesProdRuleCfgExtService {
@ApiOperation(value = "【排序线】获取产品加工规则(条码对应的装配件绑定记录,目前条码等同工单) -同时- 关联不可用规则")
MesProdRuleContext getProdRuleSortContext(MesProdRuleContext prodRuleContext, Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap);
@ApiOperation(value = "【排序线】获取产品加工规则 [前道所有装配件] -同时- 关联不可用规则")
MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap);
@ApiOperation(value = "【排序线】获取产品加工规则 [前道所有装配件] -同时- 关联不可用规则; 判断是否剔除平行工位 ; 判断是否根据工序顺序号过滤后道")
MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap,
Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap, Boolean isFilterParallel, Boolean isFilterAfterCraft);
}

@ -25,10 +25,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@ -89,9 +86,9 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
return productionAssemblySortContextList;
}
//【排序线】获取生产工单装配件绑定记录 [前道所有装配件,无爆炸图与音频文件逻辑] -同时- 关联不可用规则
//【排序线】获取生产工单装配件绑定记录 [前道所有装配件,无爆炸图与音频文件逻辑] -同时- 关联不可用规则 ; 判断是否剔除平行工位 ; 判断是否根据工序顺序号过滤后道
@Override
public List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap) {
public List<MesProductionAssemblySortContext> getProductionAssemblySortPreCraftContextList(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap, Boolean isFilterParallel, Boolean isFilterAfterCraft) {
if (null == prodRuleContext) return null;
@ -99,7 +96,7 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
StringUtils.isEmpty(prodRuleContext.getWorkCellCode()) || StringUtils.isEmpty(prodRuleContext.getProcessCode()) || StringUtils.isEmpty(prodRuleContext.getProductSn())) return null;
//【排序线】获取生产工单装配件清单 [前道所有装配件]
List<MesWorkOrderAssembly> workOrderAssemblyList = getWorkOrderAssemblyListAllCell(prodRuleContext, new ArrayList<>(workCellMap.values()));
List<MesWorkOrderAssembly> workOrderAssemblyList = getWorkOrderAssemblyListPreCraft(prodRuleContext, isFilterParallel, isFilterAfterCraft);
if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null;
@ -150,18 +147,33 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
}
//【排序线】获取生产工单装配件清单[前道所有装配件]
//【排序线】获取生产工单装配件清单[前道所有装配件] 判断是否剔除平行工位 ; 判断是否过滤后道
@Override
public List<MesWorkOrderAssembly> getWorkOrderAssemblyListAllCell(MesProdRuleContext prodRuleContext, List<MesWorkCell> workCellList) {
public List<MesWorkOrderAssembly> getWorkOrderAssemblyListPreCraft(MesProdRuleContext prodRuleContext, Boolean isFilterParallel, Boolean isFilterAfterCraft) {
//【排序线】获取生产工单装配件清单
List<MesWorkOrderAssembly> workOrderAssemblyList = getWorkOrderAssemblyList(prodRuleContext, true);
if (CollectionUtils.isEmpty(workOrderAssemblyList)) return workOrderAssemblyList;
//判断是否存在其他末道工位[可能存在平行工位]
List<String> workCellList2End = workCellList.stream().filter(o -> (null != o
&& o.getIsEndWorkCell().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0
&& !o.getWorkCellCode().equals(prodRuleContext.getWorkCellCode()))).map(MesWorkCell::getWorkCellCode).collect(Collectors.toList());
if (CollectionUtils.isEmpty(workCellList2End)) return workOrderAssemblyList;
return workOrderAssemblyList.stream().filter(o -> (null != o && !workCellList2End.contains(o.getWorkCellCode()))).collect(Collectors.toList());
//获取当前工位的第一个装配件的工艺顺序号
Optional<MesWorkOrderAssembly> optional = workOrderAssemblyList.stream().filter(o -> (null != o && prodRuleContext.getWorkCellCode().equals(o.getWorkCellCode()))).findFirst();
if ((null == optional || !optional.isPresent()) || StringUtils.isEmpty(optional.get().getProcessSeq())) return workOrderAssemblyList;
//平行工位, 需要剔除相同工艺顺序号的工位的装配件
if (isFilterParallel) {
workOrderAssemblyList = workOrderAssemblyList.stream().filter(o -> (null != o && (StringUtils.isEmpty(o.getProcessSeq()) ||
o.getProcessSeq().compareTo(optional.get().getProcessSeq()) != 0 || o.getWorkCellCode().equals(prodRuleContext.getWorkCellCode())))).collect(Collectors.toList());
}
if (CollectionUtils.isEmpty(workOrderAssemblyList)) return workOrderAssemblyList;
//根据工序顺序号过滤后道
if (isFilterAfterCraft) {
workOrderAssemblyList = workOrderAssemblyList.stream().filter(o -> (null != o &&
(StringUtils.isEmpty(o.getProcessSeq()) || o.getProcessSeq().compareTo(optional.get().getProcessSeq()) <= 0))).collect(Collectors.toList());
}
return workOrderAssemblyList;
}
//获取装配件绑定记录【排序】

@ -137,10 +137,10 @@ public class MesProdRuleCfgExtService implements IMesProdRuleCfgExtService {
return prodRuleContext.assemblyDataJson(assemblyExtService.getProductionAssemblySortContextList(prodRuleContext, prodRuleIgnoreCfgMap));
}
//【排序线】获取产品加工规则 [前道所有装配件] -同时- 关联不可用规则
//【排序线】获取产品加工规则 [前道所有装配件] -同时- 关联不可用规则; 判断是否剔除平行工位 ; 判断是否根据工序顺序号过滤后道
@Override
public MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap) {
return prodRuleContext.assemblyDataJson(assemblyExtService.getProductionAssemblySortPreCraftContextList(prodRuleContext, workCellMap, prodRuleIgnoreCfgMap));
public MesProdRuleContext getProdRuleSortPreCraftContext(MesProdRuleContext prodRuleContext, Map<String, MesWorkCell> workCellMap, Map<String, List<MesProdRuleIgnoreCfg>> prodRuleIgnoreCfgMap, Boolean isFilterParallel, Boolean isFilterAfterCraft) {
return prodRuleContext.assemblyDataJson(assemblyExtService.getProductionAssemblySortPreCraftContextList(prodRuleContext, workCellMap, prodRuleIgnoreCfgMap, isFilterParallel, isFilterAfterCraft));
}
}

@ -76,7 +76,7 @@ public class ChengDuVolvoShippingPrintStrategyService extends SortShippingDispat
modelList.add(model);
}
}
return ResultBean.success("装车单打印成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(modelList);
return ResultBean.success("发运单打印成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(modelList);
}
private ChengDuVolvoShippingPrintModel getPrintData(MesShippingOrderManagement shippingOrder) {

@ -4,6 +4,8 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesCellEquipContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsInContext;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.pojo.mes.bean.MesProdRouteOptParam;
import cn.estsh.i3plus.pojo.mes.bean.MesProdRuleIgnoreCfg;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter;
@ -12,9 +14,11 @@ import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
import cn.estsh.i3plus.pojo.mes.model.StepResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
* @Description :
@ -34,11 +38,25 @@ public class MesAssemblyShowSortPreCraftStepService extends MesAssemblyShowSortS
Map<String, MesWorkCell> workCellMap = productionProcessContextStepService.dispatchWorkCellMap(reqBean);
MesProdRuleContext prodRuleContext = new MesProdRuleContext(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), reqBean.getProcessCode(), productionProcessContext.getCraftCode())
.equipmentCode(cellEquipContext.getEquipmentCode()).workOrderNo(productionPsInContext.getWorkOrderNo()).productSn(productionPsInContext.getProductSn()).foreignKey(productionPsInContext.getForeignKey());
return prodRuleCfgExtService.getProdRuleSortPreCraftContext(prodRuleContext, workCellMap, prodRuleIgnoreCfgMap);
//获取工步参数
Optional<Map<String, MesProdRouteOptParam>> stepParamMap = getStepParams(reqBean);
//是否剔除平行工位[工步参数]
String isFilterParallel = (null != stepParamMap && stepParamMap.isPresent() && stepParamMap.get().containsKey(MesPcnExtConstWords.IS_FILTER_PARALLEL)) ? stepParamMap.get().get(MesPcnExtConstWords.IS_FILTER_PARALLEL).getParamValue() : null;
//是否根据工序顺序号过滤后道[工步参数]
String isFilterAfterCraft = (null != stepParamMap && stepParamMap.isPresent() && stepParamMap.get().containsKey(MesPcnExtConstWords.IS_FILTER_AFTER_CRAFT)) ? stepParamMap.get().get(MesPcnExtConstWords.IS_FILTER_AFTER_CRAFT).getParamValue() : null;
//【排序线】获取产品加工规则 [前道所有装配件] -同时- 关联不可用规则; 不剔除平行工位 ; 不过滤后道
return prodRuleCfgExtService.getProdRuleSortPreCraftContext(prodRuleContext, workCellMap, prodRuleIgnoreCfgMap, isFilterCfg(isFilterParallel), isFilterCfg(isFilterAfterCraft));
}
public Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, List<MesProdRuleContext> prodRuleContextList) {
return showProductionAssembly(reqBean, resultBean, workCenter, prodRuleContextList, true, false);
}
//判断配置设置是否过滤数据的标志
private Boolean isFilterCfg(String isFilterCfg) {
return StringUtils.isEmpty(isFilterCfg) ? false : true;
}
}

@ -473,6 +473,10 @@ public class MesPcnExtConstWords {
public static final String REPLACE_LENGTH = "replaceLength";
//替换信息[工步参数]
public static final String REPLACE_INFO = "replaceInfo";
//是否剔除平行工位[工步参数]
public static final String IS_FILTER_PARALLEL = "isFilterParallel";
//是否根据工序顺序号过滤后道[工步参数]
public static final String IS_FILTER_AFTER_CRAFT = "isFilterAfterCraft";
// 装配件显示规则配置[工位参数]
public static final String ASSEMBLY_SHOW_MR_CFG = "ASSEMBLY_SHOW_MR_CFG";

Loading…
Cancel
Save