diff --git a/Myshipping.Application/Helper/YardDataHelper.cs b/Myshipping.Application/Helper/YardDataHelper.cs index dfc6da47..f4756b44 100644 --- a/Myshipping.Application/Helper/YardDataHelper.cs +++ b/Myshipping.Application/Helper/YardDataHelper.cs @@ -17,9 +17,10 @@ namespace Myshipping.Application.Helper /// public static class YardDataHelper { - public static async Task> GetYardData(long tenantId, string tenantName, string mblno, string yardid, bool isWeb = true) + public static async Task> GetYardData(long userId, long tenantId, string tenantName, string mblno, string yardid, bool isWeb = true) { var cacheService = App.GetService(); + var webAccService = App.GetService(); 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(false, "未找到青岛港用户名、密码配置,请通过租户参数配置"); + return new KeyValuePair(false, "未找到青岛港用户名、密码配置,请到账号维护模块中添加"); } - qduname = tenantUserName.ItemCode; - qdpwd = tenantPwd.ItemCode; + qduname = qdPortAcc.Account; + qdpwd = qdPortAcc.Password; } var yardMappings = await cacheService.GetAllMappingYard();