From 7462388c130f5cc800e4c02eafe136d7e27d3043 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Sat, 28 Dec 2024 15:18:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=2044630=20=E8=AF=BB=E8=83=8E=E8=86=9C?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E5=B7=A5=E6=AD=A5=EF=BC=8C=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E9=80=82=E9=85=8D=E6=9F=94=E6=80=A7=E7=84=8A=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=EF=BC=8C=E9=9C=80=E8=A6=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/pcn/api/base/IMesProdOrgExtService.java | 3 + .../serviceimpl/base/MesProdOrgExtService.java | 9 ++- .../step/MesManyCellIsVerificationStepService.java | 5 +- .../MesManyCellTriggerJumpProcessStepService.java | 85 ++++++++++++++++++++++ .../ext/mes/pcn/pojo/util/MesPcnExtConstWords.java | 2 + 5 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesProdOrgExtService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesProdOrgExtService.java index e9049d1..979e94d 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesProdOrgExtService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesProdOrgExtService.java @@ -50,6 +50,9 @@ public interface IMesProdOrgExtService { @ApiOperation(value = "根据生产线代码,工位代码,关系类型查询主子工位关系信息") List getWorkCellExtendCfgList(String organizeCode, String workCenterCode, String workCellCode, Integer extendType); + @ApiOperation(value = "根据生产线代码,工位代码查询主子工位实虚关系信息[大于等于Bak工位的seq的数据排在前面]") + List getWorkCellExtendCfgRvListSortByBak(String organizeCode, String workCenterCodeBak, String workCellCodeBak); + @ApiOperation(value = "根据生产线代码,工位代码查询主子工位实虚关系信息") List getWorkCellExtendCfgRvListByBak(String organizeCode, String workCenterCodeBak, String workCellCodeBak); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesProdOrgExtService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesProdOrgExtService.java index 30749c1..c5a840e 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesProdOrgExtService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesProdOrgExtService.java @@ -165,7 +165,7 @@ public class MesProdOrgExtService implements IMesProdOrgExtService { } @Override - public List getWorkCellExtendCfgRvListByBak(String organizeCode, String workCenterCodeBak, String workCellCodeBak) { + public List getWorkCellExtendCfgRvListSortByBak(String organizeCode, String workCenterCodeBak, String workCellCodeBak) { if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(workCenterCodeBak) || StringUtils.isEmpty(workCellCodeBak)) return null; MesWorkCellExtendCfg workCellExtendCfg = getWorkCellExtendCfg(organizeCode, workCenterCodeBak, workCellCodeBak, MesExtEnumUtil.WORK_CELL_EXTEND_TYPE.RV.getValue()); if (null == workCellCodeBak) return null; @@ -176,7 +176,14 @@ public class MesProdOrgExtService implements IMesProdOrgExtService { workCellExtendCfgList.addAll(workCellExtendCfgListAfter); workCellExtendCfgList.addAll(workCellExtendCfgListBefore); return workCellExtendCfgList; + } + @Override + public List getWorkCellExtendCfgRvListByBak(String organizeCode, String workCenterCodeBak, String workCellCodeBak) { + if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(workCenterCodeBak) || StringUtils.isEmpty(workCellCodeBak)) return null; + MesWorkCellExtendCfg workCellExtendCfg = getWorkCellExtendCfg(organizeCode, workCenterCodeBak, workCellCodeBak, MesExtEnumUtil.WORK_CELL_EXTEND_TYPE.RV.getValue()); + if (null == workCellCodeBak) return null; + return getWorkCellExtendCfgList(organizeCode, workCellExtendCfg.getWorkCenterCode(), workCellExtendCfg.getWorkCellCode(), MesExtEnumUtil.WORK_CELL_EXTEND_TYPE.RV.getValue()); } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellIsVerificationStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellIsVerificationStepService.java index 55260ac..27e4a90 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellIsVerificationStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellIsVerificationStepService.java @@ -39,8 +39,8 @@ public class MesManyCellIsVerificationStepService extends BaseStepService { StepResult stepResult = StepResult.getSuccessComplete(); - //根据生产线代码,工位代码查询主子工位实虚关系信息(排除当前工位) - List workCellExtendCfgList = prodOrgExtService.getWorkCellExtendCfgRvListByBak(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()); + //根据生产线代码,工位代码查询主子工位实虚关系信息[大于等于Bak工位的seq的数据排在前面] + List workCellExtendCfgList = prodOrgExtService.getWorkCellExtendCfgRvListSortByBak(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()); if (CollectionUtils.isEmpty(workCellExtendCfgList)) return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("生产线[%s]工位[%s]未配置实虚工位对应关系", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode())); @@ -48,6 +48,7 @@ public class MesManyCellIsVerificationStepService extends BaseStepService { if (null == workCellExtendCfg) continue; + //排除当前工位 if (workCellExtendCfg.getWorkCenterCodeBak().equals(reqBean.getWorkCenterCode()) && workCellExtendCfg.getWorkCellCodeBak().equals(reqBean.getWorkCellCode())) continue; //验证下个工位是否在线 diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java new file mode 100644 index 0000000..99fbf7b --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java @@ -0,0 +1,85 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesProdOrgExtService; +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.mes.pcn.serviceimpl.fsm.IShippingDispatchService; +import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.IStepService; +import cn.estsh.i3plus.mes.pcn.websocket.StationWebSocket; +import cn.estsh.i3plus.platform.common.util.MesPcnConstWords; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; +import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellExtendCfg; +import cn.estsh.i3plus.pojo.mes.model.StationRequestBean; +import cn.estsh.i3plus.pojo.mes.model.StationResultBean; +import cn.estsh.i3plus.pojo.mes.model.StepResult; +import cn.estsh.impp.framework.boot.util.SpringContextsUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.List; + +/** + * @Description : 验证通过后所有分屏强制跳过工序工步 + * @Author : wangjie + **/ +@Slf4j +@Service("mesManyCellTriggerJumpProcessStepService") +public class MesManyCellTriggerJumpProcessStepService extends BaseStepService { + + @Autowired + private IFsmCommonService fsmCommonService; + + @Autowired + private IMesProdOrgExtService prodOrgExtService; + + @Autowired + private IShippingDispatchService shippingDispatchService; + + @Override + public StepResult execute(StationRequestBean reqBean) { + + StepResult stepResult = StepResult.getSuccessComplete(); + + if (StringUtils.isEmpty(reqBean.getScanInfo())) return stepResult; + + //所有分屏强制跳过工序密码 + String pwd = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.MANY_CELL_TRIGGER_JUMP_PROCESS_PWD); + if (StringUtils.isEmpty(pwd) || !pwd.equals(reqBean.getScanInfo())) return stepResult; + + StationResultBean resultBean = new StationResultBean(); + + //根据生产线代码,工位代码查询主子工位实虚关系信息 + List workCellExtendCfgList = prodOrgExtService.getWorkCellExtendCfgRvListByBak(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()); + + if (CollectionUtils.isEmpty(workCellExtendCfgList)) return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("生产线[%s]工位[%s]未配置实虚工位对应关系", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode())); + + for (MesWorkCellExtendCfg workCellExtendCfg : workCellExtendCfgList) { + + if (null == workCellExtendCfg) continue; + + //验证工位是否在线,当前工位无须验证 + String clientInfo = shippingDispatchService.getActorClientInfo(reqBean.getOrganizeCode(), workCellExtendCfg.getWorkCenterCodeBak(), workCellExtendCfg.getWorkCellCodeBak()); + if (!workCellExtendCfg.getWorkCenterCodeBak().equals(reqBean.getWorkCenterCode()) || !workCellExtendCfg.getWorkCellCodeBak().equals(reqBean.getWorkCellCode())) { + if (CollectionUtils.isEmpty(StationWebSocket.getStationWebSocketList(clientInfo))) continue; + } + + reqBean.setClientInfo(clientInfo); + reqBean.setInterfaceType(MesPcnConstWords.SHIPPING); + reqBean.setBusiType(MesPcnEnumUtil.ACTOR_RECEIVE_STRATEGY.WS_CMD_DO_SCAN.getCode()); + reqBean.setForceJumpProcess(true); + shippingDispatchService.sendScanQueueNextExec(reqBean); + + } + + stepSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format("生产线[%s]工位[%s]触发所有在线分屏重置工序成功!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode())); + + return stepResult; + + } + +} 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 d986680..4e2e807 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 @@ -400,6 +400,8 @@ public class MesPcnExtConstWords { public static final String ENDLESS_LOOP_READ_TIMES = "ENDLESS_LOOP_READ_TIMES"; // 死循环读取默认默认次数 public static final String ENDLESS_LOOP_READ_TIMES_DEFAULT = "10"; + // 所有分屏强制跳过工序密码[工位参数] + public static final String MANY_CELL_TRIGGER_JUMP_PROCESS_PWD = "MANY_CELL_TRIGGER_JUMP_PROCESS_PWD"; // 工位/工步 参数按钮事件 public static final String FUNCTION_CMD = "FUNCTION_CMD"; From 35f98ef220829438b32286d91a85abc9d46ddb86 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Sat, 28 Dec 2024 16:41:02 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=2044630=20=E8=AF=BB=E8=83=8E=E8=86=9C?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E5=B7=A5=E6=AD=A5=EF=BC=8C=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E9=80=82=E9=85=8D=E6=9F=94=E6=80=A7=E7=84=8A=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=EF=BC=8C=E9=9C=80=E8=A6=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../step/MesManyCellTriggerJumpProcessStepService.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java index 99fbf7b..0e239d3 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java @@ -16,6 +16,7 @@ import cn.estsh.i3plus.pojo.mes.model.StationResultBean; import cn.estsh.i3plus.pojo.mes.model.StepResult; import cn.estsh.impp.framework.boot.util.SpringContextsUtil; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -24,7 +25,7 @@ import org.springframework.util.StringUtils; import java.util.List; /** - * @Description : 验证通过后所有分屏强制跳过工序工步 + * @Description : 验证通过后所有分屏强制重置工序工步 * @Author : wangjie **/ @Slf4j @@ -68,11 +69,15 @@ public class MesManyCellTriggerJumpProcessStepService extends BaseStepService { if (CollectionUtils.isEmpty(StationWebSocket.getStationWebSocketList(clientInfo))) continue; } - reqBean.setClientInfo(clientInfo); - reqBean.setInterfaceType(MesPcnConstWords.SHIPPING); - reqBean.setBusiType(MesPcnEnumUtil.ACTOR_RECEIVE_STRATEGY.WS_CMD_DO_SCAN.getCode()); - reqBean.setForceJumpProcess(true); - shippingDispatchService.sendScanQueueNextExec(reqBean); + StationRequestBean stationRequestBean = new StationRequestBean(); + BeanUtils.copyProperties(reqBean, stationRequestBean); + stationRequestBean.setWorkCenterCode(workCellExtendCfg.getWorkCenterCodeBak()); + stationRequestBean.setWorkCellCode(workCellExtendCfg.getWorkCellCodeBak()); + stationRequestBean.setClientInfo(clientInfo); + stationRequestBean.setInterfaceType(MesPcnConstWords.SHIPPING); + stationRequestBean.setBusiType(MesPcnEnumUtil.ACTOR_RECEIVE_STRATEGY.WS_CMD_DO_SCAN.getCode()); + stationRequestBean.setForceJumpProcess(true); + shippingDispatchService.sendScanQueueNextExec(stationRequestBean); } From 601b16567a6352b94e9c9edb25a6b34fafc12055 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Sat, 28 Dec 2024 17:16:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=2044630=20=E8=AF=BB=E8=83=8E=E8=86=9C?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E5=B7=A5=E6=AD=A5=EF=BC=8C=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E9=80=82=E9=85=8D=E6=9F=94=E6=80=A7=E7=84=8A=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=EF=BC=8C=E9=9C=80=E8=A6=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java index 0e239d3..b030fba 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java @@ -48,6 +48,8 @@ public class MesManyCellTriggerJumpProcessStepService extends BaseStepService { if (StringUtils.isEmpty(reqBean.getScanInfo())) return stepResult; + stepResult.unResetScanInfo(); + //所有分屏强制跳过工序密码 String pwd = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.MANY_CELL_TRIGGER_JUMP_PROCESS_PWD); if (StringUtils.isEmpty(pwd) || !pwd.equals(reqBean.getScanInfo())) return stepResult;