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.
 
 
 
 
 
 

154 line
4.7 KiB

  1. using Learun.Application.TwoDevelopment.LR_Desktop;
  2. using Learun.Util;
  3. using System.Web.Mvc;
  4. using Learun.Application.Base.SystemModule;
  5. using Learun.Application.TwoDevelopment.EducationalAdministration;
  6. namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  10. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2018-09-25 11:32
  13. /// 描 述:图标配置
  14. /// </summary>
  15. public class DTChartController : MvcControllerBase
  16. {
  17. private DTChartIBLL dTChartIBLL = new DTChartBLL();
  18. private DatabaseLinkIBLL databaseLinkIbll = new DatabaseLinkBLL();
  19. private ThematicManagementIBLL thematicManagementIbll = new ThematicManagementBLL();
  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. return View();
  38. }
  39. #endregion
  40. #region 获取数据
  41. /// <summary>
  42. /// 获取页面显示列表数据
  43. /// <summary>
  44. /// <param name="queryJson">查询参数</param>
  45. /// <returns></returns>
  46. [HttpGet]
  47. [AjaxOnly]
  48. public ActionResult GetPageList(string pagination, string queryJson)
  49. {
  50. Pagination paginationobj = pagination.ToObject<Pagination>();
  51. var data = dTChartIBLL.GetPageList(paginationobj, queryJson);
  52. if (paginationobj == null)
  53. {
  54. return JsonResult(data);
  55. }
  56. else
  57. {
  58. var jsonData = new
  59. {
  60. rows = data,
  61. total = paginationobj.total,
  62. page = paginationobj.page,
  63. records = paginationobj.records
  64. };
  65. return JsonResult(jsonData);
  66. }
  67. }
  68. /// <summary>
  69. /// 获取表单数据
  70. /// <summary>
  71. /// <returns></returns>
  72. [HttpGet]
  73. [AjaxOnly]
  74. public ActionResult GetFormData(string keyValue)
  75. {
  76. var LR_DT_ChartData = dTChartIBLL.GetLR_DT_ChartEntity(keyValue);
  77. var jsonData = new
  78. {
  79. LR_DT_Chart = LR_DT_ChartData,
  80. };
  81. return JsonResult(jsonData);
  82. }
  83. #endregion
  84. #region 提交数据
  85. /// <summary>
  86. /// 删除实体数据
  87. /// <param name="keyValue">主键</param>
  88. /// <summary>
  89. /// <returns></returns>
  90. [HttpPost]
  91. [AjaxOnly]
  92. public ActionResult DeleteForm(string keyValue)
  93. {
  94. dTChartIBLL.DeleteEntity(keyValue);
  95. return Success("删除成功!");
  96. }
  97. /// <summary>
  98. /// 保存实体数据(新增、修改)
  99. /// <param name="keyValue">主键</param>
  100. /// <summary>
  101. /// <returns></returns>
  102. [HttpPost]
  103. [ValidateAntiForgeryToken]
  104. [AjaxOnly]
  105. public ActionResult SaveForm(string keyValue, DTChartEntity entity)
  106. {
  107. dTChartIBLL.SaveEntity(keyValue, entity);
  108. return Success("保存成功!");
  109. }
  110. [HttpGet]
  111. [AjaxOnly]
  112. public ActionResult GetSqlData(string Id)
  113. {
  114. var dtListEntity = dTChartIBLL.GetLR_DT_ChartEntity(Id);
  115. if (Id == "a2939764-2422-4782-89a1-131b57f75370" || Id == "f3c192ed-65b1-43a3-8b68-d81dd550a447")//教师电子成绩单提交统计 或 教师纸质成绩单提交统计
  116. {
  117. if (dtListEntity != null)
  118. {
  119. //获取当前时间学年和学期
  120. var yearAndSemester = Common.GetSemesterAndYear();
  121. var sql = dtListEntity.F_Sql;
  122. var strSql = $" where t.AcademicYearNo='{yearAndSemester.AcademicYearShort}' and t.Semester='{yearAndSemester.Semester}' ";
  123. var tempsql = sql.Substring(0, sql.IndexOf("group")) + strSql + sql.Substring(sql.IndexOf("group"));
  124. dtListEntity.F_Sql = tempsql;
  125. }
  126. }
  127. var reqDataTable = databaseLinkIbll.FindTable(dtListEntity.F_DataSourceId.Trim(), dtListEntity.F_Sql);
  128. var jsonData = new
  129. {
  130. Id = Id,
  131. value = reqDataTable,
  132. };
  133. return JsonResult(jsonData);
  134. }
  135. #endregion
  136. }
  137. }