using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.Core.Log;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Sys.Interface;
using Mapster;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
namespace DS.WMS.Core.Sys.Method;
public class LogOperationService : ILogOperationService
{
private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly ISaasDbService saasService;
///
///
///
///
public LogOperationService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService();
user = _serviceProvider.GetRequiredService();
saasService = _serviceProvider.GetRequiredService();
}
public DataResult> GetOperationLogList(PageRequest request)
{
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = saasService.GetLogDb().Queryable().Filter(null,true)
.Where(whereList)
.Select().ToQueryPage(request.PageCondition);
return data;
}
public DataResult GetOperationLogInfo(string id)
{
var data = saasService.GetLogDb().Queryable().Filter(null,true)
.Where(a => a.Id == long.Parse(id))
.Select()
.First();
return DataResult.Success(data,MultiLanguageConst.DataQuerySuccess);
}
}