| | |
| | | using Furion.DependencyInjection; |
| | | using Furion.DynamicApiController; |
| | | using iWare.Wms.Core; |
| | | using Mapster; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json.Linq; |
| | | using StackExchange.Redis; |
| | |
| | | /// <summary> |
| | | /// 外部访问接口日志 |
| | | /// </summary> |
| | | //[ApiDescriptionSettings("外部访问接口日志", Name = "AccessInterfaceLog", Order = 100)] |
| | | //[Route("api/[Controller]")] |
| | | [ApiDescriptionSettings("外部访问接口日志", Name = "AccessInterfaceLog", Order = 100)] |
| | | [Route("api/[Controller]")] |
| | | public class AccessInterfaceLogService : IAccessInterfaceLogService, IDynamicApiController, ITransient |
| | | { |
| | | private readonly IRepository<AccessInterfaceLog, MasterDbContextLocator> _accessInterfaceLogRep; |
| | |
| | | _accessInterfaceLogRep = accessInterfaceLogRep; |
| | | } |
| | | |
| | | |
| | | |
| | | [HttpGet("page")] |
| | | public async Task<PageResult<AddAccessInterfaceLogOutnput>> Page([FromQuery] AccessInterfaceLogInputSearch input) |
| | | { |
| | | var workPieceOutbounds = await _accessInterfaceLogRep.DetachedEntities |
| | | .Where(!string.IsNullOrEmpty(input.WorkPieceID), u => u.WorkPieceID.Contains(input.WorkPieceID)) |
| | | .Where(!string.IsNullOrEmpty(input.WorkingProcedureCurrent), u => u.WorkingProcedureCurrent.Contains(input.WorkingProcedureCurrent)) |
| | | .Where(!string.IsNullOrEmpty(input.createdUserName), u => u.CreatedUserName.Contains(input.createdUserName)) |
| | | .Where(input.QualityState != null, u => u.QualityState == input.QualityState) |
| | | .Where(!string.IsNullOrEmpty(input.StartTimeBeginTime.ToString()), u => u.CreatedTime >= input.StartTimeBeginTime) |
| | | .Where(!string.IsNullOrEmpty(input.StartTimeEndTime.ToString()), u => u.CreatedTime <= input.StartTimeEndTime) |
| | | //.OrderBy(PageInputOrder.OrderBuilder<AccessInterfaceLogInputSearch>(input)) |
| | | .OrderByDescending(x => x.Id) |
| | | .ProjectToType<AddAccessInterfaceLogOutnput>() |
| | | .ToADPagedListAsync(input.PageNo, input.PageSize); |
| | | return workPieceOutbounds; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 添加日志 |
| | | /// </summary> |
| | |
| | | public async Task AddInterfaceLogAsync(AddAccessInterfaceLogInput input) |
| | | { |
| | | AccessInterfaceLog log = new(); |
| | | log.Id=input.Id; |
| | | |
| | | log.WorkPieceID = input.WorkPieceID; |
| | | log.WorkingProcedureCurrent = input.WorkingProcedureCurrent; |
| | | log.QualityState = input.QualityState; |
| | | |
| | | log.Id = input.Id; |
| | | log.ParaJSON = input.JsonString; |
| | | log.Action = input.Action; |
| | | log.IPAddress = input.IpAddress; |
| | |
| | | // } |
| | | //} |
| | | //log.Keys = string.Join(", ", keys); |
| | | if(input.Result.GetType().Name.Equals("String")) |
| | | if (input.Result.GetType().Name.Equals("String")) |
| | | { |
| | | log.ResultJson = input.Result.ToString(); |
| | | |