BaseSupplierController.cs 3.9 KB

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