|
|
|
@ -107,20 +107,25 @@ public class MesSendProcessCmdStepService extends BaseStepService {
|
|
|
|
|
|
|
|
|
|
//写值
|
|
|
|
|
for (MesEquipmentVariable equipmentVariable : equipmentVariableList) {
|
|
|
|
|
equipVariableRwResult = equipVariableRwExtService.writeVariable(categoryLevelTwoMap.get(equipmentVariable.getCategoryLevelTwo()).get(0), equipmentVariable, kepwareFlag);
|
|
|
|
|
this.sendMessage(reqBean, resultBean, JSONObject.toJSONString(equipVariableRwResult), MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
|
|
|
|
|
if (!equipVariableRwResult.getIsSuccessed()) break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!equipVariableRwResult.getIsSuccessed() && equipVariableRwResult.getIsNoCfg()) execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format("设备[%s]:允许加工指令发送失败!原因:%s", cellEquipContext.getEquipmentName(), equipVariableRwResult.getMessage()));
|
|
|
|
|
equipVariableRwResult = equipVariableRwExtService.writeVariable(categoryLevelTwoMap.get(equipmentVariable.getCategoryLevelTwo()).get(0), equipmentVariable, kepwareFlag);
|
|
|
|
|
|
|
|
|
|
if (equipVariableRwResult.getIsSuccessed()) {
|
|
|
|
|
String message = String.format("设备[%s]:允许加工指令发送成功!", cellEquipContext.getEquipmentName());
|
|
|
|
|
this.sendMessage(reqBean, new StationResultBean().writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), String.format("%s%s", message, equipVariableRwResult.getMessage()), MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
|
|
|
|
|
return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean, stepResult, message);
|
|
|
|
|
this.sendMessage(reqBean, new StationResultBean().writeDbLog().checkRepeatType(false), String.format("[%s]%s", cellEquipContext.getEquipmentName(), equipVariableRwResult.getMessage()), MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
|
|
|
|
|
} else {
|
|
|
|
|
this.sendMessage(reqBean, new StationResultBean().writeDbLog().checkRepeatType(false), String.format("设备[%s]:允许加工指令发送失败!原因:%s", cellEquipContext.getEquipmentName(), JSONObject.toJSONString(equipVariableRwResult)), MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
execNonCompleteAndSendMsg(reqBean, resultBean.writeDbLog(), stepResult, String.format("设备[%s]:允许加工指令发送失败!累计次数[%s]!原因:%s", cellEquipContext.getEquipmentName(), i, equipVariableRwResult.getMessage()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!equipVariableRwResult.getIsSuccessed() && equipVariableRwResult.getIsNoCfg())
|
|
|
|
|
execExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format("设备[%s]:允许加工指令发送失败!原因:%s", cellEquipContext.getEquipmentName(), equipVariableRwResult.getMessage()));
|
|
|
|
|
|
|
|
|
|
if (equipVariableRwResult.getIsSuccessed())
|
|
|
|
|
return execSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("设备[%s]:允许加工指令发送成功!", cellEquipContext.getEquipmentName()));
|
|
|
|
|
|
|
|
|
|
execNonCompleteAndSendMsg(reqBean, resultBean.writeDbLog().checkRepeatType(false), stepResult, String.format("设备[%s]:允许加工指令发送失败!累计次数[%s]!原因:%s", cellEquipContext.getEquipmentName(), i, equipVariableRwResult.getMessage()));
|
|
|
|
|
|
|
|
|
|
//每失败一次 睡眠
|
|
|
|
|
if (i != maxRetryTimes) threadSleep(stepParamMap, MesPcnExtConstWords.READ_FAILURE_SLEEP, MesPcnExtConstWords.READ_FAILURE_SLEEP_DEFAULT_TIME);
|
|
|
|
|