Compare commits

..

No commits in common. "c1d618326b2a385c31e24ada3f306a4039ee7b0d" and "238def80893b11a0c20a23f536ead279339244b5" have entirely different histories.

2 changed files with 1125 additions and 1146 deletions

View File

@ -318,9 +318,9 @@ namespace IRaCIS.Core.Application.Service
{
continue;
}
str = await GetInspectionEnumValue(listIdentification, item.Identification, str);
str = await SetEnum(dto.TrialId, listIdentification, item.Identification, str);
str = await SetDataInspectionDateType(listIdentification, item.Identification, str);
str = await GetInspectionEnumValue(listIdentification, str);
str = await SetEnum(dto.TrialId, listIdentification, str);
str = await SetDataInspectionDateType(listIdentification, str);
jsonDict[nameof(InspectionJsonDetail.Data)] = JsonConvert.DeserializeObject<object>(str);
@ -330,9 +330,9 @@ namespace IRaCIS.Core.Application.Service
{
continue;
}
str2 = await GetInspectionEnumValue(listIdentification, item.Identification, str2);
str2 = await SetEnum(dto.TrialId, listIdentification, item.Identification, str2);
str2 = await SetDataInspectionDateType(listIdentification, item.Identification, str2);
str2 = await GetInspectionEnumValue(listIdentification, str2);
str2 = await SetEnum(dto.TrialId, listIdentification, str2);
str2 = await SetDataInspectionDateType(listIdentification, str2);
jsonDict[nameof(InspectionJsonDetail.CommonData)] = JsonConvert.DeserializeObject<object>(str2);
#endregion
@ -455,23 +455,20 @@ namespace IRaCIS.Core.Application.Service
/// <param name="identificationList"></param>
/// <param name="jsonStr"></param>
/// <returns></returns>
private async Task<string> SetDataInspectionDateType(List<string> identificationList, string identification, string jsonStr)
private async Task<string> SetDataInspectionDateType(List<string> identificationList, string jsonStr)
{
var list = await (from parent in _frontAuditConfigRepository.AsQueryable().Where(x => identificationList.Contains(x.Identification))
join child in _frontAuditConfigRepository.AsQueryable().Where(x => x.EnumType == "Date" && x.IsEnable) on parent.Id equals child.ParentId
select new DateDto()
{
Identification = parent.Identification,
Code = child.Code,
DateType = child.DateType,
}).ToListAsync();
list = list.GroupBy(x => new { x.Code }, (key, lst) => new DateDto()
{
Code = key.Code,
DateType = lst.FirstOrDefault(y => y.Identification == identification)?.DateType ?? lst.Max(x => x.DateType),
DateType = lst.Max(x => x.DateType),
}).ToList();
var jsonDataDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonStr);
@ -521,14 +518,13 @@ namespace IRaCIS.Core.Application.Service
///// <param name="ForeignKeyValue">外键value</param>
///// <param name="ForeignKeyText">要查询的外键值</param>
///// <param name="value">传入的纸</param>
private async Task<string> GetInspectionEnumValue(List<string> identificationList, string identification, string jsonStr)
private async Task<string> GetInspectionEnumValue(List<string> identificationList, string jsonStr)
{
var list = await (from u in _frontAuditConfigRepository.Where(x => identificationList.Contains(x.Identification))
join p in _frontAuditConfigRepository.Where(x => x.EnumType == "Foreign" && x.IsEnable) on u.Id equals p.ParentId
select new
{
Key = p.Code,
Identification = u.Identification,
ForeignKeyValue = p.ForeignKeyValue,
ForeignKeyText = p.ForeignKeyText,
ForeignKeyTable = p.ForeignKeyTableName
@ -536,10 +532,9 @@ namespace IRaCIS.Core.Application.Service
list = list.GroupBy(x => new { x.Key }, (key, lst) => new
{
Key = key.Key,
Identification = string.Empty,
ForeignKeyValue = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyValue ?? lst.Max(x => x.ForeignKeyValue),
ForeignKeyText = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyText ?? lst.Max(x => x.ForeignKeyText),
ForeignKeyTable = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyTable ?? lst.Max(x => x.ForeignKeyTable),
ForeignKeyValue = lst.Max(x => x.ForeignKeyValue),
ForeignKeyText = lst.Max(x => x.ForeignKeyText),
ForeignKeyTable = lst.Max(x => x.ForeignKeyTable),
}).ToList();
@ -591,7 +586,7 @@ namespace IRaCIS.Core.Application.Service
/// <param name="identificationList">标识</param>
/// <param name="jsonStr">Json对象</param>
/// <returns></returns>
private async Task<string> SetEnum(Guid trialId, List<string> identificationList, string identification, string jsonStr)
private async Task<string> SetEnum(Guid trialId, List<string> identificationList, string jsonStr)
{
if (jsonStr == null || jsonStr == "null")
{
@ -604,29 +599,16 @@ namespace IRaCIS.Core.Application.Service
join p in _frontAuditConfigRepository.Where(x => (x.DictionaryCode != string.Empty && x.EnumType == "Dictionary") || (x.DataType == "Table") && x.IsEnable) on u.Id equals p.ParentId
select new
{
Key = p.Code,
Identification = u.Identification,
//前端展示类型
DataType = p.DataType,
TableConfigJsonStr = p.TableConfigJsonStr,
Key = p.Code,
Code = p.DictionaryCode,
Type = p.DictionaryType
}).ToListAsync();
//两条不同的标识 但是里面配置有相同的翻译字典
list = list.GroupBy(x => new { x.Key }, (key, lst) => new
{
Key = key.Key,
Identification = string.Empty,
DataType = lst.FirstOrDefault(y => y.Identification == identification)?.DataType ?? lst.Max(x => x.DataType),
TableConfigJsonStr = lst.FirstOrDefault(y => y.Identification == identification)?.TableConfigJsonStr ?? lst.Max(x => x.TableConfigJsonStr),
Code = lst.FirstOrDefault(y => y.Identification == identification)?.Code ?? lst.Max(x => x.Code),
Type = lst.FirstOrDefault(y => y.Identification == identification)?.Type ?? lst.Max(x => x.Type),
}).ToList();
list = list.Distinct().ToList();
// 添加单双审
var trialtype = await _trialRepository.AsQueryable().Where(x => x.Id == trialId).Select(x => x.QCProcessEnum).FirstOrDefaultAsync();
@ -635,10 +617,9 @@ namespace IRaCIS.Core.Application.Service
{
list.Add(new
{
Key = "AuditState",
Identification = string.Empty,
DataType = string.Empty,
TableConfigJsonStr = string.Empty,
Key = "AuditState",
Code = trialtype == TrialQCProcess.SingleAudit ? "AuditStatePE" : "AuditStateRC",
Type = "Code",
});

View File

@ -11,8 +11,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
public string Code { get; set; }
public string DateType { get; set; }
public string Identification { get; set; }
}
public class TypeNameDto