稽查优化修改
parent
071ad5acd5
commit
c00f7a6163
|
@ -52,7 +52,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => taskIdList.Contains(t.Id), u => new VisitTask() { TaskState = TaskState.NotEffect });
|
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => taskIdList.Contains(t.Id), u => new VisitTask() { TaskState = TaskState.NotEffect },true);
|
||||||
|
|
||||||
await _visitTaskRepository.SaveChangesAsync();
|
await _visitTaskRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
return ResponseOutput.NotOk("已签名的不允许设置为失效");
|
return ResponseOutput.NotOk("已签名的不允许设置为失效");
|
||||||
}
|
}
|
||||||
|
|
||||||
await _taskMedicalReviewRepository.BatchUpdateNoTrackingAsync(t => command.MedicalReviewIdList.Contains(t.Id), c => new TaskMedicalReview() { IsInvalid = true });
|
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(t => command.MedicalReviewIdList.Contains(t.Id), c => new TaskMedicalReview() { IsInvalid = true },true);
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
|
|
||||||
|
|
||||||
await _visitTaskRepository
|
await _visitTaskRepository
|
||||||
.BatchUpdateNoTrackingAsync(updateWhere,
|
.UpdatePartialFromQueryAsync(updateWhere,
|
||||||
u => new VisitTask()
|
u => new VisitTask()
|
||||||
{
|
{
|
||||||
AllocateTime = DateTime.Now,
|
AllocateTime = DateTime.Now,
|
||||||
|
@ -189,7 +189,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
|
|
||||||
await _subjectUserRepository.DeleteFromQueryAsync(t => t.Id == command.Id);
|
await _subjectUserRepository.DeleteFromQueryAsync(t => t.Id == command.Id);
|
||||||
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState == ReadingTaskState.WaitReading && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false, u => new VisitTask()
|
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState == ReadingTaskState.WaitReading && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false, u => new VisitTask()
|
||||||
{
|
{
|
||||||
AllocateTime = null,
|
AllocateTime = null,
|
||||||
DoctorUserId = null,
|
DoctorUserId = null,
|
||||||
|
@ -2309,7 +2309,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||||
|
|
||||||
//回退后,回退状态恢复
|
//回退后,回退状态恢复
|
||||||
sv.RequestBackState = RequestBackStateEnum.NotRequest;
|
sv.RequestBackState = RequestBackStateEnum.NotRequest;
|
||||||
sv.IsCheckBack = true;
|
sv.IsCheckBack = false;
|
||||||
sv.CheckState = CheckStateEnum.None;
|
sv.CheckState = CheckStateEnum.None;
|
||||||
sv.CheckChallengeState = CheckChanllengeTypeEnum.None;
|
sv.CheckChallengeState = CheckChanllengeTypeEnum.None;
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
JsonStr = x.JsonDetail,
|
JsonStr = x.JsonDetail,
|
||||||
Identification = x.Identification,
|
Identification = x.Identification,
|
||||||
ObjectRelationParentId = x.ObjectRelationParentId,
|
ObjectRelationParentId = x.ObjectRelationParentId,
|
||||||
CreateTime=x.CreateTime
|
ObjectRelationParentId2 = x.ObjectRelationParentId2,
|
||||||
|
CreateTime = x.CreateTime,
|
||||||
|
BatchId = x.BatchId,
|
||||||
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
@ -238,9 +241,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//查询关联父层级数据
|
//查询关联父层级数据
|
||||||
if (item.Id == currentInspectionId)
|
if (item.Id == currentInspectionId)
|
||||||
{
|
{
|
||||||
//把父层级的数据的 CommonData 数据合并
|
//把父层级的数据的 CommonData 数据合并(每一个层级把下面层级需要的数据放在CommonData 里面) 麻烦点是每个层级都需要记录一些信息,而且名称不能重复
|
||||||
|
|
||||||
var commonDataObjList = await GetRelationParentData(item.ObjectRelationParentId, item.CreateTime);
|
var commonDataObjList = await GetRelationParentData(item.ObjectRelationParentId, item.ObjectRelationParentId2, item.CreateTime, item.BatchId);
|
||||||
|
|
||||||
var currentDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonDict[nameof(InspectionJsonDetail.CommonData)].ToJsonStr());
|
var currentDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonDict[nameof(InspectionJsonDetail.CommonData)].ToJsonStr());
|
||||||
|
|
||||||
|
@ -250,15 +253,31 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
foreach (var valuePair in otherDic)
|
foreach (var valuePair in otherDic)
|
||||||
{
|
{
|
||||||
if (currentDic.ContainsKey(valuePair.Key))
|
//关联层级的数据
|
||||||
|
if (valuePair.Key.Contains("_"))
|
||||||
{
|
{
|
||||||
currentDic[valuePair.Key] = valuePair.Value;
|
var entityProperName = valuePair.Key.Split("_").ToList().Last();
|
||||||
|
|
||||||
|
if (!currentDic.ContainsKey(entityProperName))
|
||||||
|
{
|
||||||
|
currentDic.Add(entityProperName, valuePair.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!currentDic.ContainsKey(valuePair.Key))
|
||||||
|
{
|
||||||
|
currentDic.Add(valuePair.Key, valuePair.Value);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
currentDic.Add(valuePair.Key, valuePair.Value);
|
if (!currentDic.ContainsKey(valuePair.Key))
|
||||||
|
{
|
||||||
|
currentDic.Add(valuePair.Key, valuePair.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,7 +320,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private async Task<List<object>> GetRelationParentData(Guid? objectRelationParentId, DateTime createTime)
|
private async Task<List<object>> GetRelationParentData(Guid? objectRelationParentId, Guid? objectRelationParentId2, DateTime createTime, Guid batchId)
|
||||||
{
|
{
|
||||||
|
|
||||||
var objectLsit = new List<object>();
|
var objectLsit = new List<object>();
|
||||||
|
@ -309,7 +328,50 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
if (objectRelationParentId != null)
|
if (objectRelationParentId != null)
|
||||||
{
|
{
|
||||||
var relationParentInspection = await _dataInspectionRepository.Where(t => t.GeneralId == objectRelationParentId && t.CreateTime <= createTime).OrderByDescending(x => x.CreateTime).Select(t => new { t.ObjectRelationParentId, t.CreateTime, t.JsonDetail }).FirstOrDefaultAsync();
|
//父子层级的数据可能在同一个批次 进行更新 但是后插入的是父层级的数据 找父层级的稽查应该优先同一批次的
|
||||||
|
var relationParentInspection = await _dataInspectionRepository.Where(t => t.GeneralId == objectRelationParentId && (t.CreateTime <= createTime || t.BatchId == batchId)).OrderByDescending(x => x.CreateTime).Select(t => new { t.ObjectRelationParentId, t.CreateTime, t.JsonDetail, t.BatchId, t.ObjectRelationParentId2, t.EntityName }).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
|
if (relationParentInspection != null)
|
||||||
|
{
|
||||||
|
Dictionary<string, object> jsonDic = JsonConvert.DeserializeObject<Dictionary<string, object>>(relationParentInspection.JsonDetail);
|
||||||
|
|
||||||
|
|
||||||
|
var commonDataDicObj = jsonDic[nameof(InspectionJsonDetail.CommonData)];
|
||||||
|
|
||||||
|
objectLsit.Add(commonDataDicObj);
|
||||||
|
|
||||||
|
//避免对象信息记录 把 Data里面的信息也取过去 但是加上稽查对象的前缀
|
||||||
|
var dataDicObj = jsonDic[nameof(InspectionJsonDetail.Data)];
|
||||||
|
|
||||||
|
if (dataDicObj != null)
|
||||||
|
{
|
||||||
|
var entityName = relationParentInspection.EntityName;
|
||||||
|
|
||||||
|
IDictionary<string, object> newNamepDic = new Dictionary<string, object>();
|
||||||
|
|
||||||
|
var tempDic = JsonConvert.DeserializeObject<Dictionary<string, object>>(dataDicObj.ToJsonStr());
|
||||||
|
|
||||||
|
foreach (var valuePair in tempDic)
|
||||||
|
{
|
||||||
|
newNamepDic.Add(entityName + "_" + valuePair.Key, valuePair.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
objectLsit.Add(newNamepDic);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
await GetRelationParentData(relationParentInspection.ObjectRelationParentId, relationParentInspection.ObjectRelationParentId2, relationParentInspection.CreateTime, relationParentInspection.BatchId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (objectRelationParentId2 != null)
|
||||||
|
{
|
||||||
|
//父子层级的数据可能在同一个批次 进行更新 但是后插入的是父层级的数据 找父层级的稽查应该优先同一批次的
|
||||||
|
var relationParentInspection = await _dataInspectionRepository.Where(t => t.GeneralId == objectRelationParentId2 && (t.CreateTime <= createTime || t.BatchId == batchId)).OrderByDescending(x => x.CreateTime).Select(t => new { t.ObjectRelationParentId, t.CreateTime, t.JsonDetail, t.BatchId, t.ObjectRelationParentId2, t.EntityName }).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
if (relationParentInspection != null)
|
if (relationParentInspection != null)
|
||||||
|
@ -322,8 +384,42 @@ namespace IRaCIS.Core.Application.Service
|
||||||
objectLsit.Add(commonDataDicObj);
|
objectLsit.Add(commonDataDicObj);
|
||||||
|
|
||||||
|
|
||||||
await GetRelationParentData(relationParentInspection.ObjectRelationParentId, relationParentInspection.CreateTime);
|
//避免对象信息记录 把 Data里面的信息也取过去 但是加上稽查对象的前缀
|
||||||
|
var dataDicObj = jsonDic[nameof(InspectionJsonDetail.Data)];
|
||||||
|
|
||||||
|
if (dataDicObj != null)
|
||||||
|
{
|
||||||
|
var entityName = relationParentInspection.EntityName;
|
||||||
|
|
||||||
|
IDictionary<string, object> newNamepDic = new Dictionary<string, object>();
|
||||||
|
|
||||||
|
var tempDic = JsonConvert.DeserializeObject<Dictionary<string, object>>(dataDicObj.ToJsonStr());
|
||||||
|
|
||||||
|
foreach (var valuePair in tempDic)
|
||||||
|
{
|
||||||
|
newNamepDic.Add(entityName + "_" + valuePair.Key, valuePair.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
objectLsit.Add(newNamepDic);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
await GetRelationParentData(relationParentInspection.ObjectRelationParentId, relationParentInspection.ObjectRelationParentId2, relationParentInspection.CreateTime, relationParentInspection.BatchId);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//用户的数据稽查没有 临时处理
|
||||||
|
|
||||||
|
var userObj = await _repository.Where<User>(t => t.Id == objectRelationParentId2).Select(t => new { UserFullName = t.FullName, t.UserName }).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
objectLsit.Add(userObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,8 @@ namespace IRaCIS.Application.Services
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
entity.ReadingClinicalDataState = ReadingClinicalDataStatus.HaveUploaded;
|
entity.ReadingClinicalDataState = ReadingClinicalDataStatus.HaveUploaded;
|
||||||
|
entity.IsBlind = null;
|
||||||
|
entity.IsComplete = null;
|
||||||
await _readingClinicalDataRepository.AddAsync(entity, true);
|
await _readingClinicalDataRepository.AddAsync(entity, true);
|
||||||
var success = await _readingClinicalDataRepository.SaveChangesAsync();
|
var success = await _readingClinicalDataRepository.SaveChangesAsync();
|
||||||
return ResponseOutput.Ok(entity.Id);
|
return ResponseOutput.Ok(entity.Id);
|
||||||
|
|
|
@ -307,7 +307,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
|
|
||||||
|
|
||||||
var isSuccess = await _trialSiteUserRepository.UpdatePartialFromQueryAsync(id, u => new TrialSiteUser()
|
var isSuccess = await _trialSiteUserRepository.UpdatePartialFromQueryAsync(id, u => new TrialSiteUser()
|
||||||
{ IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null },true);
|
{ IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null },true,true);
|
||||||
|
|
||||||
return ResponseOutput.Ok(isSuccess);
|
return ResponseOutput.Ok(isSuccess);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
public enum TrialType
|
public enum TrialType
|
||||||
{
|
{
|
||||||
|
|
||||||
//非正式项目
|
//正式项目
|
||||||
OfficialTrial = 1,
|
OfficialTrial = 1,
|
||||||
|
|
||||||
NoneOfficial = 0,
|
NoneOfficial = 0,
|
||||||
|
|
|
@ -143,6 +143,13 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// 稽查对象,关联的父对象Id
|
/// 稽查对象,关联的父对象Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? ObjectRelationParentId { get; set; }
|
public Guid? ObjectRelationParentId { get; set; }
|
||||||
|
|
||||||
|
public Guid? ObjectRelationParentId2 { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public string EntityName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Domain.Models
|
namespace IRaCIS.Core.Domain.Models
|
||||||
{
|
{
|
||||||
|
@ -11,11 +12,17 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[Table("Subject")]
|
[Table("Subject")]
|
||||||
public class Subject : Entity, IAuditAdd, IAuditUpdate, ISoftDelete
|
public class Subject : Entity, IAuditAdd, IAuditUpdate, ISoftDelete
|
||||||
{
|
{
|
||||||
|
[JsonIgnore]
|
||||||
public List<SubjectVisit> SubjectVisitList { get; set; } = new List<SubjectVisit>();
|
public List<SubjectVisit> SubjectVisitList { get; set; } = new List<SubjectVisit>();
|
||||||
|
[JsonIgnore]
|
||||||
public List<SubjectUser> SubjectDoctorList { get; set; } = new List<SubjectUser>();
|
public List<SubjectUser> SubjectDoctorList { get; set; } = new List<SubjectUser>();
|
||||||
|
[JsonIgnore]
|
||||||
public List<VisitTask> SubjectVisitTaskList { get; set; } = new List<VisitTask>();
|
public List<VisitTask> SubjectVisitTaskList { get; set; } = new List<VisitTask>();
|
||||||
|
[JsonIgnore]
|
||||||
|
public List<ReadModule> ReadModuleList { get; set; }
|
||||||
|
|
||||||
|
public List<SubjectCanceDoctor> SubjectCanceDoctorList { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[ForeignKey("FinalSubjectVisitId")]
|
[ForeignKey("FinalSubjectVisitId")]
|
||||||
|
@ -85,7 +92,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public bool IsUrgent { get; set; }
|
public bool IsUrgent { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public List<ReadModule> ReadModuleList { get; set; }
|
|
||||||
public bool IsDeleted { get; set; }
|
public bool IsDeleted { get; set; }
|
||||||
public DateTime? DeletedTime { get; set; }
|
public DateTime? DeletedTime { get; set; }
|
||||||
|
|
||||||
|
@ -93,7 +99,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
public bool IsReReadingOrBackInfluenceAnalysis { get; set; }
|
public bool IsReReadingOrBackInfluenceAnalysis { get; set; }
|
||||||
|
|
||||||
public List<SubjectCanceDoctor> SubjectCanceDoctorList { get; set; }
|
|
||||||
|
|
||||||
//是否分配了读片医生
|
//是否分配了读片医生
|
||||||
//public bool IsAssignDoctorUser{get;set;}
|
//public bool IsAssignDoctorUser{get;set;}
|
||||||
|
|
|
@ -153,8 +153,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
ResearchProgramNo = x.ResearchProgramNo,
|
ResearchProgramNo = x.ResearchProgramNo,
|
||||||
}, new
|
}, new
|
||||||
{
|
{
|
||||||
|
ExperimentName = entity.ExperimentName,
|
||||||
|
ResearchProgramNo = entity.ResearchProgramNo,
|
||||||
|
|
||||||
TrialDicList = string.Join(",", trialDics)
|
TrialDicList = string.Join(",", trialDics)
|
||||||
}, item.OriginalValues);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 访视计划
|
// 访视计划
|
||||||
|
@ -242,7 +245,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
entity.Site = await _dbContext.Site.Where(x => x.Id == entity.SiteId).FirstOrDefaultAsync();
|
entity.Site = await _dbContext.Site.Where(x => x.Id == entity.SiteId).FirstOrDefaultAsync();
|
||||||
}
|
}
|
||||||
await InsertInspection<TrialSite>(entity, type,null, new
|
await InsertInspection<TrialSite>(entity, type, null, new
|
||||||
{
|
{
|
||||||
TrialSiteCode = entity.TrialSiteCode,
|
TrialSiteCode = entity.TrialSiteCode,
|
||||||
SiteName = entity.Site.SiteName,
|
SiteName = entity.Site.SiteName,
|
||||||
|
@ -359,7 +362,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
var entity = item.Entity as TrialQCQuestion;
|
var entity = item.Entity as TrialQCQuestion;
|
||||||
var paretName = await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => x.QuestionName).FirstOrDefaultAsync();
|
var paretName = await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => x.QuestionName).FirstOrDefaultAsync();
|
||||||
await InsertInspection<TrialQCQuestion>(entity, type,null, new
|
await InsertInspection<TrialQCQuestion>(entity, type, null, new
|
||||||
{
|
{
|
||||||
QuestionName = entity.QuestionName,
|
QuestionName = entity.QuestionName,
|
||||||
Type = entity.Type,
|
Type = entity.Type,
|
||||||
|
@ -389,7 +392,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
dicomStudy = await _dbContext.DicomStudys.AsNoTracking().FirstOrDefaultAsync(x => x.Id == entity.StudyId);
|
dicomStudy = await _dbContext.DicomStudys.AsNoTracking().FirstOrDefaultAsync(x => x.Id == entity.StudyId);
|
||||||
}
|
}
|
||||||
await InsertInspection<DicomSeries>(item.Entity as DicomSeries, type,null, new
|
await InsertInspection<DicomSeries>(item.Entity as DicomSeries, type, null, new
|
||||||
{
|
{
|
||||||
StudyCode = dicomStudy?.StudyCode,
|
StudyCode = dicomStudy?.StudyCode,
|
||||||
Modalities = dicomStudy?.Modalities,
|
Modalities = dicomStudy?.Modalities,
|
||||||
|
@ -428,7 +431,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
filecount = filecount + count;
|
filecount = filecount + count;
|
||||||
}
|
}
|
||||||
|
|
||||||
await InsertInspection<NoneDicomStudy>(noneDicomStudy, type,null, new
|
await InsertInspection<NoneDicomStudy>(noneDicomStudy, type, null, new
|
||||||
{
|
{
|
||||||
FileCount = filecount,
|
FileCount = filecount,
|
||||||
});
|
});
|
||||||
|
@ -437,29 +440,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 访视
|
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SubjectVisit)))
|
|
||||||
{
|
|
||||||
var entity = item.Entity as SubjectVisit;
|
|
||||||
string reason = string.Empty;
|
|
||||||
|
|
||||||
if (_userInfo.RequestUrl.ToLower() == "qcoperation/setcheckpass")
|
|
||||||
{
|
|
||||||
reason = entity.ManualPassReason;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var subjectCode = entity.Subject?.Code;
|
|
||||||
await InsertInspection<SubjectVisit>(item.Entity as SubjectVisit, type, x => new InspectionConvertDTO()
|
|
||||||
{
|
|
||||||
SubjectCode = subjectCode,
|
|
||||||
SubjectId = x.SubjectId,
|
|
||||||
SubjectVisitId = x.Id,
|
|
||||||
SubjectVisitName = x.VisitName,
|
|
||||||
BlindName = x.BlindName,
|
|
||||||
Reason = reason,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 既往手术史
|
// 既往手术史
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(PreviousSurgery)))
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(PreviousSurgery)))
|
||||||
|
@ -570,7 +551,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
subjectVisit = subjectVisit ?? new SubjectVisit();
|
subjectVisit = subjectVisit ?? new SubjectVisit();
|
||||||
if (type == "Add")
|
if (type == "Add")
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
await InsertInspection(firstEntity, type, answer => new InspectionConvertDTO()
|
await InsertInspection(firstEntity, type, answer => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
|
@ -581,7 +562,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
SubjectVisitId = subjectVisit.Id,
|
SubjectVisitId = subjectVisit.Id,
|
||||||
GeneralId = subjectVisit.Id,
|
GeneralId = subjectVisit.Id,
|
||||||
//byzhouhang
|
//byzhouhang
|
||||||
ObjectRelationParentId=subjectVisit.Id,
|
ObjectRelationParentId = subjectVisit.Id,
|
||||||
}, new
|
}, new
|
||||||
{
|
{
|
||||||
QcQuestionAnswerCommands = await Getdata(entitylist),
|
QcQuestionAnswerCommands = await Getdata(entitylist),
|
||||||
|
@ -610,7 +591,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
QcQuestionAnswerCommands = await Getdata(entitylist),
|
QcQuestionAnswerCommands = await Getdata(entitylist),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task<List<AnswerDto>> Getdata(List<TrialQCQuestionAnswer> questionAnswers)
|
async Task<List<AnswerDto>> Getdata(List<TrialQCQuestionAnswer> questionAnswers)
|
||||||
|
@ -721,9 +702,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
GeneralId = x.Id,
|
GeneralId = x.Id,
|
||||||
}, new
|
}, new
|
||||||
{
|
{
|
||||||
|
//父层级的数据 暂时没有记录稽查 所以这里必须查
|
||||||
Name = doctor.FullName,
|
Name = doctor.FullName,
|
||||||
ChineseName = doctor.ChineseName,
|
ChineseName = doctor.ChineseName,
|
||||||
Email = doctor.EMail,
|
Email = doctor.EMail,
|
||||||
|
|
||||||
|
|
||||||
IsUploadedACKSOW = entity.AttachmentId != Guid.Empty
|
IsUploadedACKSOW = entity.AttachmentId != Guid.Empty
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -741,9 +725,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
GeneralId = enroll.Id,
|
GeneralId = enroll.Id,
|
||||||
}, new
|
}, new
|
||||||
{
|
{
|
||||||
|
//父层级的数据 暂时没有记录稽查 所以这里必须查
|
||||||
Name = enroll.Doctor.FullName,
|
Name = enroll.Doctor.FullName,
|
||||||
ChineseName = enroll.Doctor.ChineseName,
|
ChineseName = enroll.Doctor.ChineseName,
|
||||||
Email = enroll.Doctor.EMail,
|
Email = enroll.Doctor.EMail,
|
||||||
|
|
||||||
|
IsUploadedACKSOW = enroll.AttachmentId != Guid.Empty,
|
||||||
ReadingCategoryList = list.Select(t => t.ReadingCategory).ToList()
|
ReadingCategoryList = list.Select(t => t.ReadingCategory).ToList()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -761,10 +748,41 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
await InsertInspection<Subject>(entity, type, x => new InspectionConvertDTO()
|
await InsertInspection<Subject>(entity, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
SubjectId = x.Id,
|
SubjectId = x.Id,
|
||||||
SubjectCode = x.Code,
|
//SubjectCode = x.Code,
|
||||||
}, new
|
}, new
|
||||||
{
|
{
|
||||||
FinalSubjectVisitName = finalSubjectVisitName,
|
FinalSubjectVisitName = finalSubjectVisitName,
|
||||||
|
SujectCode = entity.Code
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 访视
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SubjectVisit)))
|
||||||
|
{
|
||||||
|
var entity = item.Entity as SubjectVisit;
|
||||||
|
string reason = string.Empty;
|
||||||
|
|
||||||
|
if (_userInfo.RequestUrl.ToLower() == "qcoperation/setcheckpass")
|
||||||
|
{
|
||||||
|
reason = entity.ManualPassReason;
|
||||||
|
}
|
||||||
|
|
||||||
|
var subjectCode = entity.Subject?.Code;
|
||||||
|
|
||||||
|
await InsertInspection<SubjectVisit>(item.Entity as SubjectVisit, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
ObjectRelationParentId = x.SubjectId,
|
||||||
|
SubjectCode = subjectCode,
|
||||||
|
SubjectId = x.SubjectId,
|
||||||
|
SubjectVisitId = x.Id,
|
||||||
|
//SubjectVisitName = x.VisitName,
|
||||||
|
//BlindName = x.BlindName,
|
||||||
|
Reason = reason,
|
||||||
|
}, new
|
||||||
|
{
|
||||||
|
SubjectVisitName = entity.VisitName,
|
||||||
|
BlindName = entity.BlindName,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -874,7 +892,122 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 阅片
|
||||||
|
|
||||||
|
//用户添加
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(User)))
|
||||||
|
{
|
||||||
|
var entity = item.Entity as User;
|
||||||
|
|
||||||
|
await InsertInspection<User>(entity, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
IsDistinctionInterface = false
|
||||||
|
}, new
|
||||||
|
{
|
||||||
|
UserFullName = entity.FullName,
|
||||||
|
entity.UserCode,
|
||||||
|
entity.UserName
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//分配规则
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TaskAllocationRule)))
|
||||||
|
{
|
||||||
|
var entity = item.Entity as TaskAllocationRule;
|
||||||
|
|
||||||
|
await InsertInspection<TaskAllocationRule>(entity, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
IsDistinctionInterface = false,
|
||||||
|
|
||||||
|
ObjectRelationParentId = entity.EnrollId,
|
||||||
|
|
||||||
|
ObjectRelationParentId2 = entity.DoctorUserId
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// suject 医生绑定关系
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SubjectUser)))
|
||||||
|
{
|
||||||
|
var entity = item.Entity as SubjectUser;
|
||||||
|
|
||||||
|
await InsertInspection<SubjectUser>(entity, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
IsDistinctionInterface = false,
|
||||||
|
|
||||||
|
ObjectRelationParentId = entity.SubjectId,
|
||||||
|
|
||||||
|
ObjectRelationParentId2 = entity.DoctorUserId
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//任务
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(VisitTask)))
|
||||||
|
{
|
||||||
|
var entity = item.Entity as VisitTask;
|
||||||
|
|
||||||
|
await InsertInspection<VisitTask>(entity, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
IsDistinctionInterface = type == AuditOpt.Update ? true : false,
|
||||||
|
ObjectRelationParentId = entity.SourceSubjectVisitId != null ? entity.SourceSubjectVisitId : entity.SouceReadModuleId,
|
||||||
|
|
||||||
|
ObjectRelationParentId2 = entity.DoctorUserId
|
||||||
|
|
||||||
|
}); ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//申请重阅记录表
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(VisitTaskReReading)))
|
||||||
|
{
|
||||||
|
var entity = item.Entity as VisitTaskReReading;
|
||||||
|
|
||||||
|
await InsertInspection<VisitTaskReReading>(entity, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
|
||||||
|
ObjectRelationParentId = entity.OriginalReReadingTaskId,
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//医学审核
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TaskMedicalReview)))
|
||||||
|
{
|
||||||
|
var entity = item.Entity as TaskMedicalReview;
|
||||||
|
|
||||||
|
await InsertInspection<TaskMedicalReview>(entity, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
|
||||||
|
ObjectRelationParentId = entity.VisitTaskId,
|
||||||
|
|
||||||
|
ObjectRelationParentId2 = entity.MedicalManagerUserId
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//一致性分析规则
|
||||||
|
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TaskConsistentRule)))
|
||||||
|
{
|
||||||
|
var entity = item.Entity as TaskConsistentRule;
|
||||||
|
|
||||||
|
await InsertInspection<TaskConsistentRule>(entity, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
|
||||||
|
ObjectRelationParentId = entity.TrialId
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -890,12 +1023,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
/// <param name="expression">表达式</param>
|
/// <param name="expression">表达式</param>
|
||||||
/// <param name="otherItem">其他对象</param>
|
/// <param name="otherItem">其他对象</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task InsertInspection<T>(T entityObj, string type, Expression<Func<T, InspectionConvertDTO>> expression = null, object otherItem = null, object originaldata = null) where T : Entity
|
public async Task InsertInspection<T>(T entityObj, string type, Expression<Func<T, InspectionConvertDTO>> expression = null, object otherItem = null) where T : Entity
|
||||||
{
|
{
|
||||||
|
|
||||||
InspectionConvertDTO inspection = new InspectionConvertDTO();
|
InspectionConvertDTO inspection = new InspectionConvertDTO();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (expression != null)
|
if (expression != null)
|
||||||
{
|
{
|
||||||
|
@ -905,7 +1038,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
//避免重复赋值 有些特殊的GeneralId
|
//避免重复赋值 有些特殊的GeneralId
|
||||||
var generalId = (inspection.GeneralId != null && inspection.GeneralId != Guid.Empty) ? inspection.GeneralId : entityObj.Id ;
|
var generalId = (inspection.GeneralId != null && inspection.GeneralId != Guid.Empty) ? inspection.GeneralId : entityObj.Id;
|
||||||
inspection.GeneralId = generalId;
|
inspection.GeneralId = generalId;
|
||||||
|
|
||||||
inspection.Identification = await GetInspectionRecordIdentificationAsync(entityObj, type, inspection.IsDistinctionInterface);
|
inspection.Identification = await GetInspectionRecordIdentificationAsync(entityObj, type, inspection.IsDistinctionInterface);
|
||||||
|
@ -932,7 +1065,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
//inspection.ParentId = (await _dbContext.DataInspection.AsQueryable().Where(x => x.TrialId == inspection.TrialId && x.SubjectVisitId == inspection.SubjectVisitId && x.SubjectId == inspection.SubjectId && x.SiteId == inspection.SiteId && x.GeneralId == inspection.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
|
//inspection.ParentId = (await _dbContext.DataInspection.AsQueryable().Where(x => x.TrialId == inspection.TrialId && x.SubjectVisitId == inspection.SubjectVisitId && x.SubjectId == inspection.SubjectId && x.SiteId == inspection.SiteId && x.GeneralId == inspection.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
|
||||||
|
|
||||||
|
|
||||||
inspection.ParentId = (await _dbContext.DataInspection.AsQueryable().Where(x => x.GeneralId == inspection.GeneralId && x.ObjectRelationParentId== inspection.ObjectRelationParentId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
|
inspection.ParentId = (await _dbContext.DataInspection.AsQueryable().Where(x => x.GeneralId == inspection.GeneralId && x.ObjectRelationParentId == inspection.ObjectRelationParentId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
|
||||||
}
|
}
|
||||||
inspection.CreateUserId = _userInfo.Id;
|
inspection.CreateUserId = _userInfo.Id;
|
||||||
inspection.IP = _userInfo.IP;
|
inspection.IP = _userInfo.IP;
|
||||||
|
@ -944,20 +1077,29 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
inspection.IsSign = true;
|
inspection.IsSign = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var entityName= entityObj.GetType().Name;
|
||||||
|
|
||||||
inspection.JsonDetail = new InspectionJsonDetail
|
inspection.JsonDetail = new InspectionJsonDetail
|
||||||
{
|
{
|
||||||
//稽查实体,加上扩充的信息
|
//稽查实体,加上扩充的信息
|
||||||
Data = AddJsonItem(entityObj, otherItem),
|
//Data = AddJsonItem(entityObj, otherItem),
|
||||||
|
|
||||||
//通用信息 每条稽查必须记录的
|
//通用信息 每条稽查必须记录的
|
||||||
CommonData = generalData
|
//CommonData = generalData
|
||||||
|
|
||||||
|
EntityName = entityName,
|
||||||
|
|
||||||
|
Data = entityObj,
|
||||||
|
|
||||||
|
CommonData = AddJsonItem(generalData, otherItem)
|
||||||
|
|
||||||
}.ToJsonStr();
|
}.ToJsonStr();
|
||||||
|
|
||||||
inspection.BatchId = _userInfo.BatchId.Value;
|
inspection.BatchId = _userInfo.BatchId.Value;
|
||||||
|
|
||||||
await _dbContext.DataInspection.AddAsync(inspection );
|
inspection.EntityName = entityName;
|
||||||
|
|
||||||
|
await _dbContext.DataInspection.AddAsync(inspection);
|
||||||
|
|
||||||
|
|
||||||
//await AddInspectionRecordAsync( entityObj, inspection, otherItem);
|
//await AddInspectionRecordAsync( entityObj, inspection, otherItem);
|
||||||
|
@ -1018,25 +1160,25 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
#region 访视 阅片期那里关联了访视
|
#region 访视 阅片期那里关联了访视
|
||||||
|
|
||||||
if (generalData.SubjectVisitId != null)
|
//if (generalData.SubjectVisitId != null)
|
||||||
{
|
//{
|
||||||
//添加访视的时候,会带信息过来
|
// //添加访视的时候,会带信息过来
|
||||||
if (string.IsNullOrEmpty(generalData.SubjectVisitName))
|
// if (string.IsNullOrEmpty(generalData.SubjectVisitName))
|
||||||
{
|
// {
|
||||||
var info = (await _dbContext.SubjectVisit.Where(x => x.Id == generalData.SubjectVisitId).Select(x =>
|
// var info = (await _dbContext.SubjectVisit.Where(x => x.Id == generalData.SubjectVisitId).Select(x =>
|
||||||
new { x.VisitName, x.SubjectId, x.SiteId, SubjectCode = x.Subject.Code, TrialSiteCode = x.TrialSite.TrialSiteCode, x.TrialId, x.Trial.ExperimentName, x.Trial.ResearchProgramNo }).FirstOrDefaultAsync()).IfNullThrowException();
|
// new { x.VisitName, x.SubjectId, x.SiteId, SubjectCode = x.Subject.Code, TrialSiteCode = x.TrialSite.TrialSiteCode, x.TrialId, x.Trial.ExperimentName, x.Trial.ResearchProgramNo }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
generalData.SubjectVisitName = info.VisitName;
|
// generalData.SubjectVisitName = info.VisitName;
|
||||||
|
|
||||||
generalData.TrialId = info.TrialId;
|
// generalData.TrialId = info.TrialId;
|
||||||
generalData.TrialName = info.ExperimentName;
|
// generalData.TrialName = info.ExperimentName;
|
||||||
generalData.ResearchProgramNo = info.ResearchProgramNo;
|
// generalData.ResearchProgramNo = info.ResearchProgramNo;
|
||||||
generalData.SiteId = info.SiteId;
|
// generalData.SiteId = info.SiteId;
|
||||||
generalData.SubjectCode = info.SubjectCode;
|
// generalData.SubjectCode = info.SubjectCode;
|
||||||
generalData.SubjectId = info.SubjectId;
|
// generalData.SubjectId = info.SubjectId;
|
||||||
generalData.SiteCode = info.TrialSiteCode;
|
// generalData.SiteCode = info.TrialSiteCode;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1112,7 +1254,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
/// 获取稽查记录的标识符 部分业务会进行特殊处理
|
/// 获取稽查记录的标识符 部分业务会进行特殊处理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetInspectionRecordIdentificationAsync<T>(T entityObj, string type, bool IsDistinctionInterface = true)
|
public async Task<string> GetInspectionRecordIdentificationAsync<T>(T entityObj, string type, bool IsDistinctionInterface = true)
|
||||||
{
|
{
|
||||||
var entityTypeName = entityObj.GetType().Name;
|
var entityTypeName = entityObj.GetType().Name;
|
||||||
|
|
||||||
|
@ -1178,8 +1320,127 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
//确认重阅 区分用户类型
|
||||||
|
case "visittask/confirmrereading":
|
||||||
|
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
||||||
|
{
|
||||||
|
type = type + "/" + 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
type = type + "/" + 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case nameof(VisitTask):
|
||||||
|
|
||||||
|
var visitTask = entityObj as VisitTask;
|
||||||
|
|
||||||
|
switch (_userInfo.RequestUrl)
|
||||||
|
{
|
||||||
|
//申请重阅
|
||||||
|
case "VisitTask/applyReReading":
|
||||||
|
type = type + "/" + (int)visitTask.ReReadingApplyState;
|
||||||
|
break;
|
||||||
|
//同意重阅
|
||||||
|
case "VisitTask/ConfirmReReading":
|
||||||
|
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
||||||
|
{
|
||||||
|
type = type + "/" + 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
type = type + "/" + 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (visitTask.ReReadingApplyState == ReReadingApplyState.Agree)
|
||||||
|
{
|
||||||
|
type = type + "/" + 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (visitTask.ReReadingApplyState == ReReadingApplyState.Reject)
|
||||||
|
{
|
||||||
|
type = type + "/" + 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == AuditOpt.Add)
|
||||||
|
{
|
||||||
|
//生成一致性分析任务
|
||||||
|
if (visitTask.IsSelfAnalysis == true)
|
||||||
|
{
|
||||||
|
type = type + "/" + "SelfAnalysis";
|
||||||
|
}
|
||||||
|
else if (visitTask.IsSelfAnalysis == false)
|
||||||
|
{
|
||||||
|
type = type + "/" + "GroupAnalysis";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
type = type + "/" + "NotAnalysis";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case nameof(VisitTaskReReading):
|
||||||
|
|
||||||
|
var visitTaskReReading = entityObj as VisitTaskReReading;
|
||||||
|
|
||||||
|
switch (_userInfo.RequestUrl)
|
||||||
|
{
|
||||||
|
case "VisitTask/applyReReading":
|
||||||
|
type = type + "/" + (int)visitTaskReReading.RequestReReadingType;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "VisitTask/ConfirmReReading":
|
||||||
|
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
||||||
|
{
|
||||||
|
type = type + "/" + 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
type = type + "/" + 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case nameof(TaskConsistentRule):
|
||||||
|
|
||||||
|
var taskConsistentRule = entityObj as TaskConsistentRule;
|
||||||
|
|
||||||
|
//自身一致性分析
|
||||||
|
if (taskConsistentRule.IsSelfAnalysis == true)
|
||||||
|
{
|
||||||
|
type = type + "/" + 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
//组件一致性分析
|
||||||
|
else
|
||||||
|
{
|
||||||
|
type = type + "/" + 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -30,6 +30,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
|
||||||
|
|
||||||
public Guid? ObjectRelationParentId { get; set; }
|
public Guid? ObjectRelationParentId { get; set; }
|
||||||
|
|
||||||
|
public Guid? ObjectRelationParentId2 { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批次Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid BatchId { get; set; }
|
||||||
|
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,9 +100,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class InspectionJsonDetail
|
public class InspectionJsonDetail
|
||||||
{
|
{
|
||||||
|
public string EntityName { get; set; }
|
||||||
public object Data { get; set; }
|
public object Data { get; set; }
|
||||||
|
|
||||||
public InspectionGeneralData CommonData { get; set; }
|
public object CommonData { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace IRaCIS.Core.Infrastructure.Extention
|
||||||
public static string ToJsonStr(this object obj)
|
public static string ToJsonStr(this object obj)
|
||||||
{
|
{
|
||||||
|
|
||||||
return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { DateFormatString = "yyyy-MM-dd HH:mm:ss", ReferenceLoopHandling = ReferenceLoopHandling.Ignore });
|
return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { DateFormatString = "yyyy-MM-dd HH:mm:ss", ReferenceLoopHandling = ReferenceLoopHandling.Ignore, NullValueHandling = NullValueHandling.Ignore });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue