From b457742f55804676a35519f6426cfd5514f9bcf9 Mon Sep 17 00:00:00 2001 From: liuyunfeng Date: Fri, 21 Jun 2024 13:54:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=20=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=99=A8=E5=85=B7=E8=A7=84=E6=A0=BC=E7=BC=96?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E4=BF=9D=E5=AD=98=E6=97=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dicts/DictAppService.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAppService.cs index 828a8bba0..67c7941df 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAppService.cs @@ -17,6 +17,7 @@ using System.Text; using DocumentFormat.OpenXml.Office2010.ExcelAc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; +using Volo.Abp; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories; using Win_in.Sfs.Shared; @@ -60,9 +61,17 @@ public class DictAppService : SfsBaseDataWithCodeAppServiceBase UpdateAsync(Guid id, DictEditInput input) + public override async Task UpdateAsync(Guid id, DictEditInput input) { - return base.UpdateAsync(id, input); + //return await base.UpdateAsync(id, input).ConfigureAwait(false); //lyf at 0621, 更新报错所以注释 + var entity = await _repository.GetAsync(id).ConfigureAwait(false); + if (entity == null) + { + throw new UserFriendlyException($"根据Id取字典表为空:{id}"); + } + ObjectMapper.Map(input, entity); + await _repository.UpdateAsync(entity, true).ConfigureAwait(false); + return ObjectMapper.Map(entity); } [HttpPost("update")]