diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 94076cdfd..8f567fe36 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -362,8 +362,15 @@ namespace IRaCIS.Core.Application.Service //父子层级的数据可能在同一个批次 进行更新 但是后插入的是父层级的数据 找父层级的稽查应该优先同一批次的 var relationParentInspection = await _dataInspectionRepository.Where(t => t.GeneralId == objectRelationParentId && (t.CreateTime <= createTime || t.BatchId == batchId) && t.Id != id).OrderByDescending(x => x.CreateTime).Select(t => new { t.ObjectRelationParentId, t.CreateTime, t.JsonDetail, t.BatchId, t.ObjectRelationParentId2, t.ObjectRelationParentId3, t.EntityName, t.Id }).FirstOrDefaultAsync(); + var userObj = await _userRoleRepository.Where(t => t.Id == objectRelationParentId).Select(t => new { UserRealName = t.IdentityUser.FullName, t.IdentityUser.Phone, t.IdentityUser.UserName, UserType = t.UserTypeRole.UserTypeShortName, t.UserTypeEnum, t.IdentityUser.EMail, t.IdentityUser.OrganizationName }).FirstOrDefaultAsync(); - if (relationParentInspection != null) + // 为什么要查用户 因为表dataInspection 中有用户的稽查 但是用户名为空 + if (userObj != null) + { + objectLsit.Add(userObj); + + } + else if (relationParentInspection != null) { Dictionary jsonDic = (JsonConvert.DeserializeObject>(relationParentInspection.JsonDetail)).IfNullThrowConvertException(); @@ -396,19 +403,19 @@ namespace IRaCIS.Core.Application.Service await AddJsonObjectToDic(relationParentInspection.Id, relationParentInspection.ObjectRelationParentId3, relationParentInspection.CreateTime, relationParentInspection.BatchId, objectLsit); } - else - { - //用户的数据稽查没有 临时处理 + //else + //{ + // //用户的数据稽查没有 临时处理 - var userObj = await _userRoleRepository.Where(t => t.Id == objectRelationParentId).Select(t => new { UserRealName = t.IdentityUser.FullName, t.IdentityUser.Phone, t.IdentityUser.UserName, UserType = t.UserTypeRole.UserTypeShortName, t.UserTypeEnum, t.IdentityUser.EMail, t.IdentityUser.OrganizationName }).FirstOrDefaultAsync(); + // var userObj = await _userRoleRepository.Where(t => t.Id == objectRelationParentId).Select(t => new { UserRealName = t.IdentityUser.FullName, t.IdentityUser.Phone, t.IdentityUser.UserName, UserType = t.UserTypeRole.UserTypeShortName, t.UserTypeEnum, t.IdentityUser.EMail, t.IdentityUser.OrganizationName }).FirstOrDefaultAsync(); - if (userObj != null) - { - objectLsit.Add(userObj); + // if (userObj != null) + // { + // objectLsit.Add(userObj); - } - } + // } + //} } }