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.
 
 
 
 
 
 

211 lines
6.1 KiB

  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 keyValueArr = keyValue.Split(',');
  127. foreach (var item in keyValueArr)
  128. {
  129. var entity = mP_PerformanceTrackingIBLL.GetMP_ManageMentPlanEntity(item);
  130. entity.MPConclusion = status ? 1 : 0;
  131. mP_PerformanceTrackingIBLL.SaveEntity(item, entity);
  132. }
  133. return Success("操作成功!");
  134. }
  135. /// <summary>
  136. /// 保存实体数据(新增、修改)
  137. /// <param name="keyValue">主键</param>
  138. /// <summary>
  139. /// <returns></returns>
  140. [HttpPost]
  141. [ValidateAntiForgeryToken]
  142. [AjaxOnly]
  143. public ActionResult SaveForm(string keyValue, string strEntity)
  144. {
  145. MP_ManageMentPlanEntity entity = strEntity.ToObject<MP_ManageMentPlanEntity>();
  146. entity.MPType = 1;
  147. mP_PerformanceTrackingIBLL.SaveEntity(keyValue, entity);
  148. return Success("保存成功!");
  149. }
  150. /// <summary>
  151. /// 保存实体数据(新增、修改)
  152. /// <param name="keyValue">主键</param>
  153. /// <summary>
  154. /// <returns></returns>
  155. [HttpPost]
  156. [ValidateAntiForgeryToken]
  157. [AjaxOnly]
  158. public ActionResult UploadForm(string keyValue, string strEntity)
  159. {
  160. MP_ManageMentPlanEntity entity = strEntity.ToObject<MP_ManageMentPlanEntity>();
  161. if (!string.IsNullOrEmpty(keyValue))
  162. {
  163. var entity2 = mP_PerformanceTrackingIBLL.GetMP_ManageMentPlanEntity(keyValue);
  164. if (!string.IsNullOrEmpty(entity.MPFileTwo))
  165. {
  166. entity.MPStatus = 0;//已提交
  167. entity.MPUploadTimes = $"{DateTime.Now.ToString()}, {entity2.MPUploadTimes}";
  168. entity.SUpdateTime = entity2.SUpdateTime + 1;
  169. }
  170. }
  171. else
  172. {
  173. entity.Create();
  174. if (!string.IsNullOrEmpty(entity.MPFileTwo))
  175. {
  176. entity.MPStatus = 0;//已提交
  177. entity.MPUploadTimes = DateTime.Now.ToString();
  178. entity.SUpdateTime = 1;
  179. entity.MPType = 1;
  180. }
  181. }
  182. entity.MPUploaderTwo = LoginUserInfo.Get().userId;
  183. mP_PerformanceTrackingIBLL.SaveEntity(keyValue, entity);
  184. return Success("提交成功!");
  185. }
  186. #endregion
  187. }
  188. }