必选修规则新人训产生学习记录新增剔除宝连通临时工

master
xiaochanghai 2 weeks ago
parent c4c22f1b07
commit 1f6b160ead
  1. 9
      Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs

@ -326,6 +326,8 @@ public class Ghre_StudyRuleServices : BaseServices<Ghre_StudyRule, Ghre_StudyRul
{ {
//await Db.Ado.BeginTranAsync(); //await Db.Ado.BeginTranAsync();
bool isFliterTempStaff = false;
var rule = await Db.Queryable<Ghre_StudyRule>().FirstAsync(x => x.Id == ruleId); var rule = await Db.Queryable<Ghre_StudyRule>().FirstAsync(x => x.Id == ruleId);
var ZoneIds = new List<int?>(); var ZoneIds = new List<int?>();
@ -399,6 +401,12 @@ public class Ghre_StudyRuleServices : BaseServices<Ghre_StudyRule, Ghre_StudyRul
} }
#endregion #endregion
#region 判断是否需要过滤临时工(宝连通)
if (rule.DataBelongID.IsNotEmptyOrNull() && rule.TrainType == "NewStaff")
isFliterTempStaff = await Db.Queryable<Ghrs_DataBelong>().Where(x => x.DataBelongNo == "BLT01").AnyAsync();
#endregion
var staffs = await Db.Queryable<Ghra_Staff>() var staffs = await Db.Queryable<Ghra_Staff>()
.WhereIF(inStaffIds.Any(), x => inStaffIds.Contains(x.StaffID)) .WhereIF(inStaffIds.Any(), x => inStaffIds.Contains(x.StaffID))
.Where(x => x.OutDate == null || (x.OutDate != null && x.Indate != null && x.Indate.Value.Date <= DateTime.Now.Date && x.Indate.Value.Date >= DateTime.Now.Date)) .Where(x => x.OutDate == null || (x.OutDate != null && x.Indate != null && x.Indate.Value.Date <= DateTime.Now.Date && x.Indate.Value.Date >= DateTime.Now.Date))
@ -409,6 +417,7 @@ public class Ghre_StudyRuleServices : BaseServices<Ghre_StudyRule, Ghre_StudyRul
.WhereIF(JobIds.Any(), x => JobIds.Contains(x.JobID)) .WhereIF(JobIds.Any(), x => JobIds.Contains(x.JobID))
.WhereIF(!ruleStaffIds.IsNull() && ruleStaffIds.Any(), x => ruleStaffIds.Contains(x.StaffID)) .WhereIF(!ruleStaffIds.IsNull() && ruleStaffIds.Any(), x => ruleStaffIds.Contains(x.StaffID))
.WhereIF(rule.DataBelongID.IsNotEmptyOrNull(), x => x.DataBelongID == rule.DataBelongID) .WhereIF(rule.DataBelongID.IsNotEmptyOrNull(), x => x.DataBelongID == rule.DataBelongID)
.WhereIF(isFliterTempStaff, x => x.Reverse16 != "03")
.ToListAsync(); .ToListAsync();
if (staffs.Any()) if (staffs.Any())

Loading…
Cancel
Save