赖素文
authored
|
1
2
3
4
5
6
|
using Hh.Mes.Common.Request;
using Hh.Mes.Service.Configure;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Hh.Mes.Service.SystemAuth;
using WebMvc.Aop;
|
唐召明
authored
|
7
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
唐召明
authored
|
8
9
10
11
12
|
using Hh.Mes.POJO.WebEntity.configure;
using System;
using System.Collections.Generic;
using Hh.Mes.POJO.Entity;
using Hh.Mes.POJO.Response;
|
赖素文
authored
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
namespace WebMvc.Areas.Configure.Controllers
{
/// <summary>
/// 客户端状态
/// </summary>
[Area("configure")]
public class DaqClientStatusController : BaseController
{
private readonly DaqClientStatusService _service;
protected readonly IWebHostEnvironment hostingEnvironment;
public DaqClientStatusController(IAuth authUtil, DaqClientStatusService service) : base(authUtil)
{
_service = service;
_service.sysWebUser = authUtil.GetCurrentUser().User;
}
|
唐召明
authored
|
30
|
|
赖素文
authored
|
31
32
33
34
35
36
37
38
39
|
#region 视图功能
/// <summary>
/// 默认视图Action
/// </summary>
/// <returns></returns>
[Authenticate]
[ServiceFilter(typeof(OperLogFilter))]
public ActionResult Index()
{
|
唐召明
authored
|
40
|
var projectList = _service.GetProjectInfo();
|
唐召明
authored
|
41
42
43
|
var softTypes = _service.GetSoftType();
var data = new SelectList(projectList, "Key", "Value");
ViewBag.SoftTypes = new SelectList(softTypes, "Key", "Value");
|
唐召明
authored
|
44
|
return View(data);
|
赖素文
authored
|
45
46
|
}
#endregion
|
唐召明
authored
|
47
|
|
赖素文
authored
|
48
|
#region 数据操作
|
唐召明
authored
|
49
|
|
赖素文
authored
|
50
51
52
53
54
55
56
|
/// <summary>
/// 加载及分页查询
/// </summary>
/// <param name="pageRequest">表单请求信息</param>
/// <param name="entity">请求条件实例</param>
/// <returns></returns>
[HttpPost]
|
唐召明
authored
|
57
|
public string Load(PageReq pageRequest, daq_client_config entity)
|
赖素文
authored
|
58
|
{
|
唐召明
authored
|
59
|
return Serialize(_service.LoadStatus(pageRequest, entity));
|
赖素文
authored
|
60
|
}
|
唐召明
authored
|
61
|
|
赖素文
authored
|
62
63
64
65
66
67
68
|
/// <summary>
/// 新增数据
/// </summary>
/// <param name="entity">新增实例</param>
/// <returns></returns>
[HttpPost]
[ServiceFilter(typeof(OperLogFilter))]
|
唐召明
authored
|
69
|
public string Ins(daq_client_config entity)
|
赖素文
authored
|
70
71
72
|
{
return Serialize(_service.Ins(entity));
}
|
唐召明
authored
|
73
|
|
赖素文
authored
|
74
75
76
77
78
79
80
|
/// <summary>
/// 修改数据
/// </summary>
/// <param name="entity">修改实例</param>
/// <returns></returns>
[HttpPost]
[ServiceFilter(typeof(OperLogFilter))]
|
唐召明
authored
|
81
|
public string Upd(daq_client_config entity)
|
赖素文
authored
|
82
83
84
|
{
return Serialize(_service.Upd(entity));
}
|
唐召明
authored
|
85
|
|
赖素文
authored
|
86
87
88
89
90
91
92
|
/// <summary>
/// 删除数据
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
[HttpPost]
[ServiceFilter(typeof(OperLogFilter))]
|
唐召明
authored
|
93
|
public string DelByIds(Guid[] ids)
|
赖素文
authored
|
94
95
96
97
|
{
return Serialize(_service.DelByIds(ids));
}
#endregion
|
唐召明
authored
|
98
|
|
赖素文
authored
|
99
100
101
102
103
104
105
|
#region 导出数据
/// <summary>
/// 导出数据
/// </summary>
/// <param name="entity">请求条件实例</param>
/// <returns></returns>
[HttpPost]
|
唐召明
authored
|
106
|
public string Export(daq_client_config entity)
|
赖素文
authored
|
107
108
109
110
|
{
return Serialize(_service.ExportData(entity));
}
#endregion
|
唐召明
authored
|
111
|
|
赖素文
authored
|
112
|
#region 自定义方法
|
唐召明
authored
|
113
|
|
唐召明
authored
|
114
115
116
117
118
119
|
[HttpGet]
public Response<List<base_factory>> GetFactorys(string projectCode)
{
return _service.GetFactorys(projectCode);
}
|
赖素文
authored
|
120
121
122
|
#endregion
}
}
|