北京泉江 před 1 rokem
rodič
revize
0d3718534f
2 změnil soubory, kde provedl 34 přidání a 7 odebrání
  1. +0
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs
  2. +34
    -5
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs

+ 0
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs Zobrazit soubor

@@ -100,8 +100,6 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
[AjaxOnly]
public ActionResult GetPageListCol(string pagination, string queryJson)
{
//pagination = "{page:1,rows:1}";
queryJson = "{Year:2023,Month:12}";
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = gz_AmountsIBLL.GetPageListCol(paginationobj, queryJson);
var jsonData = new


+ 34
- 5
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs Zobrazit soubor

@@ -318,12 +318,27 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
{
try
{
var yearStart = DateTime.Now.Year;
var monthStart = DateTime.Now.Month;
var yearEnd = DateTime.Now.Year;
var monthEnd = DateTime.Now.Month;

var skip = pagination.rows * (pagination.page - 1);

var qj = queryJson.ToJObject();

var year = Convert.ToInt32(qj["Year"]);
var month= Convert.ToInt32(qj["Month"]);
if(!qj["time1"].IsEmpty())
{
var ts = Convert.ToDateTime(qj["time1"]);
yearStart = ts.Year;
monthStart = ts.Month;
}
if (!qj["time2"].IsEmpty())
{
var ts = Convert.ToDateTime(qj["time2"]);
yearEnd = ts.Year;
monthEnd = ts.Month;
}

var items = this.BaseRepository("CollegeMIS").FindList<Gz_ItemsEntity>(x => x.IsShow == true).ToList();

@@ -341,12 +356,26 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement

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).GroupBy(x => new { x.UserNo, x.Year, x.Month });
var q = this.BaseRepository("CollegeMIS").FindList<Gz_AmountsEntity>(x => itemId.Contains(x.ItemId) && ((yearStart==yearEnd && x.Year==yearStart && x.Month>=monthStart && x.Month<=monthEnd) ||(yearStart<yearEnd &&(x.Year==yearStart && x.Month>=monthStart) || (x.Year==yearEnd && x.Month<=monthEnd) || (x.Year>yearStart && x.Year<yearEnd))));
var query = q.GroupBy(x => new { x.UserNo, x.Year, x.Month });
pagination.records = query.Count();

var ls = query.Skip(skip).Take(pagination.rows).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??"",DeptCode= x.FirstOrDefault(a => a.ItemId == deptCodeId)?.OriVal ?? "", DeptName= x.FirstOrDefault(a => a.ItemId == deptId)?.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 ?? "", Remark= x.FirstOrDefault(a => a.ItemId == bzId)?.OriVal ?? "", Reviewer= x.FirstOrDefault(a => a.ItemId == shrId)?.OriVal ?? "" }).ToList();
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??"",DeptCode= x.FirstOrDefault(a => a.ItemId == deptCodeId)?.OriVal ?? "", DeptName= x.FirstOrDefault(a => a.ItemId == deptId)?.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 ?? "", Remark= x.FirstOrDefault(a => a.ItemId == bzId)?.OriVal ?? "", Reviewer= x.FirstOrDefault(a => a.ItemId == shrId)?.OriVal ?? "" });

if(!qj["keyword"].IsEmpty())
{
var k = qj["keyword"].ToString();
ls = ls.Where(x => x.UserNo.Contains(k) || x.RealName.Contains(k));
}
if(!qj["value"].IsEmpty())
{
var dept = qj["value"].ToString();
ls = ls.Where(x => x.DeptCode == dept);
}

return ls;
var rs = ls.Skip(skip).Take(pagination.rows);
return rs;
}
catch (Exception ex)


Načítá se…
Zrušit
Uložit