|
|
@ -2,7 +2,9 @@ |
|
|
|
using DinkToPdf.Contracts; |
|
|
|
using DinkToPdf.Contracts; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.Extensions.Hosting; |
|
|
|
using Microsoft.Extensions.Hosting; |
|
|
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
using System.IO.Compression; |
|
|
|
using System.IO.Compression; |
|
|
|
|
|
|
|
using Tiobon.Core.Common.DB.Dapper.Extensions; |
|
|
|
using static Tiobon.Core.Model.Consts; |
|
|
|
using static Tiobon.Core.Model.Consts; |
|
|
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
namespace Tiobon.Core.Services; |
|
|
@ -1191,11 +1193,12 @@ END"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<List<ResumeFormColumn1>> QueryResumeFormColumn(long resumeTemplateID) |
|
|
|
public async Task<List<ResumeFormColumn1>> QueryResumeFormColumn(long resumeTemplateID = 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
resumeTemplateID = await Db.Ado.GetLongAsync("select top 1 Id from Ghrh_ResumeTemplate where IsEnable=1 and IsPublish=1"); |
|
|
|
var sql = @$"DECLARE @ResumeTemplateID BIGINT = {resumeTemplateID}
|
|
|
|
var sql = @$"DECLARE @ResumeTemplateID BIGINT = {resumeTemplateID}
|
|
|
|
|
|
|
|
|
|
|
|
SELECT A.ColumnName, A.ResumeInfoColumnName ColumnNameDesc, D.GroupType |
|
|
|
SELECT A.ColumnName, A.ResumeInfoColumnName ColumnNameDesc, D.GroupType, A.MapTableName, A.MapColumnName |
|
|
|
FROM Ghrh_ResumeInfoColumn A |
|
|
|
FROM Ghrh_ResumeInfoColumn A |
|
|
|
LEFT JOIN Ghrh_ResumeTemplateInfoGroupColumn B |
|
|
|
LEFT JOIN Ghrh_ResumeTemplateInfoGroupColumn B |
|
|
|
ON B.ResumeInfoColumnID = A.ID |
|
|
|
ON B.ResumeInfoColumnID = A.ID |
|
|
@ -2427,8 +2430,8 @@ END"; |
|
|
|
if (entity == null) |
|
|
|
if (entity == null) |
|
|
|
return ServiceResult.OprateFailed("无效的简历ID!"); |
|
|
|
return ServiceResult.OprateFailed("无效的简历ID!"); |
|
|
|
|
|
|
|
|
|
|
|
if (entity.Status != DIC_INTERVIEW_ORDER_STATUS.HasInterview || entity.Status != DIC_INTERVIEW_ORDER_STATUS.WaitRecommended) |
|
|
|
//if (entity.Status != DIC_INTERVIEW_ORDER_STATUS.HasInterview || entity.Status != DIC_INTERVIEW_ORDER_STATUS.WaitRecommended) |
|
|
|
return ServiceResult.OprateFailed("只有在【已面试】、【待推荐】状态下,才能转入待发Offer!"); |
|
|
|
// return ServiceResult.OprateFailed("只有在【已面试】、【待推荐】状态下,才能转入待发Offer!"); |
|
|
|
|
|
|
|
|
|
|
|
if (await Db.Queryable<Ghrh_OfferApplyOrder>().AnyAsync(x => x.WorkState == 0 && x.ResumeId == id)) |
|
|
|
if (await Db.Queryable<Ghrh_OfferApplyOrder>().AnyAsync(x => x.WorkState == 0 && x.ResumeId == id)) |
|
|
|
return ServiceResult.OprateFailed("当前简历录用审批处于审批中,不可转入待发Offer!"); |
|
|
|
return ServiceResult.OprateFailed("当前简历录用审批处于审批中,不可转入待发Offer!"); |
|
|
@ -2436,9 +2439,13 @@ END"; |
|
|
|
await UpdateResumeStatus(entity, DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer); |
|
|
|
await UpdateResumeStatus(entity, DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer); |
|
|
|
|
|
|
|
|
|
|
|
var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id); |
|
|
|
var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id); |
|
|
|
await UpdateInterviewOrderStatus(order, DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer); |
|
|
|
if (order != null) |
|
|
|
await UpdateInterviewRecordStatus(order, DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer); |
|
|
|
{ |
|
|
|
await LogRecord(order.Id, "转入待发Offer!", id, null, "TransferWaitSendOffer"); |
|
|
|
|
|
|
|
|
|
|
|
await UpdateInterviewOrderStatus(order, DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer); |
|
|
|
|
|
|
|
await UpdateInterviewRecordStatus(order, DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer); |
|
|
|
|
|
|
|
await LogRecord(order.Id, "转入待发Offer!", id, null, "TransferWaitSendOffer"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ServiceResult.OprateSuccess(); |
|
|
|
return ServiceResult.OprateSuccess(); |
|
|
@ -2784,9 +2791,8 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
var result = new ResumeScheduleInterviewResult(); |
|
|
|
var result = new ResumeScheduleInterviewResult(); |
|
|
|
var entity = await base.QueryById(id); |
|
|
|
var entity = await base.QueryById(id); |
|
|
|
var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id); |
|
|
|
var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id); |
|
|
|
var records = await _ghrh_InterviewRecordServices.Query(x => x.Round == order.Round && x.OrderId == order.Id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (order.RequestId.IsNotEmptyOrNull()) |
|
|
|
if (order != null && order.RequestId.IsNotEmptyOrNull()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var request = await _ghrh_HumanRequestServices.QueryById(order.RequestId); |
|
|
|
var request = await _ghrh_HumanRequestServices.QueryById(order.RequestId); |
|
|
|
result.RequestId = order.RequestId; |
|
|
|
result.RequestId = order.RequestId; |
|
|
@ -2799,13 +2805,16 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
result.DeptName = order.HireDeptName; |
|
|
|
result.DeptName = order?.HireDeptName; |
|
|
|
result.TitleName = order.HireTitleName; |
|
|
|
result.TitleName = order?.HireTitleName; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result.ResumeStaffName = entity.StaffName; |
|
|
|
result.ResumeStaffName = entity.StaffName; |
|
|
|
result.Times = new List<string>(); |
|
|
|
result.Times = new List<string>(); |
|
|
|
result.Staffs = new(); |
|
|
|
result.Staffs = new(); |
|
|
|
|
|
|
|
var records = new List<Ghrh_InterviewRecord>(); |
|
|
|
|
|
|
|
if (order != null) records = await _ghrh_InterviewRecordServices.Query(x => x.Round == order.Round && x.OrderId == order.Id); |
|
|
|
|
|
|
|
|
|
|
|
if (records != null && records.Any()) |
|
|
|
if (records != null && records.Any()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var record = records.Where(x => x.PlanInterviewTime1 != null).FirstOrDefault(); |
|
|
|
var record = records.Where(x => x.PlanInterviewTime1 != null).FirstOrDefault(); |
|
|
@ -3786,275 +3795,264 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
public async Task<bool> SyncToStaff(long id) |
|
|
|
public async Task<bool> SyncToStaff(long id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
try |
|
|
|
var entity = await base.QueryById(id); |
|
|
|
|
|
|
|
if (entity.IsSyncToStaff == true || await Db.Queryable<Ghra_Staff>().Where(x => x.IdCardNo == entity.IdCardNo).AnyAsync()) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
return false; |
|
|
|
var entity = await base.QueryById(id); |
|
|
|
} |
|
|
|
if (entity.IsSyncToStaff == true || await Db.Queryable<Ghra_Staff>().Where(x => x.IdCardNo == entity.IdCardNo).AnyAsync()) |
|
|
|
//【简历库-录用-已发offer】配置按钮 |
|
|
|
{ |
|
|
|
var sendOfferConfig = await Db.Queryable<Ghrh_Config>().Where(x => x.ConfigCode == "ESS_Recruit_Custom_Transfer_Staff").FirstAsync(); |
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//【简历库-录用-已发offer】配置按钮 |
|
|
|
|
|
|
|
var sendOfferConfig = await Db.Queryable<Ghrh_Config>().Where(x => x.ConfigCode == "ESS_Recruit_Custom_Transfer_Staff").FirstAsync(); |
|
|
|
|
|
|
|
|
|
|
|
var type = sendOfferConfig?.ConfigValue ?? "Fast"; |
|
|
|
var type = sendOfferConfig?.ConfigValue ?? "Fast"; |
|
|
|
|
|
|
|
var formColumns = await QueryResumeFormColumn(); |
|
|
|
#region 人事资料 |
|
|
|
formColumns = formColumns.Where(x => x.MapTableName.IsNotEmptyOrNull() && x.MapColumnName.IsNotEmptyOrNull()).ToList(); |
|
|
|
var staff = new Ghra_Staff(); |
|
|
|
|
|
|
|
staff.StaffName = entity.StaffName; |
|
|
|
|
|
|
|
var aaa = entity.StaffName.GetTotalPingYin(); |
|
|
|
|
|
|
|
//staff.PinYinName = entity.StaffName.GetTotalPingYin(); |
|
|
|
|
|
|
|
staff.StaffEname = entity.StaffEname; |
|
|
|
|
|
|
|
staff.PhotoUrl = entity.PhotoUrl; |
|
|
|
|
|
|
|
staff.Nation = entity.Nation; |
|
|
|
|
|
|
|
staff.Birthday = entity.Birthday; |
|
|
|
|
|
|
|
staff.NativePlace = entity.NativePlace; |
|
|
|
|
|
|
|
staff.Gender = entity.Gender; |
|
|
|
|
|
|
|
staff.EduDegree = entity.EduDegree; |
|
|
|
|
|
|
|
staff.MaritalStatus = entity.MaritalStatus; |
|
|
|
|
|
|
|
staff.PoliticStatus = entity.PoliticStatus; |
|
|
|
|
|
|
|
staff.Mobile = entity.Mobile; |
|
|
|
|
|
|
|
staff.Email = entity.Email; |
|
|
|
|
|
|
|
staff.Indate = DateTime.Now; |
|
|
|
|
|
|
|
staff.Reverse3 = entity.CertificateType; |
|
|
|
|
|
|
|
staff.IDCardBegin = entity.IDCardBegin; |
|
|
|
|
|
|
|
staff.IDCardEnd = entity.IDCardEnd; |
|
|
|
|
|
|
|
staff.IdCardNo = entity.IdCardNo; |
|
|
|
|
|
|
|
staff.IDCardOrg = entity.IDCardOrg; |
|
|
|
|
|
|
|
staff.RegisteredType = entity.RegisteredType; |
|
|
|
|
|
|
|
staff.UrgentContact = entity.UrgentContact; |
|
|
|
|
|
|
|
staff.UrgentContactTel = entity.UrgentContactTel; |
|
|
|
|
|
|
|
staff.RegisteredPlace = entity.NowAddress; |
|
|
|
|
|
|
|
staff.RegisteredAddress = entity.RegisteredAddress; |
|
|
|
|
|
|
|
staff.NationNo = entity.NationNo; |
|
|
|
|
|
|
|
//staff.FundAccountID = entity.FundAccountID; |
|
|
|
|
|
|
|
staff.FundBase = entity.FundBase; |
|
|
|
|
|
|
|
//staff.InInsureAccountNo = entity.InInsureAccountNo; |
|
|
|
|
|
|
|
//staff.InsureAccountID = entity.InsureAccountID; |
|
|
|
|
|
|
|
staff.InsureBase = entity.InsureBase; |
|
|
|
|
|
|
|
staff.IsInsure = entity.IsInsure == true ? 1 : 0; |
|
|
|
|
|
|
|
staff.IsFund = entity.IsFund == true ? 1 : 0; |
|
|
|
|
|
|
|
//staff.IsStay = entity.IsStay; |
|
|
|
|
|
|
|
//staff.CarNo = entity.CarNo; |
|
|
|
|
|
|
|
//staff.TitleType = entity.TitleType; |
|
|
|
|
|
|
|
//staff.StaffType1 = entity.StaffType1; |
|
|
|
|
|
|
|
staff.IsRelease = 1; |
|
|
|
|
|
|
|
staff.SortNo = 1; |
|
|
|
|
|
|
|
staff.IsDefault = 1; |
|
|
|
|
|
|
|
if (type == "Fast") |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
staff.IsEnable = 2; |
|
|
|
|
|
|
|
staff.ToDoType = "ToDo"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
staff.IsEnable = 1; |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var applyOrder = await Db.Queryable<Ghrh_OfferApplyOrder>().Where(x => x.ResumeId == id).FirstAsync(); |
|
|
|
int staffId = 0; |
|
|
|
if (applyOrder != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
staff.DeptID = applyOrder.DeptId; |
|
|
|
|
|
|
|
staff.TitleID = applyOrder.TitleId; |
|
|
|
|
|
|
|
staff.JobID = applyOrder.JobId; |
|
|
|
|
|
|
|
staff.GradeID = applyOrder.GradeId; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var staffId = await Db.Insertable(staff).ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (staffId > 0) |
|
|
|
await Db.Ado.BeginTranAsync(); |
|
|
|
{ |
|
|
|
|
|
|
|
entity.IsSyncToStaff = true; |
|
|
|
|
|
|
|
entity.StaffId = staffId; |
|
|
|
|
|
|
|
await Update(entity, ["IsSyncToStaff", "StaffId"]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 家庭关系 |
|
|
|
|
|
|
|
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(); |
|
|
|
|
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == family.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
#region 人事资料 |
|
|
|
|
|
|
|
Dictionary<string, object> dict = new(); |
|
|
|
|
|
|
|
formColumns.Where(x => x.GroupType == "Base") |
|
|
|
|
|
|
|
.ToList() |
|
|
|
|
|
|
|
.ForEach(x => |
|
|
|
{ |
|
|
|
{ |
|
|
|
attachments.ForEach(x => |
|
|
|
dict.Add(x.MapColumnName, entity.GetPropertyValue(x.ColumnName)); |
|
|
|
{ |
|
|
|
}); |
|
|
|
x.CreateTime = DateTime.Now; |
|
|
|
|
|
|
|
x.TableName = "Ghra_StaffSocialRelation"; |
|
|
|
dict.Add("IsRelease", 1); |
|
|
|
x.StaffID = staffId; |
|
|
|
dict.Add("SortNo", 1); |
|
|
|
x.TableKeyID = staffSocialRelation; |
|
|
|
dict.Add("IsDefault", 1); |
|
|
|
}); |
|
|
|
|
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
if (type == "Fast") |
|
|
|
} |
|
|
|
{ |
|
|
|
|
|
|
|
dict.Add("IsEnable", 2); |
|
|
|
|
|
|
|
dict.Add("ToDoType", "ToDo"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
dict.Add("IsEnable", 1); |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
#region 教育背景 |
|
|
|
var applyOrder = await Db.Queryable<Ghrh_OfferApplyOrder>().Where(x => x.ResumeId == id).FirstAsync(); |
|
|
|
var educations = await _ghrh_ResumeEduBGServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
if (applyOrder != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dict.Add("DeptID", applyOrder.DeptId); |
|
|
|
|
|
|
|
dict.Add("TitleID", applyOrder.TitleId); |
|
|
|
|
|
|
|
dict.Add("JobID", applyOrder.JobId); |
|
|
|
|
|
|
|
dict.Add("GradeID", applyOrder.GradeId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < educations.Count; i++) |
|
|
|
if (dict.Count > 0) |
|
|
|
|
|
|
|
staffId = await Db.Insertable(dict).AS("Ghra_Staff").ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
if (staffId > 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var education = educations[i]; |
|
|
|
entity.IsSyncToStaff = true; |
|
|
|
var staffEduBG = new Ghra_StaffEduBG() |
|
|
|
entity.StaffId = staffId; |
|
|
|
{ |
|
|
|
await Update(entity, ["IsSyncToStaff", "StaffId"]); |
|
|
|
StaffID = staffId, |
|
|
|
|
|
|
|
BeginDate = education.BeginDate.ObjToString(), |
|
|
|
#region 家庭关系 |
|
|
|
EndDate = education.EndDate.ObjToString(), |
|
|
|
var list = new List<Dictionary<string, object>>(); |
|
|
|
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 attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == education.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
var familys = await _ghrh_ResumeHomeServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
|
|
|
|
for (int i = 0; i < familys.Count; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
attachments.ForEach(x => |
|
|
|
var family = familys[i]; |
|
|
|
|
|
|
|
var staffEduBG = new Ghra_StaffSocialRelation() |
|
|
|
{ |
|
|
|
{ |
|
|
|
x.CreateTime = DateTime.Now; |
|
|
|
StaffID = staffId, |
|
|
|
x.TableName = "Ghra_StaffEduBG"; |
|
|
|
RelationType = family.RelationType, |
|
|
|
x.StaffID = staffId; |
|
|
|
RelationName = family.RelationName, |
|
|
|
x.TableKeyID = staffEduBGId; |
|
|
|
IDCardNo = family.IDCardNo, |
|
|
|
}); |
|
|
|
Gender = family.Gender, |
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
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(); |
|
|
|
|
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == family.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
attachments.ForEach(x => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
x.CreateTime = DateTime.Now; |
|
|
|
|
|
|
|
x.TableName = "Ghra_StaffSocialRelation"; |
|
|
|
|
|
|
|
x.StaffID = staffId; |
|
|
|
|
|
|
|
x.TableKeyID = staffSocialRelation; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 工作经历 |
|
|
|
#region 教育背景 |
|
|
|
var workExps = await _ghrh_ResumeWorkExpServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
var educations = await _ghrh_ResumeEduBGServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
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(); |
|
|
|
|
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == workExp.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
for (int i = 0; i < educations.Count; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
attachments.ForEach(x => |
|
|
|
var education = educations[i]; |
|
|
|
|
|
|
|
var staffEduBG = new Ghra_StaffEduBG() |
|
|
|
{ |
|
|
|
{ |
|
|
|
x.CreateTime = DateTime.Now; |
|
|
|
StaffID = staffId, |
|
|
|
x.TableName = "Ghra_StaffWorkExp"; |
|
|
|
BeginDate = education.BeginDate.ObjToString(), |
|
|
|
x.StaffID = staffId; |
|
|
|
EndDate = education.EndDate.ObjToString(), |
|
|
|
x.TableKeyID = staffworkExpId; |
|
|
|
SchoolName = education.SchoolName, |
|
|
|
}); |
|
|
|
DeptName = education.DeptName, |
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
DegreeLevel = education.DegreeLevel, |
|
|
|
|
|
|
|
IsGraduate = education.IsGraduate == true ? 1 : 0, |
|
|
|
|
|
|
|
RemarkSz = education.RemarkSz |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
var staffEduBGId = await Db.Insertable(staffEduBG).ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == education.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
attachments.ForEach(x => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
x.CreateTime = DateTime.Now; |
|
|
|
|
|
|
|
x.TableName = "Ghra_StaffEduBG"; |
|
|
|
|
|
|
|
x.StaffID = staffId; |
|
|
|
|
|
|
|
x.TableKeyID = staffEduBGId; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 证件 |
|
|
|
#region 工作经历 |
|
|
|
var Licences = await _ghrh_ResumeLicenceServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
var workExps = await _ghrh_ResumeWorkExpServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
for (int i = 0; i < Licences.Count; i++) |
|
|
|
for (int i = 0; i < workExps.Count; i++) |
|
|
|
{ |
|
|
|
|
|
|
|
var licence = Licences[i]; |
|
|
|
|
|
|
|
var staffEduBG = new Ghra_StaffLicence() |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
StaffID = staffId, |
|
|
|
var workExp = workExps[i]; |
|
|
|
BeginDate = licence.BeginDate, |
|
|
|
var staffEduBG = new Ghra_StaffWorkExp() |
|
|
|
EndDate = licence.EndDate, |
|
|
|
{ |
|
|
|
LicenceName = licence.LicenceName, |
|
|
|
StaffID = staffId, |
|
|
|
//LicenceLevel = licence.LicenceLevel, |
|
|
|
BeginDate = workExp.BeginDate, |
|
|
|
//IsCompany = workExp.IsCompany, |
|
|
|
EndDate = workExp.EndDate, |
|
|
|
LicenceNo = licence.LicenceNo, |
|
|
|
CompanyName = workExp.CompanyName, |
|
|
|
//SeparationReason = licence.SeparationReason, |
|
|
|
TitleName = workExp.TitleName, |
|
|
|
RemarkSz = licence.RemarkSz |
|
|
|
//IsCompany = workExp.IsCompany, |
|
|
|
}; |
|
|
|
SalaryAmount = workExp.SalaryAmount, |
|
|
|
var staffLicenceId = await Db.Insertable(staffEduBG).ExecuteReturnIdentityAsync(); |
|
|
|
SeparationReason = workExp.SeparationReason, |
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == licence.Id.ObjToString()).ToListAsync(); |
|
|
|
RemarkSz = workExp.RemarkSz |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
var staffworkExpId = await Db.Insertable(staffEduBG).ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == workExp.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
attachments.ForEach(x => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
x.CreateTime = DateTime.Now; |
|
|
|
|
|
|
|
x.TableName = "Ghra_StaffWorkExp"; |
|
|
|
|
|
|
|
x.StaffID = staffId; |
|
|
|
|
|
|
|
x.TableKeyID = staffworkExpId; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
#region 证件 |
|
|
|
|
|
|
|
var Licences = await _ghrh_ResumeLicenceServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
|
|
|
|
for (int i = 0; i < Licences.Count; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
attachments.ForEach(x => |
|
|
|
var licence = Licences[i]; |
|
|
|
|
|
|
|
var staffEduBG = new Ghra_StaffLicence() |
|
|
|
{ |
|
|
|
{ |
|
|
|
x.CreateTime = DateTime.Now; |
|
|
|
StaffID = staffId, |
|
|
|
x.TableName = "Ghra_StaffLicence"; |
|
|
|
BeginDate = licence.BeginDate, |
|
|
|
x.StaffID = staffId; |
|
|
|
EndDate = licence.EndDate, |
|
|
|
x.TableKeyID = staffLicenceId; |
|
|
|
LicenceName = licence.LicenceName, |
|
|
|
}); |
|
|
|
//LicenceLevel = licence.LicenceLevel, |
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
//IsCompany = workExp.IsCompany, |
|
|
|
|
|
|
|
LicenceNo = licence.LicenceNo, |
|
|
|
|
|
|
|
//SeparationReason = licence.SeparationReason, |
|
|
|
|
|
|
|
RemarkSz = licence.RemarkSz |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
var staffLicenceId = await Db.Insertable(staffEduBG).ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == licence.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
attachments.ForEach(x => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
x.CreateTime = DateTime.Now; |
|
|
|
|
|
|
|
x.TableName = "Ghra_StaffLicence"; |
|
|
|
|
|
|
|
x.StaffID = staffId; |
|
|
|
|
|
|
|
x.TableKeyID = staffLicenceId; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 简历培训记录 |
|
|
|
#region 简历培训记录 |
|
|
|
var Trainings = await _ghrh_ResumeTrainingServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
var Trainings = await _ghrh_ResumeTrainingServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); |
|
|
|
for (int i = 0; i < Trainings.Count; i++) |
|
|
|
for (int i = 0; i < Trainings.Count; i++) |
|
|
|
{ |
|
|
|
|
|
|
|
var training = Trainings[i]; |
|
|
|
|
|
|
|
var staffEduBG = new Ghra_StaffTraining() |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
StaffID = staffId, |
|
|
|
var training = Trainings[i]; |
|
|
|
BeginDate = training.BeginDate, |
|
|
|
var staffEduBG = new Ghra_StaffTraining() |
|
|
|
EndDate = training.EndDate, |
|
|
|
{ |
|
|
|
TrainingOrgName = training.TrainingOrgName, |
|
|
|
StaffID = staffId, |
|
|
|
ClassHour = training.ClassHour, |
|
|
|
BeginDate = training.BeginDate, |
|
|
|
IsPass = training.IsPass == true ? 1 : 0, |
|
|
|
EndDate = training.EndDate, |
|
|
|
CourseName = training.CourseName, |
|
|
|
TrainingOrgName = training.TrainingOrgName, |
|
|
|
//ClassCredit = training.ClassCredit, |
|
|
|
ClassHour = training.ClassHour, |
|
|
|
Reverse1 = training.Reverse1, |
|
|
|
IsPass = training.IsPass == true ? 1 : 0, |
|
|
|
RemarkSz = training.RemarkSz |
|
|
|
CourseName = training.CourseName, |
|
|
|
}; |
|
|
|
//ClassCredit = training.ClassCredit, |
|
|
|
var staffTrainingId = await Db.Insertable(staffEduBG).ExecuteReturnIdentityAsync(); |
|
|
|
Reverse1 = training.Reverse1, |
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == training.Id.ObjToString()).ToListAsync(); |
|
|
|
RemarkSz = training.RemarkSz |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
var staffTrainingId = await Db.Insertable(staffEduBG).ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == training.Id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
attachments.ForEach(x => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
x.CreateTime = DateTime.Now; |
|
|
|
|
|
|
|
x.TableName = "Ghra_StaffTraining"; |
|
|
|
|
|
|
|
x.StaffID = staffId; |
|
|
|
|
|
|
|
x.TableKeyID = staffTrainingId; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
if (attachments.Any()) |
|
|
|
#region 附件 |
|
|
|
|
|
|
|
var attachments1 = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == id.ObjToString()).ToListAsync(); |
|
|
|
|
|
|
|
if (attachments1.Any()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
attachments.ForEach(x => |
|
|
|
attachments1.ForEach(x => |
|
|
|
{ |
|
|
|
{ |
|
|
|
x.CreateTime = DateTime.Now; |
|
|
|
x.CreateTime = DateTime.Now; |
|
|
|
x.TableName = "Ghra_StaffTraining"; |
|
|
|
x.TableName = "Ghra_staff"; |
|
|
|
x.StaffID = staffId; |
|
|
|
x.StaffID = staffId; |
|
|
|
x.TableKeyID = staffTrainingId; |
|
|
|
x.TableKeyID = staffId; |
|
|
|
}); |
|
|
|
}); |
|
|
|
await Db.Insertable(attachments).ExecuteReturnIdentityAsync(); |
|
|
|
await Db.Insertable(attachments1).ExecuteReturnIdentityAsync(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
await Db.Ado.CommitTranAsync(); |
|
|
|
|
|
|
|
|
|
|
|
#region 附件 |
|
|
|
return true; |
|
|
|
var attachments1 = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == id.ObjToString()).ToListAsync(); |
|
|
|
} |
|
|
|
if (attachments1.Any()) |
|
|
|
catch (Exception) |
|
|
|
{ |
|
|
|
{ |
|
|
|
attachments1.ForEach(x => |
|
|
|
await Db.Ado.RollbackTranAsync(); |
|
|
|
{ |
|
|
|
throw; |
|
|
|
x.CreateTime = DateTime.Now; |
|
|
|
|
|
|
|
x.TableName = "Ghra_staff"; |
|
|
|
|
|
|
|
x.StaffID = staffId; |
|
|
|
|
|
|
|
x.TableKeyID = staffId; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
await Db.Insertable(attachments1).ExecuteReturnIdentityAsync(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
} |
|
|
|
} |