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.
 
 
 
 
 
 

207 lines
6.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. using System;
  7. namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  11. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2019-03-25 12:00
  14. /// 描 述:入库申请
  15. /// </summary>
  16. public class Ass_AssetsInfoApplyController : MvcControllerBase
  17. {
  18. private Ass_AssetsInfoApplyIBLL ass_AssetsInfoApplyIBLL = new Ass_AssetsInfoApplyBLL();
  19. #region 视图功能
  20. /// <summary>
  21. /// 主页面
  22. /// <summary>
  23. /// <returns></returns>
  24. [HttpGet]
  25. public ActionResult Index()
  26. {
  27. return View();
  28. }
  29. [HttpGet]
  30. public ActionResult IndexJY()
  31. {
  32. return View();
  33. }
  34. [HttpGet]
  35. public ActionResult IndexJYHC()
  36. {
  37. return View();
  38. }
  39. /// <summary>
  40. /// 表单查看页
  41. /// <summary>
  42. /// <returns></returns>
  43. [HttpGet]
  44. public ActionResult FormView()
  45. {
  46. return View();
  47. }
  48. [HttpGet]
  49. public ActionResult FormViewJY()
  50. {
  51. return View();
  52. }
  53. [HttpGet]
  54. public ActionResult FormViewJYHC()
  55. {
  56. return View();
  57. }
  58. /// <summary>
  59. /// 表单页
  60. /// <summary>
  61. /// <returns></returns>
  62. [HttpGet]
  63. public ActionResult Form()
  64. {
  65. ViewBag.AACode = "RKSQ_" + CommonHelper.CreateNo();
  66. return View();
  67. }
  68. [HttpGet]
  69. public ActionResult FormJY()
  70. {
  71. ViewBag.AACode = "RKSQ_" + CommonHelper.CreateNo();
  72. return View();
  73. }
  74. [HttpGet]
  75. public ActionResult FormJYHC()
  76. {
  77. ViewBag.AACode = "RKSQ_" + CommonHelper.CreateNo();
  78. return View();
  79. }
  80. /// <summary>
  81. /// 采购入库表单页
  82. /// </summary>
  83. /// <returns></returns>
  84. [HttpGet]
  85. public ActionResult FormPurchase()
  86. {
  87. ViewBag.AACode = "RKSQ_" + CommonHelper.CreateNo();
  88. return View();
  89. }
  90. [HttpGet]
  91. public ActionResult FormPurchaseJY()
  92. {
  93. ViewBag.AACode = "RKSQ_" + CommonHelper.CreateNo();
  94. return View();
  95. }
  96. #endregion
  97. #region 获取数据
  98. /// <summary>
  99. /// 获取页面显示列表数据
  100. /// <summary>
  101. /// <param name="queryJson">查询参数</param>
  102. /// <returns></returns>
  103. [HttpGet]
  104. [AjaxOnly]
  105. public ActionResult GetPageList(string pagination, string queryJson)
  106. {
  107. Pagination paginationobj = pagination.ToObject<Pagination>();
  108. var data = ass_AssetsInfoApplyIBLL.GetPageList(paginationobj, queryJson);
  109. var jsonData = new
  110. {
  111. rows = data,
  112. total = paginationobj.total,
  113. page = paginationobj.page,
  114. records = paginationobj.records
  115. };
  116. return Success(jsonData);
  117. }
  118. /// <summary>
  119. /// 获取表单数据
  120. /// <summary>
  121. /// <returns></returns>
  122. [HttpGet]
  123. [AjaxOnly]
  124. public ActionResult GetFormData(string keyValue)
  125. {
  126. var Ass_AssetsInfoApplyData = ass_AssetsInfoApplyIBLL.GetAss_AssetsInfoApplyEntity(keyValue);
  127. var Ass_AssetsInfoItemApplyData = ass_AssetsInfoApplyIBLL.GetAss_AssetsInfoItemApplyList(Ass_AssetsInfoApplyData.AAId);
  128. var jsonData = new
  129. {
  130. Ass_AssetsInfoApply = Ass_AssetsInfoApplyData,
  131. Ass_AssetsInfoItemApply = Ass_AssetsInfoItemApplyData,
  132. };
  133. return Success(jsonData);
  134. }
  135. /// <summary>
  136. /// 获取表单数据
  137. /// <summary>
  138. /// <returns></returns>
  139. [HttpGet]
  140. [AjaxOnly]
  141. public ActionResult GetFormDataByProcessId(string processId)
  142. {
  143. var Ass_AssetsInfoApplyData = ass_AssetsInfoApplyIBLL.GetEntityByProcessId(processId);
  144. var Ass_AssetsInfoItemApplyData = ass_AssetsInfoApplyIBLL.GetAss_AssetsInfoItemApplyList(Ass_AssetsInfoApplyData.AAId);
  145. var jsonData = new
  146. {
  147. Ass_AssetsInfoApply = Ass_AssetsInfoApplyData,
  148. Ass_AssetsInfoItemApply = Ass_AssetsInfoItemApplyData,
  149. };
  150. return Success(jsonData);
  151. }
  152. #endregion
  153. #region 提交数据
  154. /// <summary>
  155. /// 删除实体数据
  156. /// <param name="keyValue">主键</param>
  157. /// <summary>
  158. /// <returns></returns>
  159. [HttpPost]
  160. [AjaxOnly]
  161. public ActionResult DeleteForm(string keyValue)
  162. {
  163. ass_AssetsInfoApplyIBLL.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_AssetsInfoItemApplyList)
  175. {
  176. Ass_AssetsInfoApplyEntity entity = strEntity.ToObject<Ass_AssetsInfoApplyEntity>();
  177. entity.AAStatus = 0;
  178. entity.AACreateTime = DateTime.Now;
  179. List<Ass_AssetsInfoItemApplyEntity> ass_AssetsInfoItemApplyList = strass_AssetsInfoItemApplyList.ToObject<List<Ass_AssetsInfoItemApplyEntity>>();
  180. ass_AssetsInfoApplyIBLL.SaveEntity(keyValue, entity, ass_AssetsInfoItemApplyList);
  181. return Success("保存成功!");
  182. }
  183. /// <summary>
  184. /// 提交入库申请
  185. /// </summary>
  186. /// <param name="keyValue"></param>
  187. /// <returns></returns>
  188. [HttpPost]
  189. [AjaxOnly]
  190. public ActionResult ChangeStatusById(string keyValue, string processId)
  191. {
  192. ass_AssetsInfoApplyIBLL.ChangeStatusById(keyValue, 1, processId);
  193. return Success("操作成功!");
  194. }
  195. #endregion
  196. }
  197. }