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.
 
 
 
 
 
 

222 lines
6.8 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. using System;
  9. namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers
  10. {
  11. /// <summary>
  12. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  13. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  14. /// 创 建:超级管理员
  15. /// 日 期:2020-11-18 10:46
  16. /// 描 述:资产验收
  17. /// </summary>
  18. public class Ass_AcceptanceController : MvcControllerBase
  19. {
  20. private Ass_AcceptanceIBLL ass_AcceptanceIBLL = new Ass_AcceptanceBLL();
  21. private Ass_AcceptanceMainIBLL ass_AcceptanceMainIBLL = new Ass_AcceptanceMainBLL();
  22. private CodeRuleIBLL codeRuleIBLL = new CodeRuleBLL();
  23. #region 视图功能
  24. /// <summary>
  25. /// 主页面
  26. /// <summary>
  27. /// <returns></returns>
  28. [HttpGet]
  29. public ActionResult Index()
  30. {
  31. return View();
  32. }
  33. /// <summary>
  34. /// 表单页
  35. /// <summary>
  36. /// <returns></returns>
  37. [HttpGet]
  38. public ActionResult Form()
  39. {
  40. ViewBag.Code = "RKSQ_" + CommonHelper.CreateNo();
  41. return View();
  42. }
  43. /// <summary>
  44. /// 表单页
  45. /// <summary>
  46. /// <returns></returns>
  47. [HttpGet]
  48. public ActionResult FormItem()
  49. {
  50. ViewBag.AAICode = CommonHelper.CreateNo();
  51. return View();
  52. }
  53. /// <summary>
  54. /// 表单页
  55. /// <summary>
  56. /// <returns></returns>
  57. [HttpGet]
  58. public ActionResult ViewForm()
  59. {
  60. return View();
  61. }
  62. /// <summary>
  63. /// 表单页
  64. /// <summary>
  65. /// <returns></returns>
  66. [HttpGet]
  67. public ActionResult FormView()
  68. {
  69. return View();
  70. }
  71. /// <summary>
  72. /// 表单页
  73. /// <summary>
  74. /// <returns></returns>
  75. [HttpGet]
  76. public ActionResult Print()
  77. {
  78. ViewBag.Date = DateTime.Now.ToString("yyyy年MM月dd日");
  79. return View();
  80. }
  81. #endregion
  82. #region 获取数据
  83. /// <summary>
  84. /// 获取页面显示列表数据
  85. /// </summary>
  86. /// <param name="pagination">分页参数</param>
  87. /// <param name="queryJson">查询参数</param>
  88. /// <returns></returns>
  89. [HttpGet]
  90. [AjaxOnly]
  91. public ActionResult GetPageList(string pagination, string queryJson)
  92. {
  93. Pagination paginationobj = pagination.ToObject<Pagination>();
  94. var data = ass_AcceptanceMainIBLL.GetPageList(paginationobj, queryJson);
  95. var jsonData = new
  96. {
  97. rows = data,
  98. total = paginationobj.total,
  99. page = paginationobj.page,
  100. records = paginationobj.records
  101. };
  102. return Success(jsonData);
  103. }
  104. /// <summary>
  105. /// 获取表单数据
  106. /// </summary>
  107. /// <param name="keyValue">主键</param>
  108. /// <returns></returns>
  109. [HttpGet]
  110. [AjaxOnly]
  111. public ActionResult GetFormData(string keyValue)
  112. {
  113. var Ass_AcceptanceMainData = ass_AcceptanceMainIBLL.GetAss_AcceptanceMainEntity(keyValue);
  114. var Ass_AcceptanceData = ass_AcceptanceIBLL.GetAss_AcceptanceListByMainId(Ass_AcceptanceMainData.Id);
  115. var jsonData = new
  116. {
  117. Ass_AcceptanceMain = Ass_AcceptanceMainData,
  118. Ass_Acceptance = Ass_AcceptanceData
  119. };
  120. return Success(jsonData);
  121. }
  122. /// <summary>
  123. /// 获取表单数据
  124. /// </summary>
  125. /// <param name="processId">流程实例主键</param>
  126. /// <returns></returns>
  127. [HttpGet]
  128. [AjaxOnly]
  129. public ActionResult GetFormDataByProcessId(string processId)
  130. {
  131. var Ass_AcceptanceMainData = ass_AcceptanceMainIBLL.GetEntityByProcessId(processId);
  132. var Ass_AcceptanceData = ass_AcceptanceIBLL.GetAss_AcceptanceListByMainId(Ass_AcceptanceMainData.Id);
  133. var jsonData = new
  134. {
  135. Ass_AcceptanceMain = Ass_AcceptanceMainData,
  136. Ass_Acceptance = Ass_AcceptanceData
  137. };
  138. return Success(jsonData);
  139. }
  140. #endregion
  141. #region 提交数据
  142. /// <summary>
  143. /// 提交
  144. /// </summary>
  145. /// <param name="keyValue"></param>
  146. /// <returns></returns>
  147. [HttpPost]
  148. [AjaxOnly]
  149. public ActionResult ChangeStatusById(string keyValue, string processId)
  150. {
  151. ass_AcceptanceIBLL.ChangeStatusById(keyValue, 1, processId);
  152. return Success("操作成功!");
  153. }
  154. /// <summary>
  155. /// 删除实体数据
  156. /// </summary>
  157. /// <param name="keyValue">主键</param>
  158. /// <returns></returns>
  159. [HttpPost]
  160. [AjaxOnly]
  161. public ActionResult DeleteForm(string keyValue)
  162. {
  163. ass_AcceptanceMainIBLL.DeleteEntity(keyValue);
  164. return Success("删除成功!");
  165. }
  166. /// <summary>
  167. /// 保存实体数据(新增、修改)
  168. /// <param name="keyValue">主键</param>
  169. /// <summary>
  170. /// <returns></returns>
  171. [HttpPost]
  172. [ValidateAntiForgeryToken]
  173. [AjaxOnly]
  174. public ActionResult SaveForm(string keyValue, string strEntity, string strass_Ass_AcceptanceList)
  175. {
  176. Ass_AcceptanceMainEntity entity = strEntity.ToObject<Ass_AcceptanceMainEntity>();
  177. if (string.IsNullOrEmpty(keyValue))
  178. {
  179. entity.Status = 0;
  180. }
  181. List<Ass_AcceptanceEntity> ass_AcceptanceList = strass_Ass_AcceptanceList.ToObject<List<Ass_AcceptanceEntity>>();
  182. ass_AcceptanceMainIBLL.SaveEntity(keyValue, entity, ass_AcceptanceList);
  183. return Success("保存成功!");
  184. }
  185. ///// <summary>
  186. ///// 保存实体数据(新增、修改)
  187. ///// </summary>
  188. ///// <param name="keyValue">主键</param>
  189. ///// <param name="strEntity">实体</param>
  190. ///// <returns></returns>
  191. //[HttpPost]
  192. //[ValidateAntiForgeryToken]
  193. //[AjaxOnly]
  194. //public ActionResult SaveForm(string keyValue, string strEntity)
  195. //{
  196. // Ass_AcceptanceEntity entity = strEntity.ToObject<Ass_AcceptanceEntity>();
  197. // ass_AcceptanceIBLL.SaveEntity(keyValue, entity);
  198. // if (string.IsNullOrEmpty(keyValue))
  199. // {
  200. // }
  201. // return Success("保存成功!");
  202. //}
  203. #endregion
  204. }
  205. }