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.
 
 
 
 
 
 

215 lines
5.9 KiB

  1. using Learun.Application.TwoDevelopment.EducationalAdministration;
  2. using Learun.Util;
  3. using System;
  4. using System.Data;
  5. using System.IO;
  6. using System.Web.Mvc;
  7. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  11. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2022-11-07 11:54
  14. /// 描 述:工资条
  15. /// </summary>
  16. public class WageScheduleController : MvcControllerBase
  17. {
  18. private WageScheduleIBLL wageScheduleIBLL = new WageScheduleBLL();
  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 IndexPrint()
  35. {
  36. return View();
  37. }
  38. /// <summary>
  39. /// 我的工资条
  40. /// </summary>
  41. /// <returns></returns>
  42. [HttpGet]
  43. public ActionResult IndexMy()
  44. {
  45. return View();
  46. }
  47. /// <summary>
  48. /// 表单页
  49. /// </summary>
  50. /// <returns></returns>
  51. [HttpGet]
  52. public ActionResult Form()
  53. {
  54. return View();
  55. }
  56. /// <summary>
  57. /// 导入页面
  58. /// <summary>
  59. /// <returns></returns>
  60. [HttpGet]
  61. public ActionResult ImportForm()
  62. {
  63. return View();
  64. }
  65. #endregion
  66. #region 获取数据
  67. /// <summary>
  68. /// 人员类别
  69. /// </summary>
  70. /// <returns></returns>
  71. public ActionResult PeopleType()
  72. {
  73. var data = wageScheduleIBLL.GetPeopleType();
  74. return Success(data);
  75. }
  76. /// <summary>
  77. /// 岗位类别
  78. /// </summary>
  79. /// <returns></returns>
  80. public ActionResult PostType()
  81. {
  82. var data = wageScheduleIBLL.GetPostType();
  83. return Success(data);
  84. }
  85. /// <summary>
  86. /// 薪级
  87. /// </summary>
  88. /// <returns></returns>
  89. public ActionResult PayGrade()
  90. {
  91. var data = wageScheduleIBLL.GetPayGrade();
  92. return Success(data);
  93. }
  94. /// <summary>
  95. /// 获取列表数据
  96. /// </summary>
  97. /// <param name="queryJson">查询参数</param>
  98. /// <returns></returns>
  99. [HttpGet]
  100. [AjaxOnly]
  101. public ActionResult GetList(string queryJson)
  102. {
  103. var data = wageScheduleIBLL.GetList(queryJson);
  104. return Success(data);
  105. }
  106. /// <summary>
  107. /// 获取列表分页数据
  108. /// </summary>
  109. /// <param name="pagination">分页参数</param>
  110. /// <param name="queryJson">查询参数</param>
  111. /// <returns></returns>
  112. [HttpGet]
  113. [AjaxOnly]
  114. public ActionResult GetPageList(string pagination, string queryJson)
  115. {
  116. Pagination paginationobj = pagination.ToObject<Pagination>();
  117. var data = wageScheduleIBLL.GetPageList(paginationobj, queryJson);
  118. var jsonData = new
  119. {
  120. rows = data,
  121. total = paginationobj.total,
  122. page = paginationobj.page,
  123. records = paginationobj.records
  124. };
  125. return Success(jsonData);
  126. }
  127. /// <summary>
  128. /// 获取表单数据
  129. /// </summary>
  130. /// <param name="keyValue">主键</param>
  131. /// <returns></returns>
  132. [HttpGet]
  133. [AjaxOnly]
  134. public ActionResult GetFormData(string keyValue)
  135. {
  136. var WageScheduleData = wageScheduleIBLL.GetEntity(keyValue);
  137. var jsonData = new
  138. {
  139. WageSchedule = WageScheduleData,
  140. };
  141. return Success(jsonData);
  142. }
  143. #endregion
  144. #region 提交数据
  145. /// <summary>
  146. /// 删除实体数据
  147. /// </summary>
  148. /// <param name="keyValue">主键</param>
  149. /// <returns></returns>
  150. [HttpPost]
  151. [AjaxOnly]
  152. public ActionResult DeleteForm(string keyValue)
  153. {
  154. wageScheduleIBLL.DeleteEntity(keyValue);
  155. return Success("删除成功!");
  156. }
  157. /// <summary>
  158. /// 保存实体数据(新增、修改)
  159. /// </summary>
  160. /// <param name="keyValue">主键</param>
  161. /// <param name="entity">实体</param>
  162. /// <returns></returns>
  163. [HttpPost]
  164. [ValidateAntiForgeryToken]
  165. [AjaxOnly]
  166. public ActionResult SaveForm(string keyValue, WageScheduleEntity entity)
  167. {
  168. wageScheduleIBLL.SaveEntity(keyValue, entity);
  169. return Success("保存成功!");
  170. }
  171. #endregion
  172. #region 扩展代码
  173. [HttpPost]
  174. [AjaxOnly]
  175. public ActionResult CheckForm(string keyValue,string Status)
  176. {
  177. wageScheduleIBLL.CheckEntity(keyValue, Status);
  178. return Success("审核成功!");
  179. }
  180. /// <summary>
  181. /// 下载文件
  182. /// </summary>
  183. /// <returns></returns>
  184. public ActionResult DownTemplate()
  185. {
  186. FileStreamResult result = null;
  187. try
  188. {
  189. var path = Server.MapPath("~/Content/excel/");
  190. var pathoffull = path + "SalarySheetImport.xls";
  191. FileStream fsread = fsread = new FileStream(pathoffull, FileMode.OpenOrCreate, FileAccess.ReadWrite);
  192. result = File(fsread, "application/ms-excel", "工资条导入.xls");
  193. return result;
  194. }
  195. catch (Exception ex)
  196. {
  197. return null;
  198. }
  199. }
  200. #endregion
  201. }
  202. }