diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java index 16fd207..a5eb469 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java @@ -14,58 +14,58 @@ public class CreateTaskRequest extends BaseRequest { /** * 任务编号 */ - @JsonProperty("Taskcode") + @JsonProperty("task_code") private String Taskcode; /** * 取货点1 */ - @JsonProperty("Startdevicecode") + @JsonProperty("start_device_code") String Startdevicecode; /** * 放货点1 */ - @JsonProperty("Nextdevicecode") + @JsonProperty("next_device_code") String Nextdevicecode; /** * 优先级 */ - @JsonProperty("Priority") + @JsonProperty("priority") String Priority = "1"; /** * 载具号 */ - @JsonProperty("Vehiclecode") + @JsonProperty("vehicle_code") String Vehiclecode; /** * 载具类型 */ - @JsonProperty("Vehicletype") + @JsonProperty("vehicle_type") String Vehicletype; /** * 任务类型 */ - @JsonProperty("Tasktype") + @JsonProperty("task_type") String Tasktype; /** * 备注 */ - @JsonProperty("Remark") + @JsonProperty("remark") String Remark; /** * 扩展属性 */ - @JsonProperty("Params") + @JsonProperty("params") Map Params = new HashMap<>(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index f1a0348..64ec82f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -106,16 +106,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .get(wmsurl + getToken_url) .execute(); } catch (Exception e) { - logServer.extLog("获取token", "反馈任务状态获取token失败" + e.getMessage()); - return null; + logServer.extLog("获取token", "反馈任务状态获取token失败,原因:" + e.getMessage()); + return getTokenResult; } String token = getTokenResult.body(); - logServer.extLog("获取token", "反馈任务状态获取token成功" + token); + logServer.extLog("获取token", "反馈任务状态获取token成功,token值:" + token); HttpResponse result = null; - log.info("feedbackTaskStatusToWms-----请求参数{}", data.toString()); - AddressDto addressDto = addressService.findByCode("feedbackTaskStatusToWms"); String methods_url = addressDto.getMethods_url(); String url = wmsurl + methods_url; @@ -125,20 +123,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String taskcode = jsonObject.getString("Taskcode"); String taskstatus = jsonObject.getString("Taskstatus"); JSONObject reqData = new JSONObject(); - reqData.put("Staus",taskstatus); + reqData.put("Staus", taskstatus); try { result = HttpRequest .put(url + taskcode + "?token=" + token) .header("Content-Type", "application/json") .body(String.valueOf(reqData)) .execute(); -// //System.out.println(result2); + log.info("反馈WMS任务状态,请求参数:{},响应参数:{}", String.valueOf(reqData), String.valueOf(result)); } catch (Exception e) { - String msg = e.getMessage(); - //网络不通 -// //System.out.println(msg); - log.info("feedbackTaskStatusToWms-----输出参数{}", msg); - + log.error("反馈WMS任务状态,请求参数:{},响应参数:{}", String.valueOf(reqData), e.getMessage()); } } String type = ""; @@ -558,29 +552,24 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .get(wmsUrl + getToken_url) .execute(); } catch (Exception e) { - logServer.extLog("获取token", e.getMessage()); + logServer.extLog("反馈WMS取放货状态获取token失败", e.getMessage()); return null; } String token = getTokenResult.body(); - + logServer.extLog("反馈WMS取放货状态获取token成功,token值:", token); AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus"); String methods_url = addressDto.getMethods_url(); String url = wmsUrl + methods_url; HttpResponse result = null; - log.info("feedAgvTaskStatus----请求参数{}", from); - try { result = HttpRequest.post(url + "?token=" + token) - .body(String.valueOf(from)) + .body(JSON.toJSONString(from)) .execute(); - System.out.println(result); - log.info("feedAgvTaskStatus----返回参数{}", result); + log.info("反馈WMS取放货状态,请求参数:{},响应参数:{}", JSON.toJSONString(from), String.valueOf(result)); } catch (Exception e) { - String msg = e.getMessage(); - //网络不通 - //System.out.println(msg); + log.info("反馈WMS取放货状态,请求参数:{},响应参数:{}", JSON.toJSONString(from), e.getMessage()); } return result; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index e7d6d5e..7499905 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -593,7 +593,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("agv_system_type", "1"); jo.put("remark", remark); jo.put("params", params); - jo.put("task_type", StrUtil.isEmpty(task_type) ? 1 : Integer.parseInt(task_type)); + jo.put("task_type", task_type); TaskDto task_dto = jo.toJavaObject(TaskDto.class); try {