|
|
|
@ -1,10 +1,11 @@ |
|
|
|
|
using DinkToPdf; |
|
|
|
|
using DinkToPdf.Contracts; |
|
|
|
|
using Google.Protobuf.WellKnownTypes; |
|
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
|
using Microsoft.AspNetCore.Http.HttpResults; |
|
|
|
|
using Microsoft.Extensions.Hosting; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.ComponentModel; |
|
|
|
|
using System.IO.Compression; |
|
|
|
|
using Tiobon.Core.Common.DB.Dapper.Extensions; |
|
|
|
|
using static Tiobon.Core.Model.Consts; |
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
@ -3807,7 +3808,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
|
|
|
|
|
var type = sendOfferConfig?.ConfigValue ?? "Fast"; |
|
|
|
|
var formColumns = await QueryResumeFormColumn(); |
|
|
|
|
formColumns = formColumns.Where(x => x.MapTableName.IsNotEmptyOrNull() && x.MapColumnName.IsNotEmptyOrNull()).ToList(); |
|
|
|
|
formColumns = formColumns.Where(x => x.MapColumnName.IsNotEmptyOrNull()).ToList(); |
|
|
|
|
|
|
|
|
|
int staffId = 0; |
|
|
|
|
|
|
|
|
@ -3854,28 +3855,41 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
await Update(entity, ["IsSyncToStaff", "StaffId"]); |
|
|
|
|
|
|
|
|
|
#region 家庭关系 |
|
|
|
|
var list = new List<Dictionary<string, object>>(); |
|
|
|
|
//var list = new List<Dictionary<string, object>>(); |
|
|
|
|
|
|
|
|
|
//StaffID = staffId, |
|
|
|
|
// RelationType = family.RelationType, |
|
|
|
|
// RelationName = family.RelationName, |
|
|
|
|
// IDCardNo = family.IDCardNo, |
|
|
|
|
// Gender = family.Gender, |
|
|
|
|
// Birthday = family.Birth, |
|
|
|
|
// CompanyName = family.WorkCompany, |
|
|
|
|
// //DeptName = family.WorkCompany, |
|
|
|
|
// RelationAddress = family.RelationAddress, |
|
|
|
|
// RelationTel = family.Telephone, |
|
|
|
|
// Reverse1 = family.RelationAge, |
|
|
|
|
// RemarkSz = family.RemarkSz |
|
|
|
|
|
|
|
|
|
var familys = await _ghrh_ResumeHomeServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
|
for (int i = 0; i < familys.Count; i++) |
|
|
|
|
{ |
|
|
|
|
var family = familys[i]; |
|
|
|
|
var staffEduBG = new Ghra_StaffSocialRelation() |
|
|
|
|
{ |
|
|
|
|
StaffID = staffId, |
|
|
|
|
RelationType = family.RelationType, |
|
|
|
|
RelationName = family.RelationName, |
|
|
|
|
IDCardNo = family.IDCardNo, |
|
|
|
|
Gender = family.Gender, |
|
|
|
|
Birthday = family.Birth, |
|
|
|
|
CompanyName = family.WorkCompany, |
|
|
|
|
//DeptName = family.WorkCompany, |
|
|
|
|
RelationAddress = family.RelationAddress, |
|
|
|
|
RelationTel = family.Telephone, |
|
|
|
|
Reverse1 = family.RelationAge, |
|
|
|
|
RemarkSz = family.RemarkSz |
|
|
|
|
}; |
|
|
|
|
var staffSocialRelation = await Db.Insertable(staffEduBG).ExecuteReturnIdentityAsync(); |
|
|
|
|
Dictionary<string, object> staffFamily = new(); |
|
|
|
|
staffFamily.Add("StaffID", staffId); |
|
|
|
|
staffFamily.Add("CreateBy", App.User.ID); |
|
|
|
|
staffFamily.Add("CreateTime", DateTime.Now); |
|
|
|
|
staffFamily.Add("CreateProg", null); |
|
|
|
|
staffFamily.Add("CreateIP", null); |
|
|
|
|
formColumns.Where(x => x.GroupType == "Family" && x.ColumnName != "AttachmentIDs").ToList() |
|
|
|
|
.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
staffFamily.Add(x.MapColumnName, family.GetPropertyValue(x.ColumnName)); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var staffSocialRelation = await Db.Insertable(staffFamily).AS("Ghra_StaffSocialRelation").ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
|
|
if (formColumns.Where(x => x.GroupType == "Family" && x.ColumnName == "AttachmentIDs").Any()) |
|
|
|
|
{ |
|
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == family.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
@ -3890,6 +3904,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 教育背景 |
|
|
|
@ -3898,18 +3913,35 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
for (int i = 0; i < educations.Count; i++) |
|
|
|
|
{ |
|
|
|
|
var education = educations[i]; |
|
|
|
|
var staffEduBG = new Ghra_StaffEduBG() |
|
|
|
|
{ |
|
|
|
|
StaffID = staffId, |
|
|
|
|
BeginDate = education.BeginDate.ObjToString(), |
|
|
|
|
EndDate = education.EndDate.ObjToString(), |
|
|
|
|
SchoolName = education.SchoolName, |
|
|
|
|
DeptName = education.DeptName, |
|
|
|
|
DegreeLevel = education.DegreeLevel, |
|
|
|
|
IsGraduate = education.IsGraduate == true ? 1 : 0, |
|
|
|
|
RemarkSz = education.RemarkSz |
|
|
|
|
}; |
|
|
|
|
var staffEduBGId = await Db.Insertable(staffEduBG).ExecuteReturnIdentityAsync(); |
|
|
|
|
//var staffEduBG = new Ghra_StaffEduBG() |
|
|
|
|
//{ |
|
|
|
|
// StaffID = staffId, |
|
|
|
|
// BeginDate = education.BeginDate.ObjToString(), |
|
|
|
|
// EndDate = education.EndDate.ObjToString(), |
|
|
|
|
// SchoolName = education.SchoolName, |
|
|
|
|
// DeptName = education.DeptName, |
|
|
|
|
// DegreeLevel = education.DegreeLevel, |
|
|
|
|
// IsGraduate = education.IsGraduate == true ? 1 : 0, |
|
|
|
|
// RemarkSz = education.RemarkSz |
|
|
|
|
//}; |
|
|
|
|
Dictionary<string, object> staffEduBG = new(); |
|
|
|
|
staffEduBG.Add("StaffID", staffId); |
|
|
|
|
staffEduBG.Add("CreateBy", App.User.ID); |
|
|
|
|
staffEduBG.Add("CreateTime", DateTime.Now); |
|
|
|
|
staffEduBG.Add("CreateProg", null); |
|
|
|
|
staffEduBG.Add("CreateIP", null); |
|
|
|
|
formColumns.Where(x => x.GroupType == "Education" && x.ColumnName != "AttachmentIDs").ToList() |
|
|
|
|
.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
if (x.MapColumnName != "IsGraduate") |
|
|
|
|
staffEduBG.Add(x.MapColumnName, education.GetPropertyValue(x.ColumnName)); |
|
|
|
|
else |
|
|
|
|
staffEduBG.Add(x.MapColumnName, education.GetPropertyValue(x.ColumnName).ObjToBool() == true ? 1 : 0); |
|
|
|
|
}); |
|
|
|
|
var staffEduBGId = await Db.Insertable(staffEduBG).AS("Ghra_StaffEduBG").ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
|
|
if (formColumns.Where(x => x.GroupType == "Education" && x.ColumnName == "AttachmentIDs").Any()) |
|
|
|
|
{ |
|
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == education.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
@ -3924,6 +3956,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 工作经历 |
|
|
|
@ -3931,19 +3964,20 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
for (int i = 0; i < workExps.Count; i++) |
|
|
|
|
{ |
|
|
|
|
var workExp = workExps[i]; |
|
|
|
|
var staffEduBG = new Ghra_StaffWorkExp() |
|
|
|
|
{ |
|
|
|
|
StaffID = staffId, |
|
|
|
|
BeginDate = workExp.BeginDate, |
|
|
|
|
EndDate = workExp.EndDate, |
|
|
|
|
CompanyName = workExp.CompanyName, |
|
|
|
|
TitleName = workExp.TitleName, |
|
|
|
|
//IsCompany = workExp.IsCompany, |
|
|
|
|
SalaryAmount = workExp.SalaryAmount, |
|
|
|
|
SeparationReason = workExp.SeparationReason, |
|
|
|
|
RemarkSz = workExp.RemarkSz |
|
|
|
|
}; |
|
|
|
|
var staffworkExpId = await Db.Insertable(staffEduBG).ExecuteReturnIdentityAsync(); |
|
|
|
|
Dictionary<string, object> staffWorkExp = new(); |
|
|
|
|
staffWorkExp.Add("StaffID", staffId); |
|
|
|
|
staffWorkExp.Add("CreateBy", App.User.ID); |
|
|
|
|
staffWorkExp.Add("CreateTime", DateTime.Now); |
|
|
|
|
staffWorkExp.Add("CreateProg", null); |
|
|
|
|
staffWorkExp.Add("CreateIP", null); |
|
|
|
|
formColumns.Where(x => x.GroupType == "WorkExp" && x.ColumnName != "AttachmentIDs").ToList() |
|
|
|
|
.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
staffWorkExp.Add(x.MapColumnName, workExp.GetPropertyValue(x.ColumnName)); |
|
|
|
|
}); |
|
|
|
|
var staffworkExpId = await Db.Insertable(staffWorkExp).AS("Ghra_StaffWorkExp").ExecuteReturnIdentityAsync(); |
|
|
|
|
if (formColumns.Where(x => x.GroupType == "WorkExp" && x.ColumnName == "AttachmentIDs").Any()) |
|
|
|
|
{ |
|
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == workExp.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
@ -3958,6 +3992,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 证件 |
|
|
|
@ -3965,19 +4000,23 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
for (int i = 0; i < Licences.Count; i++) |
|
|
|
|
{ |
|
|
|
|
var licence = Licences[i]; |
|
|
|
|
var staffEduBG = new Ghra_StaffLicence() |
|
|
|
|
{ |
|
|
|
|
StaffID = staffId, |
|
|
|
|
BeginDate = licence.BeginDate, |
|
|
|
|
EndDate = licence.EndDate, |
|
|
|
|
LicenceName = licence.LicenceName, |
|
|
|
|
//LicenceLevel = licence.LicenceLevel, |
|
|
|
|
//IsCompany = workExp.IsCompany, |
|
|
|
|
LicenceNo = licence.LicenceNo, |
|
|
|
|
//SeparationReason = licence.SeparationReason, |
|
|
|
|
RemarkSz = licence.RemarkSz |
|
|
|
|
}; |
|
|
|
|
var staffLicenceId = await Db.Insertable(staffEduBG).ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
|
|
Dictionary<string, object> staffLicences = new(); |
|
|
|
|
staffLicences.Add("StaffID", staffId); |
|
|
|
|
staffLicences.Add("CreateBy", App.User.ID); |
|
|
|
|
staffLicences.Add("CreateTime", DateTime.Now); |
|
|
|
|
staffLicences.Add("CreateProg", null); |
|
|
|
|
staffLicences.Add("CreateIP", null); |
|
|
|
|
formColumns.Where(x => x.GroupType == "Licence" && x.ColumnName != "AttachmentIDs").ToList() |
|
|
|
|
.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
staffLicences.Add(x.MapColumnName, licence.GetPropertyValue(x.ColumnName)); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var staffLicenceId = await Db.Insertable(staffLicences).AS("Ghra_StaffLicence").ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
|
|
if (formColumns.Where(x => x.GroupType == "Licence" && x.ColumnName == "AttachmentIDs").Any()) |
|
|
|
|
{ |
|
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == licence.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
@ -3992,6 +4031,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 简历培训记录 |
|
|
|
@ -3999,20 +4039,39 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
for (int i = 0; i < Trainings.Count; i++) |
|
|
|
|
{ |
|
|
|
|
var training = Trainings[i]; |
|
|
|
|
var staffEduBG = new Ghra_StaffTraining() |
|
|
|
|
{ |
|
|
|
|
StaffID = staffId, |
|
|
|
|
BeginDate = training.BeginDate, |
|
|
|
|
EndDate = training.EndDate, |
|
|
|
|
TrainingOrgName = training.TrainingOrgName, |
|
|
|
|
ClassHour = training.ClassHour, |
|
|
|
|
IsPass = training.IsPass == true ? 1 : 0, |
|
|
|
|
CourseName = training.CourseName, |
|
|
|
|
//ClassCredit = training.ClassCredit, |
|
|
|
|
Reverse1 = training.Reverse1, |
|
|
|
|
RemarkSz = training.RemarkSz |
|
|
|
|
}; |
|
|
|
|
var staffTrainingId = await Db.Insertable(staffEduBG).ExecuteReturnIdentityAsync(); |
|
|
|
|
//var staffEduBG = new Ghra_StaffTraining() |
|
|
|
|
//{ |
|
|
|
|
// StaffID = staffId, |
|
|
|
|
// BeginDate = training.BeginDate, |
|
|
|
|
// EndDate = training.EndDate, |
|
|
|
|
// TrainingOrgName = training.TrainingOrgName, |
|
|
|
|
// ClassHour = training.ClassHour, |
|
|
|
|
// IsPass = training.IsPass == true ? 1 : 0, |
|
|
|
|
// CourseName = training.CourseName, |
|
|
|
|
// //ClassCredit = training.ClassCredit, |
|
|
|
|
// Reverse1 = training.Reverse1, |
|
|
|
|
// RemarkSz = training.RemarkSz |
|
|
|
|
//}; |
|
|
|
|
|
|
|
|
|
Dictionary<string, object> staffTraining = new(); |
|
|
|
|
staffTraining.Add("StaffID", staffId); |
|
|
|
|
staffTraining.Add("CreateBy", App.User.ID); |
|
|
|
|
staffTraining.Add("CreateTime", DateTime.Now); |
|
|
|
|
staffTraining.Add("CreateProg", null); |
|
|
|
|
staffTraining.Add("CreateIP", null); |
|
|
|
|
formColumns.Where(x => x.GroupType == "Training" && x.ColumnName != "AttachmentIDs").ToList() |
|
|
|
|
.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
if (x.MapColumnName == "IsPasss") |
|
|
|
|
staffTraining.Add(x.MapColumnName, training.GetPropertyValue(x.ColumnName).ObjToBool() == true ? 1 : 0); |
|
|
|
|
else |
|
|
|
|
staffTraining.Add(x.MapColumnName, training.GetPropertyValue(x.ColumnName)); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var staffTrainingId = await Db.Insertable(staffTraining).AS("Ghra_StaffTraining").ExecuteReturnIdentityAsync(); |
|
|
|
|
if (formColumns.Where(x => x.GroupType == "Training" && x.ColumnName == "AttachmentIDs").Any()) |
|
|
|
|
{ |
|
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == training.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
@ -4027,6 +4086,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 附件 |
|
|
|
|