From 2ddc6df153fb97240985dd1d2560cb3f9c3f9e20 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Thu, 27 Oct 2022 08:42:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hailiang/hailiang_flat/ItemProtocol.java | 4 +-- .../nl/hand/service/impl/HandServiceImpl.java | 28 ++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_flat/ItemProtocol.java b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_flat/ItemProtocol.java index 4c4f8f9..a2a3830 100644 --- a/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_flat/ItemProtocol.java +++ b/nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_flat/ItemProtocol.java @@ -538,7 +538,7 @@ public class ItemProtocol { list.add(new ItemDto(item_strapping_seat8, "捆扎段占位8", "I29.4")); list.add(new ItemDto(item_strapping_seat9, "捆扎段占位9", "I29.5")); list.add(new ItemDto(item_strapping_seat10, "捆扎段占位10", "I29.6")); - list.add(new ItemDto(item_strapping_seat10, "捆扎段占位11", "I35.5")); + list.add(new ItemDto(item_strapping_seat11, "捆扎段占位11", "I35.5")); list.add(new ItemDto(item_strapping_seat12, "捆扎段占位12", "I36.7")); list.add(new ItemDto(item_a_error1_clear, "A侧摇杆出料异常复位", "DB214.X10.7")); list.add(new ItemDto(item_b_error1_clear, "B侧摇杆出料异常复位", "DB234.X10.7")); @@ -617,7 +617,7 @@ public class ItemProtocol { //list.add(new ItemDto(item_strapping_seat8, "捆扎段占位8", "I29.4")); //list.add(new ItemDto(item_strapping_seat9, "捆扎段占位9", "I29.5")); //list.add(new ItemDto(item_strapping_seat10, "捆扎段占位10", "I29.6")); - //list.add(new ItemDto(item_strapping_seat10, "捆扎段占位11", "I35.5")); + //list.add(new ItemDto(item_strapping_seat11, "捆扎段占位11", "I35.5")); //list.add(new ItemDto(item_strapping_seat12, "捆扎段占位12", "I36.7")); list.add(new ItemDto(item_a_error1_clear, "A侧摇杆出料异常复位", "DB214.X10.7")); list.add(new ItemDto(item_b_error1_clear, "B侧摇杆出料异常复位", "DB234.X10.7")); diff --git a/nladmin-system/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java b/nladmin-system/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java index 4fd7dae..b80be98 100644 --- a/nladmin-system/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java +++ b/nladmin-system/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java @@ -411,10 +411,11 @@ public class HandServiceImpl implements HandService { String name = param.get("name"); String type = param.get("type"); String value = param.get("value"); - Device device = deviceAppService.findDeviceByCode("PB01"); - HailiangFlatDeviceDriver hailiangFlatDeviceDriver; - if (device.getDeviceDriver() instanceof HailiangFlatDeviceDriver){ - hailiangFlatDeviceDriver = (HailiangFlatDeviceDriver) device.getDeviceDriver(); + HailiangFlatDeviceDriver hailiangFlatDeviceDriver = deviceAppService.findDeviceDriver(HailiangFlatDeviceDriver.class).get(0); + //Device device = deviceAppService.findDeviceByCode("PB01"); + //HailiangFlatDeviceDriver hailiangFlatDeviceDriver; + //if (device.getDeviceDriver() instanceof HailiangFlatDeviceDriver){ + // hailiangFlatDeviceDriver = (HailiangFlatDeviceDriver) device.getDeviceDriver(); if (type.equals("1")){ hailiangFlatDeviceDriver.writing(name,value); }else if (type.equals("2")){ @@ -428,7 +429,7 @@ public class HandServiceImpl implements HandService { } else { hailiangFlatDeviceDriver.writing(name,value); } - } + // } // 返回 resultJSON.put("code", "1"); resultJSON.put("desc", "下发成功"); @@ -437,11 +438,12 @@ public class HandServiceImpl implements HandService { @Override public JSONObject queryDeviceInfo() { - Device device = deviceAppService.findDeviceByCode("PB01"); + HailiangFlatDeviceDriver hailiangFlatDeviceDriver = deviceAppService.findDeviceDriver(HailiangFlatDeviceDriver.class).get(0); + //Device device = deviceAppService.findDeviceByCode("PB01"); JSONObject resp = new JSONObject(); - HailiangFlatDeviceDriver hailiangFlatDeviceDriver; - if (device.getDeviceDriver() instanceof HailiangFlatDeviceDriver){ - hailiangFlatDeviceDriver = (HailiangFlatDeviceDriver) device.getDeviceDriver(); + //HailiangFlatDeviceDriver hailiangFlatDeviceDriver; + //if (device.getDeviceDriver() instanceof HailiangFlatDeviceDriver){ + // hailiangFlatDeviceDriver = (HailiangFlatDeviceDriver) device.getDeviceDriver(); int is_auto = hailiangFlatDeviceDriver.getIs_auto(); int is_running = hailiangFlatDeviceDriver.getIs_running(); int mode = hailiangFlatDeviceDriver.getMode(); @@ -595,9 +597,9 @@ public class HandServiceImpl implements HandService { result.put("error_clear",error_clear); resp.put("result",result); return resp; - } - resp.put("code","0"); - resp.put("desc","查询失败"); - return resp; + // } + // resp.put("code","0"); + // resp.put("desc","查询失败"); + // return resp; } }