|
|
@ -1,4 +1,7 @@ |
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
using MySqlX.XDevAPI.Common; |
|
|
|
|
|
|
|
using Org.BouncyCastle.Utilities; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// 员工群组 (服务) |
|
|
|
/// 员工群组 (服务) |
|
|
@ -281,31 +284,32 @@ public class Ghre_StaffGroupServices : BaseServices<Ghre_StaffGroup, Ghre_StaffG |
|
|
|
|
|
|
|
|
|
|
|
#region 处理查询条件 |
|
|
|
#region 处理查询条件 |
|
|
|
var whereExpression = Expressionable.Create<Ghra_Staff>(); |
|
|
|
var whereExpression = Expressionable.Create<Ghra_Staff>(); |
|
|
|
foreach (JProperty jProperty in filter.jsonParam.Properties()) |
|
|
|
if (filter.jsonParam != null) |
|
|
|
{ |
|
|
|
foreach (JProperty jProperty in filter.jsonParam.Properties()) |
|
|
|
var name = jProperty.Name; |
|
|
|
|
|
|
|
var value = jProperty.Value.ToString(); |
|
|
|
|
|
|
|
if (name == "page" || name == "pageSize") |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
if (value.IsNotEmptyOrNull()) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
var jsonParam = JsonHelper.JsonToObj<JsonParam>(value); |
|
|
|
var name = jProperty.Name; |
|
|
|
|
|
|
|
var value = jProperty.Value.ToString(); |
|
|
|
switch (name) |
|
|
|
if (name == "page" || name == "pageSize") |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
if (value.IsNotEmptyOrNull()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
//case "WaitRecommend": |
|
|
|
var jsonParam = JsonHelper.JsonToObj<JsonParam>(value); |
|
|
|
// if (jsonParam.columnValue.ObjToInt() == 1) |
|
|
|
|
|
|
|
// whereExpression.And(x => x.Status == DIC_INTERVIEW_ORDER_STATUS.WaitRecommended); |
|
|
|
switch (name) |
|
|
|
// break; |
|
|
|
{ |
|
|
|
|
|
|
|
//case "WaitRecommend": |
|
|
|
|
|
|
|
// if (jsonParam.columnValue.ObjToInt() == 1) |
|
|
|
|
|
|
|
// whereExpression.And(x => x.Status == DIC_INTERVIEW_ORDER_STATUS.WaitRecommended); |
|
|
|
|
|
|
|
// break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// break; |
|
|
|
// break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (x.StaffType1s.Any()) |
|
|
|
if (x.StaffType1s.Any()) |
|
|
|
whereExpression.And(o => x.StaffType1s.Contains(o.StaffType1)); |
|
|
|
whereExpression.And(o => x.StaffType1s.Contains(o.StaffType1)); |
|
|
@ -354,9 +358,41 @@ public class Ghre_StaffGroupServices : BaseServices<Ghre_StaffGroup, Ghre_StaffG |
|
|
|
.Where(whereExpression.ToExpression()) |
|
|
|
.Where(whereExpression.ToExpression()) |
|
|
|
.OrderBy(it => new { UpdateTime = SqlFunc.Desc(it.UpdateTime), CreateTime = SqlFunc.Desc(it.CreateTime) }) |
|
|
|
.OrderBy(it => new { UpdateTime = SqlFunc.Desc(it.UpdateTime), CreateTime = SqlFunc.Desc(it.CreateTime) }) |
|
|
|
.ToPageListAsync(filter.pageNum, filter.pageSize, total); |
|
|
|
.ToPageListAsync(filter.pageNum, filter.pageSize, total); |
|
|
|
var result = new ServicePageResult<Ghra_StaffDto>(filter.pageNum, total, filter.pageSize, Mapper.Map(entitys).ToANew<List<Ghra_StaffDto>>()); |
|
|
|
var data = Mapper.Map(entitys).ToANew<List<Ghra_StaffDto>>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var zoneIds = data.Where(x => x.ZoneID != null).Select(x => x.ZoneID.Value).ToList(); |
|
|
|
|
|
|
|
var zones = await Db.Queryable<Ghra_Zone>().Where(x => x.ZoneID != null && zoneIds.Contains(x.ZoneID.Value)).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
var deptIds = data.Where(x => x.DeptID != null).Select(x => x.DeptID.Value).ToList(); |
|
|
|
|
|
|
|
var depts = await Db.Queryable<Ghro_Dept>().Where(x => x.DeptID != null && deptIds.Contains(x.DeptID.Value)).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var titleIds = data.Where(x => x.TitleID != null).Select(x => x.TitleID.Value).ToList(); |
|
|
|
|
|
|
|
var titles = await Db.Queryable<Ghra_Title>().Where(x => x.TitleID != null && titleIds.Contains(x.TitleID.Value)).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var gradeIds = data.Where(x => x.GradeID != null).Select(x => x.GradeID.Value).ToList(); |
|
|
|
|
|
|
|
var grades = await Db.Queryable<Ghra_Grade>().Where(x => gradeIds.Contains(x.GradeID)).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var jobIds = data.Where(x => x.JobID != null).Select(x => x.JobID.Value).ToList(); |
|
|
|
|
|
|
|
var jobs = await Db.Queryable<Ghra_Job>().Where(x => x.JobID != null && jobIds.Contains(x.JobID.Value)).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.ForEach(async x => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
x.GenderLabel = await GetParaLabel("Gender", x.Gender); |
|
|
|
|
|
|
|
x.IndateLabel = DateTimeHelper.ConvertToDayString(x.Indate); |
|
|
|
|
|
|
|
x.StaffType1Label = await GetParaLabel(x.StaffType1); |
|
|
|
|
|
|
|
x.StaffType2Label = await GetParaLabel(x.StaffType2); |
|
|
|
|
|
|
|
if (x.ZoneID != null) |
|
|
|
|
|
|
|
x.ZoneName = zones.Where(o => o.ZoneID == x.ZoneID).FirstOrDefault()?.ZoneName; |
|
|
|
|
|
|
|
if (x.DeptID != null) |
|
|
|
|
|
|
|
x.DeptName = depts.Where(o => o.DeptID == x.DeptID).FirstOrDefault()?.DeptName; |
|
|
|
|
|
|
|
if (x.GradeID != null) |
|
|
|
|
|
|
|
x.GradeName = grades.Where(o => o.GradeID == x.GradeID).FirstOrDefault()?.GradeName; |
|
|
|
|
|
|
|
if (x.JobID != null) |
|
|
|
|
|
|
|
x.JobName = jobs.Where(o => o.JobID == x.JobID).FirstOrDefault()?.JobName; |
|
|
|
|
|
|
|
if (x.TitleID != null) |
|
|
|
|
|
|
|
x.TitleName = titles.Where(o => o.TitleID == x.TitleID).FirstOrDefault()?.TitleName; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new ServicePageResult<Ghra_StaffDto>(filter.pageNum, total, filter.pageSize, data); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |