rev:更新
This commit is contained in:
@@ -34,6 +34,7 @@ public class AcsToHJXServiceImpl implements AcsToHJXService {
|
|||||||
private LuceneExecuteLogService luceneLogService;
|
private LuceneExecuteLogService luceneLogService;
|
||||||
|
|
||||||
public String token;
|
public String token;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse actionRequest(JSONObject jsonObject) throws IOException {
|
public HttpResponse actionRequest(JSONObject jsonObject) throws IOException {
|
||||||
HttpResponse execute = null;
|
HttpResponse execute = null;
|
||||||
@@ -41,31 +42,31 @@ public class AcsToHJXServiceImpl implements AcsToHJXService {
|
|||||||
String wmsurl = jsonObject.getString("url");
|
String wmsurl = jsonObject.getString("url");
|
||||||
AddressDto addressDto = addressService.findByCode("actionRequest");
|
AddressDto addressDto = addressService.findByCode("actionRequest");
|
||||||
String url = wmsurl + addressDto.getMethods_url();
|
String url = wmsurl + addressDto.getMethods_url();
|
||||||
|
log.info("actionRequest-----请求路径:{},输入参数{}", url, jsonObject);
|
||||||
try {
|
try {
|
||||||
execute = HttpRequest.post(wmsurl)
|
execute = HttpRequest.post(url)
|
||||||
.header(Header.USER_AGENT, "Hutool http")
|
.setConnectionTimeout(5000)
|
||||||
.header("Authorization", token)
|
.body(JSON.toJSONString(jsonObject))
|
||||||
.body(String.valueOf(jsonObject))
|
|
||||||
.execute();
|
.execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
String msg = e.getMessage();
|
||||||
log.info("actionRequest-----输出参数{}", msg);
|
log.info("actionRequest-----输出参数{}", msg);
|
||||||
//网络不通
|
//网络不通
|
||||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "actionRequest", String.valueOf(execute.getStatus()),
|
// LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "actionRequest", String.valueOf(execute.getStatus()),
|
||||||
String.valueOf(jsonObject),
|
// String.valueOf(jsonObject),
|
||||||
String.valueOf(execute.body()), jsonObject.getString("task_code") + "设备工位取货完成反馈失败");
|
// String.valueOf(execute.body()), jsonObject.getString("task_code") + "设备工位取货完成反馈失败");
|
||||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
// luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||||
}
|
}
|
||||||
log.info("actionRequest - 动作请求反馈{}", jsonObject);
|
log.info("actionRequest - 动作请求反馈{}", execute);
|
||||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "actionRequest", "",
|
// LuceneLogDto luceneLogDto = new LuceneLogDto(4, "actionRequest", "",
|
||||||
String.valueOf(jsonObject),
|
// String.valueOf(jsonObject),
|
||||||
"", jsonObject.getString("task_code") + "动作请求反馈");
|
// "", jsonObject.getString("task_code") + "动作请求反馈");
|
||||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
// luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "actionRequest", String.valueOf(execute.getStatus()),
|
// LuceneLogDto luceneLogDto = new LuceneLogDto(4, "actionRequest", String.valueOf(execute.getStatus()),
|
||||||
JSON.toJSONString(execute.body()),
|
// JSON.toJSONString(execute.body()),
|
||||||
String.valueOf(execute.body()), jsonObject.getString("task_code") + "设备工位动作请求反馈失败");
|
// String.valueOf(execute.body()), jsonObject.getString("task_code") + "设备工位动作请求反馈失败");
|
||||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
// luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||||
}
|
}
|
||||||
return execute;
|
return execute;
|
||||||
}
|
}
|
||||||
@@ -80,14 +81,15 @@ public class AcsToHJXServiceImpl implements AcsToHJXService {
|
|||||||
log.info("feedAgvTaskStatus----请求参数{}", whereJson);
|
log.info("feedAgvTaskStatus----请求参数{}", whereJson);
|
||||||
try {
|
try {
|
||||||
result = HttpRequest.post(url)
|
result = HttpRequest.post(url)
|
||||||
.body(String.valueOf(whereJson))
|
.setConnectionTimeout(5000)
|
||||||
|
.body(JSON.toJSONString(whereJson))
|
||||||
.execute();
|
.execute();
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
log.info("feedAgvTaskStatus----返回参数{}", result);
|
log.info("feedAgvTaskStatus----返回参数{}", result);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
String msg = e.getMessage();
|
||||||
//网络不通
|
//网络不通
|
||||||
log.info("错误原因{}",msg);
|
log.info("错误原因{}", msg);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -102,7 +104,7 @@ public class AcsToHJXServiceImpl implements AcsToHJXService {
|
|||||||
log.info("deprecateMesTask----请求参数{}", whereJson);
|
log.info("deprecateMesTask----请求参数{}", whereJson);
|
||||||
try {
|
try {
|
||||||
result = HttpRequest.post(url)
|
result = HttpRequest.post(url)
|
||||||
.body(String.valueOf(whereJson))
|
.body(JSON.toJSONString(whereJson))
|
||||||
.execute();
|
.execute();
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
log.info("deprecateMesTask----返回参数{}", result);
|
log.info("deprecateMesTask----返回参数{}", result);
|
||||||
@@ -121,17 +123,18 @@ public class AcsToHJXServiceImpl implements AcsToHJXService {
|
|||||||
String methods_url = addressDto.getMethods_url();
|
String methods_url = addressDto.getMethods_url();
|
||||||
String url = wmsUrl + methods_url;
|
String url = wmsUrl + methods_url;
|
||||||
HttpResponse result = null;
|
HttpResponse result = null;
|
||||||
log.info("actionFinish----请求参数{}", whereJson);
|
log.info("actionFinish-----请求路径:{},输入参数{}", url, whereJson);
|
||||||
try {
|
try {
|
||||||
result = HttpRequest.post(url)
|
result = HttpRequest.post(url)
|
||||||
.body(String.valueOf(whereJson))
|
.body(JSON.toJSONString(whereJson))
|
||||||
.execute();
|
.execute();
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
log.info("actionFinish----返回参数{}", result);
|
log.info("actionFinish----返回参数{}", result);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
String msg = e.getMessage();
|
||||||
//网络不通
|
//网络不通
|
||||||
log.info("错误原因{}",msg);
|
log.info("actionFinish----返回参数{}", msg);
|
||||||
|
log.info("错误原因{}", msg);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user