fix 补充岗位信息记录

This commit is contained in:
2025-12-30 10:15:31 +08:00
parent 9aa3d8688e
commit b23bdc3e46
2 changed files with 23 additions and 1 deletions

View File

@@ -112,6 +112,9 @@ public class BirthdayVoucherService : BaseVoucherService, IVoucherService
CostId = gainfo.CostId,
Werks = gainfo.Werks,
Factory = gainfo.Factory,
PositionNo = gainfo.PositionNo,
DepartmentNo = gainfo.DepartmentNo,
DepartmentNoFirst = department?.DepartmentNoFirst,
DepartmentNoSecond = department?.DepartmentNoSecond,
@@ -179,10 +182,23 @@ public class BirthdayVoucherService : BaseVoucherService, IVoucherService
var endMonth = end.Month;
var overYear = endMonth < beginMonth;
//var limit = end.Date.AddHours(9);//9点入职
var excludePositionNos = new List<string>
{
"41001471",
"43000181",
"43000452",
"43000459",
"49200047",
"49400001",
"49400002",
"49990004"
};
return await DbContext.Queryable<GainfoEntity>()
.WhereIF(userCodes.IsPresent(), x => userCodes.Contains(x.Code))
.Where(x => !SqlFunc.IsNullOrEmpty(x.DepartmentNo))
.Where(x => !excludePositionNos.Contains(x.PositionNo))//排除特殊岗位
.Where(x => x.Type == GainfoUserTypeEnumType.Normal || x.Type == GainfoUserTypeEnumType.SecurityWhite)
.Where(x => x.Birthday.HasValue && !string.IsNullOrEmpty(x.CostId))
.WhereIF(isToday, x => SqlFunc.DateValue(x.Birthday.Value, DateType.Month) == begin.Month && SqlFunc.DateValue(x.Birthday.Value, DateType.Day) == begin.Day)

View File

@@ -45,6 +45,12 @@ public class VoucherUserInfoEntity : SugarBaseEntity
[SugarColumn(IsNullable = false)]
public string DepartmentNo { get; set; }
/// <summary>
/// 岗位No
/// </summary>
[SugarColumn(IsNullable = false)]
public string PositionNo { get; set; }
/// <summary>
/// 一级部门
/// </summary>