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.
 
 
 
 
 
 

160 lines
4.7 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.AssetManagementSystem;
  4. using System.Web.Mvc;
  5. using Learun.Application.TwoDevelopment.LR_CodeDemo;
  6. using System.Collections.Generic;
  7. using Learun.Application.Base.SystemModule;
  8. namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  12. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  13. /// 创 建:超级管理员
  14. /// 日 期:2020-11-18 10:46
  15. /// 描 述:资产验收
  16. /// </summary>
  17. public class Ass_AcceptanceController : MvcControllerBase
  18. {
  19. private Ass_AcceptanceIBLL ass_AcceptanceIBLL = new Ass_AcceptanceBLL();
  20. private CodeRuleIBLL codeRuleIBLL = new CodeRuleBLL();
  21. #region 视图功能
  22. /// <summary>
  23. /// 主页面
  24. /// <summary>
  25. /// <returns></returns>
  26. [HttpGet]
  27. public ActionResult Index()
  28. {
  29. return View();
  30. }
  31. /// <summary>
  32. /// 表单页
  33. /// <summary>
  34. /// <returns></returns>
  35. [HttpGet]
  36. public ActionResult Form()
  37. {
  38. return View();
  39. }
  40. /// <summary>
  41. /// 表单页
  42. /// <summary>
  43. /// <returns></returns>
  44. [HttpGet]
  45. public ActionResult ViewForm()
  46. {
  47. return View();
  48. }
  49. #endregion
  50. #region 获取数据
  51. /// <summary>
  52. /// 获取页面显示列表数据
  53. /// </summary>
  54. /// <param name="pagination">分页参数</param>
  55. /// <param name="queryJson">查询参数</param>
  56. /// <returns></returns>
  57. [HttpGet]
  58. [AjaxOnly]
  59. public ActionResult GetPageList(string pagination, string queryJson)
  60. {
  61. Pagination paginationobj = pagination.ToObject<Pagination>();
  62. var data = ass_AcceptanceIBLL.GetPageList(paginationobj, queryJson);
  63. var jsonData = new
  64. {
  65. rows = data,
  66. total = paginationobj.total,
  67. page = paginationobj.page,
  68. records = paginationobj.records
  69. };
  70. return Success(jsonData);
  71. }
  72. /// <summary>
  73. /// 获取表单数据
  74. /// </summary>
  75. /// <param name="keyValue">主键</param>
  76. /// <returns></returns>
  77. [HttpGet]
  78. [AjaxOnly]
  79. public ActionResult GetFormData(string keyValue)
  80. {
  81. var Ass_AcceptanceData = ass_AcceptanceIBLL.GetAss_AcceptanceEntity( keyValue );
  82. var jsonData = new {
  83. Ass_Acceptance = Ass_AcceptanceData,
  84. };
  85. return Success(jsonData);
  86. }
  87. /// <summary>
  88. /// 获取表单数据
  89. /// </summary>
  90. /// <param name="processId">流程实例主键</param>
  91. /// <returns></returns>
  92. [HttpGet]
  93. [AjaxOnly]
  94. public ActionResult GetFormDataByProcessId(string processId)
  95. {
  96. var Ass_AcceptanceData = ass_AcceptanceIBLL.GetEntityByProcessId( processId );
  97. var jsonData = new {
  98. Ass_Acceptance = Ass_AcceptanceData,
  99. };
  100. return Success(jsonData);
  101. }
  102. #endregion
  103. #region 提交数据
  104. /// <summary>
  105. /// 提交
  106. /// </summary>
  107. /// <param name="keyValue"></param>
  108. /// <returns></returns>
  109. [HttpPost]
  110. [AjaxOnly]
  111. public ActionResult ChangeStatusById(string keyValue, string processId)
  112. {
  113. ass_AcceptanceIBLL.ChangeStatusById(keyValue, 1, processId);
  114. return Success("操作成功!");
  115. }
  116. /// <summary>
  117. /// 删除实体数据
  118. /// </summary>
  119. /// <param name="keyValue">主键</param>
  120. /// <returns></returns>
  121. [HttpPost]
  122. [AjaxOnly]
  123. public ActionResult DeleteForm(string keyValue)
  124. {
  125. ass_AcceptanceIBLL.DeleteEntity(keyValue);
  126. return Success("删除成功!");
  127. }
  128. /// <summary>
  129. /// 保存实体数据(新增、修改)
  130. /// </summary>
  131. /// <param name="keyValue">主键</param>
  132. /// <param name="strEntity">实体</param>
  133. /// <returns></returns>
  134. [HttpPost]
  135. [ValidateAntiForgeryToken]
  136. [AjaxOnly]
  137. public ActionResult SaveForm(string keyValue, string strEntity)
  138. {
  139. Ass_AcceptanceEntity entity = strEntity.ToObject<Ass_AcceptanceEntity>();
  140. ass_AcceptanceIBLL.SaveEntity(keyValue,entity);
  141. if (string.IsNullOrEmpty(keyValue))
  142. {
  143. }
  144. return Success("保存成功!");
  145. }
  146. #endregion
  147. }
  148. }