Merge branch 'master' of http://121.41.2.71:3000/wyw/mh_jy_safe
This commit is contained in:
commit
1a9edcad1a
@ -305,5 +305,10 @@
|
||||
/// 所有数据库链接
|
||||
/// </summary>
|
||||
public const string ConnAll = "OPConn";
|
||||
|
||||
/// <summary>
|
||||
/// 所有Tenant
|
||||
/// </summary>
|
||||
public const string TenantAll = "OPTenant";
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,5 +22,13 @@ namespace APT.BaseData.Domain.IServices.OP
|
||||
/// <param name="ORG_ID">过滤值</param>
|
||||
/// <returns></returns>
|
||||
string GetConnByORGID(Guid ORG_ID);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据ORGID 获取 Tenant
|
||||
/// </summary>
|
||||
/// <param name="ORG_ID"></param>
|
||||
/// <returns></returns>
|
||||
string GetTenantByORGID(Guid ORG_ID);
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,5 +164,56 @@ namespace APT.BaseData.Services.Services.OP
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据ORGID 获取 Tenant
|
||||
/// </summary>
|
||||
/// <param name="ORG_ID"></param>
|
||||
/// <returns></returns>
|
||||
public string GetTenantByORGID(Guid ORG_ID)
|
||||
{
|
||||
|
||||
Dictionary<Guid, string> dicORGCONN = new Dictionary<Guid, string>();
|
||||
//从Redis中获取所有数据库链接值
|
||||
|
||||
bool isRedisConfig = true;
|
||||
var redisConfig = APT.Infrastructure.Api.ConfigurationManager.AppSettings["RedisFormConfig"];
|
||||
if (!string.IsNullOrEmpty(redisConfig))
|
||||
isRedisConfig = bool.Parse(redisConfig);
|
||||
if (isRedisConfig)
|
||||
{
|
||||
if (CsRedisManager.KeyExists(RedisCacheKey.TenantAll))
|
||||
dicORGCONN = CsRedisManager.StringGet<Dictionary<Guid, string>>(RedisCacheKey.TenantAll);
|
||||
}
|
||||
#region Redis没找到 去数据库查找
|
||||
|
||||
if (dicORGCONN == null || dicORGCONN.Count < 1)
|
||||
{
|
||||
string conn = string.Empty;
|
||||
IEnumerable<T_OP_TENANT> listTent = null;
|
||||
using (var context = new MigrationContext())
|
||||
{
|
||||
Expression<Func<T_OP_TENANT, bool>> expression = e => e.DB_CONN_ID.HasValue;
|
||||
listTent = context.GetEntities(expression, null, null);
|
||||
if (listTent != null && listTent.Count() > 0)
|
||||
{
|
||||
foreach (var item in listTent)
|
||||
{
|
||||
if (!dicORGCONN.ContainsKey(item.ID))
|
||||
{
|
||||
dicORGCONN.Add(item.ID, item.CODE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (dicORGCONN != null && dicORGCONN.Count > 0 && dicORGCONN.ContainsKey(ORG_ID))
|
||||
{
|
||||
return dicORGCONN[ORG_ID];
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -653,34 +653,32 @@
|
||||
T_PF_APPROVE result = null;
|
||||
if (!string.IsNullOrEmpty(filter.Parameter1) && filter.OrgId.HasValue && filter.Parameter1 != filter.OrgId.Value.ToString())
|
||||
{
|
||||
//集团人员 通过 首页点击 获取对应的数据库链接 返回结果
|
||||
//这边怎么调用 原生的 GetEntity 方法
|
||||
//集团人员 通过 首页点击 获取对应的数据库链接 返回结果
|
||||
|
||||
|
||||
string conn = OPTenantDBConnService.GetConnByORGID(new Guid(filter.Parameter1));
|
||||
//var service = APT.Infrastructure.Api.ServiceLocator.Instance.GetService<IFMNotificatoinService>();
|
||||
filter.IgnoreOrgRule = true;
|
||||
////后端直接处理
|
||||
//string tenant = OPTenantDBConnService.GetTenantByORGID(new Guid(filter.Parameter1));
|
||||
//filter.IgnoreOrgRule = true;
|
||||
//filter.OrgId = null;
|
||||
filter.SpecifyDbConn = conn;
|
||||
filter.SpecifyTenant = "0005";
|
||||
//var ccc = service.GetEntities<T_PF_APPROVE>(e => !e.IS_DELETED, filter, null);
|
||||
//filter.IsSpecifyDb = true;
|
||||
//filter.SpecifyTenant = tenant;
|
||||
//filter.IgnoreDataRule = true;
|
||||
//result = GetEntity<T_PF_APPROVE>(e => !e.IS_DELETED, filter, null);
|
||||
|
||||
|
||||
var aaa = GetEntities<T_PF_APPROVE>(e => !e.IS_DELETED, filter, null);
|
||||
//前端处理了Tenant
|
||||
filter.IgnoreOrgRule = true;
|
||||
filter.OrgId = null;
|
||||
}
|
||||
else
|
||||
|
||||
result = GetEntity<T_PF_APPROVE>(null, filter, null);
|
||||
if (result != null)
|
||||
{
|
||||
result = GetEntity<T_PF_APPROVE>(null, filter, null);
|
||||
if (result != null)
|
||||
if (result.APPROVE_TEMP_ID != null)
|
||||
{
|
||||
if (result.APPROVE_TEMP_ID != null)
|
||||
{
|
||||
var approveTemp = this.GetEntity<T_PF_APPROVE_TEMP>(t => t.ID == result.APPROVE_TEMP_ID);
|
||||
if (approveTemp != null)
|
||||
result.REJECT_INTERFACE = approveTemp.REJECT_INTERFACE;
|
||||
}
|
||||
result.Nav_ApproveDetails = result.Nav_ApproveDetails.OrderBy(t => t.NUM).ThenBy(m => m.MODIFY_TIME).ToList();
|
||||
var approveTemp = this.GetEntity<T_PF_APPROVE_TEMP>(t => t.ID == result.APPROVE_TEMP_ID);
|
||||
if (approveTemp != null)
|
||||
result.REJECT_INTERFACE = approveTemp.REJECT_INTERFACE;
|
||||
}
|
||||
result.Nav_ApproveDetails = result.Nav_ApproveDetails.OrderBy(t => t.NUM).ThenBy(m => m.MODIFY_TIME).ToList();
|
||||
}
|
||||
return result;
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user