|
@@ -449,6 +449,47 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<List<Tuple<string, string, int>>> GetAmountsDetail(string userNo, int year, int month, int show) |
|
|
|
|
|
{ |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
var rs = new List<List<Tuple<string, string, int>>>(); |
|
|
|
|
|
var items = this.BaseRepository("CollegeMIS").FindList<Gz_ItemsEntity>(x => x.IsShow == (show == 1)).OrderBy(x => x.ShowOrder).ToList(); |
|
|
|
|
|
var itemId = items.Select(x => x.Id).ToArray(); |
|
|
|
|
|
//var query = this.BaseRepository("CollegeMIS").FindList<Gz_AmountsEntity>(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<string, string, int>(b.Name, a.OriVal, b.ShowOrder ?? 0)).OrderBy(x => x.Item3); |
|
|
|
|
|
|
|
|
|
|
|
var query = this.BaseRepository("CollegeMIS").FindList<Gz_AmountsEntity>(x => itemId.Contains(x.ItemId) && x.UserNo == userNo && x.Year == year && x.Month == month).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
if (query.Any()) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
var ls = query.GroupBy(x => x.SendCount).ToDictionary(x => x.Key, a => a.ToList()); |
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in ls.Keys) |
|
|
|
|
|
{ |
|
|
|
|
|
var dl = ls[item].Join(items, a => a.ItemId, b => b.Id, (a, b) => new Tuple<string, string, int>(b.Name, a.OriVal, b.ShowOrder ?? 0)).OrderBy(x => x.Item3).ToList(); |
|
|
|
|
|
dl.Add(new Tuple<string, string, int>("发放次数", item, 0)); |
|
|
|
|
|
rs.Add(dl); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//query.Join(items, a => a.ItemId, b => b.Id, (a, b) => new Tuple<string, string, int>(b.Name, a.OriVal, b.ShowOrder ?? 0)).OrderBy(x => x.Item3); |
|
|
|
|
|
//return rs; |
|
|
|
|
|
} |
|
|
|
|
|
return rs; |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
if (ex is ExceptionEx) |
|
|
|
|
|
{ |
|
|
|
|
|
throw; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
throw ExceptionEx.ThrowBusinessException(ex); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public IEnumerable<Gz_AmountsCols> GetPageListCol(Pagination pagination, string queryJson, string userNo) |
|
|
public IEnumerable<Gz_AmountsCols> GetPageListCol(Pagination pagination, string queryJson, string userNo) |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
@@ -526,28 +567,42 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
public IEnumerable<Tuple<string, string, int>> GetAmountsCurrent(string userNo, out int year, out int month) |
|
|
|
|
|
|
|
|
public List<List<Tuple<string, string, int>>> GetAmountsCurrent(string userNo, out int year, out int month) |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
var items = this.BaseRepository("CollegeMIS").FindList<Gz_ItemsEntity>(x => x.IsShow == true).OrderBy(x => x.ShowOrder).ToList(); |
|
|
var items = this.BaseRepository("CollegeMIS").FindList<Gz_ItemsEntity>(x => x.IsShow == true).OrderBy(x => x.ShowOrder).ToList(); |
|
|
var itemId = items.Select(x => x.Id).ToArray(); |
|
|
var itemId = items.Select(x => x.Id).ToArray(); |
|
|
var c = itemId.Length; |
|
|
|
|
|
|
|
|
//var c = itemId.Length; |
|
|
var query = this.BaseRepository("CollegeMIS").FindList<Gz_AmountsEntity>(x => itemId.Contains(x.ItemId) && x.UserNo == userNo).GroupBy(x=> new { x.Year,x.Month}).Take(1).ToList(); |
|
|
var query = this.BaseRepository("CollegeMIS").FindList<Gz_AmountsEntity>(x => itemId.Contains(x.ItemId) && x.UserNo == userNo).GroupBy(x=> new { x.Year,x.Month}).Take(1).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
var rs = new List<List<Tuple<string, string, int>>>(); |
|
|
|
|
|
|
|
|
if (query.Any()) |
|
|
if (query.Any()) |
|
|
{ |
|
|
{ |
|
|
year = query.First().Key.Year ?? DateTime.Now.Year; |
|
|
year = query.First().Key.Year ?? DateTime.Now.Year; |
|
|
month = query.First().Key.Month ?? DateTime.Now.Month; |
|
|
month = query.First().Key.Month ?? DateTime.Now.Month; |
|
|
var rs = new List<Tuple<string, string, int>>(); //query.Join(items, a => a.ItemId, b => b.Id, (a, b) => new Tuple<string, string, int>(b.Name, a.OriVal, b.ShowOrder ?? 0)).OrderBy(x => x.Item3); |
|
|
|
|
|
return rs; |
|
|
|
|
|
|
|
|
//var rs = new List<Tuple<string, string, int>>(); |
|
|
|
|
|
|
|
|
|
|
|
var ls = query.First().GroupBy(x => x.SendCount).ToDictionary(x=>x.Key,a=>a.ToList()); |
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in ls.Keys) |
|
|
|
|
|
{ |
|
|
|
|
|
var dl=ls[item].Join(items, a => a.ItemId, b => b.Id, (a, b) => new Tuple<string, string, int>(b.Name, a.OriVal, b.ShowOrder ?? 0)).OrderBy(x => x.Item3).ToList(); |
|
|
|
|
|
dl.Add(new Tuple<string, string, int>("发放次数", item, 0)); |
|
|
|
|
|
rs.Add(dl); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//query.Join(items, a => a.ItemId, b => b.Id, (a, b) => new Tuple<string, string, int>(b.Name, a.OriVal, b.ShowOrder ?? 0)).OrderBy(x => x.Item3); |
|
|
|
|
|
//return rs; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
year = DateTime.Now.Year; |
|
|
year = DateTime.Now.Year; |
|
|
month = DateTime.Now.Month; |
|
|
month = DateTime.Now.Month; |
|
|
return new List<Tuple<string, string, int>>(); |
|
|
|
|
|
|
|
|
//return new List<Tuple<string, string, int>>(); |
|
|
} |
|
|
} |
|
|
|
|
|
return rs; |
|
|
} |
|
|
} |
|
|
catch (Exception ex) |
|
|
catch (Exception ex) |
|
|
{ |
|
|
{ |
|
|