fix 反馈设备状态

This commit is contained in:
张江玮
2023-08-18 14:56:12 +08:00
parent 398148cf7a
commit 36907a602a
9 changed files with 57 additions and 0 deletions

View File

@@ -448,6 +448,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", this.getError_message());
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "4");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
@@ -472,6 +475,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", status);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "4");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}

View File

@@ -691,6 +691,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
param.put("device_code", this.device_code);
param.put("error", error);
param.put("error_msg", this.getError_message());
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "4");
param.put("product_area", ParamService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -715,6 +718,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", status);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "4");
param.put("product_area", ParamService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}

View File

@@ -123,6 +123,9 @@ public class DeviceStatusDeviceDriver extends AbstractOpcDeviceDriver implements
param.put("device_code", this.device_id);
param.put("error", alarm);
param.put("error_msg", 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());
acsToWmsService.sendDeviceStatus(param);
}
this.last_iserror = iserror;

View File

@@ -37,6 +37,8 @@ import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.service.ParamService;
import org.nl.modules.system.service.impl.ParamServiceImpl;
import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired;
@@ -67,6 +69,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
@Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class);
//工作模式
int mode = 0;
int last_mode = 0;
@@ -180,6 +183,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", mode);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "2");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
if (mode == 2) {
@@ -221,6 +227,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
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);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));

View File

@@ -233,6 +233,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", mode);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
@@ -275,6 +278,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
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);
}
}

View File

@@ -191,6 +191,9 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", mode);
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, "mode", String.valueOf(mode));
@@ -230,6 +233,9 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
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);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));

View File

@@ -174,6 +174,9 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", mode);
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, "mode", String.valueOf(mode));
@@ -208,6 +211,9 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
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);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));

View File

@@ -165,6 +165,9 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", mode);
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 (to_command != last_to_command) {
@@ -189,6 +192,9 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
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);
}
}

View File

@@ -34,6 +34,8 @@ import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.service.ParamService;
import org.nl.modules.system.service.impl.ParamServiceImpl;
import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired;
@@ -64,6 +66,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
@Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class);
//分切行架机械手是否禁用 0否 1是
private int is_disable = 0;
private String error_type = "fqhj_error_type";
@@ -233,6 +236,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", mode);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "2");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
inst_type = null;
@@ -265,6 +271,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
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);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));