修改一版
parent
8827ed17ef
commit
6daaebc31e
|
@ -48,27 +48,38 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 完全复制对象
|
||||||
|
/// </summary>
|
||||||
public class FullyReplicated
|
public class FullyReplicated
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据来源对象
|
/// 数据来源对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid DataFromItem { get; set; }
|
public Guid DataFromItemGuid { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 要赋值到的对象
|
/// 要赋值到的对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid ThisTiem { get; set; }
|
public Guid ThisItemGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 复制其他对象到当前对象
|
||||||
|
/// </summary>
|
||||||
public class CopyOtherToThisItem
|
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
|
public class GetDescriptionByModuleTypeDto
|
||||||
|
|
|
@ -571,12 +571,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> FullyReplicated(FullyReplicated fully)
|
public async Task<IResponseOutput> FullyReplicated(FullyReplicated fully)
|
||||||
{
|
{
|
||||||
await _frontAuditConfigRepository.DeleteFromQueryAsync(x => x.ParentId == fully.ThisTiem);
|
await _frontAuditConfigRepository.DeleteFromQueryAsync(x => x.ParentId == fully.ThisItemGuid);
|
||||||
var list = await _frontAuditConfigRepository.Where(x => x.ParentId == fully.DataFromItem).ToListAsync();
|
var list = await _frontAuditConfigRepository.Where(x => x.ParentId == fully.DataFromItemGuid).ToListAsync();
|
||||||
list.ForEach(x =>
|
list.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.Id = NewId.NextGuid();
|
x.Id = NewId.NextGuid();
|
||||||
x.ParentId = fully.ThisTiem;
|
x.ParentId = fully.ThisItemGuid;
|
||||||
});
|
});
|
||||||
await _frontAuditConfigRepository.AddRangeAsync(list);
|
await _frontAuditConfigRepository.AddRangeAsync(list);
|
||||||
await _frontAuditConfigRepository.SaveChangesAsync();
|
await _frontAuditConfigRepository.SaveChangesAsync();
|
||||||
|
@ -593,11 +593,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
public async Task<IResponseOutput> CopyOtherToThisItem(CopyOtherToThisItem item)
|
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(),
|
Sort = lst.Select(x => x.Sort).FirstOrDefault(),
|
||||||
IsShowByTrialConfig= lst.Select(x => x.IsShowByTrialConfig).FirstOrDefault(),
|
IsShowByTrialConfig= lst.Select(x => x.IsShowByTrialConfig).FirstOrDefault(),
|
||||||
|
@ -609,7 +609,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
EnumList = lst.Select(x => x.EnumList).FirstOrDefault(),
|
EnumList = lst.Select(x => x.EnumList).FirstOrDefault(),
|
||||||
//IsConfig = lst.Select(x => x.IsConfig).FirstOrDefault(),
|
//IsConfig = lst.Select(x => x.IsConfig).FirstOrDefault(),
|
||||||
IsShowParent = lst.Select(x => x.IsShowParent).FirstOrDefault(),
|
IsShowParent = lst.Select(x => x.IsShowParent).FirstOrDefault(),
|
||||||
ParentId = item.AddItem,
|
ParentId = item.AddItemGuid,
|
||||||
CreateUserId = _userInfo.Id,
|
CreateUserId = _userInfo.Id,
|
||||||
IsEnable = lst.Select(x => x.IsEnable).FirstOrDefault(),
|
IsEnable = lst.Select(x => x.IsEnable).FirstOrDefault(),
|
||||||
DictionaryKey = lst.Select(x => x.DictionaryKey).FirstOrDefault(),
|
DictionaryKey = lst.Select(x => x.DictionaryKey).FirstOrDefault(),
|
||||||
|
|
|
@ -131,19 +131,19 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
var entity = item.Entity as Trial;
|
var entity = item.Entity as Trial;
|
||||||
List<string> trials = new List<string>();
|
List<string> trials = new List<string>();
|
||||||
var trialids = new List<Guid>();
|
var dictionaryIds = new List<Guid>();
|
||||||
if (entity.TrialDicList == null || entity.TrialDicList.Count == 0)
|
if (entity.TrialDicList == null || entity.TrialDicList.Count == 0)
|
||||||
{
|
{
|
||||||
trialids = await this._dbContext.TrialDictionary.Where(x => x.TrialId == entity.Id && x.KeyName == "Criterion").Select(x => x.DictionaryId).ToListAsync();
|
dictionaryIds = await this._dbContext.TrialDictionary.Where(x => x.TrialId == entity.Id && x.KeyName == "Criterion").Select(x => x.DictionaryId).ToListAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
trialids = entity.TrialDicList.Select(x => x.DictionaryId).ToList();
|
dictionaryIds = entity.TrialDicList.Select(x => x.DictionaryId).ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trials = await this._dbContext.Dictionary.Where(x => trialids.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync();
|
trials = await this._dbContext.Dictionary.Where(x => dictionaryIds.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync();
|
||||||
|
|
||||||
await InsertInspection<Trial>(item.Entity, type, x => new DataInspection()
|
await InsertInspection<Trial>(item.Entity, type, x => new DataInspection()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue