服务端的TigerApi 框架,基于.NET6 2024 版本
YangYuGang
2025-03-12 5563f93c09bd957e3a08cf6314f2c4395143d238
Tiger.Business.WMS/ERP/WMS_U9C.cs
@@ -48,6 +48,7 @@
        public static string CreateTransferInUrl
        { get; set; } = ApiConfig.IsTestServer ? Cache.SysParam["CreateTransferInUrl_Test", "U9CUrl"].PARAM_VALUE : Cache.SysParam["CreateTransferInUrl", "U9CUrl"].PARAM_VALUE; //http://172.16.80.20/u9c/webapi/TransferIn/Create
        /// <summary>
        /// 新增收货单-来源ASN单接口
        /// </summary>
@@ -69,27 +70,8 @@
                        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,
                            }
                        }
                     }
                };
                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 result = JsonConvert.DeserializeObject<U9CResult2>(response.Message);
                if (result != null)
@@ -141,16 +123,9 @@
                    rcvDTO = new()
                    {
                        BusinessDate = DateTime.Now,
                        Supplier = new() { m_code = "C.9999" },
                        RcvDocType = new() { m_code = "RCV01" },
                        RcvLines= new() {
                        },
                        IsRcvByChangeable =true,
                        IsPriceListChangeable = true,
                        IsConfirmTermChangeable = true,
                        IsPaymentTermChangeable = true,
                        IsLineApprove= true,
                        Supplier = new() { m_code = input.Supplier },
                        RcvDocType = new() { m_code = input.RcvDocType },
                        RcvLines= input.RcvLines,
                    },
                    OtherID = "WMS"
                };
@@ -189,32 +164,6 @@
            var action = new ApiAction<List<U9CReturnData2>>();
            try
            {
                //如果已经登录则不需要再次登录,直接使用传入的token
                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($"收货单-行审核总入口接口提交Json: {JsonConvert.SerializeObject(input.param)},返回Json: {response.Message}");
                    }
                    else
                    {
                        action.IsSuccessed = false;
                        action.LocaleMsg = new($"{action.Message}; {result.Data[0].ErrorMsg}");
                        Logger.Interface.Info($"收货单-行审核总入口接口失败:{result.Data[0].ErrorMsg}");
                    }
                }
                action = await SubmitLine(input);
                if (action.IsSuccessed) {
                    action = await ApproveLine(input);