青岛港账号密码从账号维护中获取

optimize
wanghaomei 2 years ago
parent 35a19b12e1
commit 9aa251bd59

@ -17,9 +17,10 @@ namespace Myshipping.Application.Helper
/// </summary>
public static class YardDataHelper
{
public static async Task<KeyValuePair<bool, string>> GetYardData(long tenantId, string tenantName, string mblno, string yardid, bool isWeb = true)
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>();
var webAccService = App.GetService<IDjyWebsiteAccountConfigService>();
var sysConfig = await cacheService.GetAllSysConfig();
@ -35,16 +36,17 @@ namespace Myshipping.Application.Helper
{
//从租户参数中获取网站青岛港账号密码
var tenantParam = await cacheService.GetAllTenantParam();
var tenantUserName = tenantParam.FirstOrDefault(x => x.TenantId == tenantId && x.ParaCode == "QDPORT_USERNAME");
var tenantPwd = tenantParam.FirstOrDefault(x => x.TenantId == tenantId && x.ParaCode == "QDPORT_PWD");
var qdPortAcc = await webAccService.GetAccountConfig("QingDaoPort", userId);
//var tenantUserName = tenantParam.FirstOrDefault(x => x.TenantId == tenantId && x.ParaCode == "QDPORT_USERNAME");
//var tenantPwd = tenantParam.FirstOrDefault(x => x.TenantId == tenantId && x.ParaCode == "QDPORT_PWD");
if (tenantUserName == null || tenantPwd == null)
if (qdPortAcc == null || string.IsNullOrEmpty(qdPortAcc.Account) || string.IsNullOrEmpty(qdPortAcc.Password))
{
return new KeyValuePair<bool, string>(false, "未找到青岛港用户名、密码配置,请通过租户参数配置");
return new KeyValuePair<bool, string>(false, "未找到青岛港用户名、密码配置,请到账号维护模块中添加");
}
qduname = tenantUserName.ItemCode;
qdpwd = tenantPwd.ItemCode;
qduname = qdPortAcc.Account;
qdpwd = qdPortAcc.Password;
}
var yardMappings = await cacheService.GetAllMappingYard();

Loading…
Cancel
Save