From a270c26ed3cdd19b7b228bce04d9f1e5143872cb Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Wed, 20 Dec 2023 16:53:15 +0800 Subject: [PATCH] jx pcn plc pass cfg noplc not need cfg plc --- .../busi/step/jx/JxCenterPlcPassStepService.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/step/jx/JxCenterPlcPassStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/step/jx/JxCenterPlcPassStepService.java index 07f8574..d485d2c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/step/jx/JxCenterPlcPassStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/step/jx/JxCenterPlcPassStepService.java @@ -49,16 +49,24 @@ public class JxCenterPlcPassStepService extends BaseStepService { if (forceCmd) reqBean.getDataMap().remove(forceCmdKey); fsmCommonService.checkWcpcMapForDoScan(reqBean); - String plcCode = fsmCommonService.getAndCheckWcpcMapIsContainsKey(reqBean, reqBean.getWcpcMap(), MesPcnExtConstWords.PLC_CODE_UC); + String plcPassValueParamCode = reqBean.getDataMap().containsKey(MesPcnExtConstWords.PLC_PASS_VALUE) ? (String) reqBean.getDataMap().get(MesPcnExtConstWords.PLC_PASS_VALUE) : MesPcnExtConstWords.PLC_PASS_VALUE; String plcPassValue = fsmCommonService.getAndCheckWcpcMapIsContainsKey(reqBean, reqBean.getWcpcMap(), plcPassValueParamCode); - if (StringUtils.isEmpty(plcCode) || StringUtils.isEmpty(plcPassValue)) foundExThrowNoShowMsg(); + if (StringUtils.isEmpty(plcPassValue)) foundExThrowNoShowMsg(); + + if (!plcPassValue.equals("noplc")) { + + String plcCode = fsmCommonService.getAndCheckWcpcMapIsContainsKey(reqBean, reqBean.getWcpcMap(), MesPcnExtConstWords.PLC_CODE_UC); - MesPlc plcDb = getPlcDb(reqBean, resultBean, plcCode); - if (null == plcDb) execExpSendMsgAndThrowEx(reqBean, resultBean, String.format("生产线[%s]工位[%s]工位参数[%s]值[%s]对应的PLC信息不存在!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), MesPcnExtConstWords.PLC_CODE_UC, plcCode)); + if (StringUtils.isEmpty(plcCode)) foundExThrowNoShowMsg(); - if (!plcPassValue.equals("noplc") && !plcExtService.doWriteOpcParamValue(plcDb, plcPassValue)) - execExpSendMsgAndThrowEx(reqBean, resultBean, String.format("生产线[%s]工位[%s]%s放行失败:写入PLC[%s]值[%s]失败!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), !forceCmd ? MesPcnExtConstWords.EMPTY : "强制", plcCode, plcPassValue)); + MesPlc plcDb = getPlcDb(reqBean, resultBean, plcCode); + if (null == plcDb) execExpSendMsgAndThrowEx(reqBean, resultBean, String.format("生产线[%s]工位[%s]工位参数[%s]值[%s]对应的PLC信息不存在!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), MesPcnExtConstWords.PLC_CODE_UC, plcCode)); + + if (!plcExtService.doWriteOpcParamValue(plcDb, plcPassValue)) + execExpSendMsgAndThrowEx(reqBean, resultBean, String.format("生产线[%s]工位[%s]%s放行失败:写入PLC[%s]值[%s]失败!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), !forceCmd ? MesPcnExtConstWords.EMPTY : "强制", plcCode, plcPassValue)); + + } if (reqBean.getDataMap().containsKey(MesPcnExtConstWords.PLC_PASS_VALUE)) reqBean.getDataMap().remove(MesPcnExtConstWords.PLC_PASS_VALUE);