CostCalculationItem/IRaCIS.Core.API/Controllers/StatisticsController.cs

132 lines
4.4 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using IRaCIS.Application.Interfaces;
using IRaCIS.Application.ViewModels;
using IRaCIS.Core.Application.Contracts.RequestAndResponse;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace IRaCIS.Api.Controllers
{
/// <summary>
/// Dashboard统计、全局工作量统计、入组两个维度统计按照项目、按照人
/// </summary>
[Route("statistics")]
[ApiController, Authorize, ApiExplorerSettings(GroupName = "Dashboard&Statistics")]
public class StatisticsController : ControllerBase
{
private readonly IStatisticsService _statisticsService;
public StatisticsController(IStatisticsService statisticsService)
{
_statisticsService = statisticsService;
}
/// <summary> 根据项目和医生,分页获取工作量统计[New] </summary>
[HttpPost, Route("getWorkloadByTrialAndReviewer")]
public IResponseOutput<PageOutput<WorkloadByTrialAndReviewerDTO>> GetWorkloadByTrialAndReviewer(
StatisticsWorkloadQueryParam param)
{
return ResponseOutput.Ok(
_statisticsService.GetWorkloadByTrialAndReviewer(param, Guid.Parse(User.FindFirst("id").Value)));
}
/// <summary> 项目入组 医生维度统计[New] </summary>
[HttpPost, Route("getEnrollStatByReviewer")]
public IResponseOutput<PageOutput<EnrollStatByReviewerDTO>> GetEnrollStatByReviewer(
EnrollStatByReviewerQueryDTO param)
{
return ResponseOutput.Ok(_statisticsService.GetEnrollStatByReviewer(param));
}
[HttpPost, Route("getEnrollStatByTrial")]
public IResponseOutput<PageOutput<EnrollStatByTrialDTO>> GetEnrollStatByTrial(
EnrollStatByTrialQueryDTO param)
{
return ResponseOutput.Ok(_statisticsService.GetEnrollStatByTrial(param));
}
#region Dashbord
/// <summary> 读片数分类统计[New] </summary>
[HttpGet, Route("getReadingDataByType")]
public IResponseOutput<ReadingDataDTO> GetReadingDataByType()
{
return ResponseOutput.Ok(_statisticsService.GetReadingDataByType());
}
/// <summary> 获取最近几个月份的数据[New] </summary>
[HttpGet, Route("getReadingDataByMonth/{monthCount:int}")]
public IResponseOutput<List<ReadingDataMonthDTO>> GetReadingDataByMonth(int monthCount)
{
return ResponseOutput.Ok(_statisticsService.GetReadingDataByMonth(monthCount));
}
/// <summary> 读片数量排行前几的数据[New] </summary>
[HttpGet, Route("GetReadingDataRank/{topCount:int}")]
public IResponseOutput<List<ReadingDataRankDTO>> GetReadingDataRank(int topCount)
{
return ResponseOutput.Ok(_statisticsService.GetReadingDataRank(topCount));
}
/// <summary> 按Rank统计Reviewer 数量[New] </summary>
[HttpGet, Route("getReviewersByRank")]
public IResponseOutput<List<RankReviewersDTO>> GetReviewersByRank()
{
return ResponseOutput.Ok(_statisticsService.GetReviewersByRank());
}
///<summary> 最近几个季度入组人次[New] type==0 按照月份 </summary>
[HttpGet, Route("GetEnrollDataByQuarter/{type:int}/{count:int}")]
public IResponseOutput<List<EnrollQuartDataDTO>> GetEnrollDataByQuarter(int type, int count)
{
return ResponseOutput.Ok(_statisticsService.GetEnrollDataByQuarter(type, count));
}
///<summary> 参与项目数排行 [New] </summary>
[HttpGet, Route("getTrialCountRank/{topCount:int}")]
public IResponseOutput<List<TrialDataRankDTO>> GetTrialCountRank(int topCount)
{
return ResponseOutput.Ok(_statisticsService.GetTrialCountRank(topCount));
}
///<summary> 最新工作量 (已确定的)[New] </summary>
[HttpGet, Route("getLatestWorkLoadList/{searchCount:int}")]
public IResponseOutput<List<LatestWorkLoadDTO>> GetLatestWorkLoadList(int searchCount)
{
return ResponseOutput.Ok(_statisticsService.GetLatestWorkLoadList(searchCount));
}
#endregion
}
}