{
};
columnNames.Add("TitleName");
columnNames.Add("GenderLabel");
columnNames.Add("EducationLabel");
columnNames.Add("NationLabel");
columnNames.Add("MaritalStatusLabel");
columnNames.Add("PoliticStatusLabel");
columnNames.Add("UrgentRelationLabel");
columnNames.Add("CertificateTypeLabel");
columnNames.Add("RegisteredTypeLabel");
columnNames.Add("EduDegreeLabel");
columnNames.Add("ApplyStatusLabel");
columnNames.Add("ChannelLabel");
columnNames.ForEach(x =>
{
var value = entity.GetPropertyValue(x);
if (x == "RemarkSz")
{
if (value != null)
{
value = "" + value.ToString().Replace("\n", "") + "
";
}
dicts.Add(x, value);
}
else
dicts.Add(x, value);
});
ViewBag.BaseDic = dicts;
ViewBag.entity = entity;
#endregion
#region 家庭关系
columnNames = formColumns.Where(x => x.GroupType == "Family").Select(x => x.ColumnName).ToList();
columnNames = columnNames.Distinct().ToList();
columnNames.Add("GenderLabel");
columnNames.Add("RelationTypeLabel");
var familys = await _ghrh_ResumeHomeServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
var familyDic = new List>();
familys.ForEach(family =>
{
var dicts = new Dictionary();
columnNames.ForEach(x =>
{
var value = family.GetPropertyValue(x);
dicts.Add(x, value);
});
familyDic.Add(dicts);
});
ViewBag.FamilyDic = familyDic;
#endregion
#region 教育背景
columnNames = formColumns.Where(x => x.GroupType == "Education").Select(x => x.ColumnName).ToList();
columnNames = columnNames.Distinct().ToList();
columnNames.Add("IsGraduateLabel");
columnNames.Add("DegreeLevelLabel");
columnNames.Add("BeginDate1");
columnNames.Add("EndDate1");
var educations = await _ghrh_ResumeEduBGServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
var educationDic = new List>();
educations.ForEach(education =>
{
var dicts = new Dictionary();
columnNames.ForEach(x =>
{
var value = education.GetPropertyValue(x);
dicts.Add(x, value);
});
educationDic.Add(dicts);
});
ViewBag.EducationDic = educationDic;
#endregion
#region 工作经历
columnNames = formColumns.Where(x => x.GroupType == "WorkExp").Select(x => x.ColumnName).ToList();
columnNames = columnNames.Distinct().ToList();
columnNames.Add("BeginDate1");
columnNames.Add("EndDate1");
var workExps = await _ghrh_ResumeWorkExpServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
var workExpDic = new List>();
workExps.ForEach(workExp =>
{
var dicts = new Dictionary();
columnNames.ForEach(x =>
{
var value = workExp.GetPropertyValue(x);
dicts.Add(x, value);
});
workExpDic.Add(dicts);
});
ViewBag.WorkExpDic = workExpDic;
#endregion
#region 证件
columnNames = formColumns.Where(x => x.GroupType == "Licence").Select(x => x.ColumnName).ToList();
columnNames = columnNames.Distinct().ToList();
columnNames.Add("BeginDate1");
columnNames.Add("EndDate1");
var Licences = await _ghrh_ResumeLicenceServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
var licenceDic = new List>();
Licences.ForEach(licence =>
{
var dicts = new Dictionary();
columnNames.ForEach(x =>
{
var value = licence.GetPropertyValue(x);
dicts.Add(x, value);
});
licenceDic.Add(dicts);
});
ViewBag.LicenceDic = licenceDic;
#endregion
#region 简历培训记录
columnNames = formColumns.Where(x => x.GroupType == "Training").Select(x => x.ColumnName).ToList();
columnNames = columnNames.Distinct().ToList();
columnNames.Add("BeginDate1");
columnNames.Add("EndDate1");
columnNames.Add("IsPassLabel");
var Trainings = await _ghrh_ResumeTrainingServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
var trainingDic = new List>();
Trainings.ForEach(training =>
{
var dicts = new Dictionary();
columnNames.ForEach(x =>
{
var value = training.GetPropertyValue(x);
dicts.Add(x, value);
});
trainingDic.Add(dicts);
});
ViewBag.TrainingDic = trainingDic;
#endregion
var statements = await _ghrh_ResumeStatementServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);//证件
var StatementDic = new Dictionary();
statements.ForEach(statement =>
{
if (!StatementDic.ContainsKey(statement.StatementCode))
StatementDic.Add(statement.StatementCode, statement.TrueOrFalse);
});
ViewBag.StatementDic = StatementDic;
#endregion
string cssUrl = AppSettings.app(["Startup", "FrontUrl"]);
string path = string.Empty;
cssUrl += "/Advanced";
if (App.HostEnvironment.IsDevelopment())
cssUrl = "http://localhost:9292";
cssUrl += "/css/resume.css";
ViewBag.CssUrl = cssUrl;
ViewBag.StatementRemark = statementRemark.Replace("\\n", "");
var displaySignatureArea = false;
var config = await _db.Queryable().Where(x => x.ConfigCode == "ESS_Recruit_File_Display_Signature_Area").SingleAsync();
if (config != null && config.ConfigValue == "1")
displaySignatureArea = true;
ViewBag.DisplaySignatureArea = displaySignatureArea;
return View();
}
[NonAction]
public async Task> QueryResumeFormColumn(long resumeTemplateID)
{
var sql = @$"DECLARE @ResumeTemplateID BIGINT = {resumeTemplateID}
SELECT A.ColumnName, A.ResumeInfoColumnName ColumnNameDesc, A.ColumnType, D.GroupType
FROM Ghrh_ResumeInfoColumn A
LEFT JOIN Ghrh_ResumeTemplateInfoGroupColumn B
ON B.ResumeInfoColumnID = A.ID
AND B.IsDisplay = 1
AND B.IsEnable = 1
AND A.IsEnable = 1
JOIN Ghrh_ResumeTemplateInfoGroup C
ON B.ResumeTemplateInfoGroupID = C.Id
JOIN Ghrh_ResumeInfoGroup D
ON C.ResumeInfoGroupId = D.ID AND D.IsEnable = 1
WHERE C.ResumeTemplateID = @ResumeTemplateID
-- AND D.GroupType = 'Base'
ORDER BY D.GroupType, b.SortNo";
return await _db.Ado.SqlQueryAsync(sql);
}
}