| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Microsoft.AspNetCore.Identity; |
| | | using Model.ModelDto.LogDto; |
| | | using Model.ModelVm.LogVm; |
| | | using SqlSugar; |
| | | using Utility; |
| | | using WMS.DAL; |
| | | using WMS.Entity.Context; |
| | | using WMS.Entity.LogEntity; |
| | |
| | | public class OperationCrServer: DbHelper<LogOperationCR>,IOperationCRServer |
| | | { |
| | | private static readonly SqlSugarScope Db = DataContext.Db; |
| | | private readonly UserManager _userManager; |
| | | public OperationCrServer() : base(Db) |
| | | { |
| | | } |
| | | public OperationCrServer(UserManager userManager) : base(Db) |
| | | { |
| | | _userManager = userManager; |
| | | } |
| | | public List<OperationDto> GetLogOperationCrList(string menuName, string type, string msg, string startTime, string endTime, int page, int limit, out int count) |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | var contextDb = DataContext.Db; |
| | | var menu = contextDb.Queryable<SysFunctionMenu>().Where(m => m.IsDel == "0").ToList(); |
| | | var dic = contextDb.Queryable<SysDictionary>().Where(m => m.ParentNo == "LogType" && m.IsDel == "0").ToList(); |
| | | var menu = Db.Queryable<SysFunctionMenu>().Where(m => m.IsDel == "0").ToList(); |
| | | var dic = Db.Queryable<SysDictionary>().Where(m => m.ParentNo == "LogType" && m.IsDel == "0").ToList(); |
| | | var typeId = dic.FirstOrDefault(m => m.DictName == type); |
| | | |
| | | var n = Add(new LogOperationCR() |
| | |
| | | throw new Exception(e.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 新增系统操作日志 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async Task<int> AddLogOperationCr(OperationInputVm input) |
| | | { |
| | | input.ParentNo = (await Db.Queryable<SysFunctionMenu>().FirstAsync(s => s.MenuName == input.ParentName && s.IsDel == "0"))?.MenuNo; |
| | | input.MenuNo = (await Db.Queryable<SysFunctionMenu>().FirstAsync(s => s.MenuName == input.MenuName && s.IsDel == "0"))?.MenuNo; |
| | | input.Type = (await Db.Queryable<SysDictionary>().FirstAsync(s => s.DictName == input.TypeName && s.IsDel == "0"))?.Id.ToString(); |
| | | input.CreateUser = _userManager.UserId; |
| | | input.CreateTime = DateTime.Now; |
| | | return await Db.Insertable<LogOperationSys>(input).ExecuteCommandAsync(); |
| | | } |
| | | } |
| | | } |