DashboardController.cs
2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using Hh.Mes.Common.log;
using Hh.Mes.POJO.Response;
using Hh.Mes.Service.ApiService;
using Hh.Mes.Service.Equipment;
using Hh.Mes.Service.SystemAuth;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using System;
namespace WebMvc.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
[EnableCors("cors")]
public class DashboardController : BaseController
{
private readonly DashboardService _dashboardService;
public DashboardController(IAuth authUtil, DashboardService dashboardService) : base(authUtil)
{
_dashboardService = dashboardService;
}
#region 故障报告
[HttpGet]
public string GetFaultReport(string yyyyMonth, string projectCode, string equipmentTypeCode)
{
var result = _dashboardService.GetFaultReport(yyyyMonth, projectCode, equipmentTypeCode);
return Serialize(result);
}
/// <summary>
/// 故障报告-本周故障分析-具体每天故障分析
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
[HttpGet]
public string GetEquipmentWeekDayFaultInfo(string startTime, string endTime, string projectCode)
{
var result = _dashboardService.GetEquipmentWeekDayFaultInfo(startTime, endTime, projectCode);
return Serialize(result);
}
#endregion
#region 故障分析
/// <summary>
/// 故障統計分析
/// </summary>
/// <returns></returns>
[HttpGet]
public string FaultStatistics(string begin, string end, string projectCode, string equipmentTypeCode)
{
var result = _dashboardService.FaultStatistics(begin, end, projectCode, equipmentTypeCode);
return Serialize(result);
}
#endregion
#region 妥善率
/// <summary>
/// 妥善率趋势图
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="yearOrdaySelectVal"></param>
/// <param name="timeFlag"></param>
/// <returns></returns>
[HttpGet]
public string GetProperRate(string startTime, string endTime, string yearOrdaySelectVal, string timeFlag, string projecCode, string equipmentTypeCode)
{
var result = _dashboardService.GetProperRate(startTime, endTime, yearOrdaySelectVal, timeFlag, projecCode, equipmentTypeCode);
return Serialize(result);
}
#endregion
#region 故障月份对比
public string FailureMonthCompare(int year, int month, string projectCode, string equipmentTypeCode)
{
var result = _dashboardService.GetFailureMonthCompare(year, month, projectCode, equipmentTypeCode);
return Serialize(result);
}
#endregion
}
}