|
|
@ -103,6 +103,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
log.info("开始反馈wms任务状态,请求参数:{}", JSON.toJSONString(data)); |
|
|
|
this.getTokenFromWms(); |
|
|
|
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); |
|
|
|
String password=paramService.findByCode(AcsConfig.PASSWORD).getValue(); |
|
|
|
HttpResponse result = null; |
|
|
|
AddressDto addressDto = addressService.findByCode("feedbackTaskStatusToWms"); |
|
|
|
String methods_url = addressDto.getMethods_url(); |
|
|
@ -113,7 +114,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
result = HttpRequest |
|
|
|
.post(url) |
|
|
|
.header("Content-Type", "application/json;charset=UTF-8") |
|
|
|
.basicAuth("INFOR","Aa123456@@!!") |
|
|
|
.basicAuth("INFOR",password) |
|
|
|
.body(JSON.toJSONString(data)) |
|
|
|
.timeout(3000) |
|
|
|
.execute(); |
|
|
@ -535,6 +536,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
MDC.put(log_file_type, log_type); |
|
|
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { |
|
|
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); |
|
|
|
String password=paramService.findByCode(AcsConfig.PASSWORD).getValue(); |
|
|
|
AddressDto addressDto = addressService.findByCode("shipDeviceUpdate"); |
|
|
|
String methods_url = addressDto.getMethods_url(); |
|
|
|
String url = wmsUrl + methods_url; |
|
|
@ -543,7 +545,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
ja.add(param); |
|
|
|
HttpResponse result=HttpRequest.post(url) |
|
|
|
.body(ja.toString()) |
|
|
|
.basicAuth("INFOR","Aa123456@@!!") |
|
|
|
.basicAuth("INFOR",password) |
|
|
|
.execute(); |
|
|
|
log.info("shipDeviceUpdate - 返回参数 {}", result.body()); |
|
|
|
return JSONObject.parseObject(result.body()); |
|
|
@ -563,6 +565,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
|
|
|
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { |
|
|
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); |
|
|
|
String password=paramService.findByCode(AcsConfig.PASSWORD).getValue(); |
|
|
|
AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus"); |
|
|
|
String methodsUrl = addressDto.getMethods_url(); |
|
|
|
String url = wmsUrl + methodsUrl; |
|
|
@ -570,7 +573,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
HttpResponse response = HttpRequest |
|
|
|
.post(url) |
|
|
|
.body(from.toString()) |
|
|
|
.basicAuth("INFOR","Aa123456@@!!") |
|
|
|
.basicAuth("INFOR",password) |
|
|
|
.execute(); |
|
|
|
log.info("feedAgvTaskStatus - 返回参数 {}", response.body()); |
|
|
|
return JSONObject.parseObject(response.body()); |
|
|
@ -626,7 +629,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
@Override |
|
|
|
public HttpResponse feedbackAgvDeviceStatus(String device_code, String hasGoods) { |
|
|
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); |
|
|
|
|
|
|
|
String password=paramService.findByCode(AcsConfig.PASSWORD).getValue(); |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("device_code", device_code); |
|
|
|
json.put("is_have", hasGoods); |
|
|
@ -640,7 +643,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
try { |
|
|
|
result = HttpRequest.post(url) |
|
|
|
.body(String.valueOf(json)) |
|
|
|
.basicAuth("INFOR","Aa123456@@!!") |
|
|
|
.basicAuth("INFOR",password) |
|
|
|
.execute(); |
|
|
|
System.out.println(result); |
|
|
|
log.info("feedbackAgvDeviceStatus----返回参数{}", result); |
|
|
|