diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesAssemblyExtService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesAssemblyExtService.java index fe9bf75..87fb10b 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesAssemblyExtService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesAssemblyExtService.java @@ -61,14 +61,15 @@ public class MesAssemblyExtService implements IMesAssemblyExtService { //【排序线】获取生产工单装配件清单 List workOrderAssemblyList = getWorkOrderAssemblyList(prodRuleContext, false); - // 搜集待装配或者解绑的数据 - workOrderAssemblyList = CollectionUtils.isEmpty(workOrderAssemblyList) ? null : workOrderAssemblyList.stream().filter(o -> (null != o && - (o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0 || o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()) == 0))).collect(Collectors.toList()); - if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null; + // 搜集待装配或者解绑的数据 + List unBindList = workOrderAssemblyList.stream().filter(o -> (null != o && + (o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0 || + o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()) == 0))).collect(Collectors.toList()); + //获取排序FILE文件URL - Map fileMap = getFileMap(prodRuleContext.getOrganizeCode(), filterSortFileIdList(workOrderAssemblyList)); + Map fileMap = getFileMap(prodRuleContext.getOrganizeCode(), filterSortFileIdList(unBindList)); List productionAssemblySortContextList = new ArrayList<>(); @@ -89,11 +90,12 @@ public class MesAssemblyExtService implements IMesAssemblyExtService { //【排序线】获取生产工单装配件清单 List workOrderAssemblyList = getWorkOrderAssemblyList(prodRuleContext, true); - // 搜集非已装配的数据 - workOrderAssemblyList = CollectionUtils.isEmpty(workOrderAssemblyList) ? null : workOrderAssemblyList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList()); - if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null; + // 搜集非已装配的数据 + List unBindList = workOrderAssemblyList.stream().filter(o -> (null != o && + o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList()); + //获取装配件绑定记录 Map> productionAssemblyMap = groupProductionAssembly(getProductionAssemblySortList(prodRuleContext.getOrganizeCode(), prodRuleContext.getProductSn())); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyShowSortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyShowSortStepService.java index 44fdcb2..9a84aa3 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyShowSortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyShowSortStepService.java @@ -218,7 +218,7 @@ public class MesAssemblyShowSortStepService extends BaseStepService { if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue; //封装匹配当前设备的装配件信息 - List assemblyShowContextList = getAssemblyShowContextList(prodRuleContext.getAssemblyDataContext(workCenter), isNeedShowMatchRule, topRowInfo); + List assemblyShowContextList = getAssemblyShowContextList(prodRuleContext.getSortAssemblyDataContext(), isNeedShowMatchRule, topRowInfo); if (CollectionUtils.isEmpty(assemblyShowContextList)) continue; //装配件清单列表标题 @@ -252,12 +252,12 @@ public class MesAssemblyShowSortStepService extends BaseStepService { } //封装匹配当前设备的装配件信息 - private List getAssemblyShowContextList(List productionAssemblyContextList, Boolean isNeedShowMatchRule, String topRowInfo) { - if (CollectionUtils.isEmpty(productionAssemblyContextList)) return null; + private List getAssemblyShowContextList(List productionAssemblySortContextList, Boolean isNeedShowMatchRule, String topRowInfo) { + if (CollectionUtils.isEmpty(productionAssemblySortContextList)) return null; List assemblyShowContextList = new ArrayList<>(); - for (MesProductionAssemblyContext item : productionAssemblyContextList) { - //不显示且不扫描/仅目视的不显示出来 - if (null == item || MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNoShow(item.getMatchType())) continue; + for (MesProductionAssemblySortContext item : productionAssemblySortContextList) { + //不显示且不扫描/仅目视的不显示出来, 已经存在于DB的不显示出来 + if (null == item || item.getIsExistDb().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0 || MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNoShow(item.getMatchType())) continue; assemblyShowContextList.add(assemblyShowContext(item, isNeedShowMatchRule, topRowInfo)); } diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblySortContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblySortContext.java index 7f3b4f8..894e5d9 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblySortContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblySortContext.java @@ -133,6 +133,9 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte @ApiParam(name = "是否保存到DB") private Integer isSaveDb = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); + @ApiParam(name = "是否已经存在于DB") + private Integer isExistDb = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); + public MesProductionAssemblySortContext() {} //前道工位 @@ -149,10 +152,19 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte if (StringUtils.isEmpty(this.processSeq)) this.processSeq = MesPcnExtConstWords.ZERO; if (StringUtils.isEmpty(this.assemblyStatus) || this.assemblyStatus.compareTo(MesPcnExtConstWords.ZERO) == 0 || - this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()) == 0) this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue(); + this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()) == 0) { + this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue(); + } - if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0 && !MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType)) + if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) == 0 || + this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_40.getValue()) == 0) { + this.fileIsFinished().isSaveDb().setIsExistDb(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); + } + + if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0 && + !MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType)) { this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue(); + } return this; } @@ -183,6 +195,8 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte if (StringUtils.isEmpty(this.assemblyStatus) || this.assemblyStatus.compareTo(MesPcnExtConstWords.ZERO) == 0 || this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()) == 0) this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue(); + if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) == 0) this.isSaveDb().setIsExistDb(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); + if (this.assemblyStatus.compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0 && !MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNeedScan(this.matchType)) this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();