|
@ -50,8 +50,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
@Value("${acsTowms.token}") |
|
|
@Value("${acsTowms.token}") |
|
|
public String token; |
|
|
public String token; |
|
|
|
|
|
|
|
|
private String log_file_type="log_file_type"; |
|
|
private String log_file_type = "log_file_type"; |
|
|
private String log_type="ACS请求WMS"; |
|
|
private String log_type = "ACS请求WMS"; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public String applyTaskToWms(String device_code, String container_code, int height, int weight) { |
|
|
public String applyTaskToWms(String device_code, String container_code, int height, int weight) { |
|
@ -96,7 +96,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
// logServer.log("", "applyTaskToWms", type, jo.toString(), result2.body(), String.valueOf(result2.getStatus()), url, container_code);
|
|
|
// logServer.log("", "applyTaskToWms", type, jo.toString(), result2.body(), String.valueOf(result2.getStatus()), url, container_code);
|
|
|
log.info("applyTaskToWms-----输出参数{}", result2.body()); |
|
|
log.info("applyTaskToWms-----输出参数{}", result2.body()); |
|
|
return result2.body(); |
|
|
return result2.body(); |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -136,7 +136,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
} |
|
|
} |
|
|
log.info("applyTaskManipulatorToWms-----输出参数{}", result2.body()); |
|
|
log.info("applyTaskManipulatorToWms-----输出参数{}", result2.body()); |
|
|
return result2; |
|
|
return result2; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -177,7 +177,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
} |
|
|
} |
|
|
log.info("applyOuttoKiln-----输出参数{}", result2.body()); |
|
|
log.info("applyOuttoKiln-----输出参数{}", result2.body()); |
|
|
return result2; |
|
|
return result2; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -218,14 +218,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
} |
|
|
} |
|
|
log.info("lnshApplyTaskToWms-----输出参数{}", result2.body()); |
|
|
log.info("lnshApplyTaskToWms-----输出参数{}", result2.body()); |
|
|
return result2; |
|
|
return result2; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public HttpResponse applyBarcode(JSONObject json) { |
|
|
public HttpResponse applyBarcode(JSONObject json) { |
|
|
try { |
|
|
try { |
|
@ -261,7 +260,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
} |
|
|
} |
|
|
log.info("lnshApplyTaskToWms-----输出参数{}", result2.body()); |
|
|
log.info("lnshApplyTaskToWms-----输出参数{}", result2.body()); |
|
|
return result2; |
|
|
return result2; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -302,7 +301,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
} |
|
|
} |
|
|
log.info("lnshApplyTaskToWms-----输出参数{}", result2.body()); |
|
|
log.info("lnshApplyTaskToWms-----输出参数{}", result2.body()); |
|
|
return result2; |
|
|
return result2; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -332,7 +331,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
JSONObject jo = JSONObject.parseObject(result.body()); |
|
|
JSONObject jo = JSONObject.parseObject(result.body()); |
|
|
return jo; |
|
|
return jo; |
|
|
|
|
|
|
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -361,7 +360,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
log.info("getVehicleTokiln----返回参数{}", result.body()); |
|
|
log.info("getVehicleTokiln----返回参数{}", result.body()); |
|
|
JSONObject jo = JSONObject.parseObject(result.body()); |
|
|
JSONObject jo = JSONObject.parseObject(result.body()); |
|
|
return jo; |
|
|
return jo; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -390,7 +389,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
log.info("getVehicleTokiln----返回参数{}", result.body()); |
|
|
log.info("getVehicleTokiln----返回参数{}", result.body()); |
|
|
return result; |
|
|
return result; |
|
|
|
|
|
|
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -419,7 +418,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
} |
|
|
} |
|
|
log.info("outKiln----返回参数{}", result.body()); |
|
|
log.info("outKiln----返回参数{}", result.body()); |
|
|
return result; |
|
|
return result; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -448,7 +447,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
log.info("enterOrder----返回参数{}", result.body()); |
|
|
log.info("enterOrder----返回参数{}", result.body()); |
|
|
return result; |
|
|
return result; |
|
|
|
|
|
|
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -459,7 +458,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
try { |
|
|
try { |
|
|
MDC.put(log_file_type, log_type); |
|
|
MDC.put(log_file_type, log_type); |
|
|
|
|
|
|
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); |
|
|
String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); |
|
@ -468,7 +467,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
String url = wmsurl + methods_url; |
|
|
String url = wmsurl + methods_url; |
|
|
|
|
|
|
|
|
JSONObject json = new JSONObject(); |
|
|
JSONObject json = new JSONObject(); |
|
|
json.put("device_code",device_code); |
|
|
json.put("device_code", device_code); |
|
|
|
|
|
|
|
|
log.info("getVehicleCode----请求参数{}", json.toString()); |
|
|
log.info("getVehicleCode----请求参数{}", json.toString()); |
|
|
HttpResponse result = null; |
|
|
HttpResponse result = null; |
|
@ -490,7 +489,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
try { |
|
|
try { |
|
|
MDC.put(log_file_type, log_type); |
|
|
MDC.put(log_file_type, log_type); |
|
|
|
|
|
|
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); |
|
|
String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); |
|
@ -499,7 +498,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
String url = wmsurl + methods_url; |
|
|
String url = wmsurl + methods_url; |
|
|
|
|
|
|
|
|
JSONObject json = new JSONObject(); |
|
|
JSONObject json = new JSONObject(); |
|
|
json.put("vehicle_code",vehicle_code); |
|
|
json.put("vehicle_code", vehicle_code); |
|
|
|
|
|
|
|
|
log.info("getVehiclePoint----请求参数{}", json.toString()); |
|
|
log.info("getVehiclePoint----请求参数{}", json.toString()); |
|
|
HttpResponse result = null; |
|
|
HttpResponse result = null; |
|
@ -519,49 +518,39 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public HttpResponse feedbackTaskStatusToWms(JSONArray data) { |
|
|
public HttpResponse feedbackTaskStatusToWms(JSONArray data) { |
|
|
|
|
|
log.info("feedbackTaskStatusToWms-----请求参数{}", data.toString()); |
|
|
try { |
|
|
try { |
|
|
MDC.put(log_file_type, log_type); |
|
|
MDC.put(log_file_type, log_type); |
|
|
|
|
|
String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); |
|
|
|
|
|
HttpResponse result2 = null; |
|
|
|
|
|
AddressDto addressDto = addressService.findByCode("feedbackTaskStatusToWms"); |
|
|
|
|
|
String methods_url = addressDto.getMethods_url(); |
|
|
|
|
|
try { |
|
|
|
|
|
result2 = HttpRequest.post(wmsurl + methods_url) |
|
|
|
|
|
.header("Authorization", token).body(String.valueOf(data)) |
|
|
|
|
|
.execute(); |
|
|
|
|
|
System.out.println(result2); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
String msg = e.getMessage(); |
|
|
|
|
|
//网络不通
|
|
|
|
|
|
System.out.println(msg); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} finally { |
|
|
String type = ""; |
|
|
MDC.remove(log_file_type); |
|
|
if (result2.getStatus() == 200) { |
|
|
} |
|
|
type = "info"; |
|
|
String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); |
|
|
} else { |
|
|
|
|
|
type = "error"; |
|
|
String task_code = ""; |
|
|
} |
|
|
for (int i = 0; i < data.size(); i++) { |
|
|
|
|
|
JSONObject json = (JSONObject) data.get(i); |
|
|
|
|
|
task_code = json.getString("task_code"); |
|
|
|
|
|
} |
|
|
|
|
|
TaskDto taskDto = taskService.findByCode(task_code); |
|
|
|
|
|
String vehicle_code = taskDto.getVehicle_code(); |
|
|
|
|
|
|
|
|
|
|
|
HttpResponse result2 = null; |
|
|
|
|
|
log.info("feedbackTaskStatusToWms-----请求参数{}", data.toString()); |
|
|
|
|
|
|
|
|
|
|
|
AddressDto addressDto = addressService.findByCode("feedbackTaskStatusToWms"); |
|
|
|
|
|
String methods_url = addressDto.getMethods_url(); |
|
|
|
|
|
try { |
|
|
|
|
|
result2 = HttpRequest.post(wmsurl + methods_url) |
|
|
|
|
|
.header("Authorization", token).body(String.valueOf(data)) |
|
|
|
|
|
.execute(); |
|
|
|
|
|
System.out.println(result2); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
String msg = e.getMessage(); |
|
|
|
|
|
//网络不通
|
|
|
|
|
|
System.out.println(msg); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String type = ""; |
|
|
// logServer.log(task_code, "feedbackTaskStatusToWms", type, data.toString(), result2.body(), String.valueOf(result2.getStatus()), wmsurl + methods_url, vehicle_code);
|
|
|
if (result2.getStatus() == 200) { |
|
|
JSONObject jo = JSONObject.parseObject(result2.body()); |
|
|
type = "info"; |
|
|
log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString()); |
|
|
} else { |
|
|
return result2; |
|
|
type = "error"; |
|
|
} finally { |
|
|
|
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// logServer.log(task_code, "feedbackTaskStatusToWms", type, data.toString(), result2.body(), String.valueOf(result2.getStatus()), wmsurl + methods_url, vehicle_code);
|
|
|
|
|
|
JSONObject jo = JSONObject.parseObject(result2.body()); |
|
|
|
|
|
log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString()); |
|
|
|
|
|
return result2; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -597,7 +586,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
resultJson.put("data", new JSONArray()); |
|
|
resultJson.put("data", new JSONArray()); |
|
|
log.info("feedbackPointStatusToWms----输出参数{}", resultJson.toString()); |
|
|
log.info("feedbackPointStatusToWms----输出参数{}", resultJson.toString()); |
|
|
return resultJson; |
|
|
return resultJson; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -605,26 +594,26 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public JSONArray getDeviceStatusToWms() { |
|
|
public JSONArray getDeviceStatusToWms() { |
|
|
try { |
|
|
try { |
|
|
MDC.put(log_file_type,log_type); |
|
|
MDC.put(log_file_type, log_type); |
|
|
String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); |
|
|
String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); |
|
|
AddressDto addressDto = addressService.findByCode("getDeviceStatusToWms"); |
|
|
AddressDto addressDto = addressService.findByCode("getDeviceStatusToWms"); |
|
|
String methods_url = addressDto.getMethods_url(); |
|
|
String methods_url = addressDto.getMethods_url(); |
|
|
String url = wmsurl + methods_url; |
|
|
String url = wmsurl + methods_url; |
|
|
String result = ""; |
|
|
String result = ""; |
|
|
try { |
|
|
try { |
|
|
result = HttpRequest.get(url) |
|
|
result = HttpRequest.get(url) |
|
|
.execute().body(); |
|
|
.execute().body(); |
|
|
System.out.println(result); |
|
|
System.out.println(result); |
|
|
log.info("getTaskStatusToWms----返回参数{}", result); |
|
|
log.info("getTaskStatusToWms----返回参数{}", result); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
System.out.println(e.getMessage()); |
|
|
System.out.println(e.getMessage()); |
|
|
} |
|
|
} |
|
|
JSONArray jsonArray = JSONArray.parseArray(result); |
|
|
JSONArray jsonArray = JSONArray.parseArray(result); |
|
|
return jsonArray; |
|
|
return jsonArray; |
|
|
}finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -656,7 +645,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -692,7 +681,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
System.out.println(msg); |
|
|
System.out.println(msg); |
|
|
} |
|
|
} |
|
|
return result2; |
|
|
return result2; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -733,7 +722,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
System.out.println(msg); |
|
|
System.out.println(msg); |
|
|
} |
|
|
} |
|
|
return result2; |
|
|
return result2; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -765,7 +754,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
System.out.println(msg); |
|
|
System.out.println(msg); |
|
|
} |
|
|
} |
|
|
return result2; |
|
|
return result2; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -800,7 +789,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
System.out.println(msg); |
|
|
System.out.println(msg); |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -839,7 +828,38 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
System.out.println(msg); |
|
|
System.out.println(msg); |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} finally { |
|
|
} finally { |
|
|
|
|
|
MDC.remove(log_file_type); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public HttpResponse feedbackAgvTakePutStatus(JSONObject param) { |
|
|
|
|
|
try { |
|
|
|
|
|
MDC.put(log_file_type, log_type); |
|
|
|
|
|
String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL); |
|
|
|
|
|
JSONArray ja = new JSONArray(); |
|
|
|
|
|
ja.add(param); |
|
|
|
|
|
AddressDto addressDto = addressService.findByCode("feedbackAgvTakePutStatus"); |
|
|
|
|
|
String methods_url = addressDto.getMethods_url(); |
|
|
|
|
|
String url = wmsUrl + methods_url; |
|
|
|
|
|
HttpResponse result = null; |
|
|
|
|
|
log.info("feedbackDeviceStatus----请求参数{}", param); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
result = HttpRequest.post(url) |
|
|
|
|
|
.body(String.valueOf(ja)) |
|
|
|
|
|
.execute(); |
|
|
|
|
|
System.out.println(result); |
|
|
|
|
|
log.info("feedbackDeviceStatus----返回参数{}", result); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
String msg = e.getMessage(); |
|
|
|
|
|
//网络不通
|
|
|
|
|
|
System.out.println(msg); |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
|
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -868,7 +888,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
System.out.println(msg); |
|
|
System.out.println(msg); |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -899,7 +919,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
System.out.println(msg); |
|
|
System.out.println(msg); |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -927,7 +947,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} finally { |
|
|
} finally { |
|
|
MDC.remove(log_file_type); |
|
|
MDC.remove(log_file_type); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|