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