Browse Source

工资导入索引项增加发放次数,导入、删除除、列表、我的工资修改

西昌分支
北京泉江 9 months ago
parent
commit
666a160e4b
8 changed files with 29 additions and 20 deletions
  1. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs
  2. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Amounts/Index.cshtml
  3. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
  4. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs
  5. +4
    -4
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsCols.cs
  6. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsEntity.cs
  7. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs
  8. +13
    -10
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs

+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs View File

@@ -194,7 +194,8 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
var userNo = Request.Params["userNo"].ToString().Split(',');
var year = Request.Params["year"].ToString().Split(',').Select(x=>int.Parse(x)).ToArray();
var month = Request.Params["month"].ToString().Split(',').Select(x => int.Parse(x)).ToArray();
gz_AmountsIBLL.DeleteEntity(userNo, year, month);
var sendCount = Request.Params["sendCount"].ToString().Split(',');
gz_AmountsIBLL.DeleteEntity(userNo, year, month, sendCount);
return Success("删除成功!");
}
/// <summary>


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

@@ -263,6 +263,7 @@
let ids = this.multipleSelection.map(e => e.UserNo).toString()
let years = this.multipleSelection.map(e => e.Year).toString()
let months = this.multipleSelection.map(e => e.Month).toString()
let cs = this.multipleSelection.map(e => e.SendCount).toString()
if (!ids) {
this.$message.warning('请选择需要删除的数据!')
return
@@ -272,7 +273,7 @@
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
let res = await this.NetRequest('/PersonnelManagement/Gz_Amounts/DeleteForm', $.param({ userNo: ids, year: years, month: months }))
let res = await this.NetRequest('/PersonnelManagement/Gz_Amounts/DeleteForm', $.param({ userNo: ids, year: years, month: months, sendCount: cs }))
if (res) {
this.$message.success('删除成功!')
}


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config View File

@@ -178,5 +178,5 @@
<!--触发excel开票任务的url-->
<add key="ExcelInvoice" value="http://localhost:60037/api/PayFeeResult/SetUnInvoiceHandle"/>
<!--工资导入EXCEL列忽略项-->
<add key="GzColumn" value="发放年份,发放月份,职员代码"/>
<add key="GzColumn" value="发放年份,发放月份,职员代码,发放次数"/>
</appSettings>

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

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

public void DeleteEntity(string[] userNo, int[] year, int[] month)
public void DeleteEntity(string[] userNo, int[] year, int[] month, string[] sendCount)
{
try
{
gz_AmountsService.DeleteEntity(userNo, year, month);
gz_AmountsService.DeleteEntity(userNo, year, month, sendCount);
}
catch (Exception ex)
{


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

@@ -9,6 +9,10 @@

public int Month { get; set; }

/// <summary>
/// 发放次数
/// </summary>
public string SendCount { get; set; }
/// <summary>
/// UserNo
/// </summary>
@@ -39,10 +43,6 @@
/// </summary>
public string SendDate { get; set; }
/// <summary>
/// 发放次数
/// </summary>
public string SendCount { get; set; }
/// <summary>
/// 扣款合计
/// </summary>
public string TotalDeduction { get; set; }


+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsEntity.cs View File

@@ -33,6 +33,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
[Column("MONTH")]
public int? Month { get; set; }
/// <summary>
/// 发放次数
/// </summary>
public string SendCount { get; set; }
/// <summary>
/// ItemId
/// </summary>
/// <returns></returns>


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

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

void DeleteEntity(string userNo, int year, int month);

void DeleteEntity(string[] userNo, int[] year, int[] month);
void DeleteEntity(string[] userNo, int[] year, int[] month, string[] sendCount);
/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>


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

@@ -181,25 +181,26 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}

public void DeleteEntity(string[] userNo, int[] year, int[] month)
public void DeleteEntity(string[] userNo, int[] year, int[] month, string[] sendCount)
{
try
{
this.BaseRepository("CollegeMIS").BeginTrans();

if(userNo.Any())
if (userNo.Any())
{
for (int i = 0; i < userNo.Length; i++)
{
var u = userNo[i];
var y = year[i];
var m = month[i];
this.BaseRepository("CollegeMIS").Delete<Gz_AmountsEntity>(t => t.UserNo == u && t.Year == y && t.Month == m);
var c = sendCount[i];
this.BaseRepository("CollegeMIS").Delete<Gz_AmountsEntity>(t => t.UserNo == u && t.Year == y && t.Month == m && t.SendCount == c);
}
this.BaseRepository("CollegeMIS").Commit();
}

}
catch (Exception ex)
{
@@ -282,8 +283,9 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
var y = dr["发放年份"].ToString().Trim();
var m = dr["发放月份"].ToString().Trim();
var u = dr["职员代码"].ToString().Trim();
var c = dr["发放次数"].ToString().Trim();

if (y.IsEmpty() || m.IsEmpty() || u.IsEmpty() || !int.TryParse(y, out var year) || !int.TryParse(m, out var month))
if (y.IsEmpty() || m.IsEmpty() || u.IsEmpty() || c.IsEmpty() || !int.TryParse(y, out var year) || !int.TryParse(m, out var month))
{
dr["导入错误"] = "数据异常:年份、月份、职员代码不可为空且年月为数字";
failDt.Rows.Add(dr.ItemArray);
@@ -292,7 +294,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
else
{
var itemId = itemList.Select(x => x.Id).ToArray();
var hlist = this.BaseRepository("CollegeMIS").FindList<Gz_AmountsEntity>(x => x.Year == year && x.Month == month && x.UserNo == u && itemId.Contains(x.ItemId)).ToList();
var hlist = this.BaseRepository("CollegeMIS").FindList<Gz_AmountsEntity>(x => x.Year == year && x.Month == month && x.UserNo == u && x.SendCount == c && itemId.Contains(x.ItemId)).ToList();
foreach (var item in cols)
{
var val = dr[item].ToString().Trim();
@@ -307,13 +309,14 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
dbm.Year = year;
dbm.Month = month;
dbm.UserNo = u;
dbm.SendCount = c;
dbm.ItemId = itemEntity.Id;
dbm.OriVal = val;
if (cvb)
{
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.SendCount == dbm.SendCount && x.ItemId == dbm.ItemId))
{
if ((cvb && amount > 0) || !cvb)
{
@@ -571,7 +574,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
var ptcId = items.FirstOrDefault(x => x.Name == "职员类型代码")?.Id ?? "职员类型代码";
var ptId = items.FirstOrDefault(x => x.Name == "职员类型")?.Id ?? "职员类型";
var sendId = items.FirstOrDefault(x => x.Name == "发放时间")?.Id ?? "发放时间";
var sendCountId = items.FirstOrDefault(x => x.Name == "发放次数")?.Id ?? "发放次数";
//var sendCountId = items.FirstOrDefault(x => x.Name == "发放次数")?.Id ?? "发放次数";
var kchjId = items.FirstOrDefault(x => x.Name == "扣款合计")?.Id ?? "扣款合计";
var sfhjId = items.FirstOrDefault(x => x.Name == "实发合计")?.Id ?? "实发合计";
var yfhjId = items.FirstOrDefault(x => x.Name == "应发合计")?.Id ?? "应发合计";
@@ -587,10 +590,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
q = q.Where(x => x.UserNo == userNo);
}

var query = q.GroupBy(x => new { x.UserNo, x.Year, x.Month });
var query = q.GroupBy(x => new { x.UserNo, x.Year, x.Month, x.SendCount });
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 ?? "", 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 ?? "", TotalPay = x.FirstOrDefault(a => a.ItemId == yfhjId)?.OriVal ?? "" });
var ls = query.Select(x => new Gz_AmountsCols { UserNo = x.Key.UserNo, Year = x.Key.Year ?? 0, Month = x.Key.Month ?? 0, SendCount = x.Key.SendCount, RealName = x.FirstOrDefault(a => a.ItemId == xmId)?.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 ?? "", 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 ?? "", TotalPay = x.FirstOrDefault(a => a.ItemId == yfhjId)?.OriVal ?? "" });

if (!kw.IsEmpty())
{


Loading…
Cancel
Save