¶Ô±ÈÐÂÎļþ |
| | |
| | | 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"; |
| | | |
| | | |
| | | /// <summary> |
| | | /// å建æ¶è´§åæ°å¢è¡åºä½ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<ApiAction<List<U9CReturnData>>> CreateRcvLineLocation(CreateRcvLineLocationInput input) |
| | | { |
| | | Logger.Interface.Info($"/**\r\n *è¿å
¥å建æ¶è´§åæ°å¢è¡åºä½æ¥å£....\r\n */\r\n"); //åºå®åæ³ |
| | | var action = new ApiAction<List<U9CReturnData>>(); |
| | | 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(CreateRcvLineLocationUrl, JsonConvert.SerializeObject(input.RcvLineLocationParam), new Dictionary<string, string>() { { "token", input.token } }); |
| | | var result = JsonConvert.DeserializeObject<U9CResult>(response.Message); |
| | | if (result != null) |
| | | { |
| | | if (result.Success && result.Data[0].m_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].m_errorMsg}"); |
| | | Logger.Interface.Info($"å建æ¶è´§åæ°å¢è¡åºä½æ¥å£å¤±è´¥:{result.Data[0].m_errorMsg}"); |
| | | } |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | action.CatchExceptionWithLog(ex, "å建æ¶è´§åæ°å¢è¡åºä½å¼å¸¸"); |
| | | } |
| | | Logger.Interface.Info($"/* å建æ¶è´§åæ°å¢è¡åºä½ç»æ */\r\n"); //åºå®åæ³ |
| | | return action; |
| | | } |
| | | } |
| | | } |