diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 4808ae7f5..4fd242949 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -692,7 +692,7 @@
-
+
翻译稽查数据
diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs
index b8ee7760b..2c41d4257 100644
--- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs
+++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs
@@ -16,7 +16,7 @@ using Newtonsoft.Json.Linq;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Domain.Share.Management;
-namespace IRaCIS.Core.Application.Service
+namespace IRaCIS.Core.Application.Service
{
///
@@ -82,9 +82,9 @@ namespace IRaCIS.Core.Application.Service
CreateUserName = x.CreateUser.UserName,
TalkContent = x.Content,
IsTitle = true,
- }).FirstOrDefaultAsync())?? new AccessToDialogueOutDto();
+ }).FirstOrDefaultAsync()) ?? new AccessToDialogueOutDto();
- data =await _qCChallengeDialogRepository.Where(x => x.QCChallengeId == inDto.Id && x.CreateTime <= inDto.Createtime).Include(x => x.CreateUser).Select(
+ data = await _qCChallengeDialogRepository.Where(x => x.QCChallengeId == inDto.Id && x.CreateTime <= inDto.Createtime).Include(x => x.CreateUser).Select(
x => new AccessToDialogueOutDto()
{
CreateTime = x.CreateTime,
@@ -131,7 +131,7 @@ namespace IRaCIS.Core.Application.Service
public async Task CopyFrontAuditConfigItem(CopyFrontAuditConfigItemDto input)
{
var id = NewId.NextGuid();
- List frontAudits= new List();
+ List frontAudits = new List();
var frontAuditConfig = (await _frontAuditConfigRepository.FirstOrDefaultAsync(x => x.Id == input.ChildId)).Clone();
var fronts = await _frontAuditConfigRepository.Where(x => x.ParentId == frontAuditConfig.Id).ToListAsync();
@@ -159,7 +159,7 @@ namespace IRaCIS.Core.Application.Service
{
var maxSort = await _frontAuditConfigRepository.Where(x => x.ParentId == data.ParentId).MaxAsync(x => x.Sort);
- List fronts=new List();
+ List fronts = new List();
foreach (var item in data.Columns)
{
maxSort++;
@@ -184,22 +184,47 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task> SetInspectionEnumValue(SetInspectionEnumValueDto dto)
{
- return await SetInspectionEnumValueDataList(dto);
+ return await SetInspectionEnumValueDataList(dto, dto.AuditDataIds.FirstOrDefault());
}
+ public async Task> GetInspectionJsonDataList(Guid trialId, Guid id)
+ {
+ //找到上一条Id
+
+
+ var currentInspection = await _dataInspectionRepository.Where(t => t.Id == id).Select(t => new { t.GeneralId, t.ObjectRelationParentId, t.CreateTime }).FirstOrDefaultAsync();
+
+ var beforeId = await _dataInspectionRepository.Where(x => x.GeneralId == currentInspection.GeneralId && x.ObjectRelationParentId == currentInspection.ObjectRelationParentId && x.CreateTime <= currentInspection.CreateTime).OrderByDescending(x => x.CreateTime).Select(t => t.Id)
+ .FirstOrDefaultAsync();
+
+ List searchGuidList = new List() { id };
+
+ if (beforeId != Guid.Empty)
+ {
+ searchGuidList.Add(beforeId);
+ }
+
+ return await SetInspectionEnumValueDataList(new SetInspectionEnumValueDto() { TrialId = trialId, AuditDataIds = searchGuidList }, id);
+ }
+
+
+
///
/// 翻译稽查数据
///
/// 传入Dto
///
- private async Task> SetInspectionEnumValueDataList(SetInspectionEnumValueDto dto)
+ private async Task> SetInspectionEnumValueDataList(SetInspectionEnumValueDto dto, Guid currentInspectionId)
{
- var auditDatas =await _dataInspectionRepository.AsQueryable().Where(x => dto.AuditDataIds.Contains(x.Id)).Select(x=> new SetInspectionEnumDataDto() {
- Id=x.Id,
- JsonStr=x.JsonDetail,
- Identification=x.Identification
+ var auditDatas = await _dataInspectionRepository.AsQueryable().Where(x => dto.AuditDataIds.Contains(x.Id)).Select(x => new SetInspectionEnumDataDto()
+ {
+ Id = x.Id,
+ JsonStr = x.JsonDetail,
+ Identification = x.Identification,
+ ObjectRelationParentId = x.ObjectRelationParentId,
+ CreateTime=x.CreateTime
}).ToListAsync();
@@ -210,7 +235,37 @@ namespace IRaCIS.Core.Application.Service
{
Dictionary jsonDict = JsonConvert.DeserializeObject>(item.JsonStr);
-
+ //查询关联父层级数据
+ if (item.Id == currentInspectionId)
+ {
+ //把父层级的数据的 CommonData 数据合并
+
+ var commonDataObjList = await GetRelationParentData(item.ObjectRelationParentId, item.CreateTime);
+
+ var currentDic = JsonConvert.DeserializeObject>(jsonDict[nameof(InspectionJsonDetail.CommonData)].ToJsonStr());
+
+ foreach (var commonDataObj in commonDataObjList)
+ {
+ var otherDic = JsonConvert.DeserializeObject>(commonDataObj.ToJsonStr());
+
+ foreach (var valuePair in otherDic)
+ {
+ if (currentDic.ContainsKey(valuePair.Key))
+ {
+ currentDic[valuePair.Key] = valuePair.Value;
+ }
+ else
+ {
+ currentDic.Add(valuePair.Key, valuePair.Value);
+ }
+
+ }
+ }
+
+ jsonDict[nameof(InspectionJsonDetail.CommonData)] = currentDic;
+ }
+
+
item.JsonStr = jsonDict[nameof(InspectionJsonDetail.Data)].ToString();
if (item.Identification == string.Empty || item.JsonStr == string.Empty)
{
@@ -219,7 +274,11 @@ namespace IRaCIS.Core.Application.Service
item.JsonStr = await GetInspectionEnumValue(listIdentification, item.JsonStr);
item.JsonStr = await SetEnum(dto.TrialId, listIdentification, item.JsonStr);
item.JsonStr = await SetDataInspectionDateType(listIdentification, item.JsonStr);
- jsonDict[nameof(InspectionJsonDetail.Data)] = JsonConvert.DeserializeObject