|
|
|
@ -12,6 +12,7 @@ using Tiobon.Core.Common.UserManager; |
|
|
|
|
using Tiobon.Core.IRepository.Base; |
|
|
|
|
using Tiobon.Core.IServices.BASE; |
|
|
|
|
using Tiobon.Core.Model; |
|
|
|
|
using Tiobon.Core.Repository.Base; |
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services.BASE |
|
|
|
|
{ |
|
|
|
@ -464,6 +465,29 @@ namespace Tiobon.Core.Services.BASE |
|
|
|
|
ent.UpdateProg = api; |
|
|
|
|
return await BaseDal.Update(entity); |
|
|
|
|
} |
|
|
|
|
public async Task<bool> Update(Dictionary<long, TEditDto> editModels) |
|
|
|
|
{ |
|
|
|
|
HttpRequest request = UserContext.Context.Request; |
|
|
|
|
var api = request.Path.ObjToString().TrimEnd('/').ToLower(); |
|
|
|
|
var ip = GetUserIp(UserContext.Context); |
|
|
|
|
|
|
|
|
|
List<TEntity> entities = new List<TEntity>(); |
|
|
|
|
foreach (var keyValuePairs in editModels) |
|
|
|
|
{ |
|
|
|
|
if (keyValuePairs.Value == null || !BaseDal.Any(keyValuePairs.Key)) |
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
var entity = await BaseDal.QueryById(keyValuePairs.Key); |
|
|
|
|
|
|
|
|
|
ConvertTEditDto2TEntity(keyValuePairs.Value, entity); |
|
|
|
|
BasePoco ent = entity as BasePoco; |
|
|
|
|
ent.UpdateIP = ip; |
|
|
|
|
ent.UpdateProg = api; |
|
|
|
|
entities.Add(entity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return await BaseDal.Update(entities); |
|
|
|
|
} |
|
|
|
|
/// <summary> |
|
|
|
|
/// 更新实体数据 |
|
|
|
|
/// </summary> |
|
|
|
|