From bf1a9a818ffb721aea2709e9409fbb932b07e81d Mon Sep 17 00:00:00 2001 From: yyk <2336760928@qq.com> Date: 星期四, 18 七月 2024 15:55:54 +0800 Subject: [PATCH] Merge branch 'master' into yyk --- Wms/WMS.BLL/LogServer/OperationSOServer.cs | 51 ++++++++++++++++++++++----------------------------- 1 files changed, 22 insertions(+), 29 deletions(-) diff --git a/Wms/WMS.BLL/LogServer/OperationSOServer.cs b/Wms/WMS.BLL/LogServer/OperationSOServer.cs index f8cff57..f59a724 100644 --- a/Wms/WMS.BLL/LogServer/OperationSOServer.cs +++ b/Wms/WMS.BLL/LogServer/OperationSOServer.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Linq.Expressions; using System.Text; +using System.Threading.Tasks; using Model.ModelDto.LogDto; using SqlSugar; using WMS.BLL.SysServer; @@ -21,43 +22,35 @@ public OperationSOServer() : base(Db) { } - public List<OperationDto> GetLogOperationSoList(string menuName, string type, string msg, string startTime, string endTime, int page, int limit, out int count) + public async Task<List<OperationDto>> GetLogOperationSoList(string menuName, string type, string msg, string startTime, string endTime, int page, int limit, RefAsync<int> count) { - try - { - var item = Expressionable.Create<LogOperationSO>() + var item = Expressionable.Create<LogOperationSO>() .AndIF(!string.IsNullOrWhiteSpace(menuName), it => it.MenuName.Contains(menuName.Trim())) .AndIF(!string.IsNullOrWhiteSpace(type), it => it.Type == type) .AndIF(!string.IsNullOrWhiteSpace(msg), it => it.Msg.Contains(msg.Trim())) .AndIF(!string.IsNullOrWhiteSpace(startTime), it => it.CreateTime >= Convert.ToDateTime(startTime)) .AndIF(!string.IsNullOrWhiteSpace(endTime), it => it.CreateTime <= Convert.ToDateTime(endTime).AddDays(1)) .ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏� - var total = 0; - var list = GetAllWhereAsync(item) - .LeftJoin<SysDictionary>((it, dic) => it.Type == dic.Id.ToString()) - .LeftJoin<SysUserInfor>((it, dic, users) => it.CreateUser == users.Id) - .Select((it, dic, users) => new OperationDto() - { - Id = it.Id, - ParentNo = it.ParentNo, - MenuNo = it.MenuNo, - MenuName = it.MenuName, - FkNo = it.FkNo, - Type = dic.DictName, - Msg = it.Msg, - CreateTime = it.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), - CreateUserName = users.RealName, - }) - .OrderByDescending(it => it.CreateTime) - .ToOffsetPage(page, limit, ref total); - count = total; - return list.OrderByDescending(m => m.CreateTime).ToList(); - } - catch (Exception e) - { - throw new Exception(e.Message); - } + var list = await GetAllWhereAsync(item) + .LeftJoin<SysDictionary>((it, dic) => it.Type == dic.Id.ToString()) + .LeftJoin<SysUserInfor>((it, dic, users) => it.CreateUser == users.Id) + .Select((it, dic, users) => new OperationDto() + { + Id = it.Id, + ParentNo = it.ParentNo, + MenuNo = it.MenuNo, + MenuName = it.MenuName, + FkNo = it.FkNo, + Type = dic.DictName, + Msg = it.Msg, + CreateTime = it.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), + CreateUserName = users.RealName, + }) + .OrderByDescending(it => it.CreateTime) + .ToPageListAsync(page, limit, count); + + return list.OrderByDescending(m => m.CreateTime).ToList(); } public bool AddLogOperationSo(string parentNo, string menuName, string fkNo, string type, string msg, int userId) { -- Gitblit v1.8.0