Uat_Study
he 2022-04-14 16:18:06 +08:00
parent f2132e1e8d
commit 33a26641d7
2 changed files with 25 additions and 15 deletions

View File

@ -58,6 +58,13 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.ObtainOrCancelQCTask(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Inspection.DTO.ObtainOrCancelQCTaskDto})">
<summary>
手动领取 或者取消 QC任务
</summary>
<param name="opt"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.UpdateSubjectAndSVInfo(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Contracts.UploadSubjectAndVisitCommand})"> <member name="M:IRaCIS.Core.API.Controllers.InspectionController.UpdateSubjectAndSVInfo(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Contracts.UploadSubjectAndVisitCommand})">
<summary> <summary>
疾病进展确认评估 疾病进展确认评估

View File

@ -20,10 +20,14 @@ namespace IRaCIS.Core.Application.Service.Inspection
public class InspectionService : BaseService, IInspectionService public class InspectionService : BaseService, IInspectionService
{ {
private readonly IRepository<DataInspection> _dataInspectionRepository; private readonly IRepository<DataInspection> _dataInspectionRepository;
private readonly IRepository<FrontAuditConfig> _frontAuditConfigRepository;
public InspectionService(IRepository<DataInspection> dataInspectionRepository) public InspectionService(IRepository<DataInspection> dataInspectionRepository,
IRepository<FrontAuditConfig> frontAuditConfigRepository
)
{ {
this._dataInspectionRepository = dataInspectionRepository; this._dataInspectionRepository = dataInspectionRepository;
this._frontAuditConfigRepository = frontAuditConfigRepository;
} }
public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionData(GetDataInspectionDto dto) public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionData(GetDataInspectionDto dto)
{ {
@ -282,6 +286,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
} }
await SetEnum(addDto); await SetEnum(addDto);
var add = _mapper.Map<DataInspection>(addDto); var add = _mapper.Map<DataInspection>(addDto);
await SetInspectionNameValue(add);
Guid? parentId = null; Guid? parentId = null;
parentId = (await _repository.GetQueryable<DataInspection>().Where( x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId&&x.ChildrenType==add.ChildrenType && x.ObjectType==add.ObjectType&&x.VisitStageId==add.VisitStageId&&x.GeneralId==add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id; parentId = (await _repository.GetQueryable<DataInspection>().Where( x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId&&x.ChildrenType==add.ChildrenType && x.ObjectType==add.ObjectType&&x.VisitStageId==add.VisitStageId&&x.GeneralId==add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
add.ParentId = parentId; add.ParentId = parentId;
@ -289,18 +294,9 @@ namespace IRaCIS.Core.Application.Service.Inspection
add.CreateUserId = _userInfo.Id; add.CreateUserId = _userInfo.Id;
add.SignId = signId; add.SignId = signId;
add.IP = _userInfo.IP; add.IP = _userInfo.IP;
await SetInspectionNameValue(add);
await _repository.AddAsync(add); await _repository.AddAsync(add);
//if (addDto.OptType.ToLower() == "Add".ToLower()&& Statusdata!=null)
//{
// DataInspection ststus=JsonConvert.DeserializeObject<DataInspection>(JsonConvert.SerializeObject(add))??new DataInspection();
// ststus.CreateTime = add.CreateTime.AddSeconds(1);
// ststus.JsonDetail = JsonConvert.SerializeObject(Statusdata);
// ststus.ChildrenType = "Status";
// ststus.OptType = "Init";
// ststus.Id = Guid.NewGuid();
// await _repository.AddAsync(ststus);
//}
var success = await _repository.SaveChangesAsync(); var success = await _repository.SaveChangesAsync();
return ResponseOutput.Ok(success); return ResponseOutput.Ok(success);
@ -324,10 +320,11 @@ namespace IRaCIS.Core.Application.Service.Inspection
foreach (var add in datas) foreach (var add in datas)
{ {
await SetInspectionNameValue(add);
add.ParentId = (await _repository.GetQueryable<DataInspection>().Where(x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId && x.ChildrenType == add.ChildrenType && x.ObjectType == add.ObjectType&&x.VisitStageId==add.VisitStageId&& x.GeneralId == add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id; add.ParentId = (await _repository.GetQueryable<DataInspection>().Where(x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId && x.ChildrenType == add.ChildrenType && x.ObjectType == add.ObjectType&&x.VisitStageId==add.VisitStageId&& x.GeneralId == add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
add.CreateUserId = _userInfo.Id; add.CreateUserId = _userInfo.Id;
add.IP = _userInfo.IP; add.IP = _userInfo.IP;
await SetInspectionNameValue(add);
} }
await _dataInspectionRepository.AddRangeAsync(datas); await _dataInspectionRepository.AddRangeAsync(datas);
@ -486,7 +483,6 @@ namespace IRaCIS.Core.Application.Service.Inspection
} }
#endregion #endregion
#region 测试中心名称 #region 测试中心名称
@ -546,7 +542,14 @@ namespace IRaCIS.Core.Application.Service.Inspection
} }
#endregion #endregion
#region 取操作类型
var from =await _frontAuditConfigRepository.FirstOrDefaultAsync(x => x.Identification == Data.Identification);
Data.ObjectType = from.ObjectTypeId;
Data.OptType = from.OptTypeId;
Data.ChildrenType = from.ChildrenTypeId;
Data.ModuleType = from.ModuleTypeId;
#endregion
} }