代码修改
parent
8e3f7d4ba4
commit
c6e8ec0149
|
|
@ -362,8 +362,14 @@ 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 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)
|
if (userObj != null)
|
||||||
|
{
|
||||||
|
objectLsit.Add(userObj);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (relationParentInspection != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
Dictionary<string, object> jsonDic = (JsonConvert.DeserializeObject<Dictionary<string, object>>(relationParentInspection.JsonDetail)).IfNullThrowConvertException();
|
Dictionary<string, object> jsonDic = (JsonConvert.DeserializeObject<Dictionary<string, object>>(relationParentInspection.JsonDetail)).IfNullThrowConvertException();
|
||||||
|
|
@ -396,19 +402,19 @@ namespace IRaCIS.Core.Application.Service
|
||||||
await AddJsonObjectToDic(relationParentInspection.Id, relationParentInspection.ObjectRelationParentId3, relationParentInspection.CreateTime, relationParentInspection.BatchId, objectLsit);
|
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)
|
// if (userObj != null)
|
||||||
{
|
// {
|
||||||
objectLsit.Add(userObj);
|
// objectLsit.Add(userObj);
|
||||||
|
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue