From 379d73eaed4c3468c91b1dec52c4309d4f01522f Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期二, 25 三月 2025 09:46:34 +0800
Subject: [PATCH] 简化收货单审核流程,重构打印逻辑

---
 Tiger.Business.WMS/ERP/WMS_U9C.cs |   44 ++++++++++++++++++++------------------------
 1 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/Tiger.Business.WMS/ERP/WMS_U9C.cs b/Tiger.Business.WMS/ERP/WMS_U9C.cs
index 25d91e4..812a6c9 100644
--- a/Tiger.Business.WMS/ERP/WMS_U9C.cs
+++ b/Tiger.Business.WMS/ERP/WMS_U9C.cs
@@ -1,5 +1,4 @@
-锘縰sing Tiger.Model;
-using SqlSugar;
+锘縰sing SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.Linq.Expressions;
@@ -10,18 +9,7 @@
 using System.Linq;
 using Newtonsoft.Json;
 using Tiger.IBusiness;
-using Microsoft.AspNetCore.Http;
-using Tiger.Model.Minsun;
-using Org.BouncyCastle.Asn1.Tsp;
-using Tiger.Model.Entitys.MES.Position;
-using Apache.NMS.ActiveMQ.Commands;
-using System.Security.Cryptography;
-using System.Diagnostics;
 using Tiger.Model.Entitys.MES.U9C;
-using Newtonsoft.Json.Linq;
-using System.Security.Policy;
-using NetTaste;
-using static System.Net.WebRequestMethods;
 
 namespace Tiger.Business.WMS
 {
@@ -74,13 +62,15 @@
                 List<CreateRcvBySrcASNParam> param = new();
                 param.Add(input.CreateRcvBySrcASNParam);
                 var response = await HttpHelper.PostAsync(CreateRcvBySrcASNUrl, JsonConvert.SerializeObject(param), new Dictionary<string, string>() { { "token", input.token } });
+                //var response = new ApiAction("{\"ResCode\":0,\"Success\":true,\"ResMsg\":null,\"Data\":[{\"IsSucess\":true,\"U9CVersion\":null,\"OtherID\":\"WMS\",\"ID\":1002503210000100,\"Code\":\"YDRC250300003\",\"ErrorMsg\":null}]}");
+
                 var result = JsonConvert.DeserializeObject<U9CResult2>(response.Message);
                 if (result != null)
                 {
                     if (result.Success && result.Data[0].IsSucess)
                     {
                         action.Data = result.Data;
-                        Logger.Interface.Info($"鏂板鏀惰揣鍗�-鏉ユ簮ASN鍗曟帴鍙f彁浜son: {JsonConvert.SerializeObject(param)}锛岃繑鍥濲son: {response.Message}");
+                      // Logger.Interface.Info($"鏂板鏀惰揣鍗�-鏉ユ簮ASN鍗曟帴鍙f彁浜son: {JsonConvert.SerializeObject(param)}锛岃繑鍥濲son: {response.Message}");
                     }
                     else
                     {
@@ -165,10 +155,12 @@
             var action = new ApiAction<List<U9CReturnData2>>();
             try
             {
-                action = await SubmitLine(input);
-                if (action.IsSuccessed) {
-                    action = await ApproveLine(input);
-                }
+                //action = await SubmitLine(input);
+                //if (action.IsSuccessed) {
+                //    input.IsLogin = false;
+                //    action = await ApproveLine(input);
+                //}
+                action = await ApproveLine(input);
             }
             catch (System.Exception ex)
             {
@@ -199,19 +191,21 @@
                         Logger.Interface.Info($"U9C鐧诲綍token: {input.token}");
                     }
                 }
-                var response = await HttpHelper.PostAsync(SubmitLineUrl, JsonConvert.SerializeObject(input.param), new Dictionary<string, string>() { { "token", input.token } });
+                var _params = new List<SubmitLineInputParam>();
+                _params.Add(input.param);
+                var response = await HttpHelper.PostAsync(SubmitLineUrl, JsonConvert.SerializeObject(_params), new Dictionary<string, string>() { { "token", input.token } });
                 var result = JsonConvert.DeserializeObject<U9CResult2>(response.Message);
                 if (result != null)
                 {
                     if (result.Success && result.Data[0].IsSucess)
                     {
                         action.Data = result.Data;
-                        Logger.Interface.Info($"鏀惰揣鍗�-琛屾彁浜ゆ帴鍙f彁浜son: {JsonConvert.SerializeObject(input.param)}锛岃繑鍥濲son: {response.Message}");
+                        Logger.Interface.Info($"鏀惰揣鍗�-琛屾彁浜ゆ帴鍙f彁浜son: {JsonConvert.SerializeObject(_params)}锛岃繑鍥濲son: {response.Message}");
                     }
                     else
                     {
                         action.IsSuccessed = false;
-                        action.LocaleMsg = new($"{action.Message}; {result.Data[0].ErrorMsg}");
+                        action.LocaleMsg = new($"鏀惰揣鍗�-琛屾彁浜ゆ帴鍙eけ璐�: {result.Data[0].ErrorMsg}");
                         Logger.Interface.Info($"鏀惰揣鍗�-琛屾彁浜ゆ帴鍙eけ璐�:{result.Data[0].ErrorMsg}");
                     }
                 }
@@ -245,19 +239,21 @@
                         Logger.Interface.Info($"U9C鐧诲綍token: {input.token}");
                     }
                 }
-                var response = await HttpHelper.PostAsync(ApproveLineUrl, JsonConvert.SerializeObject(input.param), new Dictionary<string, string>() { { "token", input.token } });
+                var _params = new List<SubmitLineInputParam>();
+                _params.Add(input.param);
+                var response = await HttpHelper.PostAsync(ApproveLineUrl, JsonConvert.SerializeObject(_params), new Dictionary<string, string>() { { "token", input.token } });
                 var result = JsonConvert.DeserializeObject<U9CResult2>(response.Message);
                 if (result != null)
                 {
                     if (result.Success && result.Data[0].IsSucess)
                     {
                         action.Data = result.Data;
-                        Logger.Interface.Info($"鏀惰揣鍗�-琛屽鏍告帴鍙f彁浜son: {JsonConvert.SerializeObject(input.param)}锛岃繑鍥濲son: {response.Message}");
+                        Logger.Interface.Info($"鏀惰揣鍗�-琛屽鏍告帴鍙f彁浜son: {JsonConvert.SerializeObject(_params)}锛岃繑鍥濲son: {response.Message}");
                     }
                     else
                     {
                         action.IsSuccessed = false;
-                        action.LocaleMsg = new($"{action.Message}; {result.Data[0].ErrorMsg}");
+                        action.LocaleMsg = new($"鏀惰揣鍗� - 琛屽鏍告帴鍙eけ璐�:{result.Data[0].ErrorMsg}");
                         Logger.Interface.Info($"鏀惰揣鍗�-琛屽鏍告帴鍙eけ璐�:{result.Data[0].ErrorMsg}");
                     }
                 }

--
Gitblit v1.9.3