|
|
@ -5,22 +5,37 @@ using Tiobon.Core.Model.ViewModels.Extend; |
|
|
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Api.Controllers; |
|
|
|
namespace Tiobon.Core.Api.Controllers; |
|
|
|
|
|
|
|
|
|
|
|
[AllowAnonymous, Route("Ghrh_ResumeTemplatePreview/[action]"), ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
|
|
|
|
[AllowAnonymous, Route("api/Ghrh_ResumeTemplatePreview/[action]"), ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
|
|
|
|
public class Ghrh_ResumeTemplatePreviewController : Controller |
|
|
|
public class Ghrh_ResumeTemplatePreviewController : Controller |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
private readonly ISqlSugarClient _db; |
|
|
|
private readonly ISqlSugarClient _db; |
|
|
|
private readonly IGhrh_ResumeServices _ghrh_ResumeServices; |
|
|
|
private readonly IGhrh_ResumeServices _ghrh_ResumeServices; |
|
|
|
private readonly IGhrh_ResumeHomeServices _ghrh_ResumeHomeServices; |
|
|
|
private readonly IGhrh_ResumeHomeServices _ghrh_ResumeHomeServices; |
|
|
|
|
|
|
|
private readonly IGhrh_ResumeEduBGServices _ghrh_ResumeEduBGServices; |
|
|
|
|
|
|
|
private readonly IGhrh_ResumeWorkExpServices _ghrh_ResumeWorkExpServices; |
|
|
|
|
|
|
|
private readonly IGhrh_ResumeLicenceServices _ghrh_ResumeLicenceServices; |
|
|
|
|
|
|
|
private readonly IGhrh_ResumeTrainingServices _ghrh_ResumeTrainingServices; |
|
|
|
|
|
|
|
private readonly IGhrh_ResumeStatementServices _ghrh_ResumeStatementServices; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Ghrh_ResumeTemplatePreviewController(ISqlSugarClient db, |
|
|
|
public Ghrh_ResumeTemplatePreviewController(ISqlSugarClient db, |
|
|
|
IGhrh_ResumeServices ghrh_ResumeServices, |
|
|
|
IGhrh_ResumeServices ghrh_ResumeServices, |
|
|
|
|
|
|
|
IGhrh_ResumeEduBGServices ghrh_ResumeEduBGServices, |
|
|
|
|
|
|
|
IGhrh_ResumeWorkExpServices ghrh_ResumeWorkExpServices, |
|
|
|
|
|
|
|
IGhrh_ResumeLicenceServices ghrh_ResumeLicenceServices, |
|
|
|
|
|
|
|
IGhrh_ResumeTrainingServices ghrh_ResumeTrainingServices, |
|
|
|
|
|
|
|
IGhrh_ResumeStatementServices ghrh_ResumeStatementServices, |
|
|
|
IGhrh_ResumeHomeServices ghrh_ResumeHomeServices) |
|
|
|
IGhrh_ResumeHomeServices ghrh_ResumeHomeServices) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_db = db; |
|
|
|
_db = db; |
|
|
|
_ghrh_ResumeServices = ghrh_ResumeServices; |
|
|
|
_ghrh_ResumeServices = ghrh_ResumeServices; |
|
|
|
_ghrh_ResumeHomeServices = ghrh_ResumeHomeServices; |
|
|
|
_ghrh_ResumeHomeServices = ghrh_ResumeHomeServices; |
|
|
|
|
|
|
|
_ghrh_ResumeEduBGServices = ghrh_ResumeEduBGServices; |
|
|
|
|
|
|
|
_ghrh_ResumeWorkExpServices = ghrh_ResumeWorkExpServices; |
|
|
|
|
|
|
|
_ghrh_ResumeLicenceServices = ghrh_ResumeLicenceServices; |
|
|
|
|
|
|
|
_ghrh_ResumeTrainingServices = ghrh_ResumeTrainingServices; |
|
|
|
|
|
|
|
_ghrh_ResumeStatementServices = ghrh_ResumeStatementServices; |
|
|
|
} |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// Index |
|
|
|
/// Index |
|
|
@ -198,12 +213,43 @@ END"; |
|
|
|
if (o.field == "UrgentRelation") o.field = "UrgentRelationLabel"; |
|
|
|
if (o.field == "UrgentRelation") o.field = "UrgentRelationLabel"; |
|
|
|
if (o.field == "CertificateType") o.field = "CertificateTypeLabel"; |
|
|
|
if (o.field == "CertificateType") o.field = "CertificateTypeLabel"; |
|
|
|
if (o.field == "RegisteredType") o.field = "RegisteredTypeLabel"; |
|
|
|
if (o.field == "RegisteredType") o.field = "RegisteredTypeLabel"; |
|
|
|
|
|
|
|
if (o.field == "EduDegree") o.field = "EduDegreeLabel"; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x.children = x.children.Where(o => o.field != "EduDegreeLabel" |
|
|
|
|
|
|
|
&& o.field != "GenderLabel" |
|
|
|
|
|
|
|
&& o.field != "StaffName" |
|
|
|
|
|
|
|
&& o.field != "ApplyStatusLabel" |
|
|
|
|
|
|
|
&& o.field != "WorkYears" |
|
|
|
|
|
|
|
&& o.field != "WorkYears" |
|
|
|
|
|
|
|
&& o.field != "Age").ToList(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (x.tabKey == "Family") |
|
|
|
if (x.tabKey == "Family") |
|
|
|
x.children.ForEach(o => |
|
|
|
x.children.ForEach(o => |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (o.field == "Gender") o.field = "GenderLabel"; |
|
|
|
if (o.field == "Gender") o.field = "GenderLabel"; |
|
|
|
|
|
|
|
if (o.field == "RelationType") o.field = "RelationTypeLabel"; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (x.tabKey == "Education") |
|
|
|
|
|
|
|
x.children.ForEach(o => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (o.field == "IsGraduate") o.field = "IsGraduateLabel"; |
|
|
|
|
|
|
|
if (o.field == "DegreeLevel") o.field = "DegreeLevelLabel"; |
|
|
|
|
|
|
|
if (o.field == "BeginDate") o.field = "BeginDate1"; |
|
|
|
|
|
|
|
if (o.field == "EndDate") o.field = "EndDate1"; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (x.tabKey == "WorkExp" || x.tabKey == "Licence") |
|
|
|
|
|
|
|
x.children.ForEach(o => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (o.field == "BeginDate") o.field = "BeginDate1"; |
|
|
|
|
|
|
|
if (o.field == "EndDate") o.field = "EndDate1"; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (x.tabKey == "Training") |
|
|
|
|
|
|
|
x.children.ForEach(o => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (o.field == "BeginDate") o.field = "BeginDate1"; |
|
|
|
|
|
|
|
if (o.field == "EndDate") o.field = "EndDate1"; |
|
|
|
|
|
|
|
if (o.field == "IsPass") o.field = "IsPassLabel"; |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
x.children1 = null; |
|
|
|
x.children1 = null; |
|
|
@ -218,7 +264,7 @@ END"; |
|
|
|
var formColumns = await QueryResumeFormColumn(1); |
|
|
|
var formColumns = await QueryResumeFormColumn(1); |
|
|
|
|
|
|
|
|
|
|
|
#region Base |
|
|
|
#region Base |
|
|
|
var id = 1856146208591056896; |
|
|
|
var id = 1851947974159110144; |
|
|
|
var entity = await _ghrh_ResumeServices.QueryById(id); |
|
|
|
var entity = await _ghrh_ResumeServices.QueryById(id); |
|
|
|
var columnNames = formColumns.Where(x => x.GroupType == "Base").Select(x => x.ColumnName).ToList(); |
|
|
|
var columnNames = formColumns.Where(x => x.GroupType == "Base").Select(x => x.ColumnName).ToList(); |
|
|
|
columnNames = columnNames.Distinct().ToList(); |
|
|
|
columnNames = columnNames.Distinct().ToList(); |
|
|
@ -234,12 +280,14 @@ END"; |
|
|
|
columnNames.Add("UrgentRelationLabel"); |
|
|
|
columnNames.Add("UrgentRelationLabel"); |
|
|
|
columnNames.Add("CertificateTypeLabel"); |
|
|
|
columnNames.Add("CertificateTypeLabel"); |
|
|
|
columnNames.Add("RegisteredTypeLabel"); |
|
|
|
columnNames.Add("RegisteredTypeLabel"); |
|
|
|
|
|
|
|
columnNames.Add("EduDegreeLabel"); |
|
|
|
columnNames.ForEach(x => |
|
|
|
columnNames.ForEach(x => |
|
|
|
{ |
|
|
|
{ |
|
|
|
var value = entity.GetPropertyValue(x); |
|
|
|
var value = entity.GetPropertyValue(x); |
|
|
|
dicts.Add(x, value); |
|
|
|
dicts.Add(x, value); |
|
|
|
}); |
|
|
|
}); |
|
|
|
ViewBag.BaseDic = dicts; |
|
|
|
ViewBag.BaseDic = dicts; |
|
|
|
|
|
|
|
ViewBag.entity = entity; |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
#region 家庭关系 |
|
|
|
#region 家庭关系 |
|
|
@ -247,7 +295,7 @@ END"; |
|
|
|
columnNames = formColumns.Where(x => x.GroupType == "Family").Select(x => x.ColumnName).ToList(); |
|
|
|
columnNames = formColumns.Where(x => x.GroupType == "Family").Select(x => x.ColumnName).ToList(); |
|
|
|
columnNames = columnNames.Distinct().ToList(); |
|
|
|
columnNames = columnNames.Distinct().ToList(); |
|
|
|
columnNames.Add("GenderLabel"); |
|
|
|
columnNames.Add("GenderLabel"); |
|
|
|
columnNames.Add("GenderLabel"); |
|
|
|
columnNames.Add("RelationTypeLabel"); |
|
|
|
var familys = await _ghrh_ResumeHomeServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
var familys = await _ghrh_ResumeHomeServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
var familyDic = new List<Dictionary<string, object>>(); |
|
|
|
var familyDic = new List<Dictionary<string, object>>(); |
|
|
|
familys.ForEach(family => |
|
|
|
familys.ForEach(family => |
|
|
@ -258,103 +306,103 @@ END"; |
|
|
|
var value = family.GetPropertyValue(x); |
|
|
|
var value = family.GetPropertyValue(x); |
|
|
|
dicts.Add(x, value); |
|
|
|
dicts.Add(x, value); |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (columnNames.Any(x => x == "AttachmentIDs")) |
|
|
|
|
|
|
|
dicts["AttachmentIDs"] = family.AttachmentIDs; |
|
|
|
|
|
|
|
familyDic.Add(dicts); |
|
|
|
familyDic.Add(dicts); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
ViewBag.FamilyDic = familyDic; |
|
|
|
ViewBag.FamilyDic = familyDic; |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
//#region 教育背景 |
|
|
|
#region 教育背景 |
|
|
|
|
|
|
|
|
|
|
|
//columnNames = formColumns.Where(x => x.GroupType == "Education").Select(x => x.ColumnName).ToList(); |
|
|
|
columnNames = formColumns.Where(x => x.GroupType == "Education").Select(x => x.ColumnName).ToList(); |
|
|
|
//columnNames = columnNames.Distinct().ToList(); |
|
|
|
columnNames = columnNames.Distinct().ToList(); |
|
|
|
//var educations = await _ghrh_ResumeEduBGServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
columnNames.Add("IsGraduateLabel"); |
|
|
|
//var educationDic = new List<Dictionary<string, object>>(); |
|
|
|
columnNames.Add("DegreeLevelLabel"); |
|
|
|
//educations.ForEach(education => |
|
|
|
columnNames.Add("BeginDate1"); |
|
|
|
//{ |
|
|
|
columnNames.Add("EndDate1"); |
|
|
|
// var dicts = new Dictionary<string, object>(); |
|
|
|
var educations = await _ghrh_ResumeEduBGServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
// columnNames.ForEach(x => |
|
|
|
var educationDic = new List<Dictionary<string, object>>(); |
|
|
|
// { |
|
|
|
educations.ForEach(education => |
|
|
|
// var value = education.GetPropertyValue(x); |
|
|
|
{ |
|
|
|
// dicts.Add(x, value); |
|
|
|
var dicts = new Dictionary<string, object>(); |
|
|
|
// }); |
|
|
|
columnNames.ForEach(x => |
|
|
|
// if (columnNames.Any(x => x == "AttachmentIDs")) |
|
|
|
{ |
|
|
|
// dicts["AttachmentIDs"] = education.AttachmentIDs; |
|
|
|
var value = education.GetPropertyValue(x); |
|
|
|
// educationDic.Add(dicts); |
|
|
|
dicts.Add(x, value); |
|
|
|
//}); |
|
|
|
}); |
|
|
|
|
|
|
|
educationDic.Add(dicts); |
|
|
|
//Data.Education = educationDic; |
|
|
|
}); |
|
|
|
//#endregion |
|
|
|
|
|
|
|
|
|
|
|
ViewBag.EducationDic = educationDic; |
|
|
|
//#region 工作经历 |
|
|
|
#endregion |
|
|
|
//columnNames = formColumns.Where(x => x.GroupType == "WorkExp").Select(x => x.ColumnName).ToList(); |
|
|
|
|
|
|
|
//columnNames = columnNames.Distinct().ToList(); |
|
|
|
#region 工作经历 |
|
|
|
//var workExps = await _ghrh_ResumeWorkExpServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
columnNames = formColumns.Where(x => x.GroupType == "WorkExp").Select(x => x.ColumnName).ToList(); |
|
|
|
//var workExpDic = new List<Dictionary<string, object>>(); |
|
|
|
columnNames = columnNames.Distinct().ToList(); |
|
|
|
//workExps.ForEach(workExp => |
|
|
|
columnNames.Add("BeginDate1"); |
|
|
|
//{ |
|
|
|
columnNames.Add("EndDate1"); |
|
|
|
// var dicts = new Dictionary<string, object>(); |
|
|
|
var workExps = await _ghrh_ResumeWorkExpServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
// columnNames.ForEach(x => |
|
|
|
var workExpDic = new List<Dictionary<string, object>>(); |
|
|
|
// { |
|
|
|
workExps.ForEach(workExp => |
|
|
|
// var value = workExp.GetPropertyValue(x); |
|
|
|
{ |
|
|
|
// dicts.Add(x, value); |
|
|
|
var dicts = new Dictionary<string, object>(); |
|
|
|
// }); |
|
|
|
columnNames.ForEach(x => |
|
|
|
// if (columnNames.Any(x => x == "AttachmentIDs")) |
|
|
|
{ |
|
|
|
// dicts["AttachmentIDs"] = workExp.AttachmentIDs; |
|
|
|
var value = workExp.GetPropertyValue(x); |
|
|
|
// workExpDic.Add(dicts); |
|
|
|
dicts.Add(x, value); |
|
|
|
//}); |
|
|
|
}); |
|
|
|
|
|
|
|
workExpDic.Add(dicts); |
|
|
|
//Data.WorkExp = workExpDic; |
|
|
|
}); |
|
|
|
//#endregion |
|
|
|
|
|
|
|
|
|
|
|
ViewBag.WorkExpDic = workExpDic; |
|
|
|
//#region 证件 |
|
|
|
#endregion |
|
|
|
//columnNames = formColumns.Where(x => x.GroupType == "Licence").Select(x => x.ColumnName).ToList(); |
|
|
|
|
|
|
|
//columnNames = columnNames.Distinct().ToList(); |
|
|
|
#region 证件 |
|
|
|
//var Licences = await _ghrh_ResumeLicenceServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
columnNames = formColumns.Where(x => x.GroupType == "Licence").Select(x => x.ColumnName).ToList(); |
|
|
|
//var licenceDic = new List<Dictionary<string, object>>(); |
|
|
|
columnNames = columnNames.Distinct().ToList(); |
|
|
|
//Licences.ForEach(licence => |
|
|
|
columnNames.Add("BeginDate1"); |
|
|
|
//{ |
|
|
|
columnNames.Add("EndDate1"); |
|
|
|
// var dicts = new Dictionary<string, object>(); |
|
|
|
var Licences = await _ghrh_ResumeLicenceServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
// columnNames.ForEach(x => |
|
|
|
var licenceDic = new List<Dictionary<string, object>>(); |
|
|
|
// { |
|
|
|
Licences.ForEach(licence => |
|
|
|
// var value = licence.GetPropertyValue(x); |
|
|
|
{ |
|
|
|
// dicts.Add(x, value); |
|
|
|
var dicts = new Dictionary<string, object>(); |
|
|
|
// }); |
|
|
|
columnNames.ForEach(x => |
|
|
|
// if (columnNames.Any(x => x == "AttachmentIDs")) |
|
|
|
{ |
|
|
|
// dicts["AttachmentIDs"] = licence.AttachmentIDs; |
|
|
|
var value = licence.GetPropertyValue(x); |
|
|
|
// licenceDic.Add(dicts); |
|
|
|
dicts.Add(x, value); |
|
|
|
//}); |
|
|
|
}); |
|
|
|
|
|
|
|
licenceDic.Add(dicts); |
|
|
|
//Data.Licence = licenceDic; |
|
|
|
}); |
|
|
|
//#endregion |
|
|
|
|
|
|
|
|
|
|
|
ViewBag.LicenceDic = licenceDic; |
|
|
|
//#region 简历培训记录 |
|
|
|
#endregion |
|
|
|
//columnNames = formColumns.Where(x => x.GroupType == "Training").Select(x => x.ColumnName).ToList(); |
|
|
|
|
|
|
|
//columnNames = columnNames.Distinct().ToList(); |
|
|
|
#region 简历培训记录 |
|
|
|
//var Trainings = await _ghrh_ResumeTrainingServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
columnNames = formColumns.Where(x => x.GroupType == "Training").Select(x => x.ColumnName).ToList(); |
|
|
|
//var trainingDic = new List<Dictionary<string, object>>(); |
|
|
|
columnNames = columnNames.Distinct().ToList(); |
|
|
|
//Trainings.ForEach(training => |
|
|
|
columnNames.Add("BeginDate1"); |
|
|
|
//{ |
|
|
|
columnNames.Add("EndDate1"); |
|
|
|
// var dicts = new Dictionary<string, object>(); |
|
|
|
columnNames.Add("IsPassLabel"); |
|
|
|
// columnNames.ForEach(x => |
|
|
|
var Trainings = await _ghrh_ResumeTrainingServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
// { |
|
|
|
var trainingDic = new List<Dictionary<string, object>>(); |
|
|
|
// var value = training.GetPropertyValue(x); |
|
|
|
Trainings.ForEach(training => |
|
|
|
// dicts.Add(x, value); |
|
|
|
{ |
|
|
|
// }); |
|
|
|
var dicts = new Dictionary<string, object>(); |
|
|
|
// if (columnNames.Any(x => x == "AttachmentIDs")) |
|
|
|
columnNames.ForEach(x => |
|
|
|
// dicts["AttachmentIDs"] = training.AttachmentIDs; |
|
|
|
{ |
|
|
|
// trainingDic.Add(dicts); |
|
|
|
var value = training.GetPropertyValue(x); |
|
|
|
//}); |
|
|
|
dicts.Add(x, value); |
|
|
|
|
|
|
|
}); |
|
|
|
//Data.Training = trainingDic; |
|
|
|
trainingDic.Add(dicts); |
|
|
|
//#endregion |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//Data.Attachment = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == id.ObjToString()).ToListAsync(); |
|
|
|
ViewBag.TrainingDic = trainingDic; |
|
|
|
//var statements = await _ghrh_ResumeStatementServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);//证件 |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
//Data.Statement = statements.ToDictionary(person => person.StatementCode, person => person.TrueOrFalse); |
|
|
|
var statements = await _ghrh_ResumeStatementServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);//证件 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewBag.StatementDic = statements.ToDictionary(person => person.StatementCode, person => person.TrueOrFalse); |
|
|
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|