diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionCustomContextStepService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionCustomContextStepService.java index d32498e..65b8a3f 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionCustomContextStepService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionCustomContextStepService.java @@ -26,6 +26,9 @@ public interface IMesProductionCustomContextStepService { @ApiOperation(value = "发送设备质量信息") void sendEquipQualityMessage(StationRequestBean reqBean, MesCellEquipContext cellEquipContext); + @ApiOperation(value = "发送工序完成音") + void sendProcessCompleteSound(StationRequestBean reqBean); + @ApiOperation(value = "存储上个扫描/读取信息") Boolean saveLastScanContext(StationRequestBean reqBean, List dataList); diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionProcessContextStepService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionProcessContextStepService.java index b587b7c..407ed15 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionProcessContextStepService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionProcessContextStepService.java @@ -20,7 +20,7 @@ import java.util.Optional; public interface IMesProductionProcessContextStepService { @ApiOperation(value = "清除上下文中的所有基础数据") - void doFlushProductionDispatchContext(StationRequestBean reqBean); + void doFlushProductionProcessContext(StationRequestBean reqBean); @ApiOperation(value = "存储生产过程上下文对象【工步根据业务实际情况执行,配置错误等情况无需执行】") Boolean saveProductionProcessContext(StationRequestBean reqBean, MesProductionProcessContext productionProcessContext); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionResetCellContextService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionResetCellContextService.java index 71cf266..fd6c840 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionResetCellContextService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionResetCellContextService.java @@ -19,19 +19,21 @@ public class MesFunctionResetCellContextService extends BaseSwsService implement @Autowired private IMesProductionProcessContextStepService productionProcessContextStepService; + @Autowired private IMesProductionDispatchContextStepService productionDispatchContextStepService; @Override public boolean doFunction(StationRequestBean reqBean, StationResultBean resultBean, ButtonDynamicModel buttonDynamicModel) { - productionProcessContextStepService.doFlushProductionDispatchContext(reqBean); + //清除上下文中的所有基础数据 + productionProcessContextStepService.doFlushProductionProcessContext(reqBean); + //清除上下文中的所有业务数据 productionDispatchContextStepService.doFlushProductionDispatchContext(reqBean); //TODO 清除工位队列LOCK, 工位状态对象, 流程数据等信息 - this.sendMessage(reqBean, resultBean.writeDbLog(), String.format("生产线[%s]工位[%s]%s成功!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), buttonDynamicModel.getButtonName()), MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionContextFlushService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionContextFlushService.java index 33a35b5..79816b6 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionContextFlushService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionContextFlushService.java @@ -1,7 +1,9 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step.context; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionCustomContextStepService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService; import cn.estsh.i3plus.mes.pcn.actor.shipping.dispatch.FsmJumpProcessService; +import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; import cn.estsh.i3plus.pojo.mes.model.StationRequestBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Primary; @@ -14,13 +16,19 @@ public class MesProductionContextFlushService extends FsmJumpProcessService { @Autowired private IMesProductionDispatchContextStepService productionDispatchContextStepService; + @Autowired + private IMesProductionCustomContextStepService productionCustomContextStepService; + //重置工序业务实现 @Override - public Boolean doJumpProcess(StationRequestBean requestBean) { + public Boolean doJumpProcess(StationRequestBean requestBean, Integer jumpProcessSource) { //清除上下文中的所有业务数据 productionDispatchContextStepService.doFlushProductionDispatchContext(requestBean); + //发送工序完成音 + if (MesPcnEnumUtil.FSM_JUMP_PROCESS_SOURCE.TASK_COMPLETE.getValue() == jumpProcessSource) productionCustomContextStepService.sendProcessCompleteSound(requestBean); + return true; } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionCustomContextStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionCustomContextStepService.java index d9d6f6e..539d33a 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionCustomContextStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionCustomContextStepService.java @@ -38,6 +38,12 @@ public class MesProductionCustomContextStepService extends BaseStepService imple this.sendMessage(reqBean, resultBean); } + //发送工序完成音 + @Override + public void sendProcessCompleteSound(StationRequestBean reqBean) { + this.sendMessage(reqBean, new StationResultBean().resultObj(MesPcnExtConstWords.PROCESS_COMPLETE).busiType(MesPcnEnumUtil.STATION_BUSI_TYPE.CUSTOM_COMPONENT.getValue()).dataType(MesPcnEnumUtil.STATION_DATA_TYPE.SOUND.getValue())); + } + //工位加工锁KEY private String getProductionLockContextKey(StationRequestBean reqBean) { return getFsmBusikey(reqBean, new StringJoiner(MesPcnExtConstWords.COLON).add(MesPcnExtConstWords.PRODUCTION_PROCESS_CONTEXT).add(MesPcnExtConstWords.PRODUCTION_LOCK_CONTEXT).toString()); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionDispatchContextStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionDispatchContextStepService.java index 1fa7136..e344b0d 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionDispatchContextStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionDispatchContextStepService.java @@ -37,7 +37,9 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp //清除上下文中的所有业务数据 @Override public void doFlushProductionDispatchContext(StationRequestBean reqBean) { + //清除上下文中的所有业务数据 deleteFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean)); + //清除工步客制化区域数据【装配件清单】 this.sendMessage(reqBean, new StationResultBean().busiType(MesPcnEnumUtil.STATION_BUSI_TYPE.STEP_CUSTOM_CONTENT.getValue()).dataType(MesPcnEnumUtil.STATION_DATA_TYPE.TABLES.getValue())); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionProcessContextStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionProcessContextStepService.java index c6cb6da..bfd8232 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionProcessContextStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionProcessContextStepService.java @@ -47,7 +47,7 @@ public class MesProductionProcessContextStepService extends BaseStepService impl //清除上下文中的所有基础数据 @Override - public void doFlushProductionDispatchContext(StationRequestBean reqBean) { + public void doFlushProductionProcessContext(StationRequestBean reqBean) { deleteFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean)); } 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 7f7f7dc..e9357f8 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 @@ -204,6 +204,9 @@ public class MesPcnExtConstWords { // 自定义触发事件: 主条码 public static final String NEXT_TRIGGER_EVENT_PRODUCT_SN = "PRODUCT_SN"; + // 工序完成 + public static final String PROCESS_COMPLETE = "processComplete"; + // 0 public static final String ZERO_STR = "0"; // 0