From 2be19a911ab1f7bfcbdd686e03c5ac217ca88d34 Mon Sep 17 00:00:00 2001 From: zzj <31836194@qq.com> Date: Fri, 19 Jan 2024 16:30:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A3=80=E7=B4=A2=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=9F=E8=AE=A1=E5=AE=9E=E5=8F=91=E9=87=91?= =?UTF-8?q?=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Gz_AmountsController.cs | 5 ++-- .../Gz_Amounts/Gz_AmountsBLL.cs | 4 +-- .../Gz_Amounts/Gz_AmountsCols.cs | 2 ++ .../Gz_Amounts/Gz_AmountsIBLL.cs | 2 +- .../Gz_Amounts/Gz_AmountsService.cs | 26 ++++++++++--------- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs index b3b1f124b..9a4140f6d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs @@ -101,13 +101,14 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers public ActionResult GetPageListCol(string pagination, string queryJson) { Pagination paginationobj = pagination.ToObject(); - var data = gz_AmountsIBLL.GetPageListCol(paginationobj, queryJson); + var data = gz_AmountsIBLL.GetPageListCol(paginationobj, queryJson, out decimal totalSend); var jsonData = new { rows = data, total = paginationobj.total, page = paginationobj.page, - records = paginationobj.records + records = paginationobj.records, + totalSend }; return Success(jsonData); } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs index 72e14ca64..e03e4a243 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs @@ -172,11 +172,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } - public IEnumerable GetPageListCol(Pagination pagination, string queryJson) + public IEnumerable GetPageListCol(Pagination pagination, string queryJson, out decimal totalSend) { try { - return gz_AmountsService.GetPageListCol(pagination, queryJson); + return gz_AmountsService.GetPageListCol(pagination, queryJson, out decimal totalSend); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsCols.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsCols.cs index 3b634ca85..1dd8d2495 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsCols.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsCols.cs @@ -50,6 +50,8 @@ /// 实发合计 /// public string TotalSend { get; set; } + + public decimal TotalSendDecimal { get; set } /// /// 备注 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs index 51f43eca2..a9eab15a1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs @@ -56,7 +56,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement #region 自定义 (DataTable failDt, int snum, int fnum) ExecuteImportExcel(DataTable dt, string[] ignoreCol, List cols, List itemList, string fileGuid); - IEnumerable GetPageListCol(Pagination pagination, string queryJson); + IEnumerable GetPageListCol(Pagination pagination, string queryJson, out decimal totalSend); IEnumerable> GetAmountsDetail(string userNo, int year, int month); #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs index 178d99a31..10767fe58 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs @@ -212,7 +212,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement // 创建一个datatable容器用于保存导入失败的数据 DataTable failDt = new DataTable(); - + foreach (DataColumn dc in dt.Columns) { failDt.Columns.Add(dc.ColumnName, dc.DataType); @@ -259,7 +259,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement { dbm.Amount = amount; } - if(!hlist.Any(x=>x.Year==dbm.Year && x.Month==dbm.Month && x.UserNo==dbm.UserNo && x.ItemId==dbm.ItemId)) + if (!hlist.Any(x => x.Year == dbm.Year && x.Month == dbm.Month && x.UserNo == dbm.UserNo && x.ItemId == dbm.ItemId)) { addEntity.Add(dbm); } @@ -314,7 +314,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } - public IEnumerable GetPageListCol(Pagination pagination, string queryJson) + public IEnumerable GetPageListCol(Pagination pagination, string queryJson, out decimal totalSend) { try { @@ -327,7 +327,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement var qj = queryJson.ToJObject(); - if(!qj["time1"].IsEmpty()) + if (!qj["time1"].IsEmpty()) { var ts = Convert.ToDateTime(qj["time1"]); yearStart = ts.Year; @@ -343,7 +343,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement var items = this.BaseRepository("CollegeMIS").FindList(x => x.IsShow == true).ToList(); var xmId = items.FirstOrDefault(x => x.Name == "职员姓名").Id; - var deptCodeId= items.FirstOrDefault(x => x.Name == "部门代码").Id; + var deptCodeId = items.FirstOrDefault(x => x.Name == "部门代码").Id; var deptId = items.FirstOrDefault(x => x.Name == "部门名称").Id; var ptcId = items.FirstOrDefault(x => x.Name == "职员类型代码").Id; var ptId = items.FirstOrDefault(x => x.Name == "职员类型").Id; @@ -356,27 +356,29 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement var itemId = items.Select(x => x.Id).ToArray(); - var q = this.BaseRepository("CollegeMIS").FindList(x => itemId.Contains(x.ItemId) && ((yearStart==yearEnd && x.Year==yearStart && x.Month>=monthStart && x.Month<=monthEnd) ||(yearStart=monthStart) || (x.Year==yearEnd && x.Month<=monthEnd) || (x.Year>yearStart && x.Year(x => itemId.Contains(x.ItemId) && ((yearStart == yearEnd && x.Year == yearStart && x.Month >= monthStart && x.Month <= monthEnd) || (yearStart < yearEnd && (x.Year == yearStart && x.Month >= monthStart) || (x.Year == yearEnd && x.Month <= monthEnd) || (x.Year > yearStart && x.Year < yearEnd)))); + var query = q.GroupBy(x => new { x.UserNo, x.Year, x.Month }); pagination.records = query.Count(); - var ls = query.Select(x=>new Gz_AmountsCols {UserNo=x.Key.UserNo,Year=x.Key.Year??0,Month=x.Key.Month??0 ,RealName=x.FirstOrDefault(a=>a.ItemId==xmId)?.OriVal??"",DeptCode= x.FirstOrDefault(a => a.ItemId == deptCodeId)?.OriVal ?? "", DeptName= x.FirstOrDefault(a => a.ItemId == deptId)?.OriVal ?? "", PersonTypeCode= x.FirstOrDefault(a => a.ItemId == ptcId)?.OriVal ?? "", PersonType= x.FirstOrDefault(a => a.ItemId == ptId)?.OriVal ?? "", SendDate= x.FirstOrDefault(a => a.ItemId == sendId)?.OriVal ?? "", SendCount= x.FirstOrDefault(a => a.ItemId == sendCountId)?.OriVal ?? "", TotalDeduction= x.FirstOrDefault(a => a.ItemId == kchjId)?.OriVal ?? "", TotalSend= x.FirstOrDefault(a => a.ItemId == sfhjId)?.OriVal ?? "", Remark= x.FirstOrDefault(a => a.ItemId == bzId)?.OriVal ?? "", Reviewer= x.FirstOrDefault(a => a.ItemId == shrId)?.OriVal ?? "" }); + var ls = query.Select(x => new Gz_AmountsCols { UserNo = x.Key.UserNo, Year = x.Key.Year ?? 0, Month = x.Key.Month ?? 0, RealName = x.FirstOrDefault(a => a.ItemId == xmId)?.OriVal ?? "", DeptCode = x.FirstOrDefault(a => a.ItemId == deptCodeId)?.OriVal ?? "", DeptName = x.FirstOrDefault(a => a.ItemId == deptId)?.OriVal ?? "", PersonTypeCode = x.FirstOrDefault(a => a.ItemId == ptcId)?.OriVal ?? "", PersonType = x.FirstOrDefault(a => a.ItemId == ptId)?.OriVal ?? "", SendDate = x.FirstOrDefault(a => a.ItemId == sendId)?.OriVal ?? "", SendCount = x.FirstOrDefault(a => a.ItemId == sendCountId)?.OriVal ?? "", TotalDeduction = x.FirstOrDefault(a => a.ItemId == kchjId)?.OriVal ?? "", TotalSend = x.FirstOrDefault(a => a.ItemId == sfhjId)?.OriVal ?? "", TotalSendDecimal = x.FirstOrDefault(a => a.ItemId == sfhjId)?.Amount ?? 0, Remark = x.FirstOrDefault(a => a.ItemId == bzId)?.OriVal ?? "", Reviewer = x.FirstOrDefault(a => a.ItemId == shrId)?.OriVal ?? "" }); - if(!qj["keyword"].IsEmpty()) + if (!qj["keyword"].IsEmpty()) { var k = qj["keyword"].ToString(); ls = ls.Where(x => x.UserNo.Contains(k) || x.RealName.Contains(k)); } - if(!qj["value"].IsEmpty()) + if (!qj["department"].IsEmpty()) { var dept = qj["value"].ToString(); ls = ls.Where(x => x.DeptCode == dept); } + totalSend = ls.Sum(x => x.TotalSendDecimal); + var rs = ls.Skip(skip).Take(pagination.rows); return rs; - + } catch (Exception ex) { @@ -392,7 +394,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } - public IEnumerable> GetAmountsDetail(string userNo, int year, int month) + public IEnumerable> GetAmountsDetail(string userNo, int year, int month) { try {