From 59925f58acbab7df78dbee2f25f64835e669e27f Mon Sep 17 00:00:00 2001
From: z8018 <1282578289@qq.com>
Date: 星期四, 18 十二月 2025 16:33:28 +0800
Subject: [PATCH] 1

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_BasicService/MESOperation/FeedbackMesService.cs                  |   28 ++++++++++++++++++++--------
 项目代码/WMS无仓储版/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.db |    0 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/CodeChunks.db      |    0 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/Util/HttpClientHelper.cs                                    |   11 +++--------
 4 files changed, 23 insertions(+), 16 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/CodeChunks.db" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/CodeChunks.db"
index 8999491..0667523 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/CodeChunks.db"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/CodeChunks.db"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.db" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.db"
index b5b0161..3e55c8a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.db"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1204.46620/SemanticSymbols.db"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/MESOperation/FeedbackMesService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/MESOperation/FeedbackMesService.cs"
index 2e47ba7..fdc1f9a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/MESOperation/FeedbackMesService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/MESOperation/FeedbackMesService.cs"
@@ -59,7 +59,7 @@
                     {
                         return WebResponseContent.Instance.Error($"鏋勫缓鍥炶皟瀵硅薄澶辫触");
                     }
-                    string apiUrl = "";
+                    string apiUrl = AppSettings.GetValue("MaterialOutboundFeedbackUrl");
                     returnDTO.ReqCode = reqCode;
                     returnDTO.ReqTime = reqTime;
                     requestData = returnDTO.Serialize();
@@ -79,7 +79,7 @@
                     {
                         return WebResponseContent.Instance.Error($"鏋勫缓鍥炶皟瀵硅薄澶辫触");
                     }
-                    string apiUrl = "";
+                    string apiUrl = AppSettings.GetValue("AllocationFeedbackUrl"); ;
                     returnDTO.ReqCode = reqCode;
                     returnDTO.ReqTime = reqTime;
                     requestData = returnDTO.Serialize();
@@ -88,7 +88,7 @@
                     httpResponseResult.ApiUrl = apiUrl;
                 }
 
-                bool isSuccess = httpResponseResult.IsSuccess && httpResponseResult.Data != null && httpResponseResult.Data.Code == "200";
+                bool isSuccess = httpResponseResult.IsSuccess && httpResponseResult.Data.Code == "200";
                 string message = "鎴愬姛";
                 if (!isSuccess)
                 {
@@ -96,16 +96,16 @@
                     {
                         message = $"MES鎺ュ彛杩斿洖閿欒锛孒TTP浠g爜锛歿httpResponseResult.StatusCode}锛屼俊鎭細{httpResponseResult.ErrorMessage}";
                     }
-                    else if (httpResponseResult.Data.Code != "200")
+                    else if (httpResponseResult?.Data?.Code != "200")
                     {
-                        message = $"璋冪敤MES鎺ュ彛澶辫触锛屼唬鐮侊細{httpResponseResult.Data.Code}锛屼俊鎭細{httpResponseResult.Data.Message}";
+                        message = $"璋冪敤MES鎺ュ彛澶辫触锛屼唬鐮侊細{httpResponseResult?.Data?.Code}锛屼俊鎭細{httpResponseResult?.Data?.Message}";
                     }
                 }
 
                 Dt_MesReturnRecord mesReturnRecord = new Dt_MesReturnRecord()
                 {
                     ApiUrl = httpResponseResult.ApiUrl,
-                    InterfaceType = 1,
+                    InterfaceType = outboundOrder.OrderType == 0 ? 1 : 3,
                     OrderId = outboundOrder.Id,
                     OrderNo = outboundOrder.OrderNo,
                     RequestCode = reqCode,
@@ -140,7 +140,19 @@
                         x.ReturnJsonData = "";
                     });
 
+                    mesReturnRecord.ReturnType = outboundOrder.Details.Count == outboundOrderDetails.Count ? 1 : 2;
+
+                    if (outboundOrder.Details.Count == outboundOrderDetails.Count && outboundOrderDetails.All(x => x.ReturnToMESStatus == 1 || x.ReturnToMESStatus == 2))
+                    {
+                        outboundOrder.ReturnToMESStatus = isSuccess ? 1 : 2;
+                    }
+                    else
+                    {
+                        outboundOrder.ReturnToMESStatus = isSuccess ? 3 : 4;
+                    }
+
                     _outboundOrderRepository.Db.Updateable(outboundOrderDetails).ExecuteCommand();
+                    _outboundOrderRepository.UpdateData(outboundOrder);
                 }
 
                 _unitOfWorkManage.CommitTran();
@@ -341,7 +353,7 @@
                     return WebResponseContent.Instance.Error($"鏈壘鍒扮墿鏂欐潯鐮佷俊鎭瘂newBarcode}");
                 }
 
-                string apiUrl = "";
+                string apiUrl = AppSettings.GetValue("BarcodeFeedbackUrl");
 
                 BarcodeReturnDTO returnDTO = new BarcodeReturnDTO()
                 {
@@ -366,7 +378,7 @@
                 HttpResponseResult<MesResponseDTO> httpResponseResult = _httpClientHelper.Post<MesResponseDTO>(apiUrl, requestData);
                 httpResponseResult.ApiUrl = apiUrl;
 
-                bool isSuccess = httpResponseResult.IsSuccess && httpResponseResult.Data != null && httpResponseResult.Data.Code == "200";
+                bool isSuccess = httpResponseResult.IsSuccess && httpResponseResult.Data.Code == "200";
                 string message = "鎴愬姛";
                 if (!isSuccess)
                 {
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Util/HttpClientHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Util/HttpClientHelper.cs"
index cd7019e..c7f151e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Util/HttpClientHelper.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Util/HttpClientHelper.cs"
@@ -9,6 +9,7 @@
 using System.Threading.Tasks;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Logging;
+using Newtonsoft.Json;
 using WIDESEA_Core.Helper;
 
 namespace WIDESEA_Core.Util
@@ -85,10 +86,7 @@
             {
                 try
                 {
-                    TResponse? response = JsonSerializer.Deserialize<TResponse>(result.Content, new JsonSerializerOptions
-                    {
-                        PropertyNameCaseInsensitive = true
-                    });
+                    TResponse? response = JsonConvert.DeserializeObject<TResponse>(result.Content);
                     if (response != null)
                     {
                         result.Data = response;
@@ -129,10 +127,7 @@
             {
                 try
                 {
-                    TResponse? response = JsonSerializer.Deserialize<TResponse>(result.Content, new JsonSerializerOptions
-                    {
-                        PropertyNameCaseInsensitive = true
-                    });
+                    TResponse? response = JsonConvert.DeserializeObject<TResponse>(result.Content);
                     if (response != null)
                     {
                         result.Data = response;

--
Gitblit v1.9.3