修改一版
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
using Castle.Core.Internal;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
@@ -34,6 +35,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
private readonly ITrialConfigService _trialConfigService;
|
||||
private readonly ISubjectService _subjectService;
|
||||
private readonly ISubjectVisitService _subjectVisitService;
|
||||
private readonly IVisitPlanService _visitPlanService;
|
||||
private readonly IInspectionService _inspectionService;
|
||||
private readonly IRepository<DataInspection> _dataInspectionRepository;
|
||||
private delegate Task<IResponseOutput> executionFun(dynamic data);
|
||||
@@ -47,7 +49,8 @@ namespace IRaCIS.Core.API.Controllers
|
||||
IInspectionService sinspectionService,
|
||||
ITrialConfigService _trialConfigService,
|
||||
ISubjectService _subjectService,
|
||||
ISubjectVisitService subjectVisitService
|
||||
ISubjectVisitService subjectVisitService,
|
||||
IVisitPlanService visitPlanService
|
||||
)
|
||||
{
|
||||
_repository = repository;
|
||||
@@ -59,6 +62,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
this._trialConfigService = _trialConfigService;
|
||||
this._subjectService = _subjectService;
|
||||
_subjectVisitService = subjectVisitService;
|
||||
this._visitPlanService = visitPlanService;
|
||||
this._dataInspectionRepository = dataInspectionRepository;
|
||||
}
|
||||
|
||||
@@ -72,7 +76,69 @@ namespace IRaCIS.Core.API.Controllers
|
||||
return await _inspectionService.GetInspectionData(dto);
|
||||
}
|
||||
|
||||
|
||||
#region 访视计划
|
||||
/// <summary>
|
||||
/// 新增或添加访视计划
|
||||
/// </summary>
|
||||
/// <param name="visitPlan"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/VisitPlan/AddOrUpdateVisitStage")]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> AddOrUpdateVisitStage(DataInspectionDto<VisitPlanCommand> opt)
|
||||
{
|
||||
var fun = await _visitPlanService.AddOrUpdateVisitStage(opt.OptCommand);
|
||||
if (!fun.IsSuccess)
|
||||
{
|
||||
return ResponseOutput.NotOk(fun.ErrorMessage);
|
||||
}
|
||||
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, fun);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除访视计划对象
|
||||
/// </summary>
|
||||
/// <param name="opt"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/VisitPlan/DeleteVisitStage")]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> DeleteVisitStage(DataInspectionDto<IDDto> opt)
|
||||
{
|
||||
var fun = _visitPlanService.DeleteVisitStage;
|
||||
|
||||
return await _inspectionService.Enforcement(opt.OptCommand.Id, opt.AuditInfo, opt.SignInfo, fun);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 确认访视计划
|
||||
/// </summary>
|
||||
/// <param name="opt"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/VisitPlan/ConfirmTrialVisitPlan")]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> ConfirmTrialVisitPlan(DataInspectionDto<IDDto> opt)
|
||||
{
|
||||
var fun = _visitPlanService.ConfirmTrialVisitPlan;
|
||||
return await _inspectionService.Enforcement(opt.OptCommand.Id, opt.AuditInfo, opt.SignInfo, fun);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 下载访视计划
|
||||
/// </summary>
|
||||
/// <param name="opt"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/VisitPlan/DownloadInflunceStudyList")]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> DownloadInflunceStudyList(DataInspectionDto<IDDto> opt)
|
||||
{
|
||||
var fun = _visitPlanService.DownloadInflunceStudyList;
|
||||
return await _inspectionService.Enforcement(opt.OptCommand.Id, opt.AuditInfo, opt.SignInfo, fun);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 访视
|
||||
|
||||
|
||||
Reference in New Issue
Block a user