|
|
|
@ -29,7 +29,7 @@ namespace Myshipping.Application.Helper
|
|
|
|
|
/// <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)
|
|
|
|
|
public static async Task<(bool isSuccess, string data, string contact)> GetYardData(long userId, long tenantId, string tenantName, string mblno, string yardid, bool isWeb = true)
|
|
|
|
|
{
|
|
|
|
|
var cacheService = App.GetService<ISysCacheService>();
|
|
|
|
|
var webAccService = App.GetService<IDjyWebsiteAccountConfigService>();
|
|
|
|
@ -53,7 +53,7 @@ namespace Myshipping.Application.Helper
|
|
|
|
|
|
|
|
|
|
if (ygtAcc == null || string.IsNullOrEmpty(ygtAcc.Account) || string.IsNullOrEmpty(ygtAcc.Password))
|
|
|
|
|
{
|
|
|
|
|
return new KeyValuePair<bool, string>(false, "未找到云港通账号、密码配置,请到账号维护模块中添加");
|
|
|
|
|
return (false, "未找到云港通账号、密码配置,请到账号维护模块中添加", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
webAcc = ygtAcc.Account;
|
|
|
|
@ -68,7 +68,7 @@ namespace Myshipping.Application.Helper
|
|
|
|
|
|
|
|
|
|
if (ygtAcc == null || string.IsNullOrEmpty(ygtAcc.Account) || string.IsNullOrEmpty(ygtAcc.Password))
|
|
|
|
|
{
|
|
|
|
|
return new KeyValuePair<bool, string>(false, "未找到陆海通账号、密码配置,请到账号维护模块中添加");
|
|
|
|
|
return (false, "未找到陆海通账号、密码配置,请到账号维护模块中添加", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
webAcc = ygtAcc.Account;
|
|
|
|
@ -79,7 +79,7 @@ namespace Myshipping.Application.Helper
|
|
|
|
|
var ym = yardMappings.FirstOrDefault(x => x.Code.ToLower() == yardid.ToLower() && x.Module == "BillTrace");
|
|
|
|
|
if (ym == null)
|
|
|
|
|
{
|
|
|
|
|
return new KeyValuePair<bool, string>(false, $"场站代号配置未找到:{yardid}");
|
|
|
|
|
return (false, $"场站代号配置未找到:{yardid}", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var objSend = new
|
|
|
|
@ -110,7 +110,7 @@ namespace Myshipping.Application.Helper
|
|
|
|
|
var rtnObj = JObject.Parse(rtn);
|
|
|
|
|
if (rtnObj.GetIntValue("code") != 200)
|
|
|
|
|
{
|
|
|
|
|
return new KeyValuePair<bool, string>(false, $"获取场站数失败:{rtnObj.GetStringValue("msg")}");
|
|
|
|
|
return (false, $"获取场站数失败:{rtnObj.GetStringValue("msg")}", "");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -123,8 +123,8 @@ namespace Myshipping.Application.Helper
|
|
|
|
|
rtnData = rtnData.Replace(viewstatehtml, "");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new KeyValuePair<bool, string>(true, rtnData);
|
|
|
|
|
var rtnContact = rtnObj.GetJArrayValue("contact_list")?.ToJsonString() ?? "";
|
|
|
|
|
return (true, rtnData, rtnContact);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -139,15 +139,15 @@ namespace Myshipping.Application.Helper
|
|
|
|
|
/// <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,
|
|
|
|
|
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);
|
|
|
|
|
(bool isSuccess, string data, string contact) rtn = await GetYardData(userId, tenantId, tenantName, mblno, yardid, isWeb);
|
|
|
|
|
|
|
|
|
|
if (!rtn.Key)
|
|
|
|
|
if (!rtn.isSuccess)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(rtn.Value);
|
|
|
|
|
}
|
|
|
|
|
throw Oops.Bah(rtn.data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var _cache = App.GetService<ISysCacheService>();
|
|
|
|
|
|
|
|
|
@ -155,7 +155,7 @@ namespace Myshipping.Application.Helper
|
|
|
|
|
var ctnList = await _cache.GetAllCodeCtn();
|
|
|
|
|
var mapCtn = await _cache.GetAllMappingCtn();
|
|
|
|
|
|
|
|
|
|
var jData = JArray.Parse(rtn.Value);
|
|
|
|
|
var jData = JArray.Parse(rtn.data);
|
|
|
|
|
foreach (JObject item in jData)
|
|
|
|
|
{
|
|
|
|
|
var ctnall = item.GetStringValue("CTNALL");
|
|
|
|
|