rev:更新

This commit is contained in:
2026-01-17 10:09:53 +08:00
parent 3439aecb52
commit 44467c27bb

View File

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