修改一版

This commit is contained in:
he
2022-05-16 09:53:24 +08:00
parent 31a09ea99c
commit 72b8b579e2
4 changed files with 63 additions and 1 deletions
@@ -48,7 +48,20 @@ namespace IRaCIS.Core.Application.ViewModel
public Guid Id { get; set; }
}
public class FullyReplicated
{
/// <summary>
/// 数据来源对象
/// </summary>
public Guid DataFromItem { get; set; }
/// <summary>
/// 要赋值到的对象
/// </summary>
public Guid ThisTiem { get; set; }
}
public class CopyOtherToThisItem
@@ -127,7 +127,27 @@ namespace IRaCIS.Core.Application.Service
select childrenType).OrderBy(x=>x.Sort).ToListAsync();
return list;
}
/// <summary>
/// 完全复制其他子项到当前项
/// </summary>
/// <param name="fully"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> FullyReplicated(FullyReplicated fully)
{
await _frontAuditConfigRepository.DeleteFromQueryAsync(x => x.ParentId == fully.ThisTiem);
var list = await _frontAuditConfigRepository.Where(x => x.ParentId == fully.DataFromItem).ToListAsync();
list.ForEach(x =>
{
x.ParentId = fully.ThisTiem;
});
await _frontAuditConfigRepository.AddRangeAsync(list);
await _frontAuditConfigRepository.SaveChangesAsync();
return ResponseOutput.Ok();
}
/// <summary>
/// Cope子项数据
/// </summary>