|
@ -358,4 +358,25 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
return resp; |
|
|
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; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|