Browse Source

agv接口

master
常熟吴彦祖 1 month ago
parent
commit
4c49f69aa5
  1. 50
      src/main/java/com/gaotao/common/utils/AgvClientUtil.java
  2. 9
      src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java

50
src/main/java/com/gaotao/common/utils/AgvClientUtil.java

@ -82,9 +82,9 @@ public class AgvClientUtil {
} }
Long logId = null; Long logId = null;
String requestJson = JSONObject.toJSONString(request);
try { try {
// 记录接口调用日志 // 记录接口调用日志
String requestJson = JSONObject.toJSONString(request);
logId = interfaceCallLogService.logInterfaceCall( logId = interfaceCallLogService.logInterfaceCall(
"AgvClientUtil", "AgvClientUtil",
"createTask", "createTask",
@ -121,6 +121,14 @@ public class AgvClientUtil {
if (logId != null) { if (logId != null) {
interfaceCallLogService.updateCallResult(logId, null, "FAILED", e.getMessage(), null); interfaceCallLogService.updateCallResult(logId, null, "FAILED", e.getMessage(), null);
} }
ErrorLogUtils.logInterface("55",
"AGV接口",
"下达AGV任务",
"AGV",
"/rpc/createTask",
taskId,
requestJson,
e.getMessage(),e.getMessage());
throw new RuntimeException(e.getMessage()); throw new RuntimeException(e.getMessage());
} }
} }
@ -129,12 +137,11 @@ public class AgvClientUtil {
Map<String, Object> request = new HashMap<>(); Map<String, Object> request = new HashMap<>();
request.put("taskId", taskId); request.put("taskId", taskId);
request.put("target", target); request.put("target", target);
String requestJson = JSONObject.toJSONString(request);
Long logId = null; Long logId = null;
try { try {
// 记录接口调用日志 // 记录接口调用日志
String requestJson = JSONObject.toJSONString(request);
logId = interfaceCallLogService.logInterfaceCall( logId = interfaceCallLogService.logInterfaceCall(
"AgvClientUtil", "AgvClientUtil",
"modifyPutPoint", "modifyPutPoint",
@ -168,6 +175,14 @@ public class AgvClientUtil {
if (logId != null) { if (logId != null) {
interfaceCallLogService.updateCallResult(logId, null, "FAILED", e.getMessage(), null); interfaceCallLogService.updateCallResult(logId, null, "FAILED", e.getMessage(), null);
} }
ErrorLogUtils.logInterface("55",
"AGV接口",
"修改AGV任务目标点",
"AGV",
"/rpc/modifyPutPoint",
taskId,
requestJson,
e.getMessage(),e.getMessage());
throw new RuntimeException(e.getMessage()); throw new RuntimeException(e.getMessage());
} }
} }
@ -179,11 +194,10 @@ public class AgvClientUtil {
String url = agvUrl + "/rpc/continueTask"; String url = agvUrl + "/rpc/continueTask";
Map<String, Object> request = new HashMap<>(); Map<String, Object> request = new HashMap<>();
request.put("taskId", taskId); request.put("taskId", taskId);
String requestJson = JSONObject.toJSONString(request);
Long logId = null; Long logId = null;
try { try {
// 记录接口调用日志 // 记录接口调用日志
String requestJson = JSONObject.toJSONString(request);
logId = interfaceCallLogService.logInterfaceCall( logId = interfaceCallLogService.logInterfaceCall(
"AgvClientUtil", "AgvClientUtil",
"continueTask", "continueTask",
@ -210,6 +224,14 @@ public class AgvClientUtil {
if (logId != null) { if (logId != null) {
interfaceCallLogService.updateCallResult(logId, null, "FAILED", e.getMessage(), null); interfaceCallLogService.updateCallResult(logId, null, "FAILED", e.getMessage(), null);
} }
ErrorLogUtils.logInterface("55",
"AGV接口",
"AGV继续任务",
"AGV",
"/rpc/continueTask",
taskId,
requestJson,
e.getMessage(),e.getMessage());
throw new RuntimeException(e.getMessage()); throw new RuntimeException(e.getMessage());
} }
} }
@ -224,9 +246,9 @@ public class AgvClientUtil {
request.put("taskId", taskId); request.put("taskId", taskId);
Long logId = null; Long logId = null;
String requestJson = JSONObject.toJSONString(request);
try { try {
// 记录接口调用日志 // 记录接口调用日志
String requestJson = JSONObject.toJSONString(request);
logId = interfaceCallLogService.logInterfaceCall( logId = interfaceCallLogService.logInterfaceCall(
"AgvClientUtil", "AgvClientUtil",
"cancelTask", "cancelTask",
@ -253,6 +275,14 @@ public class AgvClientUtil {
if (logId != null) { if (logId != null) {
interfaceCallLogService.updateCallResult(logId, null, "FAILED", e.getMessage(), null); interfaceCallLogService.updateCallResult(logId, null, "FAILED", e.getMessage(), null);
} }
ErrorLogUtils.logInterface("55",
"AGV接口",
"AGV取消任务",
"AGV",
"/rpc/cancelTask",
taskId,
requestJson,
e.getMessage(),e.getMessage());
throw new RuntimeException(e.getMessage()); throw new RuntimeException(e.getMessage());
} }
} }
@ -322,6 +352,14 @@ public class AgvClientUtil {
// 返回数据部分 // 返回数据部分
return jsonNode.get("data"); return jsonNode.get("data");
} catch (Exception e) { } catch (Exception e) {
ErrorLogUtils.logInterface("55",
"AGV接口",
"获取在线小车状态",
"AGV",
"/rpc/getOnlineRobot",
"",
"",
e.getMessage(),e.getMessage());
throw new RuntimeException(e.getMessage()); throw new RuntimeException(e.getMessage());
} }
} }

9
src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java

@ -2,6 +2,7 @@ package com.gaotao.modules.automatedWarehouse.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gaotao.common.utils.CountModeChecker; import com.gaotao.common.utils.CountModeChecker;
import com.gaotao.common.utils.ErrorLogUtils;
import com.gaotao.modules.api.apiData.CheckInventoryExistsRequest; import com.gaotao.modules.api.apiData.CheckInventoryExistsRequest;
import com.gaotao.modules.api.entity.*; import com.gaotao.modules.api.entity.*;
import com.gaotao.modules.api.service.WcsApiService; import com.gaotao.modules.api.service.WcsApiService;
@ -2857,6 +2858,14 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService {
log.error("获取WCS分拣明细失败", e); log.error("获取WCS分拣明细失败", e);
logStatus = "ERROR"; logStatus = "ERROR";
errorMsg = e.getMessage(); errorMsg = e.getMessage();
ErrorLogUtils.logInterface(site,
"立库接口",
"查询手工分拣清单",
"WCS",
"query-auto-sorting-info",
devCode,
jsonBody,
e.getMessage(),e.getMessage());
// 失败时返回空列表不抛异常 - rqrq // 失败时返回空列表不抛异常 - rqrq
} finally { } finally {
// rqrq - 记录接口调用日志调用后只保存1次 // rqrq - 记录接口调用日志调用后只保存1次

Loading…
Cancel
Save