Browse Source

一个月多条数据展示修改

西昌分支
北京泉江 9 months ago
parent
commit
c5dfef1169
6 changed files with 17 additions and 14 deletions
  1. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs
  2. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Amounts/Index.cshtml
  3. +4
    -2
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PersonnelManagement/GzAmountApi.cs
  4. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs
  5. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs
  6. +7
    -6
      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.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs View File

@@ -173,9 +173,9 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers

[HttpGet]
[AjaxOnly]
public ActionResult GetDetail(string userNo, int year, int month)
public ActionResult GetDetail(string userNo, int year, int month, string cs)
{
var data = gz_AmountsIBLL.GetAmountsDetail(userNo, year, month, 0);
var data = gz_AmountsIBLL.GetAmountsDetail(userNo, year, month, cs, 0);
return Success(data);
}
#endregion


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Amounts/Index.cshtml View File

@@ -297,7 +297,7 @@
return
}
this.detailData = []
let result = await this.NetRequest('/PersonnelManagement/Gz_Amounts/GetDetail', $.param({ userNo: this.multipleSelection[0].UserNo, year: this.multipleSelection[0].Year, month: this.multipleSelection[0].Month }), 'get')
let result = await this.NetRequest('/PersonnelManagement/Gz_Amounts/GetDetail', $.param({ userNo: this.multipleSelection[0].UserNo, year: this.multipleSelection[0].Year, month: this.multipleSelection[0].Month, cs: this.multipleSelection[0].SendCount }), 'get')
if (result) {
let obj = {}
this.trendsColumn = result.map((e, i) => {


+ 4
- 2
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PersonnelManagement/GzAmountApi.cs View File

@@ -31,8 +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 data = gz_AmountsIBLL.GetAmountsDetail(this.userInfo.account, year, month, 1);
var data = gz_AmountsIBLL.GetAmountsDetail(this.userInfo.account, year, month, cs, 1);
var jsonData = new
{
rows = data,
@@ -50,8 +51,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 data = gz_AmountsIBLL.GetAmountsDetail(this.userInfo.account, year, month, 0);
var data = gz_AmountsIBLL.GetAmountsDetail(this.userInfo.account, year, month, cs, 0);
var jsonData = new
{
rows = data,


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs View File

@@ -191,11 +191,11 @@ 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
{
return gz_AmountsService.GetAmountsDetail(userNo, year, month, show);
return gz_AmountsService.GetAmountsDetail(userNo, year, month, cs, show);
}
catch (Exception ex)
{


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs View File

@@ -68,7 +68,7 @@ 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, int show);
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);
#endregion


+ 7
- 6
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs View File

@@ -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


Loading…
Cancel
Save