Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
da77c35b7c
|
@ -913,6 +913,9 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 上传文件( 不是医生个人的文件)[FileUpload]
|
/// 上传文件( 不是医生个人的文件)[FileUpload]
|
||||||
/// 例如:阅片章程等
|
/// 例如:阅片章程等
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.API
|
||||||
|
{
|
||||||
|
public class JSONCustomDateConverter : DateTimeConverterBase
|
||||||
|
{
|
||||||
|
private TimeZoneInfo _timeZoneInfo;
|
||||||
|
private string _dateFormat;
|
||||||
|
|
||||||
|
private IUserInfo _userInfo;
|
||||||
|
public JSONCustomDateConverter(string dateFormat, TimeZoneInfo timeZoneInfo, IUserInfo userInfo)
|
||||||
|
{
|
||||||
|
_dateFormat = dateFormat;
|
||||||
|
_timeZoneInfo = timeZoneInfo;
|
||||||
|
|
||||||
|
_userInfo = userInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||||
|
{
|
||||||
|
var timeZoneId = _userInfo.TimeZoneId;
|
||||||
|
|
||||||
|
var needConvertUtcDateTime = Convert.ToDateTime(value);
|
||||||
|
|
||||||
|
|
||||||
|
var tz = TimeZoneInfo.FindSystemTimeZoneById(timeZoneId);
|
||||||
|
|
||||||
|
|
||||||
|
var dateTimeOffset = new DateTimeOffset(needConvertUtcDateTime);
|
||||||
|
|
||||||
|
var time = TimeZoneInfo.ConvertTimeFromUtc(needConvertUtcDateTime, tz).ToString(_dateFormat);
|
||||||
|
|
||||||
|
writer.WriteValue(time);
|
||||||
|
writer.Flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace IRaCIS.Core.API
|
namespace IRaCIS.Core.API
|
||||||
|
@ -22,6 +23,9 @@ namespace IRaCIS.Core.API
|
||||||
// 设置时间格式
|
// 设置时间格式
|
||||||
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
||||||
|
|
||||||
|
//options.SerializerSettings.Converters.Add(new JSONCustomDateConverter()) ;
|
||||||
|
|
||||||
|
//IsoDateTimeConverter
|
||||||
//options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
|
//options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -9942,16 +9942,6 @@
|
||||||
<member name="M:IRaCIS.Application.Services.VisitPlanService.DeleteVisitStage(System.Guid)">
|
<member name="M:IRaCIS.Application.Services.VisitPlanService.DeleteVisitStage(System.Guid)">
|
||||||
<summary> 删除项目计划某一项 废弃 </summary>
|
<summary> 删除项目计划某一项 废弃 </summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.DoctorWorkloadService.UploadReviewerAckSOW(System.Guid,IRaCIS.Application.Contracts.ReviewerAckDTO)">
|
|
||||||
<summary>
|
|
||||||
保存协议- ack Sow [AUTH]
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Application.Services.DoctorWorkloadService.DeleteReviewerAckSOW(System.Guid,System.Guid,System.Guid)">
|
|
||||||
<summary>
|
|
||||||
删除协议
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Application.Services.DoctorWorkloadService.SetEnrollReadingCategory(IRaCIS.Application.Contracts.SetEnrollReadingCategoryInDto)">
|
<member name="M:IRaCIS.Application.Services.DoctorWorkloadService.SetEnrollReadingCategory(IRaCIS.Application.Contracts.SetEnrollReadingCategoryInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
修改项目医生的阅片类型
|
修改项目医生的阅片类型
|
||||||
|
|
|
@ -98,7 +98,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var trialReadingCriterionConfig = await _trialReadingCriterionRepository.Where(t => t.Id == confirmedTrialReadingCriterionId).Select(t => new { TrialReadingCriterionId = t.Id, t.ReadingTool, t.ReadingType, t.IsReadingTaskViewInOrder, t.IsFollowVisitAutoAssign, t.IsFollowGlobalVisitAutoAssign, t.FollowGlobalVisitAutoAssignDefaultState, t.FollowVisitAutoAssignDefaultState, t.TaskAllocateObjEnum, t.CriterionType }).FirstOrDefaultAsync();
|
var trialReadingCriterionConfig = await _trialReadingCriterionRepository.Where(t => t.Id == confirmedTrialReadingCriterionId).Select(t => new { TrialReadingCriterionId = t.Id, t.ReadingTool, t.ReadingType, t.IsReadingTaskViewInOrder, t.IsFollowVisitAutoAssign, t.IsFollowGlobalVisitAutoAssign, t.FollowGlobalVisitAutoAssignDefaultState, t.FollowVisitAutoAssignDefaultState, t.TaskAllocateObjEnum, t.CriterionType }).FirstOrDefaultAsync();
|
||||||
|
|
||||||
//获取确认的临床数据配置
|
//获取确认的临床数据配置
|
||||||
var clinicalDataConfirmList = _trialClinicalDataSetRepository.Where(t => t.TrialId == trialId && t.IsConfirm).Include(t=>t.TrialClinicalDataSetCriteriaList).ToList();
|
var clinicalDataConfirmList = _trialClinicalDataSetRepository.Where(t => t.TrialId == trialId && t.IsConfirm).Include(t => t.TrialClinicalDataSetCriteriaList).ToList();
|
||||||
|
|
||||||
var visitBlindConfig = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.BlindBaseLineName, t.BlindFollowUpPrefix }).FirstOrDefault();
|
var visitBlindConfig = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.BlindBaseLineName, t.BlindFollowUpPrefix }).FirstOrDefault();
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_provider.Set<int>($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
|
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
||||||
|
|
||||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1!=null)
|
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||||
{
|
{
|
||||||
task1.TaskAllocationState = defaultState;
|
task1.TaskAllocationState = defaultState;
|
||||||
//分配给对应Arm的人
|
//分配给对应Arm的人
|
||||||
|
@ -225,7 +225,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
task1.SuggesteFinishedTime = DateTime.Now.AddDays(7);
|
task1.SuggesteFinishedTime = DateTime.Now.AddDays(7);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2!=null)
|
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||||
{
|
{
|
||||||
task2.TaskAllocationState = defaultState;
|
task2.TaskAllocationState = defaultState;
|
||||||
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2).DoctorUserId;
|
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2).DoctorUserId;
|
||||||
|
@ -339,7 +339,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var isClinicalDataSign = false;
|
var isClinicalDataSign = false;
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return isClinicalDataSign;
|
return isClinicalDataSign;
|
||||||
}
|
}
|
||||||
|
@ -621,12 +621,19 @@ namespace IRaCIS.Core.Application.Service
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var arm1 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm1);
|
var arm1 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm1);
|
||||||
|
|
||||||
if (arm1 != null)
|
if (arm1 != null)
|
||||||
{
|
{
|
||||||
arm1.TaskAllocationState = TaskAllocationState.Allocated;
|
|
||||||
arm1.AllocateTime = DateTime.Now;
|
//有可能仅仅只分配了一个Subject 未分配 那么
|
||||||
arm1.DoctorUserId = task1.DoctorUserId;
|
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||||
arm1.SuggesteFinishedTime = DateTime.Now.AddDays(7);
|
{
|
||||||
|
arm1.TaskAllocationState = TaskAllocationState.Allocated;
|
||||||
|
arm1.AllocateTime = DateTime.Now;
|
||||||
|
arm1.DoctorUserId = task1.DoctorUserId;
|
||||||
|
arm1.SuggesteFinishedTime = DateTime.Now.AddDays(7);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -677,10 +684,15 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var arm2 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm2);
|
var arm2 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm2);
|
||||||
if (arm2 != null)
|
if (arm2 != null)
|
||||||
{
|
{
|
||||||
arm2.TaskAllocationState = TaskAllocationState.Allocated;
|
//有可能仅仅只分配了一个Subject
|
||||||
arm2.AllocateTime = DateTime.Now;
|
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||||
arm2.DoctorUserId = task2.DoctorUserId;
|
{
|
||||||
arm2.SuggesteFinishedTime = DateTime.Now.AddDays(7);
|
arm2.TaskAllocationState = TaskAllocationState.Allocated;
|
||||||
|
arm2.AllocateTime = DateTime.Now;
|
||||||
|
arm2.DoctorUserId = task2.DoctorUserId;
|
||||||
|
arm2.SuggesteFinishedTime = DateTime.Now.AddDays(7);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class TrialSOWPathDTO
|
public class TrialSOWPathDTO
|
||||||
{
|
{
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
|
@ -691,6 +691,12 @@ namespace IRaCIS.Application.Contracts
|
||||||
{
|
{
|
||||||
public Guid? Id { get; set; }
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
public Guid? TrialReadingCriterionId { get; set; }
|
||||||
|
|
||||||
|
public string CriterionName { get; set; }
|
||||||
|
|
||||||
public bool IsEnable { get; set; } = true;
|
public bool IsEnable { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -772,6 +778,9 @@ namespace IRaCIS.Application.Contracts
|
||||||
/// CreateTime
|
/// CreateTime
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetDoctorCriterionFileInDto
|
public class GetDoctorCriterionFileInDto
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk("The current phone number already existed!", new DoctorBasicInfoCommand());
|
return ResponseOutput.NotOk("The current phone number already existed!", new DoctorBasicInfoCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await _doctorRepository.AnyAsync(t => t.EMail == doctor.EMail))
|
if (await _doctorRepository.AnyAsync(t => t.EMail == doctor.EMail))
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk("The current email already existed!", new DoctorBasicInfoCommand());
|
return ResponseOutput.NotOk("The current email already existed!", new DoctorBasicInfoCommand());
|
||||||
|
@ -80,7 +80,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
doctor.Code = (await _doctorRepository.MaxAsync(t => t.Code)) + 1;
|
doctor.Code = (await _doctorRepository.MaxAsync(t => t.Code)) + 1;
|
||||||
|
|
||||||
doctor.ReviewerCode = AppSettings.GetCodeStr(doctor.Code,nameof(Doctor)) ;
|
doctor.ReviewerCode = AppSettings.GetCodeStr(doctor.Code, nameof(Doctor));
|
||||||
|
|
||||||
doctor.Password = MD5Helper.Md5(doctor.Phone);
|
doctor.Password = MD5Helper.Md5(doctor.Phone);
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ namespace IRaCIS.Application.Services
|
||||||
var updateModel = basicInfoModel;
|
var updateModel = basicInfoModel;
|
||||||
|
|
||||||
var phone = updateModel.Phone.Trim();
|
var phone = updateModel.Phone.Trim();
|
||||||
if ((await _doctorRepository.FirstOrDefaultAsync(t => t.Phone == phone && t.Id != updateModel.Id) )!= null)
|
if ((await _doctorRepository.FirstOrDefaultAsync(t => t.Phone == phone && t.Id != updateModel.Id)) != null)
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk("The current phone number already existed!", new DoctorBasicInfoCommand());
|
return ResponseOutput.NotOk("The current phone number already existed!", new DoctorBasicInfoCommand());
|
||||||
}
|
}
|
||||||
|
@ -116,10 +116,10 @@ namespace IRaCIS.Application.Services
|
||||||
var doctor = await _doctorRepository.FirstOrDefaultAsync(t => t.Id == updateModel.Id).IfNullThrowException();
|
var doctor = await _doctorRepository.FirstOrDefaultAsync(t => t.Id == updateModel.Id).IfNullThrowException();
|
||||||
|
|
||||||
//删除中间表 Title对应的记录
|
//删除中间表 Title对应的记录
|
||||||
await _repository.BatchDeleteAsync<DoctorDictionary>(t => t.DoctorId == updateModel.Id && t.KeyName == StaticData.Title);
|
await _repository.BatchDeleteAsync<DoctorDictionary>(t => t.DoctorId == updateModel.Id && t.KeyName == StaticData.Title);
|
||||||
|
|
||||||
|
|
||||||
var adddata=new List<DoctorDictionary>();
|
|
||||||
|
var adddata = new List<DoctorDictionary>();
|
||||||
//重新插入新的 Title记录
|
//重新插入新的 Title记录
|
||||||
updateModel.TitleIds.ForEach(titleId => adddata.Add(new DoctorDictionary() { DoctorId = updateModel.Id.Value, KeyName = StaticData.Title, DictionaryId = titleId }));
|
updateModel.TitleIds.ForEach(titleId => adddata.Add(new DoctorDictionary() { DoctorId = updateModel.Id.Value, KeyName = StaticData.Title, DictionaryId = titleId }));
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
|
||||||
public async Task<IResponseOutput> UpdateEmploymentInfo(EmploymentCommand doctorWorkInfoModel)
|
public async Task<IResponseOutput> UpdateEmploymentInfo(EmploymentCommand doctorWorkInfoModel)
|
||||||
{
|
{
|
||||||
#region 废弃
|
#region 废弃
|
||||||
|
@ -314,7 +314,7 @@ namespace IRaCIS.Application.Services
|
||||||
//_mapper.Map(doctorWorkInfoModel, doctor);
|
//_mapper.Map(doctorWorkInfoModel, doctor);
|
||||||
//var success = _doctorRepository.SaveChanges();
|
//var success = _doctorRepository.SaveChanges();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
var entity = await _repository.InsertOrUpdateAsync<Doctor, EmploymentCommand>(doctorWorkInfoModel, true);
|
var entity = await _repository.InsertOrUpdateAsync<Doctor, EmploymentCommand>(doctorWorkInfoModel, true);
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ namespace IRaCIS.Application.Services
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> UpdateSpecialtyInfo(SpecialtyCommand specialtyUpdateModel)
|
public async Task<IResponseOutput> UpdateSpecialtyInfo(SpecialtyCommand specialtyUpdateModel)
|
||||||
{
|
{
|
||||||
|
@ -421,7 +421,7 @@ namespace IRaCIS.Application.Services
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 简历审核
|
#region 简历审核
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> UpdateAuditResume(ResumeConfirmCommand auditResumeParam)
|
public async Task<IResponseOutput> UpdateAuditResume(ResumeConfirmCommand auditResumeParam)
|
||||||
{
|
{
|
||||||
|
@ -441,8 +441,8 @@ namespace IRaCIS.Application.Services
|
||||||
ReviewStatus = auditResumeParam.ReviewStatus,
|
ReviewStatus = auditResumeParam.ReviewStatus,
|
||||||
AcceptingNewTrial = auditResumeParam.AcceptingNewTrial,
|
AcceptingNewTrial = auditResumeParam.AcceptingNewTrial,
|
||||||
ActivelyReading = auditResumeParam.ActivelyReading,
|
ActivelyReading = auditResumeParam.ActivelyReading,
|
||||||
IsVirtual=auditResumeParam.IsVirtual,
|
IsVirtual = auditResumeParam.IsVirtual,
|
||||||
BlindName=auditResumeParam.BlindName,
|
BlindName = auditResumeParam.BlindName,
|
||||||
BlindNameCN = auditResumeParam.BlindNameCN,
|
BlindNameCN = auditResumeParam.BlindNameCN,
|
||||||
BlindPublications = auditResumeParam.BlindPublications,
|
BlindPublications = auditResumeParam.BlindPublications,
|
||||||
AuditTime = DateTime.Now,
|
AuditTime = DateTime.Now,
|
||||||
|
@ -479,11 +479,22 @@ namespace IRaCIS.Application.Services
|
||||||
public async Task<IResponseOutput> AddDoctorCriterionFile(AddDoctorCriterionFileDto inDto)
|
public async Task<IResponseOutput> AddDoctorCriterionFile(AddDoctorCriterionFileDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (await _doctorCriterionFileRepository.AnyAsync(x =>inDto.IsEnable&& x.DoctorId == inDto.DoctorId && x.FileType == inDto.FileType && x.IsEnable && x.CriterionType == inDto.CriterionType && x.Id != inDto.Id))
|
if (await _doctorCriterionFileRepository.AnyAsync(x => inDto.IsEnable && x.DoctorId == inDto.DoctorId && x.FileType == inDto.FileType && x.TrialId==inDto.TrialId &&x.TrialReadingCriterionId==inDto.TrialReadingCriterionId && x.IsEnable && x.CriterionType == inDto.CriterionType && x.Id != inDto.Id))
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException("当前标准已添加过此类型文件");
|
throw new BusinessValidationFailedException("当前标准已添加过此类型文件");
|
||||||
}
|
}
|
||||||
var entity = await _doctorCriterionFileRepository.InsertOrUpdateAsync(inDto, true);
|
|
||||||
|
|
||||||
|
var entity = await _doctorCriterionFileRepository.InsertOrUpdateAsync(inDto);
|
||||||
|
|
||||||
|
if (inDto.TrialId != null)
|
||||||
|
{
|
||||||
|
entity.Remark = await _trialRepository.Where(t => t.Id == inDto.TrialId).Select(t => t.TrialCode).FirstOrDefaultAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
await _doctorCriterionFileRepository.SaveChangesAsync();
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -523,7 +534,7 @@ namespace IRaCIS.Application.Services
|
||||||
var doctor = (await _doctorRepository
|
var doctor = (await _doctorRepository
|
||||||
.ProjectTo<ResumeConfirmDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync(t => t.Id == doctorId)).IfNullThrowException();
|
.ProjectTo<ResumeConfirmDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync(t => t.Id == doctorId)).IfNullThrowException();
|
||||||
|
|
||||||
doctor.InHoliday = (await _repository.CountAsync<Vacation>(x=>x.DoctorId==doctorId&&x.EndDate<=DateTime.Now&&x.StartDate<=DateTime.Now)) > 0;
|
doctor.InHoliday = (await _repository.CountAsync<Vacation>(x => x.DoctorId == doctorId && x.EndDate <= DateTime.Now && x.StartDate <= DateTime.Now)) > 0;
|
||||||
|
|
||||||
return doctor;
|
return doctor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
using IRaCIS.Core.Infra.EFCore;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
|
@ -164,6 +165,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AllowAnonymous]
|
||||||
public async Task<List<MenuTreeNode>> GetUserMenuTree()
|
public async Task<List<MenuTreeNode>> GetUserMenuTree()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -182,7 +184,7 @@ namespace IRaCIS.Application.Services
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AllowAnonymous]
|
||||||
public async Task<List<string>> GetUserPermissions()
|
public async Task<List<string>> GetUserPermissions()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -874,7 +874,7 @@ namespace IRaCIS.Core.Application
|
||||||
EnrollStatus = EnrollStatus.Finished
|
EnrollStatus = EnrollStatus.Finished
|
||||||
});
|
});
|
||||||
|
|
||||||
await _trialRepository.BatchUpdateNoTrackingAsync(u => u.Id == trialId, s => new Trial { TrialFinishedTime = DateTime.UtcNow.AddHours(8) });
|
await _trialRepository.BatchUpdateNoTrackingAsync(u => u.Id == trialId, s => new Trial { TrialFinishedTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -281,11 +281,16 @@ namespace IRaCIS.Application.Contracts
|
||||||
new CriterionReadingCategory()
|
new CriterionReadingCategory()
|
||||||
{
|
{
|
||||||
EnrollId = EnrollId,
|
EnrollId = EnrollId,
|
||||||
PendingCount= ReadingTaskStateList.Where(x=>x.ReadingTaskState != ReadingTaskState.HaveSigned&&x.CriterionType== t.CriterionType).Count(),
|
PendingCount= ReadingTaskStateList.Where(x=>x.ReadingTaskState != ReadingTaskState.HaveSigned&& x.TrialReadingCriterionId == t.TrialReadingCriterionId).Count(),
|
||||||
ComplectedCount = ReadingTaskStateList.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned && x.CriterionType == t.CriterionType).Count(),
|
|
||||||
TotalCount = ReadingTaskStateList.Where(x => x.CriterionType == t.CriterionType).Count(),
|
ComplectedCount = ReadingTaskStateList.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned && x.TrialReadingCriterionId == t.TrialReadingCriterionId).Count(),
|
||||||
StatementCriterionFileList = CriterionFileList.Where(x=>x.CriterionType==t.CriterionType&&x.FileType==CriterionFileType.Statement).ToList(),
|
|
||||||
AcknowledgementCriterionFileList = CriterionFileList.Where(x => x.CriterionType == t.CriterionType && x.FileType == CriterionFileType.Acknowledgement).ToList(),
|
TotalCount = ReadingTaskStateList.Where(x => x.TrialReadingCriterionId == t.TrialReadingCriterionId) .Count(),
|
||||||
|
|
||||||
|
StatementCriterionFileList = CriterionFileList.Where(x=>x.CriterionType==t.CriterionType&&x.FileType==CriterionFileType.Statement)
|
||||||
|
.WhereIf(t.CriterionType == CriterionType.SelfDefine, x => x.TrialReadingCriterionId == t.TrialReadingCriterionId).ToList(),
|
||||||
|
AcknowledgementCriterionFileList = CriterionFileList.Where(x => x.CriterionType == t.CriterionType && x.FileType == CriterionFileType.Acknowledgement)
|
||||||
|
.WhereIf(t.CriterionType == CriterionType.SelfDefine, x => x.TrialReadingCriterionId == t.TrialReadingCriterionId).ToList(),
|
||||||
TrialReadingCriterionId = t.TrialReadingCriterionId,
|
TrialReadingCriterionId = t.TrialReadingCriterionId,
|
||||||
ReadingCategorys = CriterionReadingCategoryList.Where(c => c.TrialReadingCriterionId == t.TrialReadingCriterionId).Select(t => t.ReadingCategory).OrderBy(c => c).ToList()
|
ReadingCategorys = CriterionReadingCategoryList.Where(c => c.TrialReadingCriterionId == t.TrialReadingCriterionId).Select(t => t.ReadingCategory).OrderBy(c => c).ToList()
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
@ -305,6 +310,8 @@ namespace IRaCIS.Application.Contracts
|
||||||
public ReadingTaskState ReadingTaskState { get; set; }
|
public ReadingTaskState ReadingTaskState { get; set; }
|
||||||
|
|
||||||
public CriterionType? CriterionType { get; set; }
|
public CriterionType? CriterionType { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialReadingCriterionId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialReadingCriterionDto
|
public class TrialReadingCriterionDto
|
||||||
|
@ -340,11 +347,11 @@ namespace IRaCIS.Application.Contracts
|
||||||
|
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public Guid? TrialReadingCriterionId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件名称
|
/// 文件名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FileName { get; set; }
|
public string FileName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件路径
|
/// 文件路径
|
||||||
|
|
|
@ -50,53 +50,63 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 入组工作量统计列表 具体详情 增删改查相关 上传\删除协议
|
#region 入组工作量统计列表 具体详情 增删改查相关 上传\删除协议
|
||||||
/// <summary>
|
|
||||||
/// 保存协议- ack Sow [AUTH]
|
|
||||||
/// </summary>
|
|
||||||
[HttpPost("{trialId}")]
|
|
||||||
|
|
||||||
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
|
|
||||||
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
|
||||||
public async Task<IResponseOutput> UploadReviewerAckSOW(Guid trialId,
|
|
||||||
ReviewerAckDTO attachmentViewModel)
|
|
||||||
{
|
|
||||||
|
|
||||||
var intoGroupItem = (await _enrollRepository.Where(t => t.TrialId == trialId && t.DoctorId == attachmentViewModel.DoctorId).FirstOrDefaultAsync()).IfNullThrowException();
|
|
||||||
|
|
||||||
|
|
||||||
if (attachmentViewModel.Id != Guid.Empty)
|
#region 协议废弃
|
||||||
{
|
///// <summary>
|
||||||
await _attachmentRepository.BatchDeleteNoTrackingAsync(t => t.Id == attachmentViewModel.Id);
|
///// 保存协议- ack Sow [AUTH]
|
||||||
}
|
///// </summary>
|
||||||
|
//[HttpPost("{trialId}")]
|
||||||
|
|
||||||
var attachment = await _attachmentRepository.InsertFromDTOAsync(attachmentViewModel);
|
//[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||||
|
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||||
|
//public async Task<IResponseOutput> UploadReviewerAckSOW(Guid trialId,
|
||||||
|
// ReviewerAckDTO attachmentViewModel)
|
||||||
|
//{
|
||||||
|
|
||||||
//intoGroupItem.AttachmentId = attachment.Id;
|
// var intoGroupItem = (await _enrollRepository.Where(t => t.TrialId == trialId && t.DoctorId == attachmentViewModel.DoctorId).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
await _enrollRepository.UpdatePartialFromQueryAsync(intoGroupItem.Id, u => new Enroll() { AttachmentId = attachment.Id });
|
|
||||||
|
|
||||||
|
|
||||||
var success = await _enrollRepository.SaveChangesAsync();
|
// if (attachmentViewModel.Id != Guid.Empty)
|
||||||
|
// {
|
||||||
|
// await _attachmentRepository.BatchDeleteNoTrackingAsync(t => t.Id == attachmentViewModel.Id);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// var attachment = await _attachmentRepository.InsertFromDTOAsync(attachmentViewModel);
|
||||||
|
|
||||||
|
// //intoGroupItem.AttachmentId = attachment.Id;
|
||||||
|
// await _enrollRepository.UpdatePartialFromQueryAsync(intoGroupItem.Id, u => new Enroll() { AttachmentId = attachment.Id });
|
||||||
|
|
||||||
|
|
||||||
|
// var success = await _enrollRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
// return ResponseOutput.Result(success, attachment.Id.ToString());
|
||||||
|
//}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 删除协议
|
||||||
|
///// </summary>
|
||||||
|
//[HttpDelete, Route("{trialId}/{doctorId}/{attachmentId}")]
|
||||||
|
|
||||||
|
//[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||||
|
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||||
|
//public async Task<IResponseOutput> DeleteReviewerAckSOW(Guid trialId, Guid doctorId, Guid attachmentId)
|
||||||
|
//{
|
||||||
|
// var success1 = await _attachmentRepository.BatchDeleteNoTrackingAsync(a => a.Id == attachmentId);
|
||||||
|
// await _enrollRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.DoctorId == doctorId, u =>
|
||||||
|
// new Enroll()
|
||||||
|
// {
|
||||||
|
// AttachmentId = Guid.Empty
|
||||||
|
// }, true);
|
||||||
|
// return ResponseOutput.Ok(success1);
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
return ResponseOutput.Result(success, attachment.Id.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 删除协议
|
|
||||||
/// </summary>
|
|
||||||
[HttpDelete, Route("{trialId}/{doctorId}/{attachmentId}")]
|
|
||||||
|
|
||||||
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
|
|
||||||
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
|
||||||
public async Task<IResponseOutput> DeleteReviewerAckSOW(Guid trialId, Guid doctorId, Guid attachmentId)
|
|
||||||
{
|
|
||||||
var success1 = await _attachmentRepository.BatchDeleteNoTrackingAsync(a => a.Id == attachmentId);
|
|
||||||
await _enrollRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.DoctorId == doctorId, u =>
|
|
||||||
new Enroll()
|
|
||||||
{
|
|
||||||
AttachmentId = Guid.Empty
|
|
||||||
}, true);
|
|
||||||
return ResponseOutput.Ok(success1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 修改项目医生的阅片类型
|
/// 修改项目医生的阅片类型
|
||||||
|
@ -207,22 +217,31 @@ namespace IRaCIS.Application.Services
|
||||||
IsEnable = allocateRule.IsEnable,
|
IsEnable = allocateRule.IsEnable,
|
||||||
|
|
||||||
TrialReadingCriterionList = intoGroup.Trial.ReadingQuestionCriterionTrialList.Where(t=>t.IsConfirm).Select(t=>new TrialReadingCriterionDto() { TrialReadingCriterionId=t.Id,TrialReadingCriterionName=t.CriterionName,CriterionType=t.CriterionType,IsOncologyReading=t.IsOncologyReading,IsArbitrationReading=t.IsArbitrationReading,IsGlobalReading=t.IsGlobalReading,ReadingInfoSignTime=t.ReadingInfoSignTime,ReadingType=t.ReadingType}).ToList(),
|
TrialReadingCriterionList = intoGroup.Trial.ReadingQuestionCriterionTrialList.Where(t=>t.IsConfirm).Select(t=>new TrialReadingCriterionDto() { TrialReadingCriterionId=t.Id,TrialReadingCriterionName=t.CriterionName,CriterionType=t.CriterionType,IsOncologyReading=t.IsOncologyReading,IsArbitrationReading=t.IsArbitrationReading,IsGlobalReading=t.IsGlobalReading,ReadingInfoSignTime=t.ReadingInfoSignTime,ReadingType=t.ReadingType}).ToList(),
|
||||||
CriterionFileList= doctor.CriterionFileList.Where(x=>x.IsEnable).Select(x=> new CriterionFile() {
|
|
||||||
CriterionType=x.CriterionType,
|
|
||||||
DoctorId=x.DoctorId,
|
|
||||||
FileName=x.FileName,
|
|
||||||
FilePath=x.FilePath,
|
|
||||||
FileType=x.FileType,
|
|
||||||
Remark=x.Remark,
|
|
||||||
Id=x.Id
|
|
||||||
}).ToList(),
|
|
||||||
CriterionReadingCategoryList =intoGroup.EnrollReadingCategoryList.Select(t=>new TrialCriterionReadingCategory() { EnrollId=t.EnrollId,ReadingCategory=t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId }).ToList(),
|
CriterionReadingCategoryList =intoGroup.EnrollReadingCategoryList.Select(t=>new TrialCriterionReadingCategory() { EnrollId=t.EnrollId,ReadingCategory=t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId }).ToList(),
|
||||||
|
|
||||||
ReadingTaskStateList=doctor.User.VisitTaskList.Where(x=>x.TaskState==TaskState.Effect&&x.TrialId== trialId).Select(x=> new DoctorUserTask() {
|
CriterionFileList = doctor.CriterionFileList.Where(x => x.IsEnable && (x.TrialId==null ||x.TrialId==trialId)).Select(x => new CriterionFile()
|
||||||
ReadingTaskState= x.ReadingTaskState,
|
{
|
||||||
CriterionType=x.TrialReadingCriterion.CriterionType,
|
CriterionType = x.CriterionType,
|
||||||
|
DoctorId = x.DoctorId,
|
||||||
|
FileName = x.FileName,
|
||||||
|
FilePath = x.FilePath,
|
||||||
|
FileType = x.FileType,
|
||||||
|
Remark = x.Remark,
|
||||||
|
TrialReadingCriterionId=x.TrialReadingCriterionId,
|
||||||
|
Id = x.Id
|
||||||
|
}).ToList(),
|
||||||
|
|
||||||
|
ReadingTaskStateList = doctor.User.VisitTaskList.Where(x => x.TaskState == TaskState.Effect && x.TrialId == trialId).Select(x => new DoctorUserTask()
|
||||||
|
{
|
||||||
|
ReadingTaskState = x.ReadingTaskState,
|
||||||
|
TrialReadingCriterionId=x.TrialReadingCriterionId,
|
||||||
|
CriterionType = x.TrialReadingCriterion.CriterionType,
|
||||||
|
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
|
|
||||||
DoctorId = doctor.Id,
|
DoctorId = doctor.Id,
|
||||||
Code = doctor.ReviewerCode,
|
Code = doctor.ReviewerCode,
|
||||||
FirstName = doctor.FirstName,
|
FirstName = doctor.FirstName,
|
||||||
|
|
|
@ -5,14 +5,14 @@ namespace IRaCIS.Application.Services
|
||||||
public interface IDoctorWorkloadService
|
public interface IDoctorWorkloadService
|
||||||
{
|
{
|
||||||
Task<IResponseOutput> AddOrUpdateWorkload(WorkloadCommand workLoadAddOrUpdateModel, Guid userId);
|
Task<IResponseOutput> AddOrUpdateWorkload(WorkloadCommand workLoadAddOrUpdateModel, Guid userId);
|
||||||
Task<IResponseOutput> DeleteReviewerAckSOW(Guid trialId, Guid doctorId, Guid attachmentId);
|
//Task<IResponseOutput> DeleteReviewerAckSOW(Guid trialId, Guid doctorId, Guid attachmentId);
|
||||||
Task<IResponseOutput> DeleteWorkload(Guid workloadId);
|
Task<IResponseOutput> DeleteWorkload(Guid workloadId);
|
||||||
PageOutput<WorkLoadDetailDTO> GetEnrollmentWorkloadStatsDetail(WorkLoadStatsQueryDTO workLoadSearch);
|
PageOutput<WorkLoadDetailDTO> GetEnrollmentWorkloadStatsDetail(WorkLoadStatsQueryDTO workLoadSearch);
|
||||||
Task<List<WorkLoadDetailViewModel>> GetReviewerWorkLoadListDetail(WorkLoadDetailQueryDTO workLoadSearch);
|
Task<List<WorkLoadDetailViewModel>> GetReviewerWorkLoadListDetail(WorkLoadDetailQueryDTO workLoadSearch);
|
||||||
Task<PageOutput<WorkLoadAndAgreementDTO>> GetTrialEnrollmentWorkloadStats(WorkLoadDoctorQueryDTO doctorSearchModel);
|
Task<PageOutput<WorkLoadAndAgreementDTO>> GetTrialEnrollmentWorkloadStats(WorkLoadDoctorQueryDTO doctorSearchModel);
|
||||||
Task<WorkloadDTO> GetWorkloadDetailById(Guid id);
|
Task<WorkloadDTO> GetWorkloadDetailById(Guid id);
|
||||||
Task<IResponseOutput> UpdateReviewerReadingType(Guid trialId, Guid doctorId, int type);
|
Task<IResponseOutput> UpdateReviewerReadingType(Guid trialId, Guid doctorId, int type);
|
||||||
Task<IResponseOutput> UploadReviewerAckSOW(Guid trialId, ReviewerAckDTO attachmentViewModel);
|
//Task<IResponseOutput> UploadReviewerAckSOW(Guid trialId, ReviewerAckDTO attachmentViewModel);
|
||||||
Task<IResponseOutput<ExistWorkloadViewModel>> WorkloadExist(WorkloadExistQueryDTO param);
|
Task<IResponseOutput<ExistWorkloadViewModel>> WorkloadExist(WorkloadExistQueryDTO param);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -23,7 +23,7 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
string RealName { get; }
|
string RealName { get; }
|
||||||
string ReviewerCode { get; }
|
string ReviewerCode { get; }
|
||||||
|
|
||||||
bool IsAdmin { get; }
|
bool IsAdmin { get; }
|
||||||
|
|
||||||
bool IsTestUser { get; }
|
bool IsTestUser { get; }
|
||||||
|
|
||||||
|
@ -31,9 +31,9 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
|
|
||||||
string UserTypeEnumStr { get; }
|
string UserTypeEnumStr { get; }
|
||||||
|
|
||||||
int UserTypeEnumInt { get; }
|
int UserTypeEnumInt { get; }
|
||||||
|
|
||||||
Guid UserTypeId { get; }
|
Guid UserTypeId { get; }
|
||||||
|
|
||||||
string UserToken { get; }
|
string UserToken { get; }
|
||||||
|
|
||||||
|
@ -43,13 +43,18 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
|
|
||||||
string LocalIp { get; }
|
string LocalIp { get; }
|
||||||
|
|
||||||
bool IsEn_Us { get; }
|
bool IsEn_Us { get; }
|
||||||
|
|
||||||
string RequestUrl { get; }
|
string RequestUrl { get; }
|
||||||
|
|
||||||
Guid? SignId { get; set; }
|
Guid? SignId { get; set; }
|
||||||
|
|
||||||
Guid? BatchId { get; set; }
|
Guid? BatchId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 字符串形式 标识时区
|
||||||
|
/// </summary>
|
||||||
|
string TimeZoneId { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,6 +266,23 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string TimeZoneId
|
||||||
|
{
|
||||||
|
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var timeZoneId = _accessor?.HttpContext?.Request?.Headers["TimeZoneId"];
|
||||||
|
|
||||||
|
if (timeZoneId is not null && !string.IsNullOrEmpty(timeZoneId.Value))
|
||||||
|
{
|
||||||
|
return timeZoneId.Value;
|
||||||
|
}
|
||||||
|
return "Asia/Shanghai";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Guid? SignId
|
public Guid? SignId
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,6 +65,11 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[ForeignKey("DoctorId")]
|
[ForeignKey("DoctorId")]
|
||||||
public Doctor Doctor { get; set; }
|
public Doctor Doctor { get; set; }
|
||||||
|
|
||||||
|
public string CriterionName { get; set; }
|
||||||
|
public Guid? TrialReadingCriterionId { get; set; }
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -113,26 +113,39 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
var type = GetEntityAuditOpt(item);
|
var type = GetEntityAuditOpt(item);
|
||||||
|
|
||||||
var entity = item.Entity as Trial;
|
var entity = item.Entity as Trial;
|
||||||
List<string> trialDics = new List<string>();
|
|
||||||
var dictionaryIds = new List<Guid>();
|
|
||||||
if (entity.TrialDicList == null || entity.TrialDicList.Count == 0)
|
|
||||||
{
|
|
||||||
dictionaryIds = await this._dbContext.TrialDictionary.Where(x => x.TrialId == entity.Id && x.KeyName == "Criterion").Select(x => x.DictionaryId).ToListAsync();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dictionaryIds = entity.TrialDicList.Select(x => x.DictionaryId).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
trialDics = await this._dbContext.Dictionary.Where(x => dictionaryIds.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync();
|
//阅片标准
|
||||||
|
var criterionNameList = await _dbContext.ReadingQuestionCriterionTrial.Where(t => t.TrialId == entity.Id && t.IsConfirm).OrderBy(t => t.ShowOrder).Select(t => t.CriterionName).ToListAsync();
|
||||||
|
|
||||||
|
//临床数据配置
|
||||||
|
var clinicalDataSetNameList = await _dbContext.ClinicalDataTrialSet.Where(t => t.TrialId == entity.Id && t.IsConfirm).Select(t => t.ClinicalDataSetName).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//List<string> trialDics = new List<string>();
|
||||||
|
//var dictionaryIds = new List<Guid>();
|
||||||
|
//if (entity.TrialDicList == null || entity.TrialDicList.Count == 0)
|
||||||
|
//{
|
||||||
|
// dictionaryIds = await this._dbContext.TrialDictionary.Where(x => x.TrialId == entity.Id && x.KeyName == "Criterion").Select(x => x.DictionaryId).ToListAsync();
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// dictionaryIds = entity.TrialDicList.Select(x => x.DictionaryId).ToList();
|
||||||
|
//}
|
||||||
|
//trialDics = await this._dbContext.Dictionary.Where(x => dictionaryIds.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync();
|
||||||
|
|
||||||
await InsertInspection<Trial>(item.Entity as Trial, type, x => new InspectionConvertDTO()
|
await InsertInspection<Trial>(item.Entity as Trial, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
TrialId = x.Id,
|
TrialId = x.Id,
|
||||||
}, new
|
}, new
|
||||||
{
|
{
|
||||||
TrialDicList = string.Join(",", trialDics)
|
//TrialDicList = string.Join(",", trialDics)
|
||||||
});
|
|
||||||
|
CriterionNames = criterionNameList.Count() > 0? string.Join(",", criterionNameList):string.Empty,
|
||||||
|
|
||||||
|
ClinicalDataSetNames = clinicalDataSetNameList.Count() > 0 ? string.Join(",", clinicalDataSetNameList):String.Empty,
|
||||||
|
|
||||||
|
}); ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -183,7 +196,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
var isDistinctionInterface = false;
|
var isDistinctionInterface = false;
|
||||||
|
|
||||||
//设置项目配置 肿瘤学配置 和阅片标准配置
|
//设置项目配置 肿瘤学配置 和阅片标准配置
|
||||||
if (_userInfo.RequestUrl == "TrialConfig/setOncologySet" || _userInfo.RequestUrl == "TrialConfig/setTrialReadingCriterion"|| _userInfo.RequestUrl== "configTrialBasicInfo/ConfigTrialProcessInfoConfirm")
|
if (_userInfo.RequestUrl == "TrialConfig/setOncologySet" || _userInfo.RequestUrl == "TrialConfig/setTrialReadingCriterion" || _userInfo.RequestUrl == "configTrialBasicInfo/ConfigTrialProcessInfoConfirm"
|
||||||
|
)
|
||||||
{
|
{
|
||||||
isDistinctionInterface = true;
|
isDistinctionInterface = true;
|
||||||
}
|
}
|
||||||
|
@ -191,7 +205,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
//同步的数据 后面加"/Auto" 因为同步的地方可能会改 所以取反
|
//同步的数据 后面加"/Auto" 因为同步的地方可能会改 所以取反
|
||||||
var extraIdentification = string.Empty;
|
var extraIdentification = string.Empty;
|
||||||
if (_userInfo.RequestUrl!= "ReadingQuestion/addOrUpdateReadingQuestionCriterionTrial" && type==AuditOpt.Add)
|
if (_userInfo.RequestUrl != "ReadingQuestion/addOrUpdateReadingQuestionCriterionTrial" && type == AuditOpt.Add)
|
||||||
{
|
{
|
||||||
extraIdentification = "/Auto";
|
extraIdentification = "/Auto";
|
||||||
}
|
}
|
||||||
|
@ -205,7 +219,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
ObjectRelationParentId = x.TrialId,
|
ObjectRelationParentId = x.TrialId,
|
||||||
|
|
||||||
ExtraIndentification=extraIdentification
|
ExtraIndentification = extraIdentification
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -287,7 +301,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
ObjectRelationParentId = x.TrialId,
|
ObjectRelationParentId = x.TrialId,
|
||||||
|
|
||||||
ExtraIndentification=extraIdentification
|
ExtraIndentification = extraIdentification
|
||||||
|
|
||||||
}, new { ParentQuestionShowOrder = parentQuestionShowOrder, RelavantQuestionShowOrder = relavantQuestionShowOrder });
|
}, new { ParentQuestionShowOrder = parentQuestionShowOrder, RelavantQuestionShowOrder = relavantQuestionShowOrder });
|
||||||
}
|
}
|
||||||
|
@ -369,7 +383,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
ObjectRelationParentId = x.TrialId,
|
ObjectRelationParentId = x.TrialId,
|
||||||
|
|
||||||
ExtraIndentification=extraIdentification
|
ExtraIndentification = extraIdentification
|
||||||
|
|
||||||
}, new { ParentQuestionShowOrder = parentQuestionShowOrder, RelavantQuestionShowOrder = relavantQuestionShowOrder, DependQuestionShowOrder = dependQuestionShowOrder });
|
}, new { ParentQuestionShowOrder = parentQuestionShowOrder, RelavantQuestionShowOrder = relavantQuestionShowOrder, DependQuestionShowOrder = dependQuestionShowOrder });
|
||||||
}
|
}
|
||||||
|
@ -403,7 +417,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
var extraIdentification = string.Empty;
|
var extraIdentification = string.Empty;
|
||||||
|
|
||||||
//同步添加
|
//同步添加
|
||||||
if (_userInfo.RequestUrl != "OrganInfo/batchAddTrialOrgan" && organTrialEntityEnrtyList.Any( t=>GetEntityAuditOpt(t) == AuditOpt.Add) )
|
if (_userInfo.RequestUrl != "OrganInfo/batchAddTrialOrgan" && organTrialEntityEnrtyList.Any(t => GetEntityAuditOpt(t) == AuditOpt.Add))
|
||||||
{
|
{
|
||||||
extraIdentification = "/Auto";
|
extraIdentification = "/Auto";
|
||||||
|
|
||||||
|
@ -439,7 +453,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
QuestionAnswerList = list.Join(organList, t => t.OrganInfoId, u => u.Id, (t, u) => u).OrderBy(t => t.ShowOrder).ToList(),
|
QuestionAnswerList = list.Join(organList, t => t.OrganInfoId, u => u.Id, (t, u) => u).OrderBy(t => t.ShowOrder).ToList(),
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -483,7 +497,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
extraIdentification = "/IsTrial";
|
extraIdentification = "/IsTrial";
|
||||||
|
|
||||||
if(_userInfo.RequestUrl!= "OrganInfo/addOrUpdateCriterionNidus" && type==AuditOpt.Add)
|
if (_userInfo.RequestUrl != "OrganInfo/addOrUpdateCriterionNidus" && type == AuditOpt.Add)
|
||||||
{
|
{
|
||||||
extraIdentification = "/IsTrial/Auto";
|
extraIdentification = "/IsTrial/Auto";
|
||||||
}
|
}
|
||||||
|
@ -499,9 +513,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
TrialReadingCriterionId = entity.IsSystemCriterion == false ? entity.CriterionId : null,
|
TrialReadingCriterionId = entity.IsSystemCriterion == false ? entity.CriterionId : null,
|
||||||
|
|
||||||
ExtraIndentification=extraIdentification
|
ExtraIndentification = extraIdentification
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -572,7 +586,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
//不显示区分接口 通过是否是系统字典 以及字典Code 区分
|
//不显示区分接口 通过是否是系统字典 以及字典Code 区分
|
||||||
IsDistinctionInterface = false,
|
IsDistinctionInterface = false,
|
||||||
ExtraIndentification=extraIdentification
|
ExtraIndentification = extraIdentification
|
||||||
|
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
|
@ -697,7 +711,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
var extraIdentification = string.Empty;
|
var extraIdentification = string.Empty;
|
||||||
|
|
||||||
//失效的时候 不区分标识
|
//失效的时候 不区分标识
|
||||||
if (_userInfo.UserTypeEnumInt==(int)UserTypeEnum.MIM)
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.MIM)
|
||||||
{
|
{
|
||||||
extraIdentification = $"/MIM";
|
extraIdentification = $"/MIM";
|
||||||
}
|
}
|
||||||
|
@ -713,7 +727,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
ObjectRelationParentId = entity.TaskMedicalReviewId,
|
ObjectRelationParentId = entity.TaskMedicalReviewId,
|
||||||
|
|
||||||
ExtraIndentification=extraIdentification
|
ExtraIndentification = extraIdentification
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -730,7 +744,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
var extraIdentification = string.Empty;
|
var extraIdentification = string.Empty;
|
||||||
|
|
||||||
//失效的时候 不区分标识
|
//失效的时候 不区分标识
|
||||||
if (_dbContext.Entry(entity).Property(t => t.IsInvalid).IsModified == true && entity.IsInvalid==true)
|
if (_dbContext.Entry(entity).Property(t => t.IsInvalid).IsModified == true && entity.IsInvalid == true)
|
||||||
{
|
{
|
||||||
extraIdentification = $"/Invalid";
|
extraIdentification = $"/Invalid";
|
||||||
}
|
}
|
||||||
|
@ -745,7 +759,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
ExtraIndentification = extraIdentification,
|
ExtraIndentification = extraIdentification,
|
||||||
|
|
||||||
IsDistinctionInterface= (type==AuditOpt.Add || extraIdentification !=String.Empty)?false:true
|
IsDistinctionInterface = (type == AuditOpt.Add || extraIdentification != String.Empty) ? false : true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1547,7 +1561,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
IsDistinctionInterface = false,
|
IsDistinctionInterface = false,
|
||||||
ObjectRelationParentId = entity.TrialId,
|
ObjectRelationParentId = entity.TrialId,
|
||||||
ExtraIndentification=extraIdentification,
|
ExtraIndentification = extraIdentification,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1989,11 +2003,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
QuestionId = u.ReadingQuestionTrialId,
|
QuestionId = u.ReadingQuestionTrialId,
|
||||||
u.Answer
|
u.Answer
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var obj = new
|
var obj = new
|
||||||
{
|
{
|
||||||
TaskBlindName=visitAnswerList.Select(t=>t.TaskBlindName).FirstOrDefault(),
|
TaskBlindName = visitAnswerList.Select(t => t.TaskBlindName).FirstOrDefault(),
|
||||||
VisitQuestionAnswerList = visitAnswerList.Join(quesionList, t => t.QuestionId, u => u.QuestionId, (t, u) => new { t.Answer, u.QuestionName, u.DictionaryCode, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList(),
|
VisitQuestionAnswerList = visitAnswerList.Join(quesionList, t => t.QuestionId, u => u.QuestionId, (t, u) => new { t.Answer, u.QuestionName, u.DictionaryCode, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList(),
|
||||||
Reason = group.Where(t => t.QuestionId == null && t.GlobalAnswerType == GlobalAnswerType.Reason).FirstOrDefault()?.Answer,
|
Reason = group.Where(t => t.QuestionId == null && t.GlobalAnswerType == GlobalAnswerType.Reason).FirstOrDefault()?.Answer,
|
||||||
AgreeOrNot = group.Where(t => t.QuestionId == null && t.GlobalAnswerType == GlobalAnswerType.AgreeOrNot).FirstOrDefault()?.Answer,
|
AgreeOrNot = group.Where(t => t.QuestionId == null && t.GlobalAnswerType == GlobalAnswerType.AgreeOrNot).FirstOrDefault()?.Answer,
|
||||||
|
@ -2038,7 +2052,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
VisitTaskId = x.GlobalTaskId,
|
VisitTaskId = x.GlobalTaskId,
|
||||||
TrialReadingCriterionId = trialReadingCriterionId,
|
TrialReadingCriterionId = trialReadingCriterionId,
|
||||||
ObjectRelationParentId = x.TaskId,
|
ObjectRelationParentId = x.TaskId,
|
||||||
}, new { GlobalAnswerList = objList } );
|
}, new { GlobalAnswerList = objList });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2097,14 +2111,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
|
|
||||||
var visitTaskNum = entity.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Judge];
|
var visitTaskNum = entity.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Judge];
|
||||||
var list = await _dbContext.VisitTask.Where(t => t.TaskState == TaskState.Effect && t.SubjectId == entity.SubjectId && t.VisitTaskNum == visitTaskNum && t.JudgeVisitTaskId==entity.Id && t.TrialReadingCriterionId==entity.TrialReadingCriterionId).Select(t => new { t.Id, t.DoctorUser.FullName, t.ArmEnum }).OrderBy(t => t.ArmEnum).ToListAsync();
|
var list = await _dbContext.VisitTask.Where(t => t.TaskState == TaskState.Effect && t.SubjectId == entity.SubjectId && t.VisitTaskNum == visitTaskNum && t.JudgeVisitTaskId == entity.Id && t.TrialReadingCriterionId == entity.TrialReadingCriterionId).Select(t => new { t.Id, t.DoctorUser.FullName, t.ArmEnum }).OrderBy(t => t.ArmEnum).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var r1 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).FirstOrDefault();
|
var r1 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).FirstOrDefault();
|
||||||
var r2 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm2).FirstOrDefault();
|
var r2 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm2).FirstOrDefault();
|
||||||
|
|
||||||
|
|
||||||
obj = new { R1 = r1.FullName, R2 = r2.FullName, SelectResult = r1.Id== entity.JudgeResultTaskId ? "R1":"R2" };
|
obj = new { R1 = r1.FullName, R2 = r2.FullName, SelectResult = r1.Id == entity.JudgeResultTaskId ? "R1" : "R2" };
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 通过链接跳转 2022 12-19
|
#region 通过链接跳转 2022 12-19
|
||||||
|
@ -2708,20 +2722,20 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
////标准 器官病灶表
|
////标准 器官病灶表
|
||||||
//case nameof(CriterionNidus):
|
//case nameof(CriterionNidus):
|
||||||
|
|
||||||
// var criterionNidus = entityObj as CriterionNidus;
|
// var criterionNidus = entityObj as CriterionNidus;
|
||||||
|
|
||||||
// if (criterionNidus.IsSystemCriterion == false)
|
// if (criterionNidus.IsSystemCriterion == false)
|
||||||
// {
|
// {
|
||||||
// type = type + "/IsTrial";
|
// type = type + "/IsTrial";
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// break;
|
// break;
|
||||||
|
|
||||||
////系统 项目公用
|
////系统 项目公用
|
||||||
//case nameof(ReadingCriterionDictionary):
|
//case nameof(ReadingCriterionDictionary):
|
||||||
|
|
|
@ -501,7 +501,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
await auditingData.InsertAddEntitys(entities);
|
await auditingData.InsertAddEntitys(entities);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -529,7 +529,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
|
|
||||||
if (t.Entity is IAuditUpdate updateEntity1)
|
if (t.Entity is IAuditUpdate updateEntity1)
|
||||||
{
|
{
|
||||||
updateEntity1.UpdateTime = DateTime.UtcNow.AddHours(8);
|
updateEntity1.UpdateTime = DateTime.Now;
|
||||||
updateEntity1.UpdateUserId = _userInfo.Id;
|
updateEntity1.UpdateUserId = _userInfo.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -538,7 +538,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
if (softDelete.IsDeleted)
|
if (softDelete.IsDeleted)
|
||||||
{
|
{
|
||||||
softDelete.DeleteUserId = _userInfo.Id;
|
softDelete.DeleteUserId = _userInfo.Id;
|
||||||
softDelete.DeletedTime = DateTime.UtcNow.AddHours(8);
|
softDelete.DeletedTime = DateTime.Now;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -555,7 +555,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
{
|
{
|
||||||
if (addEntity.CreateTime == default(DateTime))
|
if (addEntity.CreateTime == default(DateTime))
|
||||||
{
|
{
|
||||||
addEntity.CreateTime = DateTime.UtcNow.AddHours(8);
|
addEntity.CreateTime = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
addEntity.CreateUserId = _userInfo.Id;
|
addEntity.CreateUserId = _userInfo.Id;
|
||||||
|
@ -563,7 +563,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
|
|
||||||
if (t.Entity is IAuditUpdate updateEntity)
|
if (t.Entity is IAuditUpdate updateEntity)
|
||||||
{
|
{
|
||||||
updateEntity.UpdateTime = DateTime.UtcNow.AddHours(8);
|
updateEntity.UpdateTime = DateTime.Now;
|
||||||
updateEntity.UpdateUserId = _userInfo.Id;
|
updateEntity.UpdateUserId = _userInfo.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -571,7 +571,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
{
|
{
|
||||||
if (addEntity3.CreateTime == default(DateTime))
|
if (addEntity3.CreateTime == default(DateTime))
|
||||||
{
|
{
|
||||||
addEntity3.CreateTime = DateTime.UtcNow.AddHours(8);
|
addEntity3.CreateTime = DateTime.Now;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
// if (context.Entity.CreateTime == default(DateTime))
|
// if (context.Entity.CreateTime == default(DateTime))
|
||||||
// {
|
// {
|
||||||
// context.Entity.CreateTime = DateTime.UtcNow.AddHours(8);
|
// context.Entity.CreateTime = DateTime.Now;
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
// if (context.Entity.CreateTime == default(DateTime))
|
// if (context.Entity.CreateTime == default(DateTime))
|
||||||
// {
|
// {
|
||||||
// context.Entity.CreateTime = DateTime.UtcNow.AddHours(8);
|
// context.Entity.CreateTime = DateTime.Now;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
// {
|
// {
|
||||||
// if (context.ChangeType == ChangeType.Modified || context.ChangeType == ChangeType.Added)
|
// if (context.ChangeType == ChangeType.Modified || context.ChangeType == ChangeType.Added)
|
||||||
// {
|
// {
|
||||||
// context.Entity.UpdateTime = DateTime.UtcNow.AddHours(8);
|
// context.Entity.UpdateTime = DateTime.Now;
|
||||||
|
|
||||||
// context.Entity.UpdateUserId = _userInfo.Id;
|
// context.Entity.UpdateUserId = _userInfo.Id;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
// if (context.Entity.IsDeleted)
|
// if (context.Entity.IsDeleted)
|
||||||
// {
|
// {
|
||||||
// context.Entity.DeleteUserId = _userInfo.Id;
|
// context.Entity.DeleteUserId = _userInfo.Id;
|
||||||
// context.Entity.DeletedTime = DateTime.UtcNow.AddHours(8);
|
// context.Entity.DeletedTime = DateTime.Now;
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class AuditingInterceptor : ISaveChangesInterceptor
|
||||||
{
|
{
|
||||||
var auditContext = eventData.Context as IRaCISDBContext;
|
var auditContext = eventData.Context as IRaCISDBContext;
|
||||||
_audit.Succeeded = true;
|
_audit.Succeeded = true;
|
||||||
_audit.EndTime = DateTime.UtcNow.AddHours(8);
|
_audit.EndTime = DateTime.Now;
|
||||||
auditContext.SaveChangesAudits.Add(_audit);
|
auditContext.SaveChangesAudits.Add(_audit);
|
||||||
auditContext.SaveChanges();
|
auditContext.SaveChanges();
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ public class AuditingInterceptor : ISaveChangesInterceptor
|
||||||
var auditContext = eventData.Context as IRaCISDBContext;
|
var auditContext = eventData.Context as IRaCISDBContext;
|
||||||
_audit.Succeeded = true;
|
_audit.Succeeded = true;
|
||||||
auditContext.SaveChangesAudits.Add(_audit);
|
auditContext.SaveChangesAudits.Add(_audit);
|
||||||
_audit.EndTime = DateTime.UtcNow.AddHours(8);
|
_audit.EndTime = DateTime.Now;
|
||||||
|
|
||||||
await auditContext.SaveChangesAsync();
|
await auditContext.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ public class AuditingInterceptor : ISaveChangesInterceptor
|
||||||
{
|
{
|
||||||
auditContext.Attach(_audit);
|
auditContext.Attach(_audit);
|
||||||
_audit.Succeeded = false;
|
_audit.Succeeded = false;
|
||||||
_audit.EndTime = DateTime.UtcNow.AddHours(8);
|
_audit.EndTime = DateTime.Now;
|
||||||
_audit.ErrorMessage = eventData.Exception.Message;
|
_audit.ErrorMessage = eventData.Exception.Message;
|
||||||
|
|
||||||
auditContext.SaveChanges();
|
auditContext.SaveChanges();
|
||||||
|
@ -98,7 +98,7 @@ public class AuditingInterceptor : ISaveChangesInterceptor
|
||||||
{
|
{
|
||||||
auditContext.Attach(_audit);
|
auditContext.Attach(_audit);
|
||||||
_audit.Succeeded = false;
|
_audit.Succeeded = false;
|
||||||
_audit.EndTime = DateTime.UtcNow.AddHours(8);
|
_audit.EndTime = DateTime.Now;
|
||||||
_audit.ErrorMessage = eventData.Exception.InnerException?.Message;
|
_audit.ErrorMessage = eventData.Exception.InnerException?.Message;
|
||||||
|
|
||||||
await auditContext.SaveChangesAsync(cancellationToken);
|
await auditContext.SaveChangesAsync(cancellationToken);
|
||||||
|
@ -119,7 +119,7 @@ public class AuditingInterceptor : ISaveChangesInterceptor
|
||||||
{
|
{
|
||||||
context.ChangeTracker.DetectChanges();
|
context.ChangeTracker.DetectChanges();
|
||||||
|
|
||||||
var audit = new SaveChangesAudit { StartTime = DateTime.UtcNow.AddHours(8) };
|
var audit = new SaveChangesAudit { StartTime = DateTime.Now };
|
||||||
|
|
||||||
foreach (var entry in context.ChangeTracker.Entries().Where(t => NeedAudit(t)))
|
foreach (var entry in context.ChangeTracker.Entries().Where(t => NeedAudit(t)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue