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.

MP_PerformanceTrackingController.cs 6.0 KiB

4 jaren geleden
4 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. using System;
  2. using Learun.Util;
  3. using System.Data;
  4. using Learun.Application.TwoDevelopment.PersonnelManagement;
  5. using System.Web.Mvc;
  6. using System.Collections.Generic;
  7. using ClosedXML.Excel;
  8. namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架
  12. /// Copyright (c) 2013-2018 上海力软信息技术有限公司
  13. /// 创 建:超级管理员
  14. /// 日 期:2019-09-24 15:35
  15. /// 描 述:绩效跟踪
  16. /// </summary>
  17. public class MP_PerformanceTrackingController : MvcControllerBase
  18. {
  19. private MP_PerformanceTrackingIBLL mP_PerformanceTrackingIBLL = new MP_PerformanceTrackingBLL();
  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 IndexManagement()
  36. {
  37. return View();
  38. }
  39. /// <summary>
  40. /// 提交材料页面
  41. /// <summary>
  42. /// <returns></returns>
  43. [HttpGet]
  44. public ActionResult IndexChildren()
  45. {
  46. return View();
  47. }
  48. /// <summary>
  49. /// 表单页
  50. /// <summary>
  51. /// <returns></returns>
  52. [HttpGet]
  53. public ActionResult Form()
  54. {
  55. return View();
  56. }
  57. /// <summary>
  58. /// 提交材料页
  59. /// <summary>
  60. /// <returns></returns>
  61. [HttpGet]
  62. public ActionResult UploadForm()
  63. {
  64. return View();
  65. }
  66. #endregion
  67. #region 获取数据
  68. /// <summary>
  69. /// 获取页面显示列表数据
  70. /// <summary>
  71. /// <param name="queryJson">查询参数</param>
  72. /// <returns></returns>
  73. [HttpGet]
  74. [AjaxOnly]
  75. public ActionResult GetPageList(string pagination, string queryJson)
  76. {
  77. Pagination paginationobj = pagination.ToObject<Pagination>();
  78. var data = mP_PerformanceTrackingIBLL.GetPageList(paginationobj, queryJson);
  79. var jsonData = new
  80. {
  81. rows = data,
  82. total = paginationobj.total,
  83. page = paginationobj.page,
  84. records = paginationobj.records
  85. };
  86. return Success(jsonData);
  87. }
  88. /// <summary>
  89. /// 获取表单数据
  90. /// <summary>
  91. /// <returns></returns>
  92. [HttpGet]
  93. [AjaxOnly]
  94. public ActionResult GetFormData(string keyValue)
  95. {
  96. var MP_ManageMentPlanData = mP_PerformanceTrackingIBLL.GetMP_ManageMentPlanEntity(keyValue);
  97. var jsonData = new
  98. {
  99. MP_ManageMentPlan = MP_ManageMentPlanData,
  100. };
  101. return Success(jsonData);
  102. }
  103. #endregion
  104. #region 提交数据
  105. /// <summary>
  106. /// 删除实体数据
  107. /// <param name="keyValue">主键</param>
  108. /// <summary>
  109. /// <returns></returns>
  110. [HttpPost]
  111. [AjaxOnly]
  112. public ActionResult DeleteForm(string keyValue)
  113. {
  114. mP_PerformanceTrackingIBLL.DeleteEntity(keyValue);
  115. return Success("删除成功!");
  116. }
  117. /// <summary>
  118. /// 合格/不合格
  119. /// <param name="keyValue">主键</param>
  120. /// <summary>
  121. /// <returns></returns>
  122. [HttpPost]
  123. [AjaxOnly]
  124. public ActionResult Qqualified(string keyValue,bool status)
  125. {
  126. var entity = mP_PerformanceTrackingIBLL.GetMP_ManageMentPlanEntity(keyValue);
  127. entity.MPConclusion = status?1:0;
  128. mP_PerformanceTrackingIBLL.SaveEntity(keyValue,entity);
  129. return Success("操作成功!");
  130. }
  131. /// <summary>
  132. /// 保存实体数据(新增、修改)
  133. /// <param name="keyValue">主键</param>
  134. /// <summary>
  135. /// <returns></returns>
  136. [HttpPost]
  137. [ValidateAntiForgeryToken]
  138. [AjaxOnly]
  139. public ActionResult SaveForm(string keyValue, string strEntity)
  140. {
  141. MP_ManageMentPlanEntity entity = strEntity.ToObject<MP_ManageMentPlanEntity>();
  142. entity.MPType = 1;
  143. mP_PerformanceTrackingIBLL.SaveEntity(keyValue, entity);
  144. return Success("保存成功!");
  145. }
  146. /// <summary>
  147. /// 保存实体数据(新增、修改)
  148. /// <param name="keyValue">主键</param>
  149. /// <summary>
  150. /// <returns></returns>
  151. [HttpPost]
  152. [ValidateAntiForgeryToken]
  153. [AjaxOnly]
  154. public ActionResult UploadForm(string keyValue, string strEntity)
  155. {
  156. MP_ManageMentPlanEntity entity = strEntity.ToObject<MP_ManageMentPlanEntity>();
  157. if (!string.IsNullOrEmpty(keyValue))
  158. {
  159. var entity2 = mP_PerformanceTrackingIBLL.GetMP_ManageMentPlanEntity(keyValue);
  160. if (!string.IsNullOrEmpty(entity.MPFileTwo))
  161. {
  162. entity.MPStatus = 0;//已提交
  163. entity.MPUploadTimes = $"{DateTime.Now.ToString()}, {entity2.MPUploadTimes}";
  164. entity.SUpdateTime = entity2.SUpdateTime + 1;
  165. }
  166. }
  167. else
  168. {
  169. entity.Create();
  170. if (!string.IsNullOrEmpty(entity.MPFileTwo))
  171. {
  172. entity.MPStatus = 0;//已提交
  173. entity.MPUploadTimes = DateTime.Now.ToString();
  174. entity.SUpdateTime = 1;
  175. entity.MPType = 1;
  176. }
  177. }
  178. entity.MPUploaderTwo = LoginUserInfo.Get().userId;
  179. mP_PerformanceTrackingIBLL.SaveEntity(keyValue, entity);
  180. return Success("提交成功!");
  181. }
  182. #endregion
  183. }
  184. }