You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

149 lines
4.4 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.AssetManagementSystem;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  10. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2020-08-07 16:34
  13. /// 描 述:耗材领取
  14. /// </summary>
  15. public class Ass_ReceiveController : MvcControllerBase
  16. {
  17. private Ass_ReceiveIBLL ass_ReceiveIBLL = new Ass_ReceiveBLL();
  18. private Ass_ReceiveItemIBLL assReceiveItemIbll = new Ass_ReceiveItemBLL();
  19. #region 视图功能
  20. /// <summary>
  21. /// 主页面
  22. /// <summary>
  23. /// <returns></returns>
  24. [HttpGet]
  25. public ActionResult Index()
  26. {
  27. return View();
  28. }
  29. /// <summary>
  30. /// 表单页
  31. /// <summary>
  32. /// <returns></returns>
  33. [HttpGet]
  34. public ActionResult Form()
  35. {
  36. return View();
  37. }
  38. [HttpGet]
  39. public ActionResult FormView()
  40. {
  41. return View();
  42. }
  43. #endregion
  44. #region 获取数据
  45. /// <summary>
  46. /// 获取页面显示列表数据
  47. /// <summary>
  48. /// <param name="queryJson">查询参数</param>
  49. /// <returns></returns>
  50. [HttpGet]
  51. [AjaxOnly]
  52. public ActionResult GetPageList(string pagination, string queryJson)
  53. {
  54. Pagination paginationobj = pagination.ToObject<Pagination>();
  55. var data = ass_ReceiveIBLL.GetPageList(paginationobj, queryJson);
  56. var jsonData = new
  57. {
  58. rows = data,
  59. total = paginationobj.total,
  60. page = paginationobj.page,
  61. records = paginationobj.records
  62. };
  63. return Success(jsonData);
  64. }
  65. /// <summary>
  66. /// 获取表单数据
  67. /// <summary>
  68. /// <returns></returns>
  69. [HttpGet]
  70. [AjaxOnly]
  71. public ActionResult GetFormData(string keyValue)
  72. {
  73. var Ass_ReceiveData = ass_ReceiveIBLL.GetAss_ReceiveEntity(keyValue);
  74. var Ass_ReceiveItem = assReceiveItemIbll.GetList(keyValue);
  75. var jsonData = new
  76. {
  77. Ass_Receive = Ass_ReceiveData,
  78. Ass_ReceiveItem
  79. };
  80. return Success(jsonData);
  81. }
  82. /// <summary>
  83. /// 获取表单数据
  84. /// <summary>
  85. /// <returns></returns>
  86. [HttpGet]
  87. [AjaxOnly]
  88. public ActionResult GetFormDataByProcessId(string processId)
  89. {
  90. var Ass_Receive = ass_ReceiveIBLL.GetEntityByProcessId(processId);
  91. var Ass_ReceiveItem = assReceiveItemIbll.GetList(Ass_Receive.RID);
  92. var jsonData = new
  93. {
  94. Ass_Receive,
  95. Ass_ReceiveItem,
  96. };
  97. return Success(jsonData);
  98. }
  99. #endregion
  100. #region 提交数据
  101. /// <summary>
  102. /// 删除实体数据
  103. /// <param name="keyValue">主键</param>
  104. /// <summary>
  105. /// <returns></returns>
  106. [HttpPost]
  107. [AjaxOnly]
  108. public ActionResult DeleteForm(string keyValue)
  109. {
  110. ass_ReceiveIBLL.DeleteEntity(keyValue);
  111. return Success("删除成功!");
  112. }
  113. /// <summary>
  114. /// 保存实体数据(新增、修改)
  115. /// <param name="keyValue">主键</param>
  116. /// <summary>
  117. /// <returns></returns>
  118. [HttpPost]
  119. [ValidateAntiForgeryToken]
  120. [AjaxOnly]
  121. public ActionResult SaveForm(string keyValue, string strEntity, string receItemList)
  122. {
  123. Ass_ReceiveEntity entity = strEntity.ToObject<Ass_ReceiveEntity>();
  124. var list = receItemList.ToObject<List<Ass_ReceiveItemEntity>>();
  125. ass_ReceiveIBLL.SaveEntity(keyValue, entity, list);
  126. return Success("保存成功!");
  127. }
  128. [HttpPost]
  129. [AjaxOnly]
  130. public ActionResult ChangeStatusById(string keyValue, string processId)
  131. {
  132. ass_ReceiveIBLL.ChangeStatusById(keyValue, 1, processId);
  133. return Success("操作成功!");
  134. }
  135. #endregion
  136. }
  137. }