排序装配件 逻辑调整

tags/yfai-pcn-ext-v2.3
王杰 6 months ago
parent 824ffb83b4
commit 490ca9a003

@ -61,14 +61,15 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
//【排序线】获取生产工单装配件清单 //【排序线】获取生产工单装配件清单
List<MesWorkOrderAssembly> workOrderAssemblyList = getWorkOrderAssemblyList(prodRuleContext, false); List<MesWorkOrderAssembly> 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; if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null;
// 搜集待装配或者解绑的数据
List<MesWorkOrderAssembly> 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 //获取排序FILE文件URL
Map<Long, String> fileMap = getFileMap(prodRuleContext.getOrganizeCode(), filterSortFileIdList(workOrderAssemblyList)); Map<Long, String> fileMap = getFileMap(prodRuleContext.getOrganizeCode(), filterSortFileIdList(unBindList));
List<MesProductionAssemblySortContext> productionAssemblySortContextList = new ArrayList<>(); List<MesProductionAssemblySortContext> productionAssemblySortContextList = new ArrayList<>();
@ -89,11 +90,12 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
//【排序线】获取生产工单装配件清单 //【排序线】获取生产工单装配件清单
List<MesWorkOrderAssembly> workOrderAssemblyList = getWorkOrderAssemblyList(prodRuleContext, true); List<MesWorkOrderAssembly> 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; if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null;
// 搜集非已装配的数据
List<MesWorkOrderAssembly> unBindList = workOrderAssemblyList.stream().filter(o -> (null != o &&
o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList());
//获取装配件绑定记录 //获取装配件绑定记录
Map<Long, List<MesProductionAssembly>> productionAssemblyMap = groupProductionAssembly(getProductionAssemblySortList(prodRuleContext.getOrganizeCode(), prodRuleContext.getProductSn())); Map<Long, List<MesProductionAssembly>> productionAssemblyMap = groupProductionAssembly(getProductionAssemblySortList(prodRuleContext.getOrganizeCode(), prodRuleContext.getProductSn()));

@ -218,7 +218,7 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue; if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue;
//封装匹配当前设备的装配件信息 //封装匹配当前设备的装配件信息
List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(prodRuleContext.getAssemblyDataContext(workCenter), isNeedShowMatchRule, topRowInfo); List<MesAssemblyShowContext> assemblyShowContextList = getAssemblyShowContextList(prodRuleContext.getSortAssemblyDataContext(), isNeedShowMatchRule, topRowInfo);
if (CollectionUtils.isEmpty(assemblyShowContextList)) continue; if (CollectionUtils.isEmpty(assemblyShowContextList)) continue;
//装配件清单列表标题 //装配件清单列表标题
@ -252,12 +252,12 @@ public class MesAssemblyShowSortStepService extends BaseStepService {
} }
//封装匹配当前设备的装配件信息 //封装匹配当前设备的装配件信息
private List<MesAssemblyShowContext> getAssemblyShowContextList(List<MesProductionAssemblyContext> productionAssemblyContextList, Boolean isNeedShowMatchRule, String topRowInfo) { private List<MesAssemblyShowContext> getAssemblyShowContextList(List<MesProductionAssemblySortContext> productionAssemblySortContextList, Boolean isNeedShowMatchRule, String topRowInfo) {
if (CollectionUtils.isEmpty(productionAssemblyContextList)) return null; if (CollectionUtils.isEmpty(productionAssemblySortContextList)) return null;
List<MesAssemblyShowContext> assemblyShowContextList = new ArrayList<>(); List<MesAssemblyShowContext> assemblyShowContextList = new ArrayList<>();
for (MesProductionAssemblyContext item : productionAssemblyContextList) { for (MesProductionAssemblySortContext item : productionAssemblySortContextList) {
//不显示且不扫描/仅目视的不显示出来 //不显示且不扫描/仅目视的不显示出来, 已经存在于DB的不显示出来
if (null == item || MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.checkIsNoShow(item.getMatchType())) continue; 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)); assemblyShowContextList.add(assemblyShowContext(item, isNeedShowMatchRule, topRowInfo));
} }

@ -133,6 +133,9 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
@ApiParam(name = "是否保存到DB") @ApiParam(name = "是否保存到DB")
private Integer isSaveDb = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); private Integer isSaveDb = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
@ApiParam(name = "是否已经存在于DB")
private Integer isExistDb = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
public MesProductionAssemblySortContext() {} public MesProductionAssemblySortContext() {}
//前道工位 //前道工位
@ -149,10 +152,19 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
if (StringUtils.isEmpty(this.processSeq)) this.processSeq = MesPcnExtConstWords.ZERO; if (StringUtils.isEmpty(this.processSeq)) this.processSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.assemblyStatus) || this.assemblyStatus.compareTo(MesPcnExtConstWords.ZERO) == 0 || 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(); this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();
}
return this; return this;
} }
@ -183,6 +195,8 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte
if (StringUtils.isEmpty(this.assemblyStatus) || this.assemblyStatus.compareTo(MesPcnExtConstWords.ZERO) == 0 || 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_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)) 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(); this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue();

Loading…
Cancel
Save