BaseEquipmentGroupController.cs
2.17 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
using Hh.Mes.Common.Request;
using Hh.Mes.POJO.Entity;
using Hh.Mes.POJO.WebEntity;
using Hh.Mes.Service.SystemAuth;
using Hh.Mes.Service.WebService.Equipment;
using Microsoft.AspNetCore.Mvc;
using NPOI.POIFS.FileSystem;
using System.Collections.Generic;
using WebMvc.Aop;
namespace WebMvc.Areas.equipment.Controllers
{
[Area("Equipment")]
public class BaseEquipmentGroupController : BaseController
{
private readonly BaseEquipmentGroupService _service;
public BaseEquipmentGroupController(IAuth authUtil, BaseEquipmentGroupService service) : base(authUtil)
{
_service = service;
}
[Authenticate]
public ActionResult Index()
{
return View();
}
[HttpGet]
public List<BaseEquipmentGroup> Load()
{
return _service.LoadAll();
}
/// <summary>
/// 加载及分页查询
/// </summary>
/// <param name="pageRequest">表单请求信息</param>
/// <param name="entity">请求条件实例</param>
/// <returns></returns>
[HttpPost]
public string Load(PageReq pageRequest, BaseEquipmentGroup entity)
{
return Serialize(_service.Load(pageRequest, entity));
}
//添加
[HttpPost]
[XSSFilter]
[ServiceFilter(typeof(OperLogFilter))]
public string Add(BaseEquipmentGroup baseEquipmentGroup)
{
return Serialize(_service.Ins(baseEquipmentGroup));
}
//编辑
[HttpPost]
[ServiceFilter(typeof(OperLogFilter))]
[XSSFilter]
public string Update(BaseEquipmentGroup baseEquipmentGroup)
{
return Serialize(_service.Upd(baseEquipmentGroup));
}
[HttpPost]
public string Delete(int[] ids)
{
return Serialize(_service.DelByIds(ids));
}
//public string LoadForUser(int firstId)
//{
// return Serialize(_service.LoadForUser(firstId));
//}
//public string LoadForRole(int firstId)
//{
// return Serialize(_service.LoadForRole(firstId));
//}
}
}