DashBoardController.cs
4.65 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
using System;
using System.Collections.Generic;
using Infrastructure;
using Microsoft.AspNetCore.Mvc;
using WebApp;
using WebRepository;
namespace WebMvc
{
/// <summary>
/// DashBoard
/// </summary>
[Area("monitor")]
public class DashBoardController : Controller
{
private IUnitWork _unitWork;
protected Response Result = new Response();
public DashBoardController(IUnitWork unitWork)
{
_unitWork = unitWork;
}
#region 视图功能
/// <summary>
/// 默认Action
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult Index()
{
return View();
}
#endregion
#region 自定义方法
/// <summary>
/// 获取进度统计
/// </summary>
/// <returns></returns>
[HttpPost]
public string PartInfo()
{
dynamic data = new
{
ZD = 1,
JH = 1,
GY = 21,
SC = 349,
};
return JsonHelper.Instance.Serialize(data);
}
/// <summary>
/// 获取工人任务一览
/// </summary>
/// <returns></returns>
[HttpPost]
public string UserTaskInfo()
{
List<dynamic> data1 = new List<dynamic>();
data1.Add(new {
GroupName = "员工1",
TaskNum = 396,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 100,
});
data1.Add(new
{
GroupName = "员工2",
TaskNum = 326,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 30,
});
data1.Add(new
{
GroupName = "员工3",
TaskNum = 316,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 62,
});
data1.Add(new
{
GroupName = "员工4",
TaskNum = 196,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 63,
});
data1.Add(new
{
GroupName = "员工5",
TaskNum = 332,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 81,
});
data1.Add(new
{
GroupName = "员工6",
TaskNum = 311,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 78,
});
data1.Add(new
{
GroupName = "员工7",
TaskNum = 301,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 61,
});
dynamic data = new { UMsg = data1};
return JsonHelper.Instance.Serialize(data);
}
/// <summary>
/// 获取班组任务一览
/// </summary>
/// <returns></returns>
[HttpPost]
public string GroupTaskInfo()
{
List<dynamic> data1 = new List<dynamic>();
data1.Add(new
{
GroupName = "粗车一",
TaskNum = 20,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 0,
});
data1.Add(new
{
GroupName = "插齿",
TaskNum = 30,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 0,
});
data1.Add(new
{
GroupName = "磨半圆孔",
TaskNum = 14,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 0,
});
data1.Add(new
{
GroupName = "倒角",
TaskNum = 23,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 0,
});
data1.Add(new
{
GroupName = "铣孔",
TaskNum = 31,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 0,
});
data1.Add(new
{
GroupName = "转大锥齿轮组装",
TaskNum = 20,
UnWorkNum = 0,
ComplateNum = 0,
DelayNum = 0,
});
dynamic data = new { RMsg = data1 };
return JsonHelper.Instance.Serialize(data);
}
#endregion
}
}