using Tiger.Model; using SqlSugar; using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; using Rhea.Common; using System.Net; 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; namespace Tiger.Business.WMS { public partial class WMS_U9C { //收货单新增行库位 public static string CreateRcvLineLocationUrl { get; set; } = "http://172.16.80.20/u9c/webapi/CustReceivement/CreateRcvLineLocation"; /// /// 创建收货单新增行库位 /// /// /// public async Task>> CreateRcvLineLocation(CreateRcvLineLocationInput input) { Logger.Interface.Info($"/**\r\n *进入创建收货单新增行库位接口....\r\n */\r\n"); //固定写法 var action = new ApiAction>(); try { //如果已经登录则不需要再次登录,直接使用传入的token if (input.IsLogin) { var u9CLoginResult = await HttpHelper.GetAsync($"{U9CAuthLoginUrl}userCode={Reviewer}{secret}"); if (u9CLoginResult.Success) { input.token = u9CLoginResult.Data; Logger.Interface.Info($"U9C登录token: {input.token}"); } } var response = await HttpHelper.PostAsync(CreateRcvLineLocationUrl, JsonConvert.SerializeObject(input.RcvLineLocationParam), new Dictionary() { { "token", input.token } }); var result = JsonConvert.DeserializeObject(response.Message); if (result != null) { if (result.Success && result.Data[0].IsSucess) { action.Data = result.Data; Logger.Interface.Info($"收货单新增行库位接口提交Json: {JsonConvert.SerializeObject(input.RcvLineLocationParam)},返回Json: {response.Message}"); } else { action.IsSuccessed = false; action.LocaleMsg = new($"{action.Message}; {result.Data[0].ErrorMsg}"); Logger.Interface.Info($"收货单新增行库位接口失败:{result.Data[0].ErrorMsg}"); } } } catch (System.Exception ex) { action.CatchExceptionWithLog(ex, "收货单新增行库位异常"); } Logger.Interface.Info($"/* 创建收货单新增行库位结束 */\r\n"); //固定写法 return action; } } }