修改一版
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user