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.

Sys_ReceiveComplaintController.cs 4.4 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.EducationalAdministration;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System;
  7. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  11. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2019-04-16 17:19
  14. /// 描 述:接收投诉意见
  15. /// </summary>
  16. public class Sys_ReceiveComplaintController : MvcControllerBase
  17. {
  18. private Sys_ReceiveComplaintIBLL sys_ReceiveComplaintIBLL = new Sys_ReceiveComplaintBLL();
  19. private Sys_SendComplaintIBLL sys_SendComplaintIBLL = new Sys_SendComplaintBLL();
  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. /// <summary>
  40. /// 表单查看页
  41. /// <summary>
  42. /// <returns></returns>
  43. [HttpGet]
  44. public ActionResult FormView()
  45. {
  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 = sys_ReceiveComplaintIBLL.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 Sys_ReceiveComplaintData = sys_ReceiveComplaintIBLL.GetSys_ReceiveComplaintEntity( keyValue );
  79. var jsonData = new {
  80. Sys_ReceiveComplaint = Sys_ReceiveComplaintData,
  81. };
  82. return Success(jsonData);
  83. }
  84. #endregion
  85. #region 提交数据
  86. /// <summary>
  87. /// 删除实体数据
  88. /// <param name="keyValue">主键</param>
  89. /// <summary>
  90. /// <returns></returns>
  91. [HttpPost]
  92. [AjaxOnly]
  93. public ActionResult DeleteForm(string keyValue)
  94. {
  95. sys_ReceiveComplaintIBLL.DeleteEntity(keyValue);
  96. return Success("删除成功!");
  97. }
  98. /// <summary>
  99. /// 保存实体数据(新增、修改)
  100. /// <param name="keyValue">主键</param>
  101. /// <summary>
  102. /// <returns></returns>
  103. [HttpPost]
  104. [ValidateAntiForgeryToken]
  105. [AjaxOnly]
  106. public ActionResult SaveForm(string keyValue, string strEntity)
  107. {
  108. Sys_ReceiveComplaintEntity entity = strEntity.ToObject<Sys_ReceiveComplaintEntity>();
  109. //接收投诉意见表
  110. var sys_ReceiveComplaintEntity = sys_ReceiveComplaintIBLL.GetSys_ReceiveComplaintEntity(keyValue);
  111. sys_ReceiveComplaintEntity.ReplyContents = entity.ReplyContents;
  112. sys_ReceiveComplaintEntity.ReplyFlag = 1;
  113. sys_ReceiveComplaintEntity.ReplyTime = DateTime.Now;
  114. sys_ReceiveComplaintIBLL.SaveEntity(keyValue,sys_ReceiveComplaintEntity);
  115. //发送投诉意见表
  116. var sys_SendComplaintEntity = sys_SendComplaintIBLL.GetSys_SendComplaintEntity(sys_ReceiveComplaintEntity.SComplaintId);
  117. if (sys_SendComplaintEntity.ReplyFlag == 0) //未回复
  118. {
  119. sys_SendComplaintEntity.ReplyFlag = 1;
  120. sys_SendComplaintIBLL.SaveEntity(sys_SendComplaintEntity.SComplaintId, sys_SendComplaintEntity);
  121. }
  122. return Success("保存成功!");
  123. }
  124. #endregion
  125. }
  126. }