Procházet zdrojové kódy

修改检索,增加统计实发金额

西昌分支
北京泉江 před 1 rokem
rodič
revize
2be19a911a
5 změnil soubory, kde provedl 22 přidání a 17 odebrání
  1. +3
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs
  2. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs
  3. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsCols.cs
  4. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs
  5. +14
    -12
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs

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

@@ -101,13 +101,14 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
public ActionResult GetPageListCol(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = gz_AmountsIBLL.GetPageListCol(paginationobj, queryJson);
var data = gz_AmountsIBLL.GetPageListCol(paginationobj, queryJson, out decimal totalSend);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records
records = paginationobj.records,
totalSend
};
return Success(jsonData);
}


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

@@ -172,11 +172,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}

public IEnumerable<Gz_AmountsCols> GetPageListCol(Pagination pagination, string queryJson)
public IEnumerable<Gz_AmountsCols> GetPageListCol(Pagination pagination, string queryJson, out decimal totalSend)
{
try
{
return gz_AmountsService.GetPageListCol(pagination, queryJson);
return gz_AmountsService.GetPageListCol(pagination, queryJson, out decimal totalSend);
}
catch (Exception ex)
{


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsCols.cs Zobrazit soubor

@@ -50,6 +50,8 @@
/// 实发合计
/// </summary>
public string TotalSend { get; set; }

public decimal TotalSendDecimal { get; set }
/// <summary>
/// 备注
/// </summary>


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

@@ -56,7 +56,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
#region 自定义
(DataTable failDt, int snum, int fnum) ExecuteImportExcel(DataTable dt, string[] ignoreCol, List<string> cols, List<Gz_ItemsEntity> itemList, string fileGuid);

IEnumerable<Gz_AmountsCols> GetPageListCol(Pagination pagination, string queryJson);
IEnumerable<Gz_AmountsCols> GetPageListCol(Pagination pagination, string queryJson, out decimal totalSend);

IEnumerable<Tuple<string, string>> GetAmountsDetail(string userNo, int year, int month);
#endregion


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

@@ -212,7 +212,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement

// 创建一个datatable容器用于保存导入失败的数据
DataTable failDt = new DataTable();
foreach (DataColumn dc in dt.Columns)
{
failDt.Columns.Add(dc.ColumnName, dc.DataType);
@@ -259,7 +259,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
{
dbm.Amount = amount;
}
if(!hlist.Any(x=>x.Year==dbm.Year && x.Month==dbm.Month && x.UserNo==dbm.UserNo && x.ItemId==dbm.ItemId))
if (!hlist.Any(x => x.Year == dbm.Year && x.Month == dbm.Month && x.UserNo == dbm.UserNo && x.ItemId == dbm.ItemId))
{
addEntity.Add(dbm);
}
@@ -314,7 +314,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}

public IEnumerable<Gz_AmountsCols> GetPageListCol(Pagination pagination, string queryJson)
public IEnumerable<Gz_AmountsCols> GetPageListCol(Pagination pagination, string queryJson, out decimal totalSend)
{
try
{
@@ -327,7 +327,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement

var qj = queryJson.ToJObject();

if(!qj["time1"].IsEmpty())
if (!qj["time1"].IsEmpty())
{
var ts = Convert.ToDateTime(qj["time1"]);
yearStart = ts.Year;
@@ -343,7 +343,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
var items = this.BaseRepository("CollegeMIS").FindList<Gz_ItemsEntity>(x => x.IsShow == true).ToList();

var xmId = items.FirstOrDefault(x => x.Name == "职员姓名").Id;
var deptCodeId= items.FirstOrDefault(x => x.Name == "部门代码").Id;
var deptCodeId = items.FirstOrDefault(x => x.Name == "部门代码").Id;
var deptId = items.FirstOrDefault(x => x.Name == "部门名称").Id;
var ptcId = items.FirstOrDefault(x => x.Name == "职员类型代码").Id;
var ptId = items.FirstOrDefault(x => x.Name == "职员类型").Id;
@@ -356,27 +356,29 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement

var itemId = items.Select(x => x.Id).ToArray();

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 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.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 ?? "" });
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 ?? "", TotalSendDecimal = x.FirstOrDefault(a => a.ItemId == sfhjId)?.Amount ?? 0, Remark = x.FirstOrDefault(a => a.ItemId == bzId)?.OriVal ?? "", Reviewer = x.FirstOrDefault(a => a.ItemId == shrId)?.OriVal ?? "" });

if(!qj["keyword"].IsEmpty())
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())
if (!qj["department"].IsEmpty())
{
var dept = qj["value"].ToString();
ls = ls.Where(x => x.DeptCode == dept);
}

totalSend = ls.Sum(x => x.TotalSendDecimal);

var rs = ls.Skip(skip).Take(pagination.rows);
return rs;
}
catch (Exception ex)
{
@@ -392,7 +394,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}


public IEnumerable<Tuple<string,string>> GetAmountsDetail(string userNo, int year, int month)
public IEnumerable<Tuple<string, string>> GetAmountsDetail(string userNo, int year, int month)
{
try
{


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