diff --git a/IRaCIS.Core.Application/Service/Document/DTO/TrialNormalRecordViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/TrialNormalRecordViewModel.cs index 2b1ab0176..0fe1f6cdd 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/TrialNormalRecordViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/TrialNormalRecordViewModel.cs @@ -18,7 +18,10 @@ public class TrialNormalRecordView : TrialNormalRecordAddOrEdit } - +public class BatchAddTrialNormalRecordInDto +{ + public List<TrialNormalRecordAddOrEdit> TrialNormalRecordList { get; set; } +} public class TrialNormalRecordAddOrEdit { public Guid? Id { get; set; } diff --git a/IRaCIS.Core.Application/Service/Document/TrialNormalRecordService.cs b/IRaCIS.Core.Application/Service/Document/TrialNormalRecordService.cs index 959a2e61a..566e387a6 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialNormalRecordService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialNormalRecordService.cs @@ -69,6 +69,26 @@ public class TrialNormalRecordService(IRepository<TrialNormalRecord> _trialNorma } + /// <summary> + /// 批量新增一般文件记录 + /// </summary> + /// <param name="inDto"></param> + /// <returns></returns> + [HttpPost] + public async Task<IResponseOutput> BatchAddTrialNormalRecord(BatchAddTrialNormalRecordInDto inDto) + { + foreach (var item in inDto.TrialNormalRecordList) + { + if (item.TrialFileRecord != null) item.TrialFileRecord.TrialFileTypeId = item.TrialFileTypeId; + if (item.HistoryFileRecord != null) item.HistoryFileRecord.TrialFileTypeId = item.TrialFileTypeId; + + var entity = await _trialNormalRecordRepository.InsertFromDTOAsync(inDto); + } + + var result= await _trialNormalRecordRepository.SaveChangesAsync(); + return ResponseOutput.Ok(result); + } + /// <summary> /// 授权文档