Browse Source

rev:更新

master
gengby 2 months ago
parent
commit
4c3bb4dfa6
  1. 2
      nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java
  2. 10
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java
  3. 2
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/GateWayService.java
  4. 8
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java
  5. 21
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java
  6. 2
      nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml

2
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("项目启动成功");
}

10
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<JSONObject> request =
CommonRequest.<JSONObject>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));
// }
}
}

2
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有误");

8
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);
}

21
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;
}
}

2
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:

Loading…
Cancel
Save