|
|
@@ -181,25 +181,26 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void DeleteEntity(string[] userNo, int[] year, int[] month) |
|
|
|
public void DeleteEntity(string[] userNo, int[] year, int[] month, string[] sendCount) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
this.BaseRepository("CollegeMIS").BeginTrans(); |
|
|
|
|
|
|
|
if(userNo.Any()) |
|
|
|
if (userNo.Any()) |
|
|
|
{ |
|
|
|
for (int i = 0; i < userNo.Length; i++) |
|
|
|
{ |
|
|
|
var u = userNo[i]; |
|
|
|
var y = year[i]; |
|
|
|
var m = month[i]; |
|
|
|
this.BaseRepository("CollegeMIS").Delete<Gz_AmountsEntity>(t => t.UserNo == u && t.Year == y && t.Month == m); |
|
|
|
var c = sendCount[i]; |
|
|
|
this.BaseRepository("CollegeMIS").Delete<Gz_AmountsEntity>(t => t.UserNo == u && t.Year == y && t.Month == m && t.SendCount == c); |
|
|
|
} |
|
|
|
this.BaseRepository("CollegeMIS").Commit(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
@@ -282,8 +283,9 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement |
|
|
|
var y = dr["发放年份"].ToString().Trim(); |
|
|
|
var m = dr["发放月份"].ToString().Trim(); |
|
|
|
var u = dr["职员代码"].ToString().Trim(); |
|
|
|
var c = dr["发放次数"].ToString().Trim(); |
|
|
|
|
|
|
|
if (y.IsEmpty() || m.IsEmpty() || u.IsEmpty() || !int.TryParse(y, out var year) || !int.TryParse(m, out var month)) |
|
|
|
if (y.IsEmpty() || m.IsEmpty() || u.IsEmpty() || c.IsEmpty() || !int.TryParse(y, out var year) || !int.TryParse(m, out var month)) |
|
|
|
{ |
|
|
|
dr["导入错误"] = "数据异常:年份、月份、职员代码不可为空且年月为数字"; |
|
|
|
failDt.Rows.Add(dr.ItemArray); |
|
|
@@ -292,7 +294,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement |
|
|
|
else |
|
|
|
{ |
|
|
|
var itemId = itemList.Select(x => x.Id).ToArray(); |
|
|
|
var hlist = this.BaseRepository("CollegeMIS").FindList<Gz_AmountsEntity>(x => x.Year == year && x.Month == month && x.UserNo == u && itemId.Contains(x.ItemId)).ToList(); |
|
|
|
var hlist = this.BaseRepository("CollegeMIS").FindList<Gz_AmountsEntity>(x => x.Year == year && x.Month == month && x.UserNo == u && x.SendCount == c && itemId.Contains(x.ItemId)).ToList(); |
|
|
|
foreach (var item in cols) |
|
|
|
{ |
|
|
|
var val = dr[item].ToString().Trim(); |
|
|
@@ -307,13 +309,14 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement |
|
|
|
dbm.Year = year; |
|
|
|
dbm.Month = month; |
|
|
|
dbm.UserNo = u; |
|
|
|
dbm.SendCount = c; |
|
|
|
dbm.ItemId = itemEntity.Id; |
|
|
|
dbm.OriVal = val; |
|
|
|
if (cvb) |
|
|
|
{ |
|
|
|
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.SendCount == dbm.SendCount && x.ItemId == dbm.ItemId)) |
|
|
|
{ |
|
|
|
if ((cvb && amount > 0) || !cvb) |
|
|
|
{ |
|
|
@@ -571,7 +574,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement |
|
|
|
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 sendCountId = items.FirstOrDefault(x => x.Name == "发放次数")?.Id ?? "发放次数"; |
|
|
|
var kchjId = items.FirstOrDefault(x => x.Name == "扣款合计")?.Id ?? "扣款合计"; |
|
|
|
var sfhjId = items.FirstOrDefault(x => x.Name == "实发合计")?.Id ?? "实发合计"; |
|
|
|
var yfhjId = items.FirstOrDefault(x => x.Name == "应发合计")?.Id ?? "应发合计"; |
|
|
@@ -587,10 +590,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement |
|
|
|
q = q.Where(x => x.UserNo == userNo); |
|
|
|
} |
|
|
|
|
|
|
|
var query = q.GroupBy(x => new { x.UserNo, x.Year, x.Month }); |
|
|
|
var query = q.GroupBy(x => new { x.UserNo, x.Year, x.Month, x.SendCount }); |
|
|
|
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 ?? "", 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 ?? "", TotalPay = x.FirstOrDefault(a => a.ItemId == yfhjId)?.OriVal ?? "" }); |
|
|
|
var ls = query.Select(x => new Gz_AmountsCols { UserNo = x.Key.UserNo, Year = x.Key.Year ?? 0, Month = x.Key.Month ?? 0, SendCount = x.Key.SendCount, RealName = x.FirstOrDefault(a => a.ItemId == xmId)?.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 ?? "", 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 ?? "", TotalPay = x.FirstOrDefault(a => a.ItemId == yfhjId)?.OriVal ?? "" }); |
|
|
|
|
|
|
|
if (!kw.IsEmpty()) |
|
|
|
{ |
|
|
|