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.
 
 
 
 
 
 

196 lines
8.4 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.PersonnelManagement;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  11. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2021-04-21 15:42
  14. /// 描 述:工资条
  15. /// </summary>
  16. public class Emp_PayrollController : MvcControllerBase
  17. {
  18. private Emp_PayrollIBLL emp_PayrollIBLL = new Emp_PayrollBLL();
  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 Form()
  35. {
  36. return View();
  37. }
  38. /// <summary>
  39. /// 工资条统计
  40. /// <summary>
  41. /// <returns></returns>
  42. [HttpGet]
  43. public ActionResult StatisticIndex()
  44. {
  45. return View();
  46. }
  47. #endregion
  48. #region 获取数据
  49. /// <summary>
  50. /// 获取页面显示列表数据
  51. /// </summary>
  52. /// <param name="pagination">分页参数</param>
  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 = emp_PayrollIBLL.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. /// <param name="keyValue">主键</param>
  74. /// <returns></returns>
  75. [HttpGet]
  76. [AjaxOnly]
  77. public ActionResult GetFormData(string keyValue)
  78. {
  79. var EMP_PayrollData = emp_PayrollIBLL.GetEMP_PayrollEntity(keyValue);
  80. var jsonData = new
  81. {
  82. EMP_Payroll = EMP_PayrollData,
  83. };
  84. return Success(jsonData);
  85. }
  86. /// <summary>
  87. /// 获取页面显示列表数据
  88. /// </summary>
  89. /// <param name="pagination">分页参数</param>
  90. /// <param name="queryJson">查询参数</param>
  91. /// <returns></returns>
  92. [HttpGet]
  93. [AjaxOnly]
  94. public ActionResult GetStatisticList(string queryJson)
  95. {
  96. var data = emp_PayrollIBLL.GetList(queryJson);
  97. var datagroup = data.GroupBy(x => new { x.IssueMonth, x.IssueYear }).Select(x => new EMP_PayrollEntity
  98. {
  99. IssueYear = x.Key.IssueYear,
  100. IssueMonth = x.Key.IssueMonth,
  101. PostSalary = x.Select(y => y.PostSalary.ToDecimal()).Sum().ToString(),
  102. PayWages = x.Select(y => y.PayWages.ToDecimal()).Sum().ToString(),
  103. UpTenpercent = x.Select(y => y.UpTenpercent.ToDecimal()).Sum().ToString(),
  104. SchoolSub = x.Select(y => y.SchoolSub.ToDecimal()).Sum().ToString(),
  105. TemporarySub = x.Select(y => y.TemporarySub.ToDecimal()).Sum().ToString(),
  106. RankWage = x.Select(y => y.RankWage.ToDecimal()).Sum().ToString(),
  107. DifferentialSub = x.Select(y => y.DifferentialSub.ToDecimal()).Sum().ToString(),
  108. MeritPay = x.Select(y => y.MeritPay.ToDecimal()).Sum().ToString(),
  109. MeritPayLess = x.Select(y => y.MeritPayLess.ToDecimal()).Sum().ToString(),
  110. MonthlyoneMerit = x.Select(y => y.MonthlyoneMerit.ToDecimal()).Sum().ToString(),
  111. Tilt = x.Select(y => y.Tilt.ToDecimal()).Sum().ToString(),
  112. Classfees = x.Select(y => y.Classfees.ToDecimal()).Sum().ToString(),
  113. SuperClass = x.Select(y => y.SuperClass.ToDecimal()).Sum().ToString(),
  114. TrainingDollars = x.Select(y => y.TrainingDollars.ToDecimal()).Sum().ToString(),
  115. Bonus = x.Select(y => y.Bonus.ToDecimal()).Sum().ToString(),
  116. BabySubsidies = x.Select(y => y.BabySubsidies.ToDecimal()).Sum().ToString(),
  117. ClassTeacher = x.Select(y => y.ClassTeacher.ToDecimal()).Sum().ToString(),
  118. KeyBenefits = x.Select(y => y.KeyBenefits.ToDecimal()).Sum().ToString(),
  119. PositionFill = x.Select(y => y.PositionFill.ToDecimal()).Sum().ToString(),
  120. OvertimePay = x.Select(y => y.OvertimePay.ToDecimal()).Sum().ToString(),
  121. OnDutyfee = x.Select(y => y.OnDutyfee.ToDecimal()).Sum().ToString(),
  122. ExaminationFee = x.Select(y => y.ExaminationFee.ToDecimal()).Sum().ToString(),
  123. SecurityPay = x.Select(y => y.SecurityPay.ToDecimal()).Sum().ToString(),
  124. MedicalBills = x.Select(y => y.MedicalBills.ToDecimal()).Sum().ToString(),
  125. CoolingPurposes = x.Select(y => y.CoolingPurposes.ToDecimal()).Sum().ToString(),
  126. HousSub = x.Select(y => y.HousSub.ToDecimal()).Sum().ToString(),
  127. PropertySub = x.Select(y => y.PropertySub.ToDecimal()).Sum().ToString(),
  128. HeatingSub = x.Select(y => y.HeatingSub.ToDecimal()).Sum().ToString(),
  129. ComprehensiveSub = x.Select(y => y.ComprehensiveSub.ToDecimal()).Sum().ToString(),
  130. ControlSub = x.Select(y => y.ControlSub.ToDecimal()).Sum().ToString(),
  131. Replacement = x.Select(y => y.Replacement.ToDecimal()).Sum().ToString(),
  132. SendSum = x.Select(y => y.SendSum.ToDecimal()).Sum().ToString(),
  133. LossInsurance = x.Select(y => y.LossInsurance.ToDecimal()).Sum().ToString(),
  134. Bartender = x.Select(y => y.Bartender.ToDecimal()).Sum().ToString(),
  135. OcPension = x.Select(y => y.OcPension.ToDecimal()).Sum().ToString(),
  136. HousFund = x.Select(y => y.HousFund.ToDecimal()).Sum().ToString(),
  137. HealthCare = x.Select(y => y.HealthCare.ToDecimal()).Sum().ToString(),
  138. TheRent = x.Select(y => y.TheRent.ToDecimal()).Sum().ToString(),
  139. InternetFee = x.Select(y => y.InternetFee.ToDecimal()).Sum().ToString(),
  140. AssDeductions = x.Select(y => y.AssDeductions.ToDecimal()).Sum().ToString(),
  141. OtherDeductions = x.Select(y => y.OtherDeductions.ToDecimal()).Sum().ToString(),
  142. WithBuckletax = x.Select(y => y.WithBuckletax.ToDecimal()).Sum().ToString(),
  143. DeductionsSum = x.Select(y => y.DeductionsSum.ToDecimal()).Sum().ToString(),
  144. TaxRevenue = x.Select(y => y.TaxRevenue.ToDecimal()).Sum().ToString(),
  145. TaxIncome = x.Select(y => y.TaxIncome.ToDecimal()).Sum().ToString(),
  146. NetCombined = x.Select(y => y.NetCombined.ToDecimal()).Sum().ToString()
  147. }).OrderByDescending(x => x.IssueYear).ThenByDescending(x => x.IssueMonth);
  148. return Success(datagroup);
  149. }
  150. #endregion
  151. #region 提交数据
  152. /// <summary>
  153. /// 删除实体数据
  154. /// </summary>
  155. /// <param name="keyValue">主键</param>
  156. /// <returns></returns>
  157. [HttpPost]
  158. [AjaxOnly]
  159. public ActionResult DeleteForm(string keyValue)
  160. {
  161. emp_PayrollIBLL.DeleteEntity(keyValue);
  162. return Success("删除成功!");
  163. }
  164. /// <summary>
  165. /// 保存实体数据(新增、修改)
  166. /// </summary>
  167. /// <param name="keyValue">主键</param>
  168. /// <param name="strEntity">实体</param>
  169. /// <returns></returns>
  170. [HttpPost]
  171. [ValidateAntiForgeryToken]
  172. [AjaxOnly]
  173. public ActionResult SaveForm(string keyValue, string strEntity)
  174. {
  175. EMP_PayrollEntity entity = strEntity.ToObject<EMP_PayrollEntity>();
  176. emp_PayrollIBLL.SaveEntity(keyValue, entity);
  177. if (string.IsNullOrEmpty(keyValue))
  178. {
  179. }
  180. return Success("保存成功!");
  181. }
  182. #endregion
  183. }
  184. }