diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Emp_PayrollController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Emp_PayrollController.cs index aa4fd4f9d..86ad349ed 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Emp_PayrollController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Emp_PayrollController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.PersonnelManagement; using System.Web.Mvc; using System.Collections.Generic; +using System.Linq; namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers { @@ -26,7 +27,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +36,17 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); + } + + /// + /// 工资条统计 + /// + /// + [HttpGet] + public ActionResult StatisticIndex() + { + return View(); } #endregion @@ -71,12 +82,79 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var EMP_PayrollData = emp_PayrollIBLL.GetEMP_PayrollEntity( keyValue ); - var jsonData = new { + var EMP_PayrollData = emp_PayrollIBLL.GetEMP_PayrollEntity(keyValue); + var jsonData = new + { EMP_Payroll = EMP_PayrollData, }; return Success(jsonData); } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetStatisticList(string queryJson) + { + var data = emp_PayrollIBLL.GetList(queryJson); + var datagroup = data.GroupBy(x => new { x.IssueMonth, x.IssueYear }).Select(x => new EMP_PayrollEntity + { + IssueYear = x.Key.IssueYear, + IssueMonth = x.Key.IssueMonth, + PostSalary = x.Select(y => y.PostSalary.ToDecimal()).Sum().ToString(), + PayWages = x.Select(y => y.PayWages.ToDecimal()).Sum().ToString(), + UpTenpercent = x.Select(y => y.UpTenpercent.ToDecimal()).Sum().ToString(), + SchoolSub = x.Select(y => y.SchoolSub.ToDecimal()).Sum().ToString(), + TemporarySub = x.Select(y => y.TemporarySub.ToDecimal()).Sum().ToString(), + RankWage = x.Select(y => y.RankWage.ToDecimal()).Sum().ToString(), + DifferentialSub = x.Select(y => y.DifferentialSub.ToDecimal()).Sum().ToString(), + MeritPay = x.Select(y => y.MeritPay.ToDecimal()).Sum().ToString(), + MeritPayLess = x.Select(y => y.MeritPayLess.ToDecimal()).Sum().ToString(), + MonthlyoneMerit = x.Select(y => y.MonthlyoneMerit.ToDecimal()).Sum().ToString(), + Tilt = x.Select(y => y.Tilt.ToDecimal()).Sum().ToString(), + Classfees = x.Select(y => y.Classfees.ToDecimal()).Sum().ToString(), + SuperClass = x.Select(y => y.SuperClass.ToDecimal()).Sum().ToString(), + TrainingDollars = x.Select(y => y.TrainingDollars.ToDecimal()).Sum().ToString(), + Bonus = x.Select(y => y.Bonus.ToDecimal()).Sum().ToString(), + BabySubsidies = x.Select(y => y.BabySubsidies.ToDecimal()).Sum().ToString(), + ClassTeacher = x.Select(y => y.ClassTeacher.ToDecimal()).Sum().ToString(), + KeyBenefits = x.Select(y => y.KeyBenefits.ToDecimal()).Sum().ToString(), + PositionFill = x.Select(y => y.PositionFill.ToDecimal()).Sum().ToString(), + OvertimePay = x.Select(y => y.OvertimePay.ToDecimal()).Sum().ToString(), + OnDutyfee = x.Select(y => y.OnDutyfee.ToDecimal()).Sum().ToString(), + ExaminationFee = x.Select(y => y.ExaminationFee.ToDecimal()).Sum().ToString(), + SecurityPay = x.Select(y => y.SecurityPay.ToDecimal()).Sum().ToString(), + MedicalBills = x.Select(y => y.MedicalBills.ToDecimal()).Sum().ToString(), + CoolingPurposes = x.Select(y => y.CoolingPurposes.ToDecimal()).Sum().ToString(), + HousSub = x.Select(y => y.HousSub.ToDecimal()).Sum().ToString(), + PropertySub = x.Select(y => y.PropertySub.ToDecimal()).Sum().ToString(), + HeatingSub = x.Select(y => y.HeatingSub.ToDecimal()).Sum().ToString(), + ComprehensiveSub = x.Select(y => y.ComprehensiveSub.ToDecimal()).Sum().ToString(), + ControlSub = x.Select(y => y.ControlSub.ToDecimal()).Sum().ToString(), + Replacement = x.Select(y => y.Replacement.ToDecimal()).Sum().ToString(), + SendSum = x.Select(y => y.SendSum.ToDecimal()).Sum().ToString(), + LossInsurance = x.Select(y => y.LossInsurance.ToDecimal()).Sum().ToString(), + Bartender = x.Select(y => y.Bartender.ToDecimal()).Sum().ToString(), + OcPension = x.Select(y => y.OcPension.ToDecimal()).Sum().ToString(), + HousFund = x.Select(y => y.HousFund.ToDecimal()).Sum().ToString(), + HealthCare = x.Select(y => y.HealthCare.ToDecimal()).Sum().ToString(), + TheRent = x.Select(y => y.TheRent.ToDecimal()).Sum().ToString(), + InternetFee = x.Select(y => y.InternetFee.ToDecimal()).Sum().ToString(), + AssDeductions = x.Select(y => y.AssDeductions.ToDecimal()).Sum().ToString(), + OtherDeductions = x.Select(y => y.OtherDeductions.ToDecimal()).Sum().ToString(), + WithBuckletax = x.Select(y => y.WithBuckletax.ToDecimal()).Sum().ToString(), + DeductionsSum = x.Select(y => y.DeductionsSum.ToDecimal()).Sum().ToString(), + TaxRevenue = x.Select(y => y.TaxRevenue.ToDecimal()).Sum().ToString(), + TaxIncome = x.Select(y => y.TaxIncome.ToDecimal()).Sum().ToString(), + NetCombined = x.Select(y => y.NetCombined.ToDecimal()).Sum().ToString() + }).OrderByDescending(x => x.IssueYear).ThenByDescending(x => x.IssueMonth); + + return Success(datagroup); + } #endregion #region 提交数据 @@ -105,7 +183,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { EMP_PayrollEntity entity = strEntity.ToObject(); - emp_PayrollIBLL.SaveEntity(keyValue,entity); + emp_PayrollIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Emp_Payroll/StatisticIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Emp_Payroll/StatisticIndex.cshtml new file mode 100644 index 000000000..3f8f00577 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Emp_Payroll/StatisticIndex.cshtml @@ -0,0 +1,45 @@ +@{ + ViewBag.Title = "工资条统计"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
年份
+
+
+
+
月份
+
+
+
+
姓名
+ +
+
+
部门
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ + +@Html.AppendJsFile("/Areas/PersonnelManagement/Views/Emp_Payroll/StatisticIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Emp_Payroll/StatisticIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Emp_Payroll/StatisticIndex.js new file mode 100644 index 000000000..2b37c82ec --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Emp_Payroll/StatisticIndex.js @@ -0,0 +1,111 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-04-21 15:42 + * 描 述:工资条统计 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + //年份 + $('#IssueYear').lrselect({ + allowSearch: true, + type: 'multiple', + url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetAcademicYear', + value: 'value', + text: 'text' + }); + $('#IssueMonth').lrDataItemSelect({ code: 'MPMonth', type: 'multiple' }); + $('#Department').lrselect({ + type: 'tree', + // 展开最大高度 + maxHeight: 200, + // 是否允许搜索 + allowSearch: true, + // 访问数据接口地址 + url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/PersonnelManagement/Emp_Payroll/GetStatisticList', + headData: [ + { label: "发放年份", name: "IssueYear", width: 100, align: "left" }, + { label: "发放月份", name: "IssueMonth", width: 100, align: "left" }, + { label: "岗位工资", name: "PostSalary", width: 100, align: "left", statistics: true }, + { label: "薪级工资", name: "PayWages", width: 100, align: "left", statistics: true }, + { label: "提高百分之十", name: "UpTenpercent", width: 100, align: "left", statistics: true }, + { label: "校内补贴", name: "SchoolSub", width: 100, align: "left", statistics: true }, + { label: "临时性补贴", name: "TemporarySub", width: 100, align: "left", statistics: true }, + { label: "职级工资", name: "RankWage", width: 100, align: "left", statistics: true }, + { label: "级差补贴", name: "DifferentialSub", width: 100, align: "left", statistics: true }, + { label: "绩效工资", name: "MeritPay", width: 100, align: "left", statistics: true }, + { label: "绩效工资减少额", name: "MeritPayLess", width: 100, align: "left", statistics: true }, + { label: "月发一次性绩效", name: "MonthlyoneMerit", width: 100, align: "left", statistics: true }, + { label: "倾斜", name: "Tilt", width: 100, align: "left", statistics: true }, + { label: "课时费", name: "Classfees", width: 100, align: "left", statistics: true }, + { label: "超课时", name: "SuperClass", width: 100, align: "left", statistics: true }, + { label: "培训课酬", name: "TrainingDollars", width: 100, align: "left", statistics: true }, + { label: "奖金", name: "Bonus", width: 100, align: "left", statistics: true }, + { label: "婴补", name: "BabySubsidies", width: 100, align: "left", statistics: true }, + { label: "班主任", name: "ClassTeacher", width: 100, align: "left", statistics: true }, + { label: "骨干津贴", name: "KeyBenefits", width: 100, align: "left", statistics: true }, + { label: "职务补", name: "PositionFill", width: 100, align: "left", statistics: true }, + { label: "加班费", name: "OvertimePay", width: 100, align: "left", statistics: true }, + { label: "值班费", name: "OnDutyfee", width: 100, align: "left", statistics: true }, + { label: "考务费", name: "ExaminationFee", width: 100, align: "left", statistics: true }, + { label: "安全绩效", name: "SecurityPay", width: 100, align: "left", statistics: true }, + { label: "医药费", name: "MedicalBills", width: 100, align: "left", statistics: true }, + { label: "防暑降温", name: "CoolingPurposes", width: 100, align: "left", statistics: true }, + { label: "房补", name: "HousSub", width: 100, align: "left", statistics: true }, + { label: "物业补贴", name: "PropertySub", width: 100, align: "left", statistics: true }, + { label: "采暖补贴", name: "HeatingSub", width: 100, align: "left", statistics: true }, + { label: "综合补助", name: "ComprehensiveSub", width: 100, align: "left", statistics: true }, + { label: "综治奖", name: "ControlSub", width: 100, align: "left", statistics: true }, + { label: "补发", name: "Replacement", width: 100, align: "left", statistics: true }, + { label: "应发合计", name: "SendSum", width: 100, align: "left", statistics: true }, + { label: "失保", name: "LossInsurance", width: 100, align: "left", statistics: true }, + { label: "养保", name: "Bartender", width: 100, align: "left", statistics: true }, + { label: "职业年金", name: "OcPension", width: 100, align: "left", statistics: true }, + { label: "房积金", name: "HousFund", width: 100, align: "left", statistics: true }, + { label: "医保", name: "HealthCare", width: 100, align: "left", statistics: true }, + { label: "房租", name: "TheRent", width: 100, align: "left", statistics: true }, + { label: "网费", name: "InternetFee", width: 100, align: "left", statistics: true }, + { label: "考核扣款", name: "AssDeductions", width: 100, align: "left", statistics: true }, + { label: "其他扣款", name: "OtherDeductions", width: 100, align: "left", statistics: true }, + { label: "代扣个税", name: "WithBuckletax", width: 100, align: "left", statistics: true }, + { label: "扣款合计", name: "DeductionsSum", width: 100, align: "left", statistics: true }, + { label: "纳税收入", name: "TaxRevenue", width: 100, align: "left", statistics: true }, + { label: "免税收入", name: "TaxIncome", width: 100, align: "left", statistics: true }, + { label: "应发合计", name: "NetCombined", width: 100, align: "left", statistics: true }, + ], + mainId: 'SalaryID', + isPage: false + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index e0f4d6eae..8483e3efa 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -1377,6 +1377,7 @@ + @@ -7172,6 +7173,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Emp_Payroll/Emp_PayrollBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Emp_Payroll/Emp_PayrollBLL.cs index 53e96429c..3e05910e8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Emp_Payroll/Emp_PayrollBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Emp_Payroll/Emp_PayrollBLL.cs @@ -67,6 +67,31 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + return emp_PayrollService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Emp_Payroll/Emp_PayrollIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Emp_Payroll/Emp_PayrollIBLL.cs index 918e6dfd3..741a2374a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Emp_Payroll/Emp_PayrollIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Emp_Payroll/Emp_PayrollIBLL.cs @@ -27,6 +27,14 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 主键 /// EMP_PayrollEntity GetEMP_PayrollEntity(string keyValue); + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + IEnumerable GetList(string queryJson); #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Emp_Payroll/Emp_PayrollService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Emp_Payroll/Emp_PayrollService.cs index 6e6a687e0..9329ce4ec 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Emp_Payroll/Emp_PayrollService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Emp_Payroll/Emp_PayrollService.cs @@ -96,6 +96,71 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.* "); + strSql.Append(" FROM EMP_Payroll t"); + strSql.Append(" left join EmpInfo e on t.SalaryID=e.SalaryNumber "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["IssueYear"].IsEmpty()) + { + var strArr = queryParam["IssueYear"].ToString().Split(','); + var strs = ""; + foreach (var item in strArr) + { + strs += $"'{item}',"; + } + strs = strs.TrimEnd(','); + strSql.Append($" AND t.IssueYear in ({strs}) "); + } + if (!queryParam["IssueMonth"].IsEmpty()) + { + var strArr = queryParam["IssueMonth"].ToString().Split(','); + var strs = ""; + foreach (var item in strArr) + { + strs += $"'{item}',"; + } + strs = strs.TrimEnd(','); + strSql.Append($" AND t.IssueMonth in ({strs}) "); + } + if (!queryParam["SalaryName"].IsEmpty()) + { + dp.Add("SalaryName", "%" + queryParam["SalaryName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.SalaryName Like @SalaryName "); + } + if (!queryParam["Department"].IsEmpty()) + { + dp.Add("Department", queryParam["Department"].ToString(), DbType.String); + strSql.Append(" AND e.F_DepartmentId = @Department "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion #region 提交数据