From 06557113e6977a2b9d7c5a27ba835bca603e48a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E7=AC=91=E7=9D=80=E9=9D=A2=E5=AF=B9=E6=98=8E?= =?UTF-8?q?=E5=A4=A9?= <752558143@qq.com> Date: Wed, 12 Jun 2024 16:10:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=95=E7=A4=BA=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../step/MesAssemblyShowNosortStepService.java | 21 ++++++++++++++------- .../pcn/pojo/context/MesAssemblyShowContext.java | 9 +++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyShowNosortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyShowNosortStepService.java index d22bcf1..0f884fe 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyShowNosortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyShowNosortStepService.java @@ -85,7 +85,16 @@ public class MesAssemblyShowNosortStepService extends BaseStepService { doHandleProdRuleData(reqBean, resultBean, stepResult, workCenter, cellEquipContext, prodRuleContextList, productionPartContextList, productionPsInContextList); //保存上下文产品加工规则信息集合 - if (prodRuleContextList.size() != initSize) productionDispatchContextStepService.saveProdRuleDataContext(reqBean, prodRuleContextList); + if (prodRuleContextList.size() != initSize) { + productionDispatchContextStepService.saveProdRuleDataContext(reqBean, prodRuleContextList); + if (!CollectionUtils.isEmpty(productionPartContextList)) { + productionDispatchContextStepService.saveProductionPartContext(reqBean, productionPartContextList); + } + + if (!CollectionUtils.isEmpty(productionPsInContextList)) { + productionDispatchContextStepService.saveProductionPsInContext(reqBean, productionPsInContextList); + } + } //显示装配件信息 showProductionAssembly(reqBean, resultBean, workCenter, cellEquipContext, prodRuleContextList, productionPartContextList); @@ -213,9 +222,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService { //获取匹配产出零件的所有加工规则 List outPartNoProdRuleList = !CollectionUtils.isEmpty(prodRuleNosortCfgMap) ? prodRuleNosortCfgMap.get(productionPartContext.getPartNo()) : null; - MesProdRuleNosortCfg filter = null; - Optional optional = productionPsInContextList.stream().filter(o -> (null != o && StringUtils.isEmpty(o.getForeignKey()))).findFirst(); if (null == optional || !optional.isPresent()) break; @@ -267,9 +274,8 @@ public class MesAssemblyShowNosortStepService extends BaseStepService { //显示装配件信息 private Boolean showProductionAssembly(StationRequestBean reqBean, StationResultBean resultBean, MesWorkCenter workCenter, MesCellEquipContext cellEquipContext, List prodRuleContextList, List productionPartContextList) { - Map productionPartMap = productionPartContextList.stream().filter(o -> null != o).collect(Collectors.toMap(MesProductionPartContext::getForeignKey, o -> o)); + Map productionPartMap = productionPartContextList.stream().filter(o -> null != o && o.getForeignKey() != null).collect(Collectors.toMap(MesProductionPartContext::getForeignKey, o -> o)); - List attrBeanList = null; for (MesProdRuleContext prodRuleContext : prodRuleContextList) { @@ -282,7 +288,7 @@ public class MesAssemblyShowNosortStepService extends BaseStepService { if (CollectionUtils.isEmpty(assemblyShowContextList)) continue; //装配件清单列表标题 - if (CollectionUtils.isEmpty(attrBeanList)) attrBeanList = dataAttrList(workOrderNo); + List attrBeanList = dataAttrList(workOrderNo); //封装多表格 resultBean.addStationResultBeans(new StationResultBean().dataType(MesPcnEnumUtil.STATION_DATA_TYPE.TABLE.getValue()).dataAttrList(attrBeanList).resultList(assemblyShowContextList)); @@ -321,9 +327,10 @@ public class MesAssemblyShowNosortStepService extends BaseStepService { if (!StringUtils.isEmpty(workOrderNo)) assemblyShowContext.setWorkOrderNo(workOrderNo); assemblyShowContext.setPartNo(prodRuleContext.getOutPartNo()); if (StringUtils.isEmpty(assemblyShowContext.getRouteSeq())) assemblyShowContext.setRouteSeq(MesPcnExtConstWords.ZERO); + if (StringUtils.isEmpty(assemblyShowContext.getAssemblyStatus())) assemblyShowContext.setAssemblyStatus(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()); if (MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue() == assemblyShowContext.getAssemblyStatus() && (MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.MATCH_TYPE_50.getValue() == assemblyShowContext.getMatchType() || MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.MATCH_TYPE_60.getValue() == assemblyShowContext.getMatchType())) assemblyShowContext.setAssemblyStatus(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()); - assemblyShowContext.setAssemblyStatusName(MesExtEnumUtil.ASSEMBLY_STATUS.valueOfDescription(o.getAssemblyStatus())); + assemblyShowContext.setAssemblyStatusName(MesExtEnumUtil.ASSEMBLY_STATUS.valueOfDescription(assemblyShowContext.getAssemblyStatus())); if (MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue() != assemblyShowContext.getAssemblyStatus()) assemblyShowContext.setColor(StringUtils.isEmpty(assemblyShowContext.getShowColor()) ? MesExtEnumUtil.COLOR.GREEN.getValue() : assemblyShowContext.getShowColor()); return assemblyShowContext; diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesAssemblyShowContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesAssemblyShowContext.java index 784417e..b2380d7 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesAssemblyShowContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesAssemblyShowContext.java @@ -46,4 +46,13 @@ public class MesAssemblyShowContext implements Serializable { @ApiParam("装配零件状态") private String assemblyStatusName; + @ApiParam("序号") + private Integer index; + + + public MesAssemblyShowContext index(Integer index){ + this.index = index; + return this; + } + }