diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesMouldNoReadStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesMouldNoReadStepService.java index 9b8baee..21275e1 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesMouldNoReadStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesMouldNoReadStepService.java @@ -7,7 +7,6 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepSer import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService; import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*; import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; -import cn.estsh.i3plus.mes.pcn.actor.shipping.dispatch.IFsmCommonService; import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; import cn.estsh.i3plus.pojo.mes.bean.MesEquipmentVariable; @@ -55,9 +54,6 @@ public class MesMouldNoReadStepService extends BaseStepService { @Autowired private MesFirstMouldNoReadStepService firstMouldNoReadStepService; - @Autowired - private IFsmCommonService fsmCommonService; - @Override public StepResult init(StationRequestBean reqBean) { @@ -135,14 +131,11 @@ public class MesMouldNoReadStepService extends BaseStepService { private StepResult checkMouldNoValid(StationRequestBean reqBean, StationResultBean resultBean, Optional> stepParamMap, StepResult stepResult, MesProductionProcessContext productionProcessContext, MesCellEquipContext cellEquipContext, MesEquipLogDispatchContext equipLogDispatchContext) { - //验证上下文产出零件信息是否存在 - Boolean productionPartContextIsExist = productionDispatchContextStepService.checkProductionPartIsExistContext(reqBean); - - //未知腔数[工位参数] - String cavityUnknownCfg = fsmCommonService.doHandleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.CAVITY_UNKNOWN_CFG); + //模具号读一模多腔配置[工步参数] + String isReadMultiCavityCfg = (null != stepParamMap && stepParamMap.isPresent() && stepParamMap.get().containsKey(MesPcnExtConstWords.READ_MULTI_CAVITY_CFG)) ? stepParamMap.get().get(MesPcnExtConstWords.READ_MULTI_CAVITY_CFG).getParamValue() : null; //未采集到数据 - if (!equipLogDispatchContext.getIsCollectValue() && (equipLogDispatchContext.getNeedNewValue() || (!productionPartContextIsExist && StringUtils.isEmpty(cavityUnknownCfg)))) + if (!equipLogDispatchContext.getIsCollectValue() && (equipLogDispatchContext.getNeedNewValue() || !StringUtils.isEmpty(isReadMultiCavityCfg))) execThreadSleepAndSendTaskCompleteAndThrowEx(reqBean, resultBean, stepResult.isCompleted(false).msg(String.format("当前未读取到设备[%s]模具号,持续监听中...", cellEquipContext.getEquipmentCode())), MesPcnEnumUtil.STATION_BUSI_TYPE.GUIDE, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT, stepParamMap, MesPcnExtConstWords.READ_FAILURE_SLEEP, MesPcnExtConstWords.READ_FAILURE_SLEEP_DEFAULT_TIME); else if (!equipLogDispatchContext.getIsCollectValue()) @@ -152,7 +145,7 @@ public class MesMouldNoReadStepService extends BaseStepService { List equipVariableCollectContextList = (List) equipVariableCfgRuleMatchService.matchEquipVariableCfgCollectContext(reqBean, productionProcessContext, MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.MOULD_NO.getValue(), equipLogDispatchContext.getEquipVariableCfgCollectContextList()); //没有有效的数据: 设置常变值 或者 当前没有头道模具号或生产工单信息 - if (CollectionUtils.isEmpty(equipVariableCollectContextList) && (equipLogDispatchContext.getNeedNewValue() || (!productionPartContextIsExist && StringUtils.isEmpty(cavityUnknownCfg)))) + if (CollectionUtils.isEmpty(equipVariableCollectContextList) && (equipLogDispatchContext.getNeedNewValue() || !StringUtils.isEmpty(isReadMultiCavityCfg))) execThreadSleepAndSendTaskCompleteAndThrowEx(reqBean, resultBean.writeDbLog(), stepResult.isCompleted(false).msg(String.format("当前未读取到设备[%s]有效的模具号,持续监听中...", cellEquipContext.getEquipmentCode())), MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT, stepParamMap, MesPcnExtConstWords.READ_FAILURE_SLEEP, MesPcnExtConstWords.READ_FAILURE_SLEEP_DEFAULT_TIME); else if (CollectionUtils.isEmpty(equipVariableCollectContextList)) //非常变值 没有有效的数据 也无需再读 @@ -167,8 +160,8 @@ public class MesMouldNoReadStepService extends BaseStepService { //将模具信息放到工步结果对象的中, 工步主方法体会从里面取出 stepResult.obj(equipVariableCollectContextList.get(0)); - //判断是否存在产出零件信息 或者 工位参数没有配置未知腔数 - if (!productionPartContextIsExist && StringUtils.isEmpty(cavityUnknownCfg)) doHandleFirstMouldNo(reqBean, resultBean, stepResult, productionProcessContext, cellEquipContext, mouldNo); + //存在模具号读一模多腔配置[工步参数] + if (!StringUtils.isEmpty(isReadMultiCavityCfg)) doHandleFirstMouldNo(reqBean, resultBean, stepResult, productionProcessContext, cellEquipContext, mouldNo); return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("当前已读取到设备[%s]模具号信息[%s]!", cellEquipContext.getEquipmentCode(), mouldNo)); 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 b82103e..f1a0f95 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 @@ -123,6 +123,8 @@ public class MesPcnExtConstWords { public static final String CAVITY_FINISH_CODE = "CAVITY_FINISH_CODE"; // 设备代码[工步参数] public static final String EQUIPMENT_CODE_UC = "EQUIPMENT_CODE"; + // 模具号读一模多腔配置[工步参数] + public static final String READ_MULTI_CAVITY_CFG = "READ_MULTI_CAVITY_CFG"; // 读取失败睡眠毫秒数[工步参数] public static final String READ_FAILURE_SLEEP = "READ_FAILURE_SLEEP"; // 读取失败睡眠默认毫秒数