No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

168 líneas
5.2 KiB

  1. using System;
  2. using Learun.Util;
  3. using System.Data;
  4. using Learun.Application.TwoDevelopment.AssetManagementSystem;
  5. using System.Web.Mvc;
  6. using System.Collections.Generic;
  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-09-10 16:19
  14. /// 描 述:资产盘点
  15. /// </summary>
  16. public class Ass_InventoryController : MvcControllerBase
  17. {
  18. private Ass_InventoryIBLL ass_InventoryIBLL = new Ass_InventoryBLL();
  19. private Ass_InventoryItemApplyIBLL ass_InventoryItemApplyIBLL = new Ass_InventoryItemApplyBLL();
  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.ITNo = "PD_" + CommonHelper.CreateNo();
  38. return View();
  39. }
  40. /// <summary>
  41. /// 详情页
  42. /// <summary>
  43. /// <returns></returns>
  44. [HttpGet]
  45. public ActionResult FormView()
  46. {
  47. return View();
  48. }
  49. #endregion
  50. #region 获取数据
  51. /// <summary>
  52. /// 获取页面显示列表数据
  53. /// <summary>
  54. /// <param name="queryJson">查询参数</param>
  55. /// <returns></returns>
  56. [HttpGet]
  57. [AjaxOnly]
  58. public ActionResult GetPageList(string pagination, string queryJson)
  59. {
  60. Pagination paginationobj = pagination.ToObject<Pagination>();
  61. var data = ass_InventoryIBLL.GetPageList(paginationobj, queryJson);
  62. var jsonData = new
  63. {
  64. rows = data,
  65. total = paginationobj.total,
  66. page = paginationobj.page,
  67. records = paginationobj.records
  68. };
  69. return Success(jsonData);
  70. }
  71. /// <summary>
  72. /// 获取表单数据
  73. /// <summary>
  74. /// <returns></returns>
  75. [HttpGet]
  76. [AjaxOnly]
  77. public ActionResult GetFormData(string keyValue)
  78. {
  79. var Ass_InventoryData = ass_InventoryIBLL.GetAss_InventoryEntity(keyValue);
  80. var Ass_InventoryItemData = ass_InventoryItemApplyIBLL.GetAss_InventoryItemList(Ass_InventoryData.ITID);
  81. var jsonData = new
  82. {
  83. Ass_Inventory = Ass_InventoryData,
  84. Ass_InventoryItem = Ass_InventoryItemData
  85. };
  86. return Success(jsonData);
  87. }
  88. /// <summary>
  89. /// 获取表单数据
  90. /// <summary>
  91. /// <returns></returns>
  92. [HttpGet]
  93. [AjaxOnly]
  94. public ActionResult GetFormDataByProcessId(string processId)
  95. {
  96. var Ass_InventoryData = ass_InventoryIBLL.GetEntityByProcessId(processId);
  97. var Ass_InventoryItemData = ass_InventoryItemApplyIBLL.GetAss_InventoryItemList(Ass_InventoryData.ITID);
  98. var jsonData = new
  99. {
  100. Ass_Inventory = Ass_InventoryData,
  101. Ass_InventoryItem = Ass_InventoryItemData
  102. };
  103. return Success(jsonData);
  104. }
  105. #endregion
  106. #region 提交数据
  107. /// <summary>
  108. /// 删除实体数据
  109. /// <param name="keyValue">主键</param>
  110. /// <summary>
  111. /// <returns></returns>
  112. [HttpPost]
  113. [AjaxOnly]
  114. public ActionResult DeleteForm(string keyValue)
  115. {
  116. ass_InventoryIBLL.DeleteEntity(keyValue);
  117. return Success("删除成功!");
  118. }
  119. /// <summary>
  120. /// 保存实体数据(新增、修改)
  121. /// <param name="keyValue">主键</param>
  122. /// <summary>
  123. /// <returns></returns>
  124. [HttpPost]
  125. [ValidateAntiForgeryToken]
  126. [AjaxOnly]
  127. public ActionResult SaveForm(string keyValue, string strEntity, string strAss_InventoryItemList)
  128. {
  129. Ass_InventoryEntity entity = strEntity.ToObject<Ass_InventoryEntity>();
  130. entity.ITStatus = 0;
  131. entity.ITDate = DateTime.Now;
  132. List<Ass_InventoryItemApplyEntity> list = strAss_InventoryItemList.ToObject<List<Ass_InventoryItemApplyEntity>>();
  133. ass_InventoryIBLL.SaveEntity(keyValue, entity, list);
  134. return Success("保存成功!");
  135. }
  136. #endregion
  137. #region 扩展数据
  138. /// <summary>
  139. /// 提交盘点申请单
  140. /// </summary>
  141. /// <param name="keyValue">盘点表主键</param>
  142. /// <param name="pastatus">审核状态</param>
  143. /// <param name="processId">流程Id</param>
  144. /// <returns></returns>
  145. public ActionResult ModifyStatus(string keyValue, int pastatus, string processId)
  146. {
  147. ass_InventoryIBLL.ModifyStatus(keyValue, pastatus, processId);
  148. return Success("提交成功!");
  149. }
  150. #endregion
  151. }
  152. }