纯html画简历表

master
xiaochanghai 7 months ago
parent e0f743e9bf
commit 60644aacc0
  1. 386
      Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeTemplatePreviewController.cs
  2. 1
      Tiobon.Core.Api/Program.cs
  3. 6
      Tiobon.Core.Api/Tiobon.Core.xml
  4. 201
      Tiobon.Core.Api/Views/Ghrh_ResumeTemplatePreview/Index.cshtml
  5. 13
      Tiobon.Core.Api/Views/Shared/_Layout.cshtml
  6. 13
      Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeHome.Dto.View.cs
  7. 5
      Tiobon.Core.Model/ViewModels/Extend/ResumeTemplateGroupColumn.cs
  8. 4
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeHomeServices.cs
  9. 9
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs

@ -0,0 +1,386 @@
using SqlSugar;
using System.Dynamic;
using Tiobon.Core.Common.DB.Dapper.Extensions;
using Tiobon.Core.Model.ViewModels.Extend;
namespace Tiobon.Core.Api.Controllers;
[AllowAnonymous, Route("Ghrh_ResumeTemplatePreview/[action]"), ApiExplorerSettings(GroupName = Grouping.GroupName_Other)]
public class Ghrh_ResumeTemplatePreviewController : Controller
{
private readonly ISqlSugarClient _db;
private readonly IGhrh_ResumeServices _ghrh_ResumeServices;
private readonly IGhrh_ResumeHomeServices _ghrh_ResumeHomeServices;
public Ghrh_ResumeTemplatePreviewController(ISqlSugarClient db,
IGhrh_ResumeServices ghrh_ResumeServices,
IGhrh_ResumeHomeServices ghrh_ResumeHomeServices)
{
_db = db;
_ghrh_ResumeServices = ghrh_ResumeServices;
_ghrh_ResumeHomeServices = ghrh_ResumeHomeServices;
}
/// <summary>
/// Index
/// </summary>
/// <returns></returns>
public async Task<IActionResult> Index()
{
string sql = @"DECLARE @ID BIGINT = 1
BEGIN
DECLARE
@MasterTemplateID INT = 0,
@TemplateType INT -- ID
SELECT @TemplateType = TemplateType
FROM Ghrh_ResumeTemplate
WHERE ID = @ID
SELECT @MasterTemplateID = ID
FROM Ghrh_ResumeTemplate
WHERE IsEnable = 1 AND TemplateType = 1
SELECT *
FROM (SELECT a.ID,
a.ID ResumeTemplateInfoGroupID,
b.ID ResumeInfoGroupID,
b.GroupName tabName,
b.GroupType tabKey,
b.TableName,
b.TablePKIDName, --
ISNULL (a.IsDisplay, 0) isDisplay,
isnull (a.SortNo, b.SortNo) SortNo,
CASE
WHEN b.GroupType = 'Base' THEN 'list'
WHEN b.GroupType = 'Attachment' THEN 'Attachment'
WHEN b.GroupType = 'Statement' THEN 'Statement'
ELSE 'block'
END AS type,
-- case when ISNULL(a.IsDisplay,0)=0 then ''
CASE
WHEN 1 = 2
THEN
''
ELSE
CASE
WHEN b.GroupType = 'Base' --
THEN
isnull
(
(SELECT pp.ColumnName field,
pp.ResumeInfoColumnName label,
pp.IsRequired required,
pp.ColumnType elementType,
CASE
WHEN pp.DataSourceType =
'ParaDetailNo'
THEN
(SELECT 'TBParaDetail_'
+ ParaTypeNo
+ '_'
+ ParaMasterNo
FROM Ghrs_ParaMaster
WHERE ParaMasterId =
pp.DataSource)
WHEN pp.DataSourceType =
'CommonList'
THEN
(SELECT 'CommonList_'
+ ListCommonSqlNo
FROM Ghrs_ListCommonSql
WHERE ListCommonSqlId =
pp.DataSource)
ELSE
NULL
END dataSource,
pp.DataType dataType,
pp.MultipleSelect multipleSelect,
kk.SortNo sortNo,
pp.Placeholder placeholder,
pp.Editable editable
FROM Ghrh_ResumeTemplateInfoGroupColumn kk,
Ghrh_ResumeInfoColumn pp
WHERE kk.ResumeTemplateInfoGroupID = a.ID
-- a.ResumeTemplateInfoGroupID
AND kk.ResumeInfoColumnID = pp.ID
AND kk.IsDisplay = 1
AND pp.IsEnable = 1
AND kk.IsEnable = 1
order by kk.SortNo
FOR JSON PATH, INCLUDE_NULL_VALUES),
'')
WHEN b.GroupType = 'Photo' --
THEN
(SELECT PhotoType
FROM Ghrh_ResumeTemplate
WHERE ResumeTemplateID = @MasterTemplateID
FOR JSON PATH, INCLUDE_NULL_VALUES)
WHEN b.GroupType NOT IN ('Base', 'Photo') --
THEN
isnull
(
(SELECT pp.ColumnName field,
pp.ResumeInfoColumnName label,
pp.IsRequired required,
pp.ColumnType elementType,
CASE
WHEN pp.DataSourceType =
'ParaDetailNo'
THEN
(SELECT 'TBParaDetail_'
+ ParaTypeNo
+ '_'
+ ParaMasterNo
FROM Ghrs_ParaMaster
WHERE ParaMasterId =
pp.DataSource)
WHEN pp.DataSourceType =
'CommonList'
THEN
(SELECT 'CommonList_'
+ ListCommonSqlNo
FROM Ghrs_ListCommonSql
WHERE ListCommonSqlId =
pp.DataSource)
ELSE
NULL
END dataSource,
pp.DataType dataType,
pp.MultipleSelect multipleSelect,
kk.SortNo sortNo,
pp.Placeholder placeholder,
pp.Editable editable
FROM Ghrh_ResumeTemplateInfoGroupColumn kk,
Ghrh_ResumeInfoColumn pp
WHERE kk.ResumeTemplateID =
@MasterTemplateID
AND kk.ResumeInfoGroupId = b.Id
-- b.ResumeInfoGroupId
AND pp.Id = kk.ResumeInfoColumnId
AND kk.IsDisplay = 1
AND pp.IsEnable = 1
AND kk.IsEnable = 1
order by kk.SortNo
FOR JSON PATH, INCLUDE_NULL_VALUES),
'')
END
END children1
FROM Ghrh_ResumeInfoGroup b
LEFT JOIN Ghrh_ResumeTemplateInfoGroup a
ON a.ResumeInfoGroupId = b.ID
AND a.IsEnable = 1
AND a.ResumeTemplateID = @ID
WHERE b.IsEnable = 1) a
WHERE a.IsDisplay = 1
-- order by ISNULL(a.IsDisplay,0) desc,isnull(a.SortNo,b.SortNo) -- , ,
ORDER BY a.SortNo ASC
END";
var columns = await _db.Ado.SqlQueryAsync<ResumeFormColumn>(sql);
columns.ForEach(x =>
{
if (x.children1.IsNotEmptyOrNull())
x.children = JsonHelper.JsonToObj<List<ResumeFormColumnChildren>>(x.children1);
if (x.children != null)
{
x.children = x.children.Where(o => o.label != "附件").ToList();
if (x.tabKey == "Base")
{
x.children.ForEach(o =>
{
if (o.field == "TitleId") o.field = "TitleName";
if (o.field == "Gender") o.field = "GenderLabel";
if (o.field == "Education") o.field = "EducationLabel";
if (o.field == "Nation") o.field = "NationLabel";
if (o.field == "MaritalStatus") o.field = "MaritalStatusLabel";
if (o.field == "PoliticStatus") o.field = "PoliticStatusLabel";
if (o.field == "UrgentRelation") o.field = "UrgentRelationLabel";
if (o.field == "CertificateType") o.field = "CertificateTypeLabel";
if (o.field == "RegisteredType") o.field = "RegisteredTypeLabel";
});
}
if (x.tabKey == "Family")
x.children.ForEach(o =>
{
if (o.field == "Gender") o.field = "GenderLabel";
});
}
x.children1 = null;
});
ViewBag.Columns = columns.Where(o => o.tabName != "附件").ToList();
#region Data
dynamic Data = new ExpandoObject();
var formColumns = await QueryResumeFormColumn(1);
#region Base
var id = 1856146208591056896;
var entity = await _ghrh_ResumeServices.QueryById(id);
var columnNames = formColumns.Where(x => x.GroupType == "Base").Select(x => x.ColumnName).ToList();
columnNames = columnNames.Distinct().ToList();
var dicts = new Dictionary<string, object>
{
};
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.ForEach(x =>
{
var value = entity.GetPropertyValue(x);
dicts.Add(x, value);
});
ViewBag.BaseDic = dicts;
#endregion
#region 家庭关系
columnNames = formColumns.Where(x => x.GroupType == "Family").Select(x => x.ColumnName).ToList();
columnNames = columnNames.Distinct().ToList();
columnNames.Add("GenderLabel");
columnNames.Add("GenderLabel");
var familys = await _ghrh_ResumeHomeServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
var familyDic = new List<Dictionary<string, object>>();
familys.ForEach(family =>
{
var dicts = new Dictionary<string, object>();
columnNames.ForEach(x =>
{
var value = family.GetPropertyValue(x);
dicts.Add(x, value);
});
if (columnNames.Any(x => x == "AttachmentIDs"))
dicts["AttachmentIDs"] = family.AttachmentIDs;
familyDic.Add(dicts);
});
ViewBag.FamilyDic = familyDic;
#endregion
//#region 教育背景
//columnNames = formColumns.Where(x => x.GroupType == "Education").Select(x => x.ColumnName).ToList();
//columnNames = columnNames.Distinct().ToList();
//var educations = await _ghrh_ResumeEduBGServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
//var educationDic = new List<Dictionary<string, object>>();
//educations.ForEach(education =>
//{
// var dicts = new Dictionary<string, object>();
// columnNames.ForEach(x =>
// {
// var value = education.GetPropertyValue(x);
// dicts.Add(x, value);
// });
// if (columnNames.Any(x => x == "AttachmentIDs"))
// dicts["AttachmentIDs"] = education.AttachmentIDs;
// educationDic.Add(dicts);
//});
//Data.Education = educationDic;
//#endregion
//#region 工作经历
//columnNames = formColumns.Where(x => x.GroupType == "WorkExp").Select(x => x.ColumnName).ToList();
//columnNames = columnNames.Distinct().ToList();
//var workExps = await _ghrh_ResumeWorkExpServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
//var workExpDic = new List<Dictionary<string, object>>();
//workExps.ForEach(workExp =>
//{
// var dicts = new Dictionary<string, object>();
// columnNames.ForEach(x =>
// {
// var value = workExp.GetPropertyValue(x);
// dicts.Add(x, value);
// });
// if (columnNames.Any(x => x == "AttachmentIDs"))
// dicts["AttachmentIDs"] = workExp.AttachmentIDs;
// workExpDic.Add(dicts);
//});
//Data.WorkExp = workExpDic;
//#endregion
//#region 证件
//columnNames = formColumns.Where(x => x.GroupType == "Licence").Select(x => x.ColumnName).ToList();
//columnNames = columnNames.Distinct().ToList();
//var Licences = await _ghrh_ResumeLicenceServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
//var licenceDic = new List<Dictionary<string, object>>();
//Licences.ForEach(licence =>
//{
// var dicts = new Dictionary<string, object>();
// columnNames.ForEach(x =>
// {
// var value = licence.GetPropertyValue(x);
// dicts.Add(x, value);
// });
// if (columnNames.Any(x => x == "AttachmentIDs"))
// dicts["AttachmentIDs"] = licence.AttachmentIDs;
// licenceDic.Add(dicts);
//});
//Data.Licence = licenceDic;
//#endregion
//#region 简历培训记录
//columnNames = formColumns.Where(x => x.GroupType == "Training").Select(x => x.ColumnName).ToList();
//columnNames = columnNames.Distinct().ToList();
//var Trainings = await _ghrh_ResumeTrainingServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
//var trainingDic = new List<Dictionary<string, object>>();
//Trainings.ForEach(training =>
//{
// var dicts = new Dictionary<string, object>();
// columnNames.ForEach(x =>
// {
// var value = training.GetPropertyValue(x);
// dicts.Add(x, value);
// });
// if (columnNames.Any(x => x == "AttachmentIDs"))
// dicts["AttachmentIDs"] = training.AttachmentIDs;
// trainingDic.Add(dicts);
//});
//Data.Training = trainingDic;
//#endregion
//Data.Attachment = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == id.ObjToString()).ToListAsync();
//var statements = await _ghrh_ResumeStatementServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);//证件
//Data.Statement = statements.ToDictionary(person => person.StatementCode, person => person.TrueOrFalse);
#endregion
return View();
}
[NonAction]
public async Task<List<ResumeFormColumn1>> 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<ResumeFormColumn1>(sql);
}
}

@ -114,6 +114,7 @@ builder.Services.AddKafkaSetup(builder.Configuration);
builder.Services.AddEventBusSetup();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddMvc();
builder.Services.Replace(ServiceDescriptor.Transient<IControllerActivator, ServiceBasedControllerActivator>());
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

@ -1578,6 +1578,12 @@
<param name="filter"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeTemplatePreviewController.Index">
<summary>
Index
</summary>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghrh_ResumeTrainingController">
<summary>
简历培训记录(Controller)

@ -0,0 +1,201 @@
@using Tiobon.Core.Model.ViewModels.Extend
@{
ViewData["Title"] = "测试测试";
Layout = "~/Views/Shared/_Layout.cshtml";
List<ResumeFormColumn> Columns = ViewBag.Columns;
Dictionary<string, object> BaseDic = ViewBag.BaseDic;
List<Dictionary<string, object>> FamilyDic = ViewBag.FamilyDic;
}
<style type="text/css">
body {
color: #000000d9;
font-size: 14px;
font-family: Noto Sans SC, PingFang SC, tahoma, arial, Hiragino Sans GB, Hiragino Sans GB W3, Microsoft Yahei, STHeitiSC-Light, Helvetica-Light, sans-serif !important;
}
.ghr-preview-staff-info .pageContainer {
background-color: #fff;
overflow-y: auto;
}
.ghr-preview-staff-info .pageContainer .a4page {
width: 794px;
padding: 40px;
box-sizing: border-box;
page-break-after: always;
}
.pageContainer .a4page.displayMode {
margin: 20px auto;
/* border: 1px #d3d3d3 solid;
box-shadow: 0 0 5px #0000001a; */
display: flex;
flex-wrap: wrap;
}
.ghr-preview-staff-base-info {
margin-bottom: 30px;
}
.ghr-preview-staff-base-info .staffPhoto {
width: 138px;
height: 138px;
display: inline-block;
vertical-align: top;
position: relative;
}
.ghr-preview-staff-base-info .staffPhoto img {
width: 100%;
height: 100%;
-o-object-fit: contain;
object-fit: contain;
}
.ghr-preview-staff-base-info .staffBaseInfo {
height: 138px;
display: inline-block;
vertical-align: top;
padding-left: 25px;
}
.ghr-preview-staff-base-info .staffBaseInfo .staffName {
font-size: 20px;
margin-top: 10px;
}
.ghr-preview-staff-base-info .staffBaseInfo .staffEName {
font-size: 16px;
color: #5d5d5d;
}
.ghr-preview-staff-base-info .staffBaseInfo .staffHumanResourcesMsg {
font-size: 16px;
color: #5d5d5d;
margin-top: 15px;
}
.ghr-preview-staff-resume-title {
height: 26px;
line-height: 26px;
font-size: 18px;
color: #242424;
margin: 15px 0;
border-left: 2px solid #ff9300;
padding-left: 15px;
width: 100%
}
.ghr-preview-staff-resume-block-item {
width: 50%;
display: inline-block;
vertical-align: top;
min-height: 25px;
word-break: break-all;
line-height: 25px;
margin: 5px 0;
}
.ghr-preview-staff-resume-block-item .label {
width: 150px;
display: inline-block;
vertical-align: top;
height: 25px;
line-height: 25px;
text-align: right;
}
.ghr-preview-staff-resume-block-item .itemValue {
display: inline-block;
vertical-align: top;
min-height: 25px;
line-height: 25px;
}
</style>
<div class="ghr-preview-staff-info">
<div class="pageContainer">
<div class="a4page displayMode" id="pageIndex-0">
@if (Columns != null && Columns.Count > 0)
{
foreach (var item in Columns)
{
if (item.tabKey == "Photo")
{
<main class="ghr-preview-staff-base-info" id="info">
<div class="staffPhoto">
<img src="http://g.tiobon.com/File/UploadPath/1_20241120174307502_1729436858909.png" alt="">
</div>
<div class="staffBaseInfo">
<div class="staffName">zy001&nbsp;</div>
<div class="staffEName">&nbsp;</div>
<div class="staffHumanResourcesMsg">T1006&nbsp; <span><span>|</span><span>测试一部</span> &nbsp; </span><span><span>|</span><span>岗位: (无)</span> &nbsp; </span><span><span>|</span><span>职等: (无)</span> &nbsp; </span></div>
</div>
</main>
}
else if (item.tabKey == "Base")
{
<main class="ghr-preview-staff-resume-title" id="Base">
@item.tabName
</main>
if (item.children != null && item.children.Any())
foreach (var children in item.children)
{
<main class="ghr-preview-staff-resume-block-item" id="Base-0-StaffName">
<div class="label">@(children.label):</div>
<div class="itemValue">
@{
if (BaseDic.ContainsKey(children.field))
{
if (children.field == "Birthday" || children.field == "GraduateDate")
@DateTimeHelper.ConvertToDayString(BaseDic[children.field])
else
@BaseDic[children.field]
}
}
</div>
</main>
}
}
else if (item.tabKey == "Family")
{
if (FamilyDic.Count > 0)
{
<main class="ghr-preview-staff-resume-title" id="Base">
@item.tabName
</main>
}
for (var i = 0; i < FamilyDic.Count; i++)
{
if (i > 0)
{
<div style="margin-top:20px;width:100%"></div>
}
if (item.children != null && item.children.Any())
foreach (var children in item.children)
{
<main class="ghr-preview-staff-resume-block-item" id="Base-0-StaffName">
<div class="label">@(children.label):</div>
<div class="itemValue">
@{
if (FamilyDic[i].ContainsKey(children.field))
{
if (children.field == "Birth")
@DateTimeHelper.ConvertToDayString(FamilyDic[i][children.field])
else
@FamilyDic[i][children.field]
}
}
</div>
</main>
}
}
}
}
}
</div>
</div>
</div>

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>乔邦科技 | @ViewData["Title"]</title>
@RenderSection("Styles", required: false)
</head>
<body>
@RenderBody()
@RenderSection("Scripts", required: false)
</body>
</html>

@ -34,4 +34,17 @@ public class Ghrh_ResumeHomeDto : Ghrh_ResumeHome
/// </summary>
public string UpdateDataInfo { get; set; }
public List<ResumeAttachment> AttachmentIDs { get; set; }
/// <summary>
/// 性别
/// </summary>
public string GenderLabel { get; set; }
/// <summary>
/// 关系
/// </summary>
public string RelationTypeLabel { get; set; }
}

@ -30,8 +30,9 @@ public class ResumeFormColumn1
{
public string ColumnName { get; set; }
public string ColumnNameDesc { get; set; }
public string GroupType { get; set; }
public string GroupType { get; set; }
public string ColumnType { get; set; }
}

@ -19,8 +19,10 @@ public class Ghrh_ResumeHomeServices : BaseServices<Ghrh_ResumeHome, Ghrh_Resume
var ids = data.Select(x => x.Id.ToString()).ToList();
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => ids.Contains(x.TableName)).ToListAsync();
data.ForEach(x =>
data.ForEach(async x =>
{
x.GenderLabel = await GetParaLabel("Gender", x.Gender);
x.RelationTypeLabel = await GetParaLabel("SocialRelationType", x.RelationType);
x.AttachmentIDs = attachments
.Where(o => o.TableName == x.Id.ToString())
.Select(o => new ResumeAttachment()

@ -1,4 +1,5 @@
using Org.BouncyCastle.Crypto;
using Microsoft.IdentityModel.Tokens;
using Org.BouncyCastle.Crypto;
using static Tiobon.Core.Model.Consts;
namespace Tiobon.Core.Services;
@ -318,7 +319,9 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins
x.MaritalStatusLabel = await GetParaLabel("A03", x.MaritalStatus);
x.PoliticStatusLabel = await GetParaLabel("A04", x.PoliticStatus);
x.UrgentRelationLabel = await GetParaLabel("SocialRelationType", x.UrgentRelation);
x.CertificateTypeLabel = await GetParaLabel("D51", x.CertificateType);
x.RegisteredTypeLabel = await GetParaLabel("A08", x.RegisteredType);
x.EduBG = eduBGs.Where(o => x.Id == o.ResumeId).ToList();
x.WorkExp = workExps.Where(o => x.Id == o.ResumeId).ToList();
if (x.Tags.IsNotEmptyOrNull())
@ -2232,7 +2235,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1";
{
var dt = Db.GetDate().AddDays(-30);
var list = await base.Query(x => x.Status == "Recycled" && x.RecycledTime <= dt);
var list = await base.Query(x => x.Status == "Recycled" && x.RecycledTime <= dt);
var ids = list.Select(x => x.Id).ToList();
if (ids.Any())
await Db.Updateable<Ghrh_Resume>()

Loading…
Cancel
Save