|
|
@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import net.sf.json.JSONArray; |
|
|
|
import net.sf.json.JSONObject; |
|
|
|
import org.nl.acs.device.service.DeviceService; |
|
|
|
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; |
|
|
|
import org.nl.acs.opc.Device; |
|
|
|
import org.nl.acs.opc.DeviceAppService; |
|
|
@ -47,6 +48,7 @@ public class HsDeviceStatus { |
|
|
|
String device_code = MapUtil.getStr(whereJson1, "device_code"); |
|
|
|
Device deviceApp = deviceAppService.findDeviceByCode(device_code); |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
if (deviceApp.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) deviceApp.getDeviceDriver(); |
|
|
|
jo.put("device_code", device_code); |
|
|
@ -56,6 +58,15 @@ public class HsDeviceStatus { |
|
|
|
jo.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); |
|
|
|
jo.put("islock", standardOrdinarySiteDeviceDriver.getIslock()); |
|
|
|
} |
|
|
|
if (deviceApp.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) deviceApp.getDeviceDriver(); |
|
|
|
jo.put("device_code", device_code); |
|
|
|
jo.put("quantity", standardInspectSiteDeviceDriver.getQty()); |
|
|
|
jo.put("material_type", standardInspectSiteDeviceDriver.getMaterial()); |
|
|
|
jo.put("hasGood", standardInspectSiteDeviceDriver.getHasGoods()); |
|
|
|
jo.put("remark", standardInspectSiteDeviceDriver.getRemark()); |
|
|
|
jo.put("islock", standardInspectSiteDeviceDriver.getIslock()); |
|
|
|
} |
|
|
|
device.add(jo); |
|
|
|
} |
|
|
|
for (int i = 0; i < array2.size(); i++) { |
|
|
@ -63,6 +74,7 @@ public class HsDeviceStatus { |
|
|
|
String device_code = MapUtil.getStr(whereJson2, "device_code"); |
|
|
|
Device deviceApp = deviceAppService.findDeviceByCode(device_code); |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; |
|
|
|
if (deviceApp.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) deviceApp.getDeviceDriver(); |
|
|
|
jo.put("device_code", device_code); |
|
|
@ -72,6 +84,15 @@ public class HsDeviceStatus { |
|
|
|
jo.put("remark", standardOrdinarySiteDeviceDriver.getRemark()); |
|
|
|
jo.put("islock", standardOrdinarySiteDeviceDriver.getIslock()); |
|
|
|
} |
|
|
|
if (deviceApp.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) deviceApp.getDeviceDriver(); |
|
|
|
jo.put("device_code", device_code); |
|
|
|
jo.put("quantity", standardInspectSiteDeviceDriver.getQty()); |
|
|
|
jo.put("material_type", standardInspectSiteDeviceDriver.getMaterial()); |
|
|
|
jo.put("hasGood", standardInspectSiteDeviceDriver.getHasGoods()); |
|
|
|
jo.put("remark", standardInspectSiteDeviceDriver.getRemark()); |
|
|
|
jo.put("islock", standardInspectSiteDeviceDriver.getIslock()); |
|
|
|
} |
|
|
|
device2.add(jo); |
|
|
|
} |
|
|
|
json.put("device", device); |
|
|
|