diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs
index c9a9c242..a1fbb946 100644
--- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs
+++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs
@@ -1841,7 +1841,7 @@ namespace IRaCIS.Core.Application.Image.QA
if (command.SubjectFirstGiveMedicineTime != null)
{
- await _subjectRepository.UpdatePartialFromQueryAsync(command.SubjectId, u => new Subject() { FirstGiveMedicineTime = command.SubjectFirstGiveMedicineTime, });
+ await _subjectRepository.UpdatePartialFromQueryAsync(command.SubjectId, u => new Subject() { FirstGiveMedicineTime = command.SubjectFirstGiveMedicineTime, },true);
}
await _subjectVisitRepository.SaveChangesAsync();
diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
index 7f810d3b..d84a5fee 100644
--- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
+++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
@@ -849,6 +849,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
entityTypeName = "New/" + entityTypeName;
}
inspection.Identification = $"{_userInfo.RequestUrl}/{ entityTypeName}/{type}";
+
+ #region 注释
//if (data != null)
//{
// var originaldata = data.OriginalValues.ToObject();
@@ -857,8 +859,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
// inspection.LastJsonDetail = originaldata.ToJcJson();
// }
//}
-
-
+ #endregion
+
await AddInspectionRecordAsync(inspection, entityobj, otherItem);
}
@@ -911,40 +913,30 @@ namespace IRaCIS.Core.Infra.EFCore.Common
/// 数据
///
///
- public async Task AddInspectionRecordAsync(DataInspection add, dynamic data,object otherItem=null)
+ public async Task AddInspectionRecordAsync(DataInspection add, dynamic data, object otherItem = null)
{
MapData(data, add);
InspectionGeneralData generalData = new InspectionGeneralData();
MapData(add, generalData);
await SetInspectionNameValue(generalData);
#region 处理标识
- try
- {
- var from = await _dbContext.FrontAuditConfig.FirstOrDefaultAsync(x => x.Identification == add.Identification);
- add.ObjectType = from?.ObjectTypeId;
- add.OptType = from?.OptTypeId;
- add.ChildrenType = from?.ChildrenTypeId;
- add.ModuleType = from?.ModuleTypeId;
- }
- catch (Exception)
- {
- throw new BusinessValidationFailedException("操作标识异常");
- }
+ var from = await _dbContext.FrontAuditConfig.FirstOrDefaultAsync(x => x.Identification == add.Identification);
+ add.ObjectType = from?.ObjectTypeId;
+ add.OptType = from?.OptTypeId;
+ add.ChildrenType = from?.ChildrenTypeId;
+ add.ModuleType = from?.ModuleTypeId;
+
#endregion
if (add.ParentId == null)
{
add.ParentId = (await _dbContext.DataInspection.AsQueryable().Where(x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId && x.VisitStageId == add.VisitStageId && x.GeneralId == add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
-
}
add.CreateUserId = _userInfo.Id;
add.IP = _userInfo.IP;
- if (add.CreateTime == default(DateTime))
- {
- add.CreateTime = DateTime.Now;
- }
+ add.CreateTime = add.CreateTime == default(DateTime) ? DateTime.Now : add.CreateTime;
- if (_userInfo.SignId!=null)
+ if (_userInfo.SignId != null)
{
add.SignId = _userInfo.SignId;
add.IsSign = true;
@@ -952,11 +944,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var inspectionData = new InspectionData()
{
- Data = AddJsonItem(data,otherItem),
+ Data = AddJsonItem(data, otherItem),
Inspection = generalData
};
add.JsonDetail = inspectionData.ToJcJson();
-
+
await _dbContext.DataInspection.AddAsync(add);
}