|
1
2
3
4
5
6
7
8
9
10
11
12
|
using Hh.Mes.Common.Json;
using Hh.Mes.Service.Base;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Hosting;
using Hh.Mes.Common.config;
using Hh.Mes.Common.Redis;
using WebMvc.Aop;
using Hh.Mes.Common.Request;
using Hh.Mes.POJO.Entity;
using Hh.Mes.Service.SystemAuth;
using Hh.Mes.Service.WebService.Base;
|
|
13
14
15
|
using Org.BouncyCastle.Crypto;
using Hh.Mes.Service.Configure;
using NPOI.POIFS.FileSystem;
|
|
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
|
namespace WebMvc
{
/// <summary>
/// APP管理
/// </summary>
[Area("base")]
public class SysAppController : BaseController
{
private readonly SysAppService sysAppService;
private readonly IHostingEnvironment environment;
public SysAppController(IAuth authUtil, SysAppService service, IHostingEnvironment hostingEnvironment) : base(authUtil)
{
environment = hostingEnvironment;
sysAppService = service;
sysAppService.sysWebUser = authUtil.GetCurrentUser().User;
}
#region 视图功能
/// <summary>
/// 默认视图Action
/// </summary>
/// <returns></returns>
[Authenticate]
[ServiceFilter(typeof(OperLogFilter))]
public ActionResult Index()
{
return View();
}
#endregion
/// <summary>
/// 加载及分页查询
/// </summary>
[HttpPost]
|
|
52
|
public string Load(PageReq pageRequest, sys_app entity)
|
|
53
|
{
|
|
54
|
return Serialize(sysAppService.Load(pageRequest, entity));
|
|
55
56
57
58
59
60
61
62
63
|
}
/// <summary>
/// 修改数据
/// </summary>
/// <returns></returns>
[HttpPost]
[ServiceFilter(typeof(OperLogFilter))]
[XSSFilter]
|
|
64
|
public string Upd(sys_app entity)
|
|
65
|
{
|
|
66
67
|
var response = sysAppService.Upd(entity);
return Serialize(response);
|
|
68
69
70
71
72
73
74
75
76
77
|
}
/// <summary>
/// 删除
/// </summary>
[HttpPost]
[ServiceFilter(typeof(OperLogFilter))]
public string DelByIds(int[] ids)
{
|
|
78
|
return Serialize(sysAppService.DelByIds(ids));
|
|
79
80
81
82
83
84
85
86
87
88
|
}
/// <summary>
/// 导入数据
/// </summary>
/// <param name="excelfile">表单提交的文件信息</param>
/// <returns></returns>
[HttpPost]
public string Import(IFormFileCollection excelfile)
{
|
|
89
|
var http = ConfigRead.GetInstance.GetAppsetConnection().HttpOrHttps;
|
|
90
|
var port = Request.Host.Port.Value;
|
|
91
|
return JsonHelper.Instance.Serialize(sysAppService.Import(http, port, excelfile, environment));
|
|
92
93
94
95
|
}
}
}
|