Quellcode durchsuchen

移动端我的工资默认数据、年月查询数据、详情接口修改

西昌分支
北京泉江 vor 10 Monaten
Ursprung
Commit
e3ddc509dd
4 geänderte Dateien mit 84 neuen und 10 gelöschten Zeilen
  1. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PersonnelManagement/GzAmountApi.cs
  2. +19
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs
  3. +3
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs
  4. +60
    -5
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs

+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PersonnelManagement/GzAmountApi.cs Datei anzeigen

@@ -31,9 +31,9 @@ namespace Learun.Application.WebApi.Modules.PersonnelManagement

var year = Convert.ToInt32(qj["year"]);
var month = Convert.ToInt32(qj["month"]);
var cs = qj["cs"].ToString();
//var cs = qj["cs"].ToString();

var data = gz_AmountsIBLL.GetAmountsDetail(this.userInfo.account, year, month, cs, 1);
var data = gz_AmountsIBLL.GetAmountsDetail(this.userInfo.account, year, month, 1);
var jsonData = new
{
rows = data,


+ 19
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs Datei anzeigen

@@ -209,6 +209,24 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}
}
public List<List<Tuple<string, string, int>>> GetAmountsDetail(string userNo, int year, int month, int show)
{
try
{
return gz_AmountsService.GetAmountsDetail(userNo, year, month, show);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

public IEnumerable<Gz_AmountsCols> GetPageListCol(Pagination pagination, string queryJson, string userNo)
{
@@ -248,7 +266,7 @@ 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
{


+ 3
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs Datei anzeigen

@@ -69,8 +69,9 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
IEnumerable<Gz_AmountsCols> GetPageListCol(string userNo, out int year, out int month);

IEnumerable<Tuple<string, string, int>> GetAmountsDetail(string userNo, int year, int month, string cs, int show);
IEnumerable<Tuple<string, string, int>> GetAmountsCurrent(string userNo, out int year, out int month);
List<List<Tuple<string, string, int>>> GetAmountsDetail(string userNo, int year, int month, int show);

List<List<Tuple<string, string, int>>> GetAmountsCurrent(string userNo, out int year, out int month);
#endregion

}


+ 60
- 5
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs Datei anzeigen

@@ -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)
{
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
{
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 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 rs = new List<List<Tuple<string, string, int>>>();

if (query.Any())
{
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;
//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
{
year = DateTime.Now.Year;
month = DateTime.Now.Month;
return new List<Tuple<string, string, int>>();
//return new List<Tuple<string, string, int>>();
}
return rs;
}
catch (Exception ex)
{


Laden…
Abbrechen
Speichern