|
|
|
@ -1,9 +1,11 @@
|
|
|
|
|
using Furion;
|
|
|
|
|
using Furion.FriendlyException;
|
|
|
|
|
using Furion.Logging;
|
|
|
|
|
using Furion.RemoteRequest.Extensions;
|
|
|
|
|
using Myshipping.Core;
|
|
|
|
|
using Myshipping.Core.Service;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using Org.BouncyCastle.Asn1.X500;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
@ -17,6 +19,16 @@ namespace Myshipping.Application.Helper
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class YardDataHelper
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 异步调取出口运踪场站详情(按箱明细显示)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId">用户名ID</param>
|
|
|
|
|
/// <param name="tenantId">租户ID</param>
|
|
|
|
|
/// <param name="tenantName">租户名称</param>
|
|
|
|
|
/// <param name="mblno">提单号</param>
|
|
|
|
|
/// <param name="yardid">场站ID</param>
|
|
|
|
|
/// <param name="isWeb">是否网站</param>
|
|
|
|
|
/// <returns>返回场站详情(按箱明细显示)</returns>
|
|
|
|
|
public static async Task<KeyValuePair<bool, string>> GetYardData(long userId, long tenantId, string tenantName, string mblno, string yardid, bool isWeb = true)
|
|
|
|
|
{
|
|
|
|
|
var cacheService = App.GetService<ISysCacheService>();
|
|
|
|
@ -116,6 +128,62 @@ namespace Myshipping.Application.Helper
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 异步调取出口运踪场站详情
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 异步调取出口运踪场站详情(按箱明细显示,并对箱型做了本地转换)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId">用户名ID</param>
|
|
|
|
|
/// <param name="tenantId">租户ID</param>
|
|
|
|
|
/// <param name="tenantName">租户名称</param>
|
|
|
|
|
/// <param name="mblno">提单号</param>
|
|
|
|
|
/// <param name="yardid">场站ID</param>
|
|
|
|
|
/// <param name="isWeb">是否网站</param>
|
|
|
|
|
/// <returns>返回场站详情(按箱明细显示,并对箱型做了本地转换)</returns>
|
|
|
|
|
public static async Task<string> GetYardDataWithTranslateAsync(long userId, long tenantId, string tenantName, string mblno,
|
|
|
|
|
string yardid, bool isWeb = true)
|
|
|
|
|
{
|
|
|
|
|
var rtn = await GetYardData(userId, tenantId, tenantName, mblno, yardid, isWeb);
|
|
|
|
|
|
|
|
|
|
if (!rtn.Key)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(rtn.Value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var _cache = App.GetService<ISysCacheService>();
|
|
|
|
|
|
|
|
|
|
//场站引入的数据,转换为订舱箱型,且带上箱型代码
|
|
|
|
|
var ctnList = await _cache.GetAllCodeCtn();
|
|
|
|
|
var mapCtn = await _cache.GetAllMappingCtn();
|
|
|
|
|
|
|
|
|
|
var jData = JArray.Parse(rtn.Value);
|
|
|
|
|
foreach (JObject item in jData)
|
|
|
|
|
{
|
|
|
|
|
var ctnall = item.GetStringValue("CTNALL");
|
|
|
|
|
var findMap = mapCtn.FirstOrDefault(x => x.Module == "YardData" && x.MapCode == ctnall);
|
|
|
|
|
var findCtn = ctnList.FirstOrDefault(x => x.Name == ctnall);
|
|
|
|
|
if (findMap != null)
|
|
|
|
|
{
|
|
|
|
|
item.Add("CtnCode", findMap.Code);
|
|
|
|
|
|
|
|
|
|
findCtn = ctnList.First(c => c.Code == findMap.Code);
|
|
|
|
|
item["CTNALL"] = findCtn.Name; //名称显示维护的箱型
|
|
|
|
|
}
|
|
|
|
|
else if (findCtn != null)
|
|
|
|
|
{
|
|
|
|
|
item.Add("CtnCode", findCtn.Code);
|
|
|
|
|
item["CTNALL"] = findCtn.Name; //名称显示维护的箱型
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah($"未找到箱型{ctnall}的场站引入配置");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return jData.ToString();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static string GetDataHtmlList(string html, string startstr, string endstr)
|
|
|
|
|
{
|
|
|
|
|
var subhtml = html;
|
|
|
|
|