批量添加
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
2c9fad60fb
commit
01b9f28e7b
|
@ -18,7 +18,10 @@ public class TrialNormalRecordView : TrialNormalRecordAddOrEdit
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class BatchAddTrialNormalRecordInDto
|
||||||
|
{
|
||||||
|
public List<TrialNormalRecordAddOrEdit> TrialNormalRecordList { get; set; }
|
||||||
|
}
|
||||||
public class TrialNormalRecordAddOrEdit
|
public class TrialNormalRecordAddOrEdit
|
||||||
{
|
{
|
||||||
public Guid? Id { get; set; }
|
public Guid? Id { get; set; }
|
||||||
|
|
|
@ -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>
|
/// <summary>
|
||||||
/// 授权文档
|
/// 授权文档
|
||||||
|
|
Loading…
Reference in New Issue