From f423e1277f91427f0a767bd1224c1260dcb73086 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期一, 20 四月 2026 22:47:54 +0800
Subject: [PATCH] feat: 添加空箱入库功能及相关优化
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
index 9ea94a7..0d17367 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
@@ -1,8 +1,10 @@
锘縰sing Newtonsoft.Json;
using SqlSugar;
+using System.Diagnostics;
using WIDESEA_Common.Constants;
using WIDESEA_Common.StockEnum;
using WIDESEA_Core;
+using WIDESEA_Core.Helper;
using WIDESEA_DTO.MES;
using WIDESEA_DTO.Stock;
using WIDESEA_IBasicService;
@@ -51,6 +53,8 @@
/// </summary>
public IMesService _mesService { get; }
+ private readonly IMesLogService _mesLogService;
+
/// <summary>
/// 鏋勯�犲嚱鏁�
/// </summary>
@@ -65,7 +69,8 @@
IStockInfo_HtyService stockInfo_HtyService,
IMesService mesService,
IWarehouseService warehouseService,
- ISqlSugarClient sqlSugarClient)
+ ISqlSugarClient sqlSugarClient,
+ IMesLogService mesLogService)
{
StockInfoDetailService = stockInfoDetailService;
StockInfoService = stockInfoService;
@@ -74,6 +79,7 @@
_mesService = mesService;
_warehouseService = warehouseService;
SqlSugarClient = sqlSugarClient;
+ _mesLogService = mesLogService;
}
/// <summary>
@@ -466,6 +472,7 @@
public async Task<WebResponseContent> GroupPalletConfirmAsync(string palletCode, string deviceName)
{
WebResponseContent content = new WebResponseContent();
+ var stopwatch = Stopwatch.StartNew();
try
{
if (string.IsNullOrWhiteSpace(palletCode))
@@ -510,9 +517,21 @@
Location = d.InboundOrderRowNo.ToString()
}).ToList()
};
+ string requestJson = bindRequest.ToJson();
var bindResult = string.IsNullOrWhiteSpace(token)
? _mesService.BindContainer(bindRequest)
: _mesService.BindContainer(bindRequest, token);
+ stopwatch.Stop();
+ await _mesLogService.LogAsync(new MesApiLogDto
+ {
+ ApiType = "BindContainer",
+ RequestJson = requestJson,
+ ResponseJson = System.Text.Json.JsonSerializer.Serialize(bindResult),
+ IsSuccess = bindResult.IsSuccess,
+ ErrorMessage = bindResult.ErrorMessage,
+ ElapsedMs = (int)stopwatch.ElapsedMilliseconds,
+ Creator = "systeam"
+ });
if (bindResult == null || bindResult.Data == null || !bindResult.Data.IsSuccess)
{
return content.Error($"MES缁戝畾澶辫触: {bindResult?.Data?.Msg ?? bindResult?.ErrorMessage ?? "鏈煡閿欒"}");
--
Gitblit v1.9.3