diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java b/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java index 15a6204..4a05fd0 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java @@ -40,7 +40,7 @@ public class AppRun { public static void main(String[] args) { SpringApplication.run(AppRun.class, args); - new HeartServer(new InetSocketAddress("192.168.8.218", 20889)); + new HeartServer(new InetSocketAddress("192.168.18.218", 20889)); System.out.println("项目启动成功"); } diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java index 3afa788..30afd01 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java @@ -372,7 +372,9 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc return; } JSONObject param = new JSONObject(); - param.put(this.barcode, this.currentDeviceCode); + param.put("vehicle_code", this.barcode); + param.put("start_point", this.currentDeviceCode); + param.put("height", this.height); CommonRequest request = CommonRequest.builder() .service("InStorage") @@ -855,9 +857,9 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc // this.writing(Arrays.asList(ItemProtocol.TO_COMMAND.getKey()), Arrays.asList(CommandEnum.COMMAND_1.getValue())); // this.requireSuccess = true; // } else { - Integer address = Optional.ofNullable(next_device.getExtraValue().get("address")).map(Object::toString).map(Integer::parseInt).orElse(0); - this.writing(Arrays.asList(ItemProtocol.TO_TASK.getKey(),ItemProtocol.TO_TARGET.getKey()), Arrays.asList(inst.getInstruction_code(),address)); - //this.writing(Arrays.asList(ItemProtocol.TO_TARGET.getKey()), Arrays.asList(address)); + Integer address = Optional.ofNullable(next_device.getExtraValue().get("address")).map(Object::toString).map(Integer::parseInt).orElse(0); + this.writing(Arrays.asList(ItemProtocol.TO_TASK.getKey(), ItemProtocol.TO_TARGET.getKey()), Arrays.asList(inst.getInstruction_code(), address)); + //this.writing(Arrays.asList(ItemProtocol.TO_TARGET.getKey()), Arrays.asList(address)); // } } } diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/GateWayService.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/GateWayService.java index 00688e7..75d02a5 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/GateWayService.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/GateWayService.java @@ -26,6 +26,8 @@ public class GateWayService { return wmsToAcsService.pinkStartStop(request.handleObject()); } else if ("toCommand".equals(request.getType())) { return wmsToAcsService.toCommand(request.handleObject()); + } else if ("getWeight".equals(request.getType())){ + return wmsToAcsService.getWeight(request.handleObject()); } resp.put("code", "400"); resp.put("msg", "type有误"); diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java index 892f35d..eb025ac 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java @@ -39,4 +39,12 @@ public interface WmsToAcsService { * @return */ JSONObject toCommand(JSONObject req); + + /** + * 获取重量 + * + * @param req + * @return + */ + JSONObject getWeight(JSONObject req); } diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 64ca584..8246e4a 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -358,4 +358,25 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { return resp; } + @Override + public JSONObject getWeight(JSONObject req) { + log.info("getWeight--------------:输入参数:" + JSON.toJSONString(req)); + Assert.notNull(req); + String device_code = req.getString("device_code"); + Device device = deviceAppService.findDeviceByCode(device_code); + JSONObject resp = new JSONObject(); + JSONObject data = new JSONObject(); + if (device != null && device.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver){ + AppearanceInspectionScannerConveyorDeviceDriver appearanceInspectionScannerConveyorDeviceDriver = (AppearanceInspectionScannerConveyorDeviceDriver) device.getDeviceDriver(); + data.put("weight",appearanceInspectionScannerConveyorDeviceDriver.getWeight()); + } else { + throw new BadRequestException("设备不存在"); + } + resp.put("code","200"); + resp.put("msg", "获取成功"); + resp.put("data",data); + log.info("getWeight--------------:输出参数:" + JSON.toJSONString(resp)); + return resp; + } + } diff --git a/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml b/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml index 61d70c4..5b25fc8 100644 --- a/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml +++ b/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml @@ -77,7 +77,7 @@ spring: active: true username: root password: 123456 - url: 192.168.8.218 + url: 192.168.18.218 clientId: hs_mqtt_prod cleanSession: false topics: