服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2025-03-25 379d73eaed4c3468c91b1dec52c4309d4f01522f
Tiger.Business.WMS/ERP/WMS_U9C.cs
@@ -1,5 +1,4 @@
using Tiger.Model;
using SqlSugar;
using 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单接口提交Json: {JsonConvert.SerializeObject(param)},返回Json: {response.Message}");
                      // Logger.Interface.Info($"新增收货单-来源ASN单接口提交Json: {JsonConvert.SerializeObject(param)},返回Json: {response.Message}");
                    }
                    else
                    {
@@ -165,11 +155,12 @@
            var action = new ApiAction<List<U9CReturnData2>>();
            try
            {
                action = await SubmitLine(input);
                if (action.IsSuccessed) {
                    input.IsLogin = false;
                    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)
            {
@@ -200,14 +191,16 @@
                        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($"收货单-行提交接口提交Json: {JsonConvert.SerializeObject(input.param)},返回Json: {response.Message}");
                        Logger.Interface.Info($"收货单-行提交接口提交Json: {JsonConvert.SerializeObject(_params)},返回Json: {response.Message}");
                    }
                    else
                    {
@@ -246,14 +239,16 @@
                        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($"收货单-行审核接口提交Json: {JsonConvert.SerializeObject(input.param)},返回Json: {response.Message}");
                        Logger.Interface.Info($"收货单-行审核接口提交Json: {JsonConvert.SerializeObject(_params)},返回Json: {response.Message}");
                    }
                    else
                    {