更新
This commit is contained in:
@@ -4,6 +4,8 @@ using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Service.Inspection.Interface;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
@@ -11,10 +13,12 @@ namespace IRaCIS.Application.Services
|
||||
public class SubjectService : BaseService, ISubjectService
|
||||
{
|
||||
private readonly IRepository<Subject> _subjectRepository;
|
||||
private readonly IInspectionService _inspectionService;
|
||||
|
||||
public SubjectService(IRepository<Subject> subjectRepository)
|
||||
public SubjectService(IRepository<Subject> subjectRepository, IInspectionService inspectionService)
|
||||
{
|
||||
_subjectRepository = subjectRepository;
|
||||
this._inspectionService = inspectionService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -95,6 +99,26 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
|
||||
var createtime = DateTime.Now.AddSeconds(1);
|
||||
// 添加稽查记录
|
||||
if (subjectCommand.Id == null)
|
||||
{
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
TrialId = subjectCommand.TrialId,
|
||||
SiteId = subjectCommand.SiteId,
|
||||
SubjectId = subjectCommand.Id,
|
||||
SubjectCode = subjectCommand.Code,
|
||||
IsSign=false,
|
||||
Identification= "Subject|Init|Subject|Status",
|
||||
JsonDetail= JsonConvert.SerializeObject(new {
|
||||
Status= "OnVisit",
|
||||
})
|
||||
});
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(mapedSubject.Id.ToString());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user