diff --git a/src/main/java/com/gaotao/modules/api/service/InterfaceCallLogService.java b/src/main/java/com/gaotao/modules/api/service/InterfaceCallLogService.java
index e5476c2..1036e1a 100644
--- a/src/main/java/com/gaotao/modules/api/service/InterfaceCallLogService.java
+++ b/src/main/java/com/gaotao/modules/api/service/InterfaceCallLogService.java
@@ -43,4 +43,22 @@ public interface InterfaceCallLogService extends IService {
* @date 2025/10/07
*/
PageUtils queryPage(InterfaceCallLogData data) throws Exception;
+
+ /**
+ * @Description 一次性记录完整的接口调用日志(调用后只保存1次,不需要先存再修改)- rqrq
+ * @param interfaceName 接口名称
+ * @param methodName 方法名称
+ * @param requestData 请求数据
+ * @param responseData 响应数据
+ * @param status 状态(SUCCESS/ERROR/TIMEOUT)
+ * @param errorMessage 错误信息
+ * @param executionTime 执行时间(毫秒)
+ * @param site 站点
+ * @param businessKey 业务主键
+ * @param remark 备注
+ * @author rqrq
+ */
+ void logCompleteCall(String interfaceName, String methodName, String requestData,
+ String responseData, String status, String errorMessage,
+ Long executionTime, String site, String businessKey, String remark);
}
\ No newline at end of file
diff --git a/src/main/java/com/gaotao/modules/api/service/impl/InterfaceCallLogServiceImpl.java b/src/main/java/com/gaotao/modules/api/service/impl/InterfaceCallLogServiceImpl.java
index 90d351f..aadadf6 100644
--- a/src/main/java/com/gaotao/modules/api/service/impl/InterfaceCallLogServiceImpl.java
+++ b/src/main/java/com/gaotao/modules/api/service/impl/InterfaceCallLogServiceImpl.java
@@ -140,4 +140,48 @@ public class InterfaceCallLogServiceImpl extends ServiceImpl rfidList = new ArrayList<>();
+ String url = wcsUrl + "query-auto-sorting-info";
+ String jsonBody = "\"" + devCode + "\"";
+ long startTime = System.currentTimeMillis(); // rqrq - 记录开始时间
+ String wcsResponse = null;
+ String logStatus = "SUCCESS";
+ String errorMsg = null;
+
try {
- String url = wcsUrl + "query-auto-sorting-info";
- String jsonBody = "\"" + devCode + "\"";
-
System.out.println("调用WCS API - rqrq,url=" + url + ", devCode=" + devCode);
- String wcsResponse = com.gaotao.common.utils.HttpUtils.doPost(url, jsonBody, null);
+ wcsResponse = com.gaotao.common.utils.HttpUtils.doPost(url, jsonBody, null);
System.out.println("WCS API返回数据 - rqrq");
// 解析JSON数据 - rqrq
@@ -2802,7 +2809,28 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService {
} catch (Exception e) {
System.out.println("获取WCS分拣明细失败 - rqrq:" + e.getMessage());
log.error("获取WCS分拣明细失败", e);
+ logStatus = "ERROR";
+ errorMsg = e.getMessage();
// 失败时返回空列表,不抛异常 - rqrq
+ } finally {
+ // rqrq - 记录接口调用日志(调用后只保存1次)
+ long executionTime = System.currentTimeMillis() - startTime;
+ try {
+ interfaceCallLogService.logCompleteCall(
+ "WCS", // 接口名称
+ "query-auto-sorting-info", // 方法名称
+ jsonBody, // 请求数据
+ wcsResponse, // 响应数据
+ logStatus, // 状态
+ errorMsg, // 错误信息
+ executionTime, // 执行时间
+ site, // 站点
+ palletId, // 业务主键(栈板号)
+ "获取分拣明细RFID列表,devCode=" + devCode // 备注
+ );
+ } catch (Exception logEx) {
+ log.error("记录接口调用日志失败 - rqrq:{}", logEx.getMessage());
+ }
}
// 4. 构造返回数据 - rqrq
diff --git a/src/main/java/com/gaotao/modules/check/service/impl/PhysicalInventoryServiceImpl.java b/src/main/java/com/gaotao/modules/check/service/impl/PhysicalInventoryServiceImpl.java
index f258ea2..48fb5ab 100644
--- a/src/main/java/com/gaotao/modules/check/service/impl/PhysicalInventoryServiceImpl.java
+++ b/src/main/java/com/gaotao/modules/check/service/impl/PhysicalInventoryServiceImpl.java
@@ -622,9 +622,11 @@ public class PhysicalInventoryServiceImpl extends ServiceImpl业务逻辑:
*
- * 1. 查询未推送的栈板(task_no为空的)
- * 2. 每次推送10个栈板,尽量每层都有栈板
- * 3. 生成wms_order_task单据并推送给WCS
+ * 1. 校验盘点单状态必须是"盘点中"
+ * 2. 校验是否存在未完成的任务单(防止重复下达)
+ * 3. 查询未推送的栈板(task_no为空的)
+ * 4. 每次推送10个栈板,尽量每层都有栈板
+ * 5. 生成wms_order_task单据并推送给WCS
*
*/
@Override
@@ -641,7 +643,14 @@ public class PhysicalInventoryServiceImpl extends ServiceImpl 0) {
+ throw new RuntimeException("当前盘点单存在" + uncompletedTaskCount + "个未完成的任务单,请等待任务完成后再继续下达");
+ }
+ log.info("校验通过,无未完成的任务单");
+
+ // 3. 执行推送 - rqrq
int pushedCount = doPushPallets(query.getSite(), query.getCountNo(), query.getUsername(), 10);
log.info("continuePushCount 结束,本次推送栈板数: {}", pushedCount);
@@ -1844,7 +1853,7 @@ public class PhysicalInventoryServiceImpl extends ServiceImpl
+