|
|
@ -153,42 +153,36 @@ public class MesWorkOrderQueueAcceptStepService extends BaseStepService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//验证是否满足腔数
|
|
|
|
//验证是否满足腔数
|
|
|
|
if (CollectionUtils.isEmpty(curPushList) || curPushList.size() < cellEquipContext.getCavity()) {
|
|
|
|
if (!CollectionUtils.isEmpty(curPushList) && curPushList.size() == cellEquipContext.getCavity()) {
|
|
|
|
return stepDynamicsCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().checkRepeat(), stepResult,
|
|
|
|
|
|
|
|
false, MesPcnEnumUtil.STATION_BUSI_TYPE.GUIDE, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT,
|
|
|
|
|
|
|
|
CollectionUtils.isEmpty(curPushList) ? "当前未接收到工位工单队列,持续监听中..." : String.format("当前接收到到工位工单队列个数[%s]不满足腔数[%s],持续监听中...", curPushList.size(), cellEquipContext.getCavity()),
|
|
|
|
|
|
|
|
getStepParams(reqBean), MesPcnExtConstWords.READ_FAILURE_SLEEP, MesPcnExtConstWords.READ_FAILURE_SLEEP_DEFAULT_TIME);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//搜集工单号
|
|
|
|
//搜集工单号
|
|
|
|
List<String> workOrderNoList = curPushList.stream().filter(o -> null != o).map(MesQueueOrderPush::getWorkOrderNo).collect(Collectors.toList());
|
|
|
|
List<String> workOrderNoList = curPushList.stream().filter(o -> null != o).map(MesQueueOrderPush::getWorkOrderNo).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
//发送工步内容
|
|
|
|
//发送工步内容
|
|
|
|
productionCustomContextStepService.sendStepContextMessage(reqBean, workOrderNoList.toString(), MesExtEnumUtil.CELL_MESSAGE_SOURCE.READ);
|
|
|
|
productionCustomContextStepService.sendStepContextMessage(reqBean, workOrderNoList.toString(), MesExtEnumUtil.CELL_MESSAGE_SOURCE.READ);
|
|
|
|
|
|
|
|
|
|
|
|
List<MesEquipVariableCollectContext> equipVariableCollectContextList = new ArrayList<>();
|
|
|
|
List<MesEquipVariableCollectContext> equipVariableCollectContextList = new ArrayList<>();
|
|
|
|
workOrderNoList.stream().filter(o -> !StringUtils.isEmpty(o)).forEach(o ->
|
|
|
|
workOrderNoList.stream().filter(o -> !StringUtils.isEmpty(o)).forEach(o ->
|
|
|
|
equipVariableCollectContextList.add(new MesEquipVariableCollectContext(reqBean.getOrganizeCode(), o, MesExtEnumUtil.CELL_MESSAGE_SOURCE.READ.getValue())));
|
|
|
|
equipVariableCollectContextList.add(new MesEquipVariableCollectContext(reqBean.getOrganizeCode(), o, MesExtEnumUtil.CELL_MESSAGE_SOURCE.READ.getValue())));
|
|
|
|
//保存上下文扫/读信息:加工单
|
|
|
|
//保存上下文扫/读信息:加工单
|
|
|
|
productionDispatchContextStepService.dispatchScanWorkOrderNoContext(reqBean, equipVariableCollectContextList);
|
|
|
|
productionDispatchContextStepService.dispatchScanWorkOrderNoContext(reqBean, equipVariableCollectContextList);
|
|
|
|
|
|
|
|
|
|
|
|
this.sendMessage(reqBean, new StationResultBean().writeDbLog().checkRepeat(), String.format("获取到工位工单推送队列%s!", workOrderNoList.toString()), MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
|
|
|
|
this.sendMessage(reqBean, new StationResultBean().writeDbLog().checkRepeat(), String.format("获取到工位工单推送队列%s!", workOrderNoList.toString()), MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
//加工单验证工步 【排序】
|
|
|
|
//加工单验证工步 【排序】
|
|
|
|
stepResult = ((IStepService) SpringContextsUtil.getBean("mesWorkOrderCheckSortStepService")).executeInState(reqBean);
|
|
|
|
stepResult = ((IStepService) SpringContextsUtil.getBean("mesWorkOrderCheckSortStepService")).executeInState(reqBean);
|
|
|
|
|
|
|
|
|
|
|
|
if (!stepResult.isCompleted()) {
|
|
|
|
if (stepResult.isCompleted()) {
|
|
|
|
stepThreadSleepAndSendTaskCompleteAndThrowEx(reqBean, stepResult, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT,
|
|
|
|
|
|
|
|
getStepParams(reqBean), MesPcnExtConstWords.READ_FAILURE_SLEEP, MesPcnExtConstWords.READ_FAILURE_SLEEP_DEFAULT_TIME);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//保存上下文推单信息
|
|
|
|
//保存上下文推单信息
|
|
|
|
productionDispatchContextStepService.dispatchSortQueuePushContext(reqBean, curPushList);
|
|
|
|
productionDispatchContextStepService.dispatchSortQueuePushContext(reqBean, curPushList);
|
|
|
|
|
|
|
|
|
|
|
|
log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- QUEUE_ORDER_PUSH:{}",
|
|
|
|
log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- QUEUE_ORDER_PUSH:{}",
|
|
|
|
reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()), JSONObject.toJSONString(curPushList));
|
|
|
|
reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()), JSONObject.toJSONString(curPushList));
|
|
|
|
|
|
|
|
|
|
|
|
return stepResult;
|
|
|
|
return stepResult;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
//当需要加锁且满足腔数的情况下, 保存排序线工单队列推送锁数据
|
|
|
|
//当需要加锁且满足腔数的情况下, 保存排序线工单队列推送锁数据
|
|
|
@ -202,6 +196,16 @@ public class MesWorkOrderQueueAcceptStepService extends BaseStepService {
|
|
|
|
if (!CollectionUtils.isEmpty(queuePushMap2Locked)) queuePushMap2Locked.values().forEach(o -> unLock(reqBean, o));
|
|
|
|
if (!CollectionUtils.isEmpty(queuePushMap2Locked)) queuePushMap2Locked.values().forEach(o -> unLock(reqBean, o));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!stepResult.isCompleted()) {
|
|
|
|
|
|
|
|
stepThreadSleepAndSendTaskCompleteAndThrowEx(reqBean, stepResult, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT,
|
|
|
|
|
|
|
|
getStepParams(reqBean), MesPcnExtConstWords.READ_FAILURE_SLEEP, MesPcnExtConstWords.READ_FAILURE_SLEEP_DEFAULT_TIME);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return stepDynamicsCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().checkRepeat(), stepResult,
|
|
|
|
|
|
|
|
false, MesPcnEnumUtil.STATION_BUSI_TYPE.GUIDE, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT,
|
|
|
|
|
|
|
|
CollectionUtils.isEmpty(curPushList) ? "当前未接收到工位工单队列,持续监听中..." : String.format("当前接收到到工位工单队列个数[%s]不满足腔数[%s],持续监听中...", curPushList.size(), cellEquipContext.getCavity()),
|
|
|
|
|
|
|
|
getStepParams(reqBean), MesPcnExtConstWords.READ_FAILURE_SLEEP, MesPcnExtConstWords.READ_FAILURE_SLEEP_DEFAULT_TIME);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//加锁
|
|
|
|
//加锁
|
|
|
|