jx pcn 采集

tags/yfai-pcn-ext-v1.0
王杰 1 year ago
parent 93e2fa70c0
commit 5aee02e7f2

@ -82,7 +82,7 @@ public class JxSnProcessingCollectProductDataStepService extends BaseStepService
fsmCommonService.checkWcpcMapForDoScan(reqBean);
String plcCodes = fsmCommonService.getAndCheckWcpcMapIsContainsKey(reqBean, reqBean.getWcpcMap(), MesPcnExtConstWords.PLC_CODE_UC);
String plcCodes = fsmCommonService.getAndCheckWcpcMapIsContainsKey(reqBean, reqBean.getWcpcMap(), MesPcnExtConstWords.PLC_CODES_UC);
if (StringUtils.isEmpty(plcCodes)) foundExThrowNoShowMsg();
String key = new StringJoiner(MesPcnExtConstWords.COLON).add(MesPcnExtConstWords.PRODUCT_DATA).add(reqBean.getOrganizeCode()).add(reqBean.getWorkCenterCode()).add(reqBean.getWorkCellCode()).toString();
@ -133,12 +133,12 @@ public class JxSnProcessingCollectProductDataStepService extends BaseStepService
private String[] checkPlcCodeIsValid(StationRequestBean reqBean, StationResultBean resultBean, String plcCodes, String key) {
String[] plcCodeArr = plcCodes.split(MesPcnExtConstWords.COMMA);
if (plcCodeArr.length != 2) execExpSendMsgAndThrowEx(reqBean, resultBean, String.format("生产线[%s]工位[%s]工位参数[%s]维护的PLC代码[%s]无效!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), MesPcnExtConstWords.PLC_CODE_UC, plcCodes));
if (plcCodeArr.length != 2) execExpSendMsgAndThrowEx(reqBean, resultBean, String.format("生产线[%s]工位[%s]工位参数[%s]维护的PLC代码[%s]无效!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), MesPcnExtConstWords.PLC_CODES_UC, plcCodes));
for (String plcCode : plcCodeArr) {
MesPlc plc = plcExtService.getPlcData(reqBean.getOrganizeCode(), key, plcCode);
if (null == plc || (StringUtils.isEmpty(plc.getChannel()) || StringUtils.isEmpty(plc.getDevice()) || StringUtils.isEmpty(plc.getTagAddress())))
execExpSendMsgAndThrowEx(reqBean, resultBean, String.format("生产线[%s]工位[%s]工位参数[%s]维护的PLC代码[%s]其中[%s]未配置有效的PLC信息!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), MesPcnExtConstWords.PLC_CODE_UC, plcCodes, plcCode));
execExpSendMsgAndThrowEx(reqBean, resultBean, String.format("生产线[%s]工位[%s]工位参数[%s]维护的PLC代码[%s]其中[%s]未配置有效的PLC信息!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), MesPcnExtConstWords.PLC_CODES_UC, plcCodes, plcCode));
}
return plcCodeArr;

@ -268,6 +268,8 @@ public class MesPcnExtConstWords {
//PLC代码
public static final String PLC_CODE_UC = "PLC_CODE";
//PLC代码
public static final String PLC_CODES_UC = "PLC_CODES";
//PLC代码
public static final String PLC_CODE = "plcCode";
//对象代码
public static final String OBJECT_CODE = "objectCode";

Loading…
Cancel
Save