UserDeptController.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. using System;
  2. using System.Data;
  3. using Microsoft.AspNetCore.Mvc;using WMS.BZWeb;
  4. using WMS.Info;
  5. using WMS.Util;
  6. using WMS.Core;
  7. namespace WMS.BZWeb
  8. {
  9. /// <summary>
  10. /// 描 述:部门管理
  11. /// </summary>
  12. [Area("ACLManager")]
  13. public class UserDeptController : MvcControllerBase
  14. {
  15. ACLUserDept bll = new ACLUserDept();
  16. /// <summary>
  17. /// 主页面
  18. /// <summary>
  19. /// <returns></returns>
  20. [HttpGet]
  21. public ActionResult Index()
  22. {
  23. return View();
  24. }
  25. /// <summary>
  26. /// 表单页
  27. /// <summary>
  28. /// <returns></returns>
  29. [HttpGet]
  30. public ActionResult Form()
  31. {
  32. return View();
  33. }
  34. /// <summary>
  35. /// 获取列表数据
  36. /// <summary>
  37. /// <returns></returns>
  38. [HttpGet]
  39. ////[AjaxOnly]
  40. public ActionResult GetList(string keyword)
  41. {
  42. var data = bll.GetList(keyword);
  43. return Success("", data);
  44. }
  45. /// <summary>
  46. /// 获取分页数据
  47. /// </summary>
  48. /// <param name="pagination">分页参数</param>
  49. /// <param name="keyword">查询关键字</param>
  50. /// <returns></returns>
  51. [HttpGet]
  52. ////[AjaxOnly]
  53. public ActionResult GetPageList(string pagination, string keyword)
  54. {
  55. Pagination paginationobj = InitPagination(pagination);
  56. return ToPageDataResult(paginationobj, bll.GetPageList(keyword, paginationobj));
  57. }
  58. /// <summary>
  59. /// 获取表单数据
  60. /// <param name="keyValue">主键</param>
  61. /// <summary>
  62. /// <returns></returns>
  63. [HttpGet]
  64. ////[AjaxOnly]
  65. public ActionResult GetFormData(string keyValue)
  66. {
  67. var data = bll.GetEntity(keyValue);
  68. return Success("", data);
  69. }
  70. /// <summary>
  71. /// 删除实体数据
  72. /// <param name="keyValue">主键</param>
  73. /// <summary>
  74. /// <returns></returns>
  75. [HttpPost]
  76. ////[AjaxOnly]
  77. public ActionResult DeleteForm(string keyValue)
  78. {
  79. bll.DeleteEntity(keyValue);
  80. return Success("删除成功。");
  81. }
  82. /// <summary>
  83. /// 保存实体数据(新增、修改)
  84. /// <param name="keyValue">主键</param>
  85. /// <summary>
  86. /// <returns></returns>
  87. [HttpPost]
  88. [ValidateAntiForgeryToken]
  89. ////[AjaxOnly]
  90. public ActionResult SaveForm(string keyValue, ACL_USERDEPT entity)
  91. {
  92. bll.SaveEntity(LoginBLLCore.GetLoginUser(), keyValue, entity);
  93. return Success("保存成功!");
  94. }
  95. /// <summary>
  96. /// 获取映射数据
  97. /// </summary>
  98. /// <returns></returns>
  99. [HttpGet]
  100. ////[AjaxOnly]
  101. public ActionResult GetMap(string ver)
  102. {
  103. var data = bll.GetMap();
  104. string md5 = SecurityUtil.MD5(data.ToJson(), 32);
  105. if (md5 == ver)
  106. {
  107. return Success("no update");
  108. }
  109. else
  110. {
  111. var jsondata = new
  112. {
  113. data = data,
  114. ver = md5
  115. };
  116. return Success("", jsondata);
  117. }
  118. }
  119. /// <summary>
  120. /// 获取树形数据
  121. /// </summary>
  122. /// <returns></returns>
  123. [HttpGet]
  124. ////[AjaxOnly]
  125. public ActionResult GetTree()
  126. {
  127. var data = bll.GetTree();
  128. return this.Success("", data);
  129. }
  130. /// <summary>
  131. /// 判断是否是生产部门
  132. /// <param name="keyValue">主键</param>
  133. /// <summary>
  134. /// <returns></returns>
  135. [HttpGet]
  136. ////[AjaxOnly]
  137. public ActionResult GetIsProDep()
  138. {
  139. var data = bll.GetIsProDep(LoginBLLCore.GetLoginUser());
  140. return Success("", data);
  141. }
  142. }
  143. }