|
|
@ -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<Dict, DictDTO, S |
|
|
|
|
|
|
|
[HttpPut] |
|
|
|
[Route("{id}")] |
|
|
|
public override Task<DictDTO> UpdateAsync(Guid id, DictEditInput input) |
|
|
|
public override async Task<DictDTO> 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<DictEditInput, Dict>(input, entity); |
|
|
|
await _repository.UpdateAsync(entity, true).ConfigureAwait(false); |
|
|
|
return ObjectMapper.Map<Dict, DictDTO>(entity); |
|
|
|
} |
|
|
|
|
|
|
|
[HttpPost("update")] |
|
|
|