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();