|
|
|
@ -53,6 +53,10 @@ public class WriteVariableService implements IWriteVariableService {
|
|
|
|
|
public MesEquipVariableRwResult writeVariable(StationRequestBean reqBean, String value, MesEquipmentVariable equipmentVariable, String kepwareFlag, Integer foreignKey, Integer index, Integer maxTimes) {
|
|
|
|
|
// 需要不同的策略不同的转换方式
|
|
|
|
|
String newValue = transferValue(reqBean, value, foreignKey, index);
|
|
|
|
|
if (StringUtils.isEmpty(newValue)) {
|
|
|
|
|
LOGGER.info("发送的值为空,不予发送");
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
MesEquipVariableRwResult mesEquipVariableRwResult = equipVariableRwExtService.writeVariable(newValue, equipmentVariable, kepwareFlag);
|
|
|
|
|
if (!mesEquipVariableRwResult.getIsSuccessed() && mesEquipVariableRwResult.getIsNoCfg()) {
|
|
|
|
|
for (int i = 0;i < maxTimes; i++) {
|
|
|
|
@ -90,6 +94,9 @@ public class WriteVariableService implements IWriteVariableService {
|
|
|
|
|
if (StringUtils.isEmpty(value)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
if (mesProductionPartContext == null) {
|
|
|
|
|
mesProductionPartContext = new MesProductionPartContext();
|
|
|
|
|
}
|
|
|
|
|
switch (value.toUpperCase()) {
|
|
|
|
|
case "%RESULT%" : newValue = mesProductionPartContext.getPartNo(); break;
|
|
|
|
|
case "%PARAM%": newValue = mesProductionPartContext.getWorkOrderNo(); break;
|
|
|
|
|