|
|
@@ -427,13 +427,13 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Tuple<string, string, int>> GetAmountsDetail(string userNo, int year, int month, int show) |
|
|
|
public IEnumerable<Tuple<string, string, int>> GetAmountsDetail(string userNo, int year, int month, string cs, int show) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
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.Year == year && x.Month == month && x.UserNo == userNo && x.SendCount == cs).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 query; |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
@@ -533,12 +533,13 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement |
|
|
|
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 c = itemId.Length; |
|
|
|
var query = this.BaseRepository("CollegeMIS").FindList<Gz_AmountsEntity>(x => itemId.Contains(x.ItemId) && x.UserNo == userNo).OrderByDescending(x => x.Year).ThenByDescending(x => x.Month).Take(c).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(); |
|
|
|
|
|
|
|
if (query.Any()) |
|
|
|
{ |
|
|
|
year = query.First().Year ?? DateTime.Now.Year; |
|
|
|
month = query.First().Month ?? DateTime.Now.Month; |
|
|
|
var rs = 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); |
|
|
|
year = query.First().Key.Year ?? DateTime.Now.Year; |
|
|
|
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; |
|
|
|
} |
|
|
|
else |
|
|
|