diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyMatchSortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyMatchSortStepService.java index 4922de4..516023a 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyMatchSortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesAssemblyMatchSortStepService.java @@ -131,38 +131,6 @@ public class MesAssemblyMatchSortStepService extends BaseStepService { } - private List resetAssembly(StationRequestBean reqBean, List prodRuleContextList) { - - //是否支持混腔扫描[工位参数] - String cavityNosortCfg = getCavityNosortCfg(reqBean); - - prodRuleContextList.forEach(o -> { - - if (!StringUtils.isEmpty(o.getAssemblyDataJson())) { - - List productionAssemblyNosortContextList = o.getNosortAssemblyDataContext(); - - if (!StringUtils.isEmpty(cavityNosortCfg) || hasUnBindAssemblyOptional(productionAssemblyNosortContextList)) { - - productionAssemblyNosortContextList.forEach(i -> { if (i.getIsResetScan().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) i.assemblyStatusReset(); }); - - o.assemblyDataJson(productionAssemblyNosortContextList); - - } - - } - - }); - - return prodRuleContextList; - } - - //是否支持混腔扫描[工位参数] - private String getCavityNosortCfg(StationRequestBean reqBean) { - String cavityNosortCfg = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CAVITY_NOSORT_CFG); - return (!StringUtils.isEmpty(cavityNosortCfg) && cavityNosortCfg.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) ? cavityNosortCfg : null; - } - //验证当前是否属于装配件跳过码 private Boolean checkIsSkip(MesProductionProcessContext productionProcessContext, List equipVariableCollectContextList) { if (equipVariableCollectContextList.size() > 1) return false; @@ -190,16 +158,16 @@ public class MesAssemblyMatchSortStepService extends BaseStepService { Boolean hasUnBindAssembly = false; for (MesProdRuleContext prodRuleContext : prodRuleContextList) { if (null == prodRuleContext || StringUtils.isEmpty(prodRuleContext.getAssemblyDataJson())) continue; - List productionAssemblyNosortContextList = prodRuleContext.getNosortAssemblyDataContext(); - if (!hasUnBindAssemblyOptional(productionAssemblyNosortContextList)) continue; + List productionAssemblySortContextList = prodRuleContext.getSortAssemblyDataContext(); + if (!hasUnBindAssemblyOptional(productionAssemblySortContextList)) continue; hasUnBindAssembly = true; break; } return hasUnBindAssembly; } - private Boolean hasUnBindAssemblyOptional(List productionAssemblyNosortContextList) { - Optional optional = productionAssemblyNosortContextList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0)).findFirst(); + private Boolean hasUnBindAssemblyOptional(List productionAssemblySortContextList) { + Optional optional = productionAssemblySortContextList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()) == 0)).findFirst(); return (null == optional || !optional.isPresent()) ? false : true; } @@ -278,7 +246,7 @@ public class MesAssemblyMatchSortStepService extends BaseStepService { continue; } - MesProductionAssemblyNosortContext filter = (MesProductionAssemblyNosortContext) result.get(MesPcnExtConstWords.DATA); + MesProductionAssemblySortContext filter = (MesProductionAssemblySortContext) result.get(MesPcnExtConstWords.DATA); //前道防错 if (!StringUtils.isEmpty(filter.getProductSnId()) && !StringUtils.isEmpty(productionAssemblySortContext.getPreCraftCode())) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderCheckSortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderCheckSortStepService.java index b37d63c..d5464e7 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderCheckSortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderCheckSortStepService.java @@ -71,12 +71,17 @@ public class MesWorkOrderCheckSortStepService extends MesWorkOrderCheckStepServi //获取上下文产出零件信息 List cachedProductionPartContextList = productionDispatchContextStepService.getProductionPartContext(reqBean); - //获取工单对应的条码数据信息 - List cachedProductionPsInContextList = productionDispatchContextStepService.getProductionPsInContext(reqBean); + List cachedProductionPsInContextList = null; + List cachedProductionPsOutContextList = null; + if (!CollectionUtils.isEmpty(cachedProductionPartContextList)) { + //获取工单对应的条码数据信息 + cachedProductionPsInContextList = productionDispatchContextStepService.getProductionPsInContext(reqBean); + //获取工单对应的产出条码数据信息 + cachedProductionPsOutContextList = productionDispatchContextStepService.getProductionPsOutContext(reqBean); + } //非扫描场景 清除历史产出零件信息 - if (MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() != equipVariableCollectContextList.get(0).getMessageSource() && - (!CollectionUtils.isEmpty(cachedProductionPartContextList) || !CollectionUtils.isEmpty(cachedProductionPsInContextList))) cachedProductionPartContextList = removeBusiData(reqBean); + if (MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() != equipVariableCollectContextList.get(0).getMessageSource() && !CollectionUtils.isEmpty(cachedProductionPartContextList)) cachedProductionPartContextList = removeBusiData(reqBean); //验证扫描信息是否属于工艺强过码 Boolean isCraftJumpCode = matchCraftJumpCode(productionProcessContext, equipVariableCollectContextList); @@ -113,10 +118,10 @@ public class MesWorkOrderCheckSortStepService extends MesWorkOrderCheckStepServi equipVariableCollectContextList, productionPartContextList, productionPsInContextList, productionPsOutContextList).isCompleted()) return stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, stepResult.getMsg()); //扫描场景下合并历史产出零件信息/产品条码信息 - if (MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() == equipVariableCollectContextList.get(0).getMessageSource() && - (!CollectionUtils.isEmpty(cachedProductionPartContextList) || !CollectionUtils.isEmpty(productionPsInContextList))) { + if (MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() == equipVariableCollectContextList.get(0).getMessageSource() && !CollectionUtils.isEmpty(cachedProductionPartContextList)) { productionPartContextList.addAll(cachedProductionPartContextList); productionPsInContextList.addAll(cachedProductionPsInContextList); + productionPsOutContextList.addAll(cachedProductionPsOutContextList); } //验证是否全部为空腔 diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveSortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveSortStepService.java index 28b9bc0..66736b5 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveSortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveSortStepService.java @@ -8,6 +8,7 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionProcessContext; import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; import cn.estsh.i3plus.mes.pcn.util.StringUtil; +import cn.estsh.i3plus.platform.common.tool.TimeTool; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell; @@ -100,14 +101,14 @@ public class MesWorkOrderSaveSortStepService extends BaseStepService { workOrderRepository.updateByProperties( new String[]{MesPcnExtConstWords.ID}, new Object[]{productionPartContext.getId()}, - new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS}, - new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue()}); + new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.ONLINE_TIME}, + new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue(), TimeTool.getNowTime(true)}); } else { workOrderRepository.updateByProperties( new String[]{MesPcnExtConstWords.ID}, new Object[]{productionPartContext.getId()}, - new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.COMPLATED_QTY, MesPcnExtConstWords.UN_COMPLATED_QTY}, - new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue(), new Double(1), new Double(0)}); + new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.COMPLATED_QTY, MesPcnExtConstWords.UN_COMPLATED_QTY, MesPcnExtConstWords.OFFLINE_TIME}, + new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue(), new Double(1), new Double(0), TimeTool.getNowTime(true)}); } log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- ORDER:{} --- UPDATE:[{}:{}]", diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyContext.java index 8f3f510..304c2db 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyContext.java @@ -111,7 +111,7 @@ public class MesProductionAssemblyContext implements Serializable { public Integer foreignKey; @ApiParam(value = "是否可复用条码") - public Integer isRepeat; + public Integer isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); @ApiParam(value = "是否可复用条码是否写入上下文进行复用") public Integer isRepeat2Cache = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(); diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyNosortContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyNosortContext.java index 71fb105..59a715d 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyNosortContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyNosortContext.java @@ -50,6 +50,7 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon this.partNo = prodRuleContext.getOutPartNo(); if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO; + if (StringUtils.isEmpty(this.isRepeat)) this.isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue(); 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 ed21595..ea7310c 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 @@ -128,6 +128,8 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO; if (StringUtils.isEmpty(this.processSeq)) this.processSeq = MesPcnExtConstWords.ZERO; + if (StringUtils.isEmpty(this.assemblyStatus) || this.assemblyStatus.compareTo(MesPcnExtConstWords.ZERO) == 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)) this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue(); @@ -152,6 +154,8 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO; if (StringUtils.isEmpty(this.processSeq)) this.processSeq = MesPcnExtConstWords.ZERO; + if (StringUtils.isEmpty(this.assemblyStatus) || this.assemblyStatus.compareTo(MesPcnExtConstWords.ZERO) == 0) this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.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(); diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java index 58c66d9..70940fb 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java @@ -205,6 +205,10 @@ public class MesPcnExtConstWords { public static final String REMARK = "remark"; //状态 public static final String STATUS = "status"; + //上线时间 + public static final String ONLINE_TIME = "onlineTime"; + //下线时间 + public static final String OFFLINE_TIME = "offlineTime"; //BaseBean字段不包含工厂, 用于对象复制剔除属性BeanUtils.copyProperties(Object source, Object target, String... ignoreProperties) public static final String[] BASE_BEAN_FIELDS = {ID, IS_DELETED, IS_VALID, CREATE_DATE_TIME, CREATE_USER, MODIFY_DATE_TIME, MODIFY_USER, DESCRIPTION, REMARK, SYSTEM_SYNC_DATE_TIME, SYSTEM_SYNC_STATUS};