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.
 
 
 
 
 
 

199 líneas
6.0 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-04-10 15:12
  14. /// 描 述:资产报修
  15. /// </summary>
  16. public class Ass_RepairController : MvcControllerBase
  17. {
  18. private Ass_RepairIBLL ass_RepairIBLL = new Ass_RepairBLL();
  19. #region 视图功能
  20. /// <summary>
  21. /// 主页面
  22. /// <summary>
  23. /// <returns></returns>
  24. [HttpGet]
  25. public ActionResult Index()
  26. {
  27. return View();
  28. }
  29. /// <summary>
  30. /// 表单页
  31. /// <summary>
  32. /// <returns></returns>
  33. [HttpGet]
  34. public ActionResult Form()
  35. {
  36. ViewBag.AACode = "RKBX_" + CommonHelper.CreateNo();
  37. return View();
  38. }
  39. [HttpGet]
  40. public ActionResult FormView()
  41. {
  42. ViewBag.AACode = "RKBX_" + CommonHelper.CreateNo();
  43. return View();
  44. }
  45. #endregion
  46. #region 获取数据
  47. /// <summary>
  48. /// 获取页面显示列表数据
  49. /// <summary>
  50. /// <param name="queryJson">查询参数</param>
  51. /// <returns></returns>
  52. [HttpGet]
  53. [AjaxOnly]
  54. public ActionResult GetPageList(string pagination, string queryJson)
  55. {
  56. Pagination paginationobj = pagination.ToObject<Pagination>();
  57. var data = ass_RepairIBLL.GetPageList(paginationobj, queryJson);
  58. var jsonData = new
  59. {
  60. rows = data,
  61. total = paginationobj.total,
  62. page = paginationobj.page,
  63. records = paginationobj.records
  64. };
  65. return Success(jsonData);
  66. }
  67. /// <summary>
  68. /// 获取表单数据
  69. /// <summary>
  70. /// <returns></returns>
  71. [HttpGet]
  72. [AjaxOnly]
  73. public ActionResult GetFormData(string keyValue)
  74. {
  75. var Ass_RepairData = ass_RepairIBLL.GetAss_RepairEntity(keyValue);
  76. var jsonData = new
  77. {
  78. Ass_Repair = Ass_RepairData,
  79. };
  80. return Success(jsonData);
  81. }
  82. #endregion
  83. #region 提交数据
  84. /// <summary>
  85. /// 删除实体数据
  86. /// <param name="keyValue">主键</param>
  87. /// <summary>
  88. /// <returns></returns>
  89. [HttpPost]
  90. [AjaxOnly]
  91. public ActionResult DeleteForm(string keyValue)
  92. {
  93. ass_RepairIBLL.DeleteEntity(keyValue);
  94. return Success("删除成功!");
  95. }
  96. /// <summary>
  97. /// 保存实体数据(新增、修改)
  98. /// <param name="keyValue">主键</param>
  99. /// <summary>
  100. /// <returns></returns>
  101. [HttpPost]
  102. [ValidateAntiForgeryToken]
  103. [AjaxOnly]
  104. public ActionResult SaveForm(string keyValue, string strEntity)
  105. {
  106. Ass_RepairEntity entity = strEntity.ToObject<Ass_RepairEntity>();
  107. entity.RStatus = 0;
  108. entity.RRepairStatus = 0;
  109. ass_RepairIBLL.SaveEntity(keyValue, entity);
  110. return Success("保存成功!");
  111. }
  112. /// <summary>
  113. /// 提交实体数据
  114. /// <param name="keyValue">主键</param>
  115. /// <summary>
  116. /// <returns></returns>
  117. [HttpPost]
  118. [AjaxOnly]
  119. public ActionResult DoSubmit(string keyValue)
  120. {
  121. var entity = ass_RepairIBLL.GetAss_RepairEntity(keyValue);
  122. if (entity == null)
  123. {
  124. return Fail("数据不存在!");
  125. }
  126. entity.RStatus = 1;
  127. ass_RepairIBLL.SaveEntity(keyValue, entity);
  128. return Success("提交成功!");
  129. }
  130. /// <summary>
  131. /// 开始维修实体数据
  132. /// <param name="keyValue">主键</param>
  133. /// <summary>
  134. /// <returns></returns>
  135. [HttpPost]
  136. [AjaxOnly]
  137. public ActionResult DoStart(string keyValue)
  138. {
  139. var entity = ass_RepairIBLL.GetAss_RepairEntity(keyValue);
  140. if (entity == null)
  141. {
  142. return Fail("数据不存在!");
  143. }
  144. entity.RStartTime = DateTime.Now;
  145. entity.RRepairUserId = LoginUserInfo.Get().userId;
  146. entity.RRepairStatus = 1;
  147. ass_RepairIBLL.SaveEntity(keyValue, entity);
  148. return Success("操作成功!");
  149. }
  150. /// <summary>
  151. /// 维修完成实体数据
  152. /// <param name="keyValue">主键</param>
  153. /// <summary>
  154. /// <returns></returns>
  155. [HttpPost]
  156. [AjaxOnly]
  157. public ActionResult DoEnd(string keyValue)
  158. {
  159. var entity = ass_RepairIBLL.GetAss_RepairEntity(keyValue);
  160. if (entity == null)
  161. {
  162. return Fail("数据不存在!");
  163. }
  164. entity.REndTime = DateTime.Now;
  165. entity.RRepairStatus = 2;
  166. ass_RepairIBLL.SaveEntity(keyValue, entity);
  167. return Success("操作成功!");
  168. }
  169. /// <summary>
  170. /// 确认维修实体数据
  171. /// <param name="keyValue">主键</param>
  172. /// <summary>
  173. /// <returns></returns>
  174. [HttpPost]
  175. [AjaxOnly]
  176. public ActionResult DoConfirm(string keyValue)
  177. {
  178. var entity = ass_RepairIBLL.GetAss_RepairEntity(keyValue);
  179. if (entity == null)
  180. {
  181. return Fail("数据不存在!");
  182. }
  183. entity.RConfirmTime = DateTime.Now;
  184. entity.RRepairStatus = 3;
  185. ass_RepairIBLL.SaveEntity(keyValue, entity);
  186. return Success("操作成功!");
  187. }
  188. #endregion
  189. }
  190. }