From e3a3fdeac4da74daa2a0dadfe4411aecd7611b66 Mon Sep 17 00:00:00 2001 From: vaining01 <276653425@qq.com> Date: Thu, 6 Jun 2024 17:27:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=8A=A5=E8=A1=A8=E5=BE=AE?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reports/ReportAppService.cs | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/Shentun.Peis.Application/Reports/ReportAppService.cs b/src/Shentun.Peis.Application/Reports/ReportAppService.cs index f606452..27ecf8f 100644 --- a/src/Shentun.Peis.Application/Reports/ReportAppService.cs +++ b/src/Shentun.Peis.Application/Reports/ReportAppService.cs @@ -80,21 +80,30 @@ namespace Shentun.Peis.Reports /// /// [HttpPost("api/app/Report/GetList")] - public async Task> GetListAsync(PagedAndSortedResultRequestDto input) + public async Task> GetListAsync(ReportIdInputDto input) { - var reportList = await _repository.GetListAsync(); + // var reportList = await _repository.GetListAsync(); + var entity = await _repository.GetAsync(input.Id); + var aEntity = ObjectMapper.Map(entity); - List reports= new List(); + var userList = await _userRepository.GetListAsync(); + aEntity.IsActived = entity.IsActive.Equals('Y'); + aEntity.CreatorName = EntityHelper.GetSurnameNoSql(userList, entity.CreatorId); + aEntity.LastModifierName = EntityHelper.GetSurnameNoSql(userList, entity.LastModifierId); - foreach(var report in reportList) + List reports = new List { - var aEntity= ObjectMapper.Map(report); - var userList = await _userRepository.GetListAsync(); - aEntity.IsActived = report.IsActive.Equals('Y'); - aEntity.CreatorName = EntityHelper.GetSurnameNoSql(userList, report.CreatorId); - aEntity.LastModifierName = EntityHelper.GetSurnameNoSql(userList, report.LastModifierId); - reports.Add(aEntity); - } + aEntity + }; + //foreach(var report in reportList) + //{ + // var aEntity= ObjectMapper.Map(report); + // var userList = await _userRepository.GetListAsync(); + // aEntity.IsActived = report.IsActive.Equals('Y'); + // aEntity.CreatorName = EntityHelper.GetSurnameNoSql(userList, report.CreatorId); + // aEntity.LastModifierName = EntityHelper.GetSurnameNoSql(userList, report.LastModifierId); + // reports.Add(aEntity); + //} return reports; }