|
|
@ -1,4 +1,5 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Data; |
|
|
|
using System.Data; |
|
|
|
using MongoDB.Driver.Linq; |
|
|
|
using MongoDB.Driver.Linq; |
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
using Newtonsoft.Json.Linq; |
|
|
@ -328,6 +329,24 @@ public class Ghre_StudyRuleServices : BaseServices<Ghre_StudyRule, Ghre_StudyRul |
|
|
|
if (!rule.JobId.IsNull()) |
|
|
|
if (!rule.JobId.IsNull()) |
|
|
|
JobIds = JsonHelper.JsonToObj<List<int?>>(rule.JobId); |
|
|
|
JobIds = JsonHelper.JsonToObj<List<int?>>(rule.JobId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 处理部门是否含下阶 |
|
|
|
|
|
|
|
var deptIds = new List<int?>(); |
|
|
|
|
|
|
|
if (rule.IsDeptLower == true && DeptIds.Any()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var depts = new List<Ghro_Dept>(); |
|
|
|
|
|
|
|
depts = await GetDeptList(depts); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var dept in DeptIds) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var items = await GetDeptList(depts, dept); |
|
|
|
|
|
|
|
deptIds.AddRange(items.Select(x => x.DeptID).ToList()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
deptIds = deptIds.Distinct().ToList(); |
|
|
|
|
|
|
|
if (deptIds.Any()) |
|
|
|
|
|
|
|
DeptIds.AddRange(deptIds); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
var ruleStaffs = await Db.Queryable<Ghre_StudyRuleStaff>().Where(x => x.StudyRuleId == ruleId).ToListAsync(); |
|
|
|
var ruleStaffs = await Db.Queryable<Ghre_StudyRuleStaff>().Where(x => x.StudyRuleId == ruleId).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
await Db.Updateable<Ghre_StudyRuleResult>().Where(x => x.StudyRuleId == ruleId && x.IsEnable == 1) |
|
|
|
await Db.Updateable<Ghre_StudyRuleResult>().Where(x => x.StudyRuleId == ruleId && x.IsEnable == 1) |
|
|
@ -469,6 +488,8 @@ public class Ghre_StudyRuleServices : BaseServices<Ghre_StudyRule, Ghre_StudyRul |
|
|
|
public async Task StaffIn() |
|
|
|
public async Task StaffIn() |
|
|
|
{ |
|
|
|
{ |
|
|
|
var dt = Db.GetDate(); |
|
|
|
var dt = Db.GetDate(); |
|
|
|
|
|
|
|
var depts = new List<Ghro_Dept>(); |
|
|
|
|
|
|
|
depts = await GetDeptList(depts); |
|
|
|
var rules = await Db.Queryable<Ghre_StudyRule>().Where(x => x.TrainType != "PreWork" && x.TrainType != "Orientation").ToListAsync(); |
|
|
|
var rules = await Db.Queryable<Ghre_StudyRule>().Where(x => x.TrainType != "PreWork" && x.TrainType != "Orientation").ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < rules.Count; j++) |
|
|
|
for (int j = 0; j < rules.Count; j++) |
|
|
@ -491,6 +512,21 @@ public class Ghre_StudyRuleServices : BaseServices<Ghre_StudyRule, Ghre_StudyRul |
|
|
|
if (!rule.JobId.IsNull()) |
|
|
|
if (!rule.JobId.IsNull()) |
|
|
|
JobIds = JsonHelper.JsonToObj<List<int?>>(rule.JobId); |
|
|
|
JobIds = JsonHelper.JsonToObj<List<int?>>(rule.JobId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 处理部门是否含下阶 |
|
|
|
|
|
|
|
var deptIds = new List<int?>(); |
|
|
|
|
|
|
|
if (rule.IsDeptLower == true && DeptIds.Any()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
foreach (var dept in DeptIds) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var items = await GetDeptList(depts, dept); |
|
|
|
|
|
|
|
deptIds.AddRange(items.Select(x => x.DeptID).ToList()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
deptIds = deptIds.Distinct().ToList(); |
|
|
|
|
|
|
|
if (deptIds.Any()) |
|
|
|
|
|
|
|
DeptIds.AddRange(deptIds); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
var staffs = await Db.Queryable<Ghra_Staff>() |
|
|
|
var staffs = await Db.Queryable<Ghra_Staff>() |
|
|
|
.Where(x => x.Indate != null && x.Indate.Value.Date == dt.Date) |
|
|
|
.Where(x => x.Indate != null && x.Indate.Value.Date == dt.Date) |
|
|
|
.WhereIF(ZoneIds.Any(), x => ZoneIds.Contains(x.ZoneID)) |
|
|
|
.WhereIF(ZoneIds.Any(), x => ZoneIds.Contains(x.ZoneID)) |
|
|
|