fix 路由充值保存顺序
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Sys.Entities;
|
||||
using Dlhis.Entity.Sys.Entities;
|
||||
using Dlhis.Entity.Sys.Enums;
|
||||
using Dlhis.Sys.Identity.Services;
|
||||
using Dlhis.Sys.Menu.Request;
|
||||
using Dlhis.Sys.Menu.Response;
|
||||
using Kurisu.AspNetCore.Scope;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.Result;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Kurisu.SqlSugar.Attributes;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
|
||||
@@ -190,11 +187,12 @@ public class MenuService : IMenuService
|
||||
|
||||
public async Task ResetAsync(List<SaveMenuRequest> request)
|
||||
{
|
||||
var menus = await _dbContext.Queryable<MenuEntity>().Where(x => x.Platform == PlatformEnumType.PCAdmin).ToListAsync();
|
||||
await _dbContext.Client.Deleteable(menus).ExecuteCommandAsync();
|
||||
var currentMenus = await _dbContext.Queryable<MenuEntity>().Where(x => x.Platform == PlatformEnumType.PCAdmin).ToListAsync();
|
||||
await _dbContext.Client.Deleteable(currentMenus).ExecuteCommandAsync();
|
||||
|
||||
foreach (var item in request)
|
||||
{
|
||||
item.Sequence = currentMenus.FirstOrDefault(x => x.Code == item.Code)?.Sequence ?? item.Sequence;
|
||||
var code = await SaveMenuAsync(item);
|
||||
if (item.Items?.Any() == true)
|
||||
{
|
||||
@@ -208,6 +206,7 @@ public class MenuService : IMenuService
|
||||
{
|
||||
foreach (var item in menus)
|
||||
{
|
||||
item.Sequence = currentMenus.FirstOrDefault(x => x.Code == item.Code)?.Sequence ?? item.Sequence;
|
||||
var code = await SaveMenuAsync(item);
|
||||
|
||||
if (item.Items?.Any() == true)
|
||||
|
||||
Reference in New Issue
Block a user