pangshenghao 1 year ago
parent
commit
d56eb60dfc
  1. 2
      acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/ToAgvDevice.java

2
acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/ToAgvDevice.java

@ -29,13 +29,13 @@ public class ToAgvDevice {
DeviceAppService deviceAppService; DeviceAppService deviceAppService;
public void run() throws Exception { public void run() throws Exception {
JSONArray agv_rows = new JSONArray(); JSONArray agv_rows = new JSONArray();
JSONObject row = new JSONObject();
AgvNdcOneDeviceDriver agvNdcOneDeviceDriver; AgvNdcOneDeviceDriver agvNdcOneDeviceDriver;
try { try {
List<Device> deviceList = deviceAppService.findDeviceByType(DeviceType.agv); List<Device> deviceList = deviceAppService.findDeviceByType(DeviceType.agv);
for(Device device:deviceList) { for(Device device:deviceList) {
if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) { if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) {
JSONObject row = new JSONObject();
agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver(); agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver();
row.put("device_code", String.valueOf(device.getDevice_code())); row.put("device_code", String.valueOf(device.getDevice_code()));
row.put("energyLevel", String.valueOf(agvNdcOneDeviceDriver.getElectric_qty())); row.put("energyLevel", String.valueOf(agvNdcOneDeviceDriver.getElectric_qty()));

Loading…
Cancel
Save