批量添加
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
he 2025-03-03 16:08:50 +08:00
parent 2c9fad60fb
commit 01b9f28e7b
2 changed files with 24 additions and 1 deletions

View File

@ -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; }

View File

@ -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>
/// 授权文档