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;
|
}
|
}
|
}
|