From c4a20ef6d9c21fddddf774aaafa96f9116de7efa Mon Sep 17 00:00:00 2001 From: zzj <31836194@qq.com> Date: Wed, 24 Jan 2024 15:37:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B7=A5=E8=B5=84=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=92=E5=BA=8F=E5=B1=95=E7=A4=BA=E3=80=81=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=97=B6=E8=87=AA=E5=8A=A8=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Gz_Amounts/Gz_AmountsBLL.cs | 2 +- .../Gz_Amounts/Gz_AmountsIBLL.cs | 2 +- .../Gz_Amounts/Gz_AmountsService.cs | 50 +++++++++---------- .../Gz_Items/Gz_ItemsService.cs | 12 ++++- 4 files changed, 37 insertions(+), 29 deletions(-) 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 9d5f6ec0b..c39e3bd0f 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 @@ -191,7 +191,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } - public IEnumerable> GetAmountsDetail(string userNo, int year, int month, int show) + public IEnumerable> GetAmountsDetail(string userNo, int year, int month, int show) { try { 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 9e8efd1ec..1bd82c9e6 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 @@ -61,7 +61,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement IEnumerable GetPageListCol(Pagination pagination, string queryJson, string userNo); - IEnumerable> GetAmountsDetail(string userNo, int year, int month, int show); + IEnumerable> GetAmountsDetail(string userNo, int year, int month, int show); #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 32ef8a3e5..2fd72e679 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 @@ -344,17 +344,17 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement if (items.Any()) { - var xmId = 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; - var sendId = items.FirstOrDefault(x => x.Name == "发放时间").Id; - var sendCountId = items.FirstOrDefault(x => x.Name == "发放次数").Id; - var kchjId = items.FirstOrDefault(x => x.Name == "扣款合计").Id; - var sfhjId = items.FirstOrDefault(x => x.Name == "实发合计").Id; - var bzId = items.FirstOrDefault(x => x.Name == "备注").Id; - var shrId = items.FirstOrDefault(x => x.Name == "审核人").Id; + var xmId = 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 ?? "职员类型"; + var sendId = items.FirstOrDefault(x => x.Name == "发放时间")?.Id ?? "发放时间"; + var sendCountId = items.FirstOrDefault(x => x.Name == "发放次数")?.Id ?? "发放次数"; + var kchjId = items.FirstOrDefault(x => x.Name == "扣款合计")?.Id ?? "扣款合计"; + var sfhjId = items.FirstOrDefault(x => x.Name == "实发合计")?.Id ?? "实发合计"; + var bzId = items.FirstOrDefault(x => x.Name == "备注")?.Id ?? "备注"; + var shrId = items.FirstOrDefault(x => x.Name == "审核人")?.Id ?? "审核人"; var itemId = items.Select(x => x.Id).ToArray(); @@ -402,13 +402,13 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } - public IEnumerable> GetAmountsDetail(string userNo, int year, int month, int show) + public IEnumerable> GetAmountsDetail(string userNo, int year, int month, int show) { try { - var items = this.BaseRepository("CollegeMIS").FindList(x => x.IsShow == (show==1)).ToList(); + var items = this.BaseRepository("CollegeMIS").FindList(x => x.IsShow == (show == 1)).OrderBy(x => x.ShowOrder).ToList(); var itemId = items.Select(x => x.Id).ToArray(); - var query = this.BaseRepository("CollegeMIS").FindList(x => itemId.Contains(x.ItemId) && x.Year == year && x.Month == month && x.UserNo == userNo).Join(items, a => a.ItemId, b => b.Id, (a, b) => new Tuple(b.Name, a.OriVal)); + var query = this.BaseRepository("CollegeMIS").FindList(x => itemId.Contains(x.ItemId) && x.Year == year && x.Month == month && x.UserNo == userNo).Join(items, a => a.ItemId, b => b.Id, (a, b) => new Tuple(b.Name, a.OriVal, b.ShowOrder ?? 0)).OrderBy(x => x.Item3); return query; } catch (Exception ex) @@ -453,17 +453,17 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement var items = this.BaseRepository("CollegeMIS").FindList(x => x.IsShow == true).ToList(); if (items.Any()) { - var xmId = 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; - var sendId = items.FirstOrDefault(x => x.Name == "发放时间").Id; - var sendCountId = items.FirstOrDefault(x => x.Name == "发放次数").Id; - var kchjId = items.FirstOrDefault(x => x.Name == "扣款合计").Id; - var sfhjId = items.FirstOrDefault(x => x.Name == "实发合计").Id; - var bzId = items.FirstOrDefault(x => x.Name == "备注").Id; - var shrId = items.FirstOrDefault(x => x.Name == "审核人").Id; + var xmId = 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 ?? "职员类型"; + var sendId = items.FirstOrDefault(x => x.Name == "发放时间")?.Id ?? "发放时间"; + var sendCountId = items.FirstOrDefault(x => x.Name == "发放次数")?.Id ?? "发放次数"; + var kchjId = items.FirstOrDefault(x => x.Name == "扣款合计")?.Id ?? "扣款合计"; + var sfhjId = items.FirstOrDefault(x => x.Name == "实发合计")?.Id ?? "实发合计"; + var bzId = items.FirstOrDefault(x => x.Name == "备注")?.Id ?? "备注"; + var shrId = items.FirstOrDefault(x => x.Name == "审核人")?.Id ?? "审核人"; var itemId = items.Select(x => x.Id).ToArray(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Items/Gz_ItemsService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Items/Gz_ItemsService.cs index 55506c443..257eadd43 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Items/Gz_ItemsService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Items/Gz_ItemsService.cs @@ -92,7 +92,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } pagination.records = query.Count(); - query = query.Skip(skip).Take(pagination.rows); + query = query.OrderBy(x=>x.ShowOrder).Skip(skip).Take(pagination.rows); return query; } @@ -207,11 +207,19 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement { var ls = this.BaseRepository("CollegeMIS").FindList(); var lsName = ls.Select(x => x.Name).ToList(); + var iCount = lsName.Count; var exc = cols.Except(lsName); var addLs = new List(); + var i = iCount + 100; if (exc.Any()) { - addLs = exc.Select(x => new Gz_ItemsEntity { Name = x, Id = Guid.NewGuid().ToString() }).ToList(); + foreach (var x in exc) + { + i++; + var adm = new Gz_ItemsEntity { Name = x, Id = Guid.NewGuid().ToString(), ShowOrder = i }; + addLs.Add(adm); + } + //addLs = exc.Select(x => new Gz_ItemsEntity { Name = x, Id = Guid.NewGuid().ToString() }).ToList(); var r = this.BaseRepository("CollegeMIS").Insert(addLs); } return ls.Union(addLs).ToList();