|
|
@@ -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<Gz_AmountsCols> GetPageListCol(Pagination pagination, string queryJson) |
|
|
|
public IEnumerable<Gz_AmountsCols> 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<Gz_ItemsEntity>(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<Gz_AmountsEntity>(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 q = this.BaseRepository("CollegeMIS").FindList<Gz_AmountsEntity>(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<Tuple<string,string>> GetAmountsDetail(string userNo, int year, int month) |
|
|
|
public IEnumerable<Tuple<string, string>> GetAmountsDetail(string userNo, int year, int month) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|