From 0aed9c9ee65bd8a17837d83ec05e756d11fab297 Mon Sep 17 00:00:00 2001
From: xiazhengtongxue <133085197+xiazhengtongxue@users.noreply.github.com>
Date: 星期二, 21 四月 2026 15:29:48 +0800
Subject: [PATCH] Merge branch 'dev' of http://115.159.85.185:8098/r/SuZhouGuanHong/ShanMeiXinNengYuan into dev
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs
index 7d39b67..ead9c74 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs
@@ -1,4 +1,3 @@
-using System.Diagnostics;
using WIDESEA_Common.Constants;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Common.StockEnum;
@@ -60,7 +59,6 @@
/// </summary>
public async Task<WebResponseContent> OutboundFinishTaskAsync(CreateTaskDto taskDto)
{
- var stopwatch = Stopwatch.StartNew();
try
{
var task = await BaseDal.QueryFirstAsync(s => s.PalletCode == taskDto.PalletCode);
@@ -138,25 +136,27 @@
LocalTime = DateTime.Now,
ContainerCode = taskDto.PalletCode
};
+ string palletCode = taskDto.PalletCode;
string requestJson = outboundRequest.ToJson();
- var outboundResult = string.IsNullOrWhiteSpace(token)
- ? _mesService.OutboundInContainer(outboundRequest)
- : _mesService.OutboundInContainer(outboundRequest, token);
- stopwatch.Stop();
- await _mesLogService.LogAsync(new MesApiLogDto
- {
- ApiType = "UnbindContainer",
- RequestJson = requestJson,
- ResponseJson = System.Text.Json.JsonSerializer.Serialize(outboundResult),
- IsSuccess = outboundResult.IsSuccess,
- ErrorMessage = outboundResult.ErrorMessage,
- ElapsedMs = (int)stopwatch.ElapsedMilliseconds,
- Creator = "systeam"
- });
- if (outboundResult == null || outboundResult.Data == null || !outboundResult.Data.IsSuccess)
- {
- return content.Error($"鍑哄簱瀹屾垚澶辫触锛歁ES鍑虹珯澶辫触: {outboundResult?.Data?.Msg ?? outboundResult?.ErrorMessage ?? "鏈煡閿欒"}");
- }
+
+ // Fire-and-forget: 寮傛鎵цMES鍑虹珯锛屼笉闃诲涓讳笟鍔¢�昏緫
+ _mesUploadHelper.FireAndForget(
+ palletCode,
+ MesUploadStatusEnum.鍑虹珯涓婁紶鎴愬姛,
+ "OutboundInContainer",
+ requestJson,
+ () =>
+ {
+ var result = string.IsNullOrWhiteSpace(token)
+ ? _mesService.OutboundInContainer(outboundRequest)
+ : _mesService.OutboundInContainer(outboundRequest, token);
+ return (
+ result?.Data?.IsSuccess ?? false,
+ Newtonsoft.Json.JsonConvert.SerializeObject(result),
+ result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒",
+ _mesService.BuildConfig(token ?? string.Empty).ToJson()
+ );
+ });
var completeResult = await CompleteTaskAsync(task, "鍑哄簱瀹屾垚");
if (!completeResult.Status)
--
Gitblit v1.9.3