From c7acb51c3ace14e509704f453adc58b9eb6613a8 Mon Sep 17 00:00:00 2001 From: liuying <1427574514@qq.com> Date: 周三, 16 10月 2024 16:23:28 +0800 Subject: [PATCH] 细节 --- iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterfaceLog/AccessInterfaceLogService.cs | 36 ++++++++++++++++++++++++++++++++---- 1 files changed, 32 insertions(+), 4 deletions(-) diff --git a/iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterfaceLog/AccessInterfaceLogService.cs b/iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterfaceLog/AccessInterfaceLogService.cs index 200934f..cec4f97 100644 --- a/iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterfaceLog/AccessInterfaceLogService.cs +++ b/iWara.SCADA.Code/iWare.Wms.Application/Service/AccessInterfaceLog/AccessInterfaceLogService.cs @@ -2,6 +2,7 @@ using Furion.DependencyInjection; using Furion.DynamicApiController; using iWare.Wms.Core; +using Mapster; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json.Linq; using StackExchange.Redis; @@ -20,8 +21,8 @@ /// <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; @@ -35,6 +36,28 @@ _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> @@ -44,7 +67,12 @@ 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; @@ -112,7 +140,7 @@ // } //} //log.Keys = string.Join(", ", keys); - if(input.Result.GetType().Name.Equals("String")) + if (input.Result.GetType().Name.Equals("String")) { log.ResultJson = input.Result.ToString(); -- Gitblit v1.9.3