修改一版
This commit is contained in:
@@ -48,27 +48,38 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public Guid Id { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 完全复制对象
|
||||
/// </summary>
|
||||
public class FullyReplicated
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据来源对象
|
||||
/// </summary>
|
||||
public Guid DataFromItem { get; set; }
|
||||
public Guid DataFromItemGuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 要赋值到的对象
|
||||
/// </summary>
|
||||
public Guid ThisTiem { get; set; }
|
||||
public Guid ThisItemGuid { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 复制其他对象到当前对象
|
||||
/// </summary>
|
||||
public class CopyOtherToThisItem
|
||||
{
|
||||
public List<Guid?> DataSource { get; set; }=new List<Guid?>(){ };
|
||||
/// <summary>
|
||||
/// 数据源Guids
|
||||
/// </summary>
|
||||
public List<Guid?> DataSourceGuids { get; set; }=new List<Guid?>(){ };
|
||||
|
||||
public Guid AddItem { get; set; }
|
||||
/// <summary>
|
||||
/// 添加对象的Guid
|
||||
/// </summary>
|
||||
public Guid AddItemGuid { get; set; }
|
||||
}
|
||||
|
||||
public class GetDescriptionByModuleTypeDto
|
||||
|
||||
@@ -571,12 +571,12 @@ namespace IRaCIS.Core.Application.Service
|
||||
[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();
|
||||
await _frontAuditConfigRepository.DeleteFromQueryAsync(x => x.ParentId == fully.ThisItemGuid);
|
||||
var list = await _frontAuditConfigRepository.Where(x => x.ParentId == fully.DataFromItemGuid).ToListAsync();
|
||||
list.ForEach(x =>
|
||||
{
|
||||
x.Id = NewId.NextGuid();
|
||||
x.ParentId = fully.ThisTiem;
|
||||
x.ParentId = fully.ThisItemGuid;
|
||||
});
|
||||
await _frontAuditConfigRepository.AddRangeAsync(list);
|
||||
await _frontAuditConfigRepository.SaveChangesAsync();
|
||||
@@ -593,11 +593,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
public async Task<IResponseOutput> CopyOtherToThisItem(CopyOtherToThisItem item)
|
||||
{
|
||||
|
||||
var lists = _frontAuditConfigRepository.Where(x => x.ParentId == item.AddItem).ToList();
|
||||
var lists = _frontAuditConfigRepository.Where(x => x.ParentId == item.AddItemGuid).ToList();
|
||||
|
||||
var additem = await _frontAuditConfigRepository.FirstOrDefaultAsync(x => x.Id == item.AddItem);
|
||||
var additem = await _frontAuditConfigRepository.FirstOrDefaultAsync(x => x.Id == item.AddItemGuid);
|
||||
|
||||
var alllist = _frontAuditConfigRepository.Where(x => item.DataSource.Contains(x.ParentId)).ToList().GroupBy(x => new { x.ValueCN }, (key, lst) => new FrontAuditConfig
|
||||
var alllist = _frontAuditConfigRepository.Where(x => item.DataSourceGuids.Contains(x.ParentId)).ToList().GroupBy(x => new { x.ValueCN }, (key, lst) => new FrontAuditConfig
|
||||
{
|
||||
Sort = lst.Select(x => x.Sort).FirstOrDefault(),
|
||||
IsShowByTrialConfig= lst.Select(x => x.IsShowByTrialConfig).FirstOrDefault(),
|
||||
@@ -609,7 +609,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
EnumList = lst.Select(x => x.EnumList).FirstOrDefault(),
|
||||
//IsConfig = lst.Select(x => x.IsConfig).FirstOrDefault(),
|
||||
IsShowParent = lst.Select(x => x.IsShowParent).FirstOrDefault(),
|
||||
ParentId = item.AddItem,
|
||||
ParentId = item.AddItemGuid,
|
||||
CreateUserId = _userInfo.Id,
|
||||
IsEnable = lst.Select(x => x.IsEnable).FirstOrDefault(),
|
||||
DictionaryKey = lst.Select(x => x.DictionaryKey).FirstOrDefault(),
|
||||
|
||||
Reference in New Issue
Block a user