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 MiscRcvTransApproveUrl
|
{ get; set; } = "http://172.16.80.20/u9c/webapi/MiscRcvTrans/Approve"; // ApiConfig.IsTestServer ? Cache.SysParam["MiscRcvTransApproveUrl_Test", "U9CUrl"].PARAM_VALUE : Cache.SysParam["MiscRcvTransApproveUrl", "U9CUrl"].PARAM_VALUE; //http://172.16.80.20/u9c/webapi/MiscRcvTrans/Approve
|
|
|
/// <summary>
|
/// 杂收单审核
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
public async Task<ApiAction<List<U9CReturnData2>>> MiscRcvTransApprove(MiscRcvTransApproveInput input)
|
{
|
Logger.Interface.Info($"/**\r\n *进入杂收单审核接口....\r\n */\r\n"); //固定写法
|
var action = new ApiAction<List<U9CReturnData2>>();
|
try
|
{
|
//如果已经登录则不需要再次登录,直接使用传入的token
|
if (input.IsLogin)
|
{
|
var u9CLoginResult = await HttpHelper.GetAsync<U9CLoginResult>($"{U9CAuthLoginUrl}userCode={Reviewer}{secret}");
|
if (u9CLoginResult.Success)
|
{
|
input.token = u9CLoginResult.Data;
|
Logger.Interface.Info($"U9C登录token: {input.token}");
|
}
|
}
|
var response = await HttpHelper.PostAsync(MiscRcvTransApproveUrl, JsonConvert.SerializeObject(input.MiscRcvTransApproveParam), 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.MiscRcvTransApproveParam)},返回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;
|
}
|
}
|
}
|