HuXiYu
authored
|
1
|
using Hh.Mes.Common.Request;
|
赖素文
authored
|
2
3
4
5
6
|
using Hh.Mes.POJO.Entity;
using Hh.Mes.Service;
using Hh.Mes.Service.Equipment;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
|
HuXiYu
authored
|
7
|
using Hh.Mes.Service.SystemAuth;
|
赖素文
authored
|
8
|
using WebMvc.Aop;
|
赖素文
authored
|
9
10
|
using Microsoft.AspNetCore.Http;
using Org.BouncyCastle.Crypto;
|
赖素文
authored
|
11
|
using Hh.Mes.Service.WebService.Equipment;
|
赖素文
authored
|
12
|
using NPOI.POIFS.FileSystem;
|
赖素文
authored
|
13
|
|
HuXiYu
authored
|
14
|
namespace WebMvc.Areas.Equipment.Controllers
|
赖素文
authored
|
15
|
{
|
HuXiYu
authored
|
16
17
|
[Area("Equipment")]
public class BaseEquipmentController : BaseController
|
赖素文
authored
|
18
|
{
|
HuXiYu
authored
|
19
|
private readonly BaseEquipmentService _service;
|
赖素文
authored
|
20
|
private readonly EquipmentVisualService _visualService;
|
赖素文
authored
|
21
|
|
赖素文
authored
|
22
|
public BaseEquipmentController(IAuth authUtil, BaseEquipmentService service, EquipmentVisualService _visualService) : base(authUtil)
|
赖素文
authored
|
23
|
{
|
HuXiYu
authored
|
24
25
|
_service = service;
_service.sysWebUser = authUtil.GetCurrentUser().User;
|
赖素文
authored
|
26
|
|
王硕
authored
|
27
|
this._visualService = _visualService;
|
赖素文
authored
|
28
|
}
|
HuXiYu
authored
|
29
|
|
赖素文
authored
|
30
31
32
33
34
35
36
37
|
#region 视图功能
/// <summary>
/// 默认视图Action
/// </summary>
/// <returns></returns>
[Authenticate]
public ActionResult Index()
{
|
赖素文
authored
|
38
|
_service.UpdateRemarkWithAlarmStatus();
|
赖素文
authored
|
39
40
|
return View();
}
|
赖素文
authored
|
41
42
|
/// <summary>
|
赖素文
authored
|
43
|
/// 设备列表-项目地图
|
赖素文
authored
|
44
45
46
|
/// </summary>
/// <returns></returns>
[Authenticate]
|
赖素文
authored
|
47
48
49
50
51
|
public ActionResult IndexProjectAndEq()
{
return View();
}
|
赖素文
authored
|
52
|
#endregion
|
赖素文
authored
|
53
|
|
赖素文
authored
|
54
|
#region 数据操作
|
赖素文
authored
|
55
|
|
赖素文
authored
|
56
57
58
59
60
61
62
63
64
|
/// <summary>
/// 加载及分页查询
/// </summary>
/// <param name="pageRequest">表单请求信息</param>
/// <param name="entity">请求条件实例</param>
/// <returns></returns>
[HttpPost]
public string Load(PageReq pageRequest, base_equipment entity)
{
|
HuXiYu
authored
|
65
|
return Serialize(_service.Load(pageRequest, entity));
|
赖素文
authored
|
66
|
}
|
HuXiYu
authored
|
67
|
|
赖素文
authored
|
68
69
70
71
72
73
74
75
76
|
/// <summary>
/// 新增数据
/// </summary>
/// <param name="entity">新增实例</param>
/// <returns></returns>
[HttpPost]
[ServiceFilter(typeof(OperLogFilter))]
public string Ins(base_equipment entity)
{
|
HuXiYu
authored
|
77
|
return Serialize(_service.Ins(entity));
|
赖素文
authored
|
78
|
}
|
HuXiYu
authored
|
79
|
|
赖素文
authored
|
80
81
82
83
84
85
86
87
88
|
/// <summary>
/// 修改数据
/// </summary>
/// <param name="entity">修改实例</param>
/// <returns></returns>
[HttpPost]
[ServiceFilter(typeof(OperLogFilter))]
public string Upd(base_equipment entity)
{
|
HuXiYu
authored
|
89
|
return Serialize(_service.Upd(entity));
|
赖素文
authored
|
90
|
}
|
HuXiYu
authored
|
91
|
|
赖素文
authored
|
92
93
94
95
96
97
98
99
100
|
/// <summary>
/// 删除数据
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
[HttpPost]
[ServiceFilter(typeof(OperLogFilter))]
public string DelByIds(int[] ids)
{
|
HuXiYu
authored
|
101
|
return Serialize(_service.DelByIds(ids));
|
赖素文
authored
|
102
103
|
}
#endregion
|
HuXiYu
authored
|
104
|
|
赖素文
authored
|
105
106
107
108
109
110
111
112
113
|
#region 导出数据
/// <summary>
/// 导出数据
/// </summary>
/// <param name="entity">请求条件实例</param>
/// <returns></returns>
[HttpPost]
public string Export(base_equipment entity)
{
|
HuXiYu
authored
|
114
|
return Serialize(_service.ExportData(entity));
|
赖素文
authored
|
115
116
|
}
#endregion
|
赖素文
authored
|
117
|
|
赖素文
authored
|
118
|
#region 自定义方法
|
赖素文
authored
|
119
120
121
122
123
124
125
126
127
|
/// <summary>
/// 导入图片数据 excelfile名称不能改
/// </summary>
/// <returns></returns>
[HttpPost]
public string Import(int id, IFormFile excelfile)
{
return Serialize(_service.UpdateEquipmentImage(id, excelfile)) ;
}
|
赖素文
authored
|
128
|
#endregion
|
赖素文
authored
|
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
#region 设备可视化
/// <summary>
/// 设备可视化 页面
/// </summary>
/// <returns></returns>
[Authenticate]
public ActionResult EquipmentVisual()
{
return View();
}
/// <summary>
/// 设备文件、设备报警记录
/// </summary>
[HttpPost]
public string GetEquipmentFileList(base_equipment model)
{
return Serialize(_visualService.GetEquipmentFileList(model));
}
#endregion
|
赖素文
authored
|
151
152
|
}
}
|