From bdf2aaa385eb9b2d0f2366017536b542156da4fd Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 11 三月 2025 09:33:20 +0800 Subject: [PATCH] 雅达-动态设置接收文档类型 --- Tiger.Business.WMS/ERP/WMS_U9C.cs | 74 ++++++++++++------------------------- 1 files changed, 24 insertions(+), 50 deletions(-) diff --git a/Tiger.Business.WMS/ERP/WMS_U9C.cs b/Tiger.Business.WMS/ERP/WMS_U9C.cs index de20c77..09d0128 100644 --- a/Tiger.Business.WMS/ERP/WMS_U9C.cs +++ b/Tiger.Business.WMS/ERP/WMS_U9C.cs @@ -69,35 +69,35 @@ Logger.Interface.Info($"U9C鐧诲綍token: {input.token}"); } } - List<CreateRcvBySrcASNParam> param = new() { - new() { - aSNToRcvTransDTOs = new(){ - new(){ - TransQty=new() { - m_amount1= input.CurRevQty, - m_uOM1 = new() { - UOMMain = "1002212260110007", - UOMMain_SKey=new(){ - ID="1002212260110007", - }, - UOMSub_SKey = new(){ - ID="1002212260110007", - } - }, - }, - ASNLineKey=input.ASNLineKey, - } - } - } - }; - var response = await HttpHelper.PostAsync(CreateRcvBySrcASNUrl, JsonConvert.SerializeObject(param), new Dictionary<string, string>() { { "token", input.token } }); + //List<CreateRcvBySrcASNParam> param = new() { + // new() { + // aSNToRcvTransDTOs = new(){ + // new(){ + // TransQty=new() { + // m_amount1= input.CurRevQty, + // m_uOM1 = new() { + // UOMMain = "1002212260110007", + // UOMMain_SKey=new(){ + // ID="1002212260110007", + // }, + // UOMSub_SKey = new(){ + // ID="1002212260110007", + // } + // }, + // }, + // ASNLineKey=input.ASNLineKey, + // } + // } + // } + //}; + var response = await HttpHelper.PostAsync(CreateRcvBySrcASNUrl, JsonConvert.SerializeObject(input.CreateRcvBySrcASNParam), 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($"鏂板鏀惰揣鍗�-鏉ユ簮ASN鍗曟帴鍙f彁浜son: {JsonConvert.SerializeObject(param)}锛岃繑鍥濲son: {response.Message}"); + Logger.Interface.Info($"鏂板鏀惰揣鍗�-鏉ユ簮ASN鍗曟帴鍙f彁浜son: {JsonConvert.SerializeObject(input.CreateRcvBySrcASNParam)}锛岃繑鍥濲son: {response.Message}"); } else { @@ -142,7 +142,7 @@ { BusinessDate = DateTime.Now, Supplier = new() { m_code = input.Supplier }, - RcvDocType = new() { m_code = "RCV01" }, + RcvDocType = new() { m_code = input.RcvDocType }, RcvLines= input.RcvLines, }, OtherID = "WMS" @@ -182,32 +182,6 @@ var action = new ApiAction<List<U9CReturnData2>>(); try { - //濡傛灉宸茬粡鐧诲綍鍒欎笉闇�瑕佸啀娆$櫥褰曪紝鐩存帴浣跨敤浼犲叆鐨則oken - if (input.IsLogin) - { - var u9CLoginResult = await HttpHelper.GetAsync<U9CLoginResult>($"{U9CAuthLoginUrl}userCode={input.userId}{secret}"); - if (u9CLoginResult.Success) - { - input.token = u9CLoginResult.Data; - 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 result = JsonConvert.DeserializeObject<U9CResult2>(response.Message); - if (result != null) - { - if (result.Success && result.Data[0].IsSucess) - { - Logger.Interface.Info($"鏀惰揣鍗�-琛屽鏍告�诲叆鍙f帴鍙f彁浜son: {JsonConvert.SerializeObject(input.param)}锛岃繑鍥濲son: {response.Message}"); - } - else - { - action.IsSuccessed = false; - action.LocaleMsg = new($"{action.Message}; {result.Data[0].ErrorMsg}"); - Logger.Interface.Info($"鏀惰揣鍗�-琛屽鏍告�诲叆鍙f帴鍙eけ璐�:{result.Data[0].ErrorMsg}"); - } - } - action = await SubmitLine(input); if (action.IsSuccessed) { action = await ApproveLine(input); -- Gitblit v1.9.3