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.

Ass_PurchaseApplyController.cs 6.1 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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 17:19
  14. /// 描 述:采购申请表
  15. /// </summary>
  16. public class Ass_PurchaseApplyController : MvcControllerBase
  17. {
  18. private Ass_PurchaseApplyIBLL ass_PurchaseApplyIBLL = new Ass_PurchaseApplyBLL();
  19. private Ass_PurchaseIBLL ass_PurchaseIBLL = new Ass_PurchaseBLL();
  20. #region 视图功能
  21. /// <summary>
  22. /// 主页面
  23. /// <summary>
  24. /// <returns></returns>
  25. [HttpGet]
  26. public ActionResult Index()
  27. {
  28. return View();
  29. }
  30. /// <summary>
  31. /// 表单页
  32. /// <summary>
  33. /// <returns></returns>
  34. [HttpGet]
  35. public ActionResult Form()
  36. {
  37. ViewBag.PACode = "CGSQ_" + CommonHelper.CreateNo();
  38. return View();
  39. }
  40. /// <summary>
  41. /// 表单查看页
  42. /// </summary>
  43. /// <returns></returns>
  44. [HttpGet]
  45. public ActionResult FormView() {
  46. return View();
  47. }
  48. #endregion
  49. #region 获取数据
  50. /// <summary>
  51. /// 获取页面显示列表数据
  52. /// <summary>
  53. /// <param name="queryJson">查询参数</param>
  54. /// <returns></returns>
  55. [HttpGet]
  56. [AjaxOnly]
  57. public ActionResult GetPageList(string pagination, string queryJson)
  58. {
  59. Pagination paginationobj = pagination.ToObject<Pagination>();
  60. var data = ass_PurchaseApplyIBLL.GetPageList(paginationobj, queryJson);
  61. var jsonData = new
  62. {
  63. rows = data,
  64. total = paginationobj.total,
  65. page = paginationobj.page,
  66. records = paginationobj.records
  67. };
  68. return Success(jsonData);
  69. }
  70. /// <summary>
  71. /// 获取表单数据
  72. /// <summary>
  73. /// <returns></returns>
  74. [HttpGet]
  75. [AjaxOnly]
  76. public ActionResult GetFormData(string keyValue)
  77. {
  78. var Ass_PurchaseApplyData = ass_PurchaseApplyIBLL.GetAss_PurchaseApplyEntity(keyValue);
  79. var Ass_PurchaseItemApplyData = ass_PurchaseApplyIBLL.GetAss_PurchaseItemApplyList(Ass_PurchaseApplyData.PAId);
  80. var jsonData = new
  81. {
  82. Ass_PurchaseApply = Ass_PurchaseApplyData,
  83. Ass_PurchaseItemApply = Ass_PurchaseItemApplyData,
  84. };
  85. return Success(jsonData);
  86. }
  87. /// <summary>
  88. /// 获取表单数据
  89. /// <summary>
  90. /// <returns></returns>
  91. [HttpGet]
  92. [AjaxOnly]
  93. public ActionResult GetFormDataByProcessId(string processId)
  94. {
  95. var Ass_PurchaseApplyData = ass_PurchaseApplyIBLL.GetEntityByProcessId(processId);
  96. var Ass_PurchaseItemApplyData = ass_PurchaseApplyIBLL.GetAss_PurchaseItemApplyList(Ass_PurchaseApplyData.PAId);
  97. var jsonData = new
  98. {
  99. Ass_PurchaseApply = Ass_PurchaseApplyData,
  100. Ass_PurchaseItemApply = Ass_PurchaseItemApplyData,
  101. };
  102. return Success(jsonData);
  103. }
  104. /// <summary>
  105. /// 获取表单数据
  106. /// <summary>
  107. /// <returns></returns>
  108. [HttpGet]
  109. [AjaxOnly]
  110. public ActionResult GetFormDataByPId(string pid)
  111. {
  112. var ass_PurchaseEntity = ass_PurchaseIBLL.GetAss_PurchaseEntity(pid);
  113. var Ass_PurchaseApplyData = ass_PurchaseApplyIBLL.GetAss_PurchaseApplyEntity(ass_PurchaseEntity.PAId);
  114. var Ass_PurchaseItemApplyData = ass_PurchaseApplyIBLL.GetAss_PurchaseItemApplyList(Ass_PurchaseApplyData.PAId);
  115. var jsonData = new
  116. {
  117. Ass_PurchaseApply = Ass_PurchaseApplyData,
  118. Ass_PurchaseItemApply = Ass_PurchaseItemApplyData,
  119. };
  120. return Success(jsonData);
  121. }
  122. #endregion
  123. #region 提交数据
  124. /// <summary>
  125. /// 删除实体数据
  126. /// <param name="keyValue">主键</param>
  127. /// <summary>
  128. /// <returns></returns>
  129. [HttpPost]
  130. [AjaxOnly]
  131. public ActionResult DeleteForm(string keyValue)
  132. {
  133. ass_PurchaseApplyIBLL.DeleteEntity(keyValue);
  134. return Success("删除成功!");
  135. }
  136. /// <summary>
  137. /// 保存实体数据(新增、修改)
  138. /// <param name="keyValue">主键</param>
  139. /// <summary>
  140. /// <returns></returns>
  141. [HttpPost]
  142. [ValidateAntiForgeryToken]
  143. [AjaxOnly]
  144. public ActionResult SaveForm(string keyValue, string strEntity, string strass_PurchaseItemApplyList)
  145. {
  146. Ass_PurchaseApplyEntity entity = strEntity.ToObject<Ass_PurchaseApplyEntity>();
  147. entity.PAStatus = 0;
  148. entity.PStatus = 0;
  149. entity.PACreateTime = DateTime.Now;
  150. List<Ass_PurchaseItemApplyEntity> ass_PurchaseItemApplyList = strass_PurchaseItemApplyList.ToObject<List<Ass_PurchaseItemApplyEntity>>();
  151. ass_PurchaseApplyIBLL.SaveEntity(keyValue, entity, ass_PurchaseItemApplyList);
  152. return Success("保存成功!");
  153. }
  154. #endregion
  155. #region 扩展数据
  156. /// <summary>
  157. /// 提交采购申请单
  158. /// </summary>
  159. /// <param name="keyValue">采购申请表主键</param>
  160. /// <param name="pastatus">审核状态</param>
  161. /// <param name="processId">流程Id</param>
  162. /// <returns></returns>
  163. public ActionResult ModifyPAStatus(string keyValue, int pastatus,string processId)
  164. {
  165. ass_PurchaseApplyIBLL.ModifyPAStatus(keyValue, pastatus,processId);
  166. return Success("提交成功!");
  167. }
  168. #endregion
  169. }
  170. }