From 01b9f28e7b1600995f1ce40158f6876688c77114 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Mon, 3 Mar 2025 16:08:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DTO/TrialNormalRecordViewModel.cs | 5 ++++- .../Document/TrialNormalRecordService.cs | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) 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 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 _trialNorma } + /// + /// 批量新增一般文件记录 + /// + /// + /// + [HttpPost] + public async Task 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); + } + /// /// 授权文档