fix 反馈设备状态

This commit is contained in:
张江玮
2023-08-21 15:15:55 +08:00
parent dfd6573b2c
commit bf528e48f4
9 changed files with 65 additions and 60 deletions

View File

@@ -447,7 +447,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", this.getError_message());
param.put("error_msg", error == 0 ? "" : this.getError_message());
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "4");
param.put("product_area", paramService.findByCode("productArea").getValue());

View File

@@ -690,7 +690,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", this.getError_message());
param.put("error_msg", error == 0 ? "" : this.getError_message());
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "4");
param.put("product_area", ParamService.findByCode("productArea").getValue());

View File

@@ -118,11 +118,11 @@ public class DeviceStatusDeviceDriver extends AbstractOpcDeviceDriver implements
}
public void setIserror(Boolean iserror) {
this.iserror = iserror;
if (this.iserror != this.last_iserror && this.iserror && device_id.startsWith("RGV")) {
if (this.iserror != this.last_iserror && device_id.startsWith("RGV")) {
JSONObject param = new JSONObject();
param.put("device_code", this.device_id);
param.put("error", alarm);
param.put("error_msg", ErrorUtil.getDictDetail("ssx_error_type", alarm));
param.put("error_msg", iserror ? ErrorUtil.getDictDetail("ssx_error_type", alarm) : "");
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "3");
param.put("product_area", paramService.findByCode("productArea").getValue());

View File

@@ -222,16 +222,17 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
String errorInfo = ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(error));
dto.setError_info(errorInfo);
deviceErrorLogService.create(dto);
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", errorInfo);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "2");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(error)));
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "2");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
}

View File

@@ -272,18 +272,19 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error));
dto.setError_info(errorInfo);
deviceErrorLogService.create(dto);
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) {
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", errorInfo);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
}
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) {
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
}

View File

@@ -228,16 +228,17 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error));
dto.setError_info(errorInfo);
deviceErrorLogService.create(dto);
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", errorInfo);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
}

View File

@@ -206,16 +206,17 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error));
dto.setError_info(errorInfo);
deviceErrorLogService.create(dto);
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", errorInfo);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(
this.device_code, "", "", "信号error" + last_error + "->" + error);

View File

@@ -187,16 +187,16 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error));
dto.setError_info(errorInfo);
deviceErrorLogService.create(dto);
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", errorInfo);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
} catch (Exception var17) {
var17.printStackTrace();

View File

@@ -266,16 +266,17 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
String errorInfo = ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(error));
dto.setError_info(errorInfo);
deviceErrorLogService.create(dto);
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", errorInfo);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "2");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(error)));
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "2");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
}