110 lines
3.8 KiB
C#
110 lines
3.8 KiB
C#
using IRaCIS.Application.Interfaces;
|
|
using IRaCIS.Application.ViewModels;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using IRaCIS.Core.Application.Contracts.RequestAndResponse;
|
|
|
|
|
|
namespace IRaCIS.Api.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 项目运维人员 、研究中心CRC 配置
|
|
/// </summary>
|
|
[Route("trialMaintenance")]
|
|
[ApiController, Authorize, ApiExplorerSettings(GroupName = "Trial")]
|
|
public class MaintenanceController : ControllerBase
|
|
{
|
|
private readonly IUserTrialService _userTrialService;
|
|
public MaintenanceController(IUserTrialService userTrialService)
|
|
{
|
|
_userTrialService = userTrialService;
|
|
}
|
|
|
|
[HttpGet, Route("getTrialSiteSelect/{trialId:guid}")]
|
|
public IResponseOutput<IEnumerable<TrialSiteSelect>> GetTrialSiteSelect(Guid trialId)
|
|
{
|
|
return ResponseOutput.Ok(_userTrialService.GetTrialSiteSelect(trialId));
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取项目运维人员列表[New] 分页暂时不用
|
|
/// </summary>
|
|
/// <param name="param">项目Id必须传</param>
|
|
/// <returns></returns>
|
|
[HttpPost, Route("GetUserTrialList")]
|
|
[ApiExplorerSettings(IgnoreApi = true)]
|
|
public IResponseOutput<PageOutput<UserTrialDTO>> GetUserTrialList(UserTrialListQueryDTO param)
|
|
{
|
|
return ResponseOutput.Ok(_userTrialService.GetUserTrialList(param));
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取项目运维人员列表[New]
|
|
/// </summary>
|
|
/// <param name="param"></param>
|
|
/// <returns></returns>
|
|
[HttpPost, Route("getMaintenanceList")]
|
|
public IResponseOutput<IEnumerable<UserTrialDTO>> GetMaintenanceUserList(TrialMaintenanceQuery param)
|
|
{
|
|
return ResponseOutput.Ok(_userTrialService.GetMaintenanceUserList(param));
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取可用选择用户,用于给项目添加运维人员时的选择列表[New]
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet, Route("getUserSelectionList/{userTypeId:guid}/{institutionId:guid}")]
|
|
|
|
public IResponseOutput<IEnumerable<UserSelectionModel>> GetUserTrialList(Guid userTypeId,Guid institutionId)
|
|
{
|
|
return ResponseOutput.Ok(_userTrialService.GetUserSelectionList(userTypeId, institutionId)) ;
|
|
}
|
|
|
|
/// <summary> 添加或更新运维人员[New]</summary>
|
|
[HttpPost, Route("AddOrUpdateMaintenanceUser")]
|
|
|
|
public IResponseOutput AddOrUpdateUserTrial(UserTrialCommand param)
|
|
{
|
|
return _userTrialService.AddOrUpdateUserTrial(param);
|
|
}
|
|
|
|
/// <summary> 删除运维人员[New]</summary>
|
|
[HttpDelete, Route("deleteMaintenanceUser/{id:guid}")]
|
|
|
|
public IResponseOutput DeleteUserTrial(Guid id)
|
|
{
|
|
return _userTrialService.DeleteUserTrial(id);
|
|
}
|
|
|
|
|
|
/// <summary>获取负责研究中心CRC列表</summary>
|
|
[HttpPost, Route("getSiteCRCList")]
|
|
|
|
public IResponseOutput<PageOutput<SiteStatDTO>> GetSiteCRCList(SiteCrcQueryDTO param)
|
|
{
|
|
return ResponseOutput.Ok(_userTrialService.GetSiteCRCList(param)) ;
|
|
}
|
|
|
|
/// <summary> 添加或更新CRC人员</summary>
|
|
[HttpPost, Route("addOrUpdateSiteCRC")]
|
|
|
|
|
|
public IResponseOutput AddOrUpdateSiteCRC(SiteCRCCommand param)
|
|
{
|
|
return _userTrialService.AddOrUpdateSiteCRC(param);
|
|
}
|
|
|
|
|
|
/// <summary> 删除CRC人员</summary>
|
|
[HttpDelete, Route("deleteSiteCRC/{id:guid}")]
|
|
|
|
public IResponseOutput DeleteSiteCRC(Guid id)
|
|
{
|
|
return _userTrialService.DeleteSiteCRC(id);
|
|
}
|
|
}
|
|
}
|