|
|
@ -18,9 +18,9 @@ using static Microsoft.EntityFrameworkCore.DbLoggerCategory; |
|
|
|
|
|
|
|
|
namespace Shentun.Peis |
|
|
namespace Shentun.Peis |
|
|
{ |
|
|
{ |
|
|
public class EntityHelper |
|
|
|
|
|
|
|
|
public class EntityHelper |
|
|
{ |
|
|
{ |
|
|
private static ICachedServiceProvider _serviceProvider; |
|
|
|
|
|
|
|
|
private static ICachedServiceProvider _serviceProvider; |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 创建最大显示顺序
|
|
|
/// 创建最大显示顺序
|
|
|
@ -115,16 +115,19 @@ namespace Shentun.Peis |
|
|
{ |
|
|
{ |
|
|
UptList = (await repository.GetListAsync(o => o.DisplayOrder < entity.DisplayOrder)).OrderByDescending(o => o.DisplayOrder).ToList(); ; |
|
|
UptList = (await repository.GetListAsync(o => o.DisplayOrder < entity.DisplayOrder)).OrderByDescending(o => o.DisplayOrder).ToList(); ; |
|
|
|
|
|
|
|
|
int indexnum = entity.DisplayOrder; //原有值
|
|
|
|
|
|
|
|
|
if (UptList.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
int indexnum = entity.DisplayOrder; //原有值
|
|
|
|
|
|
|
|
|
entity.DisplayOrder = UptList[UptList.Count - 1].DisplayOrder; //修改当前排序值为最小
|
|
|
|
|
|
|
|
|
entity.DisplayOrder = UptList[UptList.Count - 1].DisplayOrder; //修改当前排序值为最小
|
|
|
|
|
|
|
|
|
//置底操作,往下一行开始,逐渐替换
|
|
|
|
|
|
foreach (var item in UptList) |
|
|
|
|
|
{ |
|
|
|
|
|
int dqnum = item.DisplayOrder; |
|
|
|
|
|
item.DisplayOrder = indexnum; |
|
|
|
|
|
indexnum = dqnum; |
|
|
|
|
|
|
|
|
//置底操作,往下一行开始,逐渐替换
|
|
|
|
|
|
foreach (var item in UptList) |
|
|
|
|
|
{ |
|
|
|
|
|
int dqnum = item.DisplayOrder; |
|
|
|
|
|
item.DisplayOrder = indexnum; |
|
|
|
|
|
indexnum = dqnum; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -603,13 +606,13 @@ namespace Shentun.Peis |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="UserId"></param>
|
|
|
/// <param name="UserId"></param>
|
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
private static async Task<string> GetUserNameFromCache( Guid? UserId) |
|
|
|
|
|
|
|
|
private static async Task<string> GetUserNameFromCache(Guid? UserId) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var cacheService = _serviceProvider.GetRequiredService<CacheService>(); |
|
|
|
|
|
var userName = await cacheService.GetUserNameAsync(UserId); |
|
|
|
|
|
return userName; |
|
|
|
|
|
|
|
|
var cacheService = _serviceProvider.GetRequiredService<CacheService>(); |
|
|
|
|
|
var userName = await cacheService.GetUserNameAsync(UserId); |
|
|
|
|
|
return userName; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|