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.
 
 
 
 
 
 

165 lines
4.5 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.LR_Desktop;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  10. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2021-06-22 11:07
  13. /// 描 述:上报
  14. /// </summary>
  15. public class QualityReportController : MvcControllerBase
  16. {
  17. private QualityReportMainIBLL fualityReportMainIBLL = new QualityReportMainBLL();
  18. private QualityReportChildIBLL fualityReportChildIBLL = new QualityReportChildBLL();
  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. return View();
  37. }
  38. /// <summary>
  39. /// 上报数据管理
  40. /// <summary>
  41. /// <returns></returns>
  42. [HttpGet]
  43. public ActionResult IndexReport()
  44. {
  45. return View();
  46. }
  47. /// <summary>
  48. /// 上报数据管理
  49. /// <summary>
  50. /// <returns></returns>
  51. [HttpGet]
  52. public ActionResult FormView()
  53. {
  54. return View();
  55. }
  56. #endregion
  57. #region 获取数据
  58. /// <summary>
  59. /// 获取页面显示列表数据
  60. /// </summary>
  61. /// <param name="pagination">分页参数</param>
  62. /// <param name="queryJson">查询参数</param>
  63. /// <returns></returns>
  64. [HttpGet]
  65. [AjaxOnly]
  66. public ActionResult GetPageList(string pagination, string queryJson)
  67. {
  68. Pagination paginationobj = pagination.ToObject<Pagination>();
  69. var data = fualityReportMainIBLL.GetPageList(paginationobj, queryJson);
  70. var jsonData = new
  71. {
  72. rows = data,
  73. total = paginationobj.total,
  74. page = paginationobj.page,
  75. records = paginationobj.records
  76. };
  77. return Success(jsonData);
  78. }
  79. /// <summary>
  80. /// 判断是否可以上报
  81. /// </summary>
  82. /// <param name="keyValue">项目Id</param>
  83. /// <returns></returns>
  84. [HttpGet]
  85. [AjaxOnly]
  86. public ActionResult IsCanReport(string keyValue)
  87. {
  88. var str = fualityReportChildIBLL.IsCanReport(keyValue);
  89. if (!string.IsNullOrEmpty(str))
  90. {
  91. return Fail(str);
  92. }
  93. return Success("");
  94. }
  95. /// <summary>
  96. /// 获取表单数据
  97. /// </summary>
  98. /// <param name="keyValue">项目Id</param>
  99. /// <returns></returns>
  100. [HttpGet]
  101. [AjaxOnly]
  102. public ActionResult GetFormData(string keyValue)
  103. {
  104. var ReportData = fualityReportChildIBLL.GetListByFillId(keyValue);
  105. return Success(ReportData);
  106. }
  107. #endregion
  108. #region 提交数据
  109. /// <summary>
  110. /// 保存实体数据(新增、修改)
  111. /// </summary>
  112. /// <param name="keyValue">主键</param>
  113. /// <param name="strEntity">实体</param>
  114. /// <returns></returns>
  115. [HttpPost]
  116. [ValidateAntiForgeryToken]
  117. [AjaxOnly]
  118. public ActionResult SaveList(string keyValue, List<QualityReportChildEntity> list)
  119. {
  120. fualityReportChildIBLL.SaveList(keyValue, list);
  121. return Success("保存成功!");
  122. }
  123. /// <summary>
  124. /// 提交
  125. /// </summary>
  126. /// <returns></returns>
  127. [HttpPost]
  128. [AjaxOnly]
  129. public ActionResult UpdateState(string keyValue, int Status)
  130. {
  131. fualityReportChildIBLL.UpdateState(keyValue, Status);
  132. return Success("操作成功!");
  133. }
  134. /// <summary>
  135. /// 删除
  136. /// </summary>
  137. /// <returns></returns>
  138. [HttpPost]
  139. [AjaxOnly]
  140. public ActionResult DeleteForm(string keyValue)
  141. {
  142. fualityReportChildIBLL.DeleteEntity(keyValue);
  143. return Success("删除成功!");
  144. }
  145. #endregion
  146. }
  147. }