You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.7 KiB
C#
51 lines
1.7 KiB
C#
9 months ago
|
using DS.Module.Core;
|
||
|
using DS.Module.Core.Extensions;
|
||
|
using DS.Module.Core.Log;
|
||
9 months ago
|
using DS.Module.SqlSugar;
|
||
9 months ago
|
using DS.Module.UserModule;
|
||
6 months ago
|
using DS.WMS.Core.Sys.Dtos;
|
||
|
using DS.WMS.Core.Sys.Entity;
|
||
|
using DS.WMS.Core.Sys.Interface;
|
||
9 months ago
|
using Mapster;
|
||
|
using Microsoft.Extensions.DependencyInjection;
|
||
|
using SqlSugar;
|
||
|
|
||
6 months ago
|
namespace DS.WMS.Core.Sys.Method;
|
||
9 months ago
|
|
||
|
public class LogVisitService : ILogVisitService
|
||
|
{
|
||
|
private readonly IServiceProvider _serviceProvider;
|
||
|
private readonly ISqlSugarClient db;
|
||
|
private readonly IUser user;
|
||
9 months ago
|
private readonly ISaasDbService saasService;
|
||
9 months ago
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
/// <param name="serviceProvider"></param>
|
||
|
public LogVisitService(IServiceProvider serviceProvider)
|
||
|
{
|
||
|
_serviceProvider = serviceProvider;
|
||
|
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
|
||
|
user = _serviceProvider.GetRequiredService<IUser>();
|
||
9 months ago
|
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
|
||
9 months ago
|
}
|
||
|
|
||
|
public DataResult<List<VisitLogRes>> GetVisitLogList(PageRequest request)
|
||
|
{
|
||
|
//序列化查询条件
|
||
|
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
|
||
9 months ago
|
var data = saasService.GetLogDb().Queryable<SysLogVisit>().Filter(null,true)
|
||
9 months ago
|
.Where(whereList)
|
||
|
.Select<VisitLogRes>().ToQueryPage(request.PageCondition);
|
||
|
return data;
|
||
|
}
|
||
|
|
||
|
public DataResult<VisitLogRes> GetVisitLogInfo(string id)
|
||
|
{
|
||
9 months ago
|
var data = saasService.GetLogDb().Queryable<SysLogVisit>().Filter(null,true)
|
||
9 months ago
|
.Where(a => a.Id == long.Parse(id))
|
||
|
.Select<VisitLogRes>()
|
||
|
.First();
|
||
|
return DataResult<VisitLogRes>.Success(data,MultiLanguageConst.DataQuerySuccess);
|
||
|
}
|
||
|
}
|