【待面试】行信息中的【改期】【取消】需要支持功能权限配置

master
xiaochanghai 6 months ago
parent afba990469
commit db4d91710a
  1. 12
      Tiobon.Core.Api/Controllers/Ghrh/Ghrh_OfferApplyOrderController.cs
  2. 10
      Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs
  3. 10
      Tiobon.Core.Api/Tiobon.Core.Model.xml
  4. 14
      Tiobon.Core.Api/Tiobon.Core.xml
  5. 2
      Tiobon.Core.IServices/Ghrh/IGhrh_OfferApplyOrderServices.cs
  6. 2
      Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs
  7. 10
      Tiobon.Core.Model/View/Ghrh/Ghrh_Resume.Dto.View.cs
  8. 48
      Tiobon.Core.Services/CommonServices.cs
  9. 29
      Tiobon.Core.Services/Ghrh/Ghrh_OfferApplyOrderServices.cs
  10. 167
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs
  11. 16
      Tiobon.Core/Tiobon.Core.xml

@ -22,4 +22,16 @@ public class Ghrh_OfferApplyOrderController : BaseController<IGhrh_OfferApplyOrd
public async Task<ServiceResult<dynamic>> QueryResume(long id) => await _service.QueryResume(id);
#endregion
#region 临时新增
/// <summary>
/// 临时新增
/// </summary>
/// <param name="resumeId">简历ID</param>
/// <param name="entity">简历ID</param>
/// <returns></returns>
[HttpPost, Route("TempAdd/{resumeId}")]
public async Task<long> TempAdd(long resumeId, InsertGhrh_OfferApplyOrderInput entity) => await _service.TempAdd(resumeId, entity);
#endregion
}

@ -338,12 +338,14 @@ public class Ghrh_ResumeController : BaseController<IGhrh_ResumeServices, Ghrh_R
/// <summary>
/// 转入已发Offer
/// </summary>
/// <param name="ids">简历Id,列表</param>
/// <param name="id">简历Id</param>
/// <param name="extFields">扩展栏位</param>
/// <param name="templateId">扩展栏位</param>
/// <returns></returns>
[HttpPost, Route("TransferHasSendOffer")]
public async Task<ServiceResult> TransferHasSendOffer([FromBody] List<long> ids)
[HttpPost, Route("TransferHasSendOffer/{id}/{templateId}")]
public async Task<ServiceResult> TransferHasSendOffer(long id, long templateId, [FromBody] Dictionary<string, string> extFields)
{
return await _service.TransferHasSendOffer(ids);
return await _service.TransferHasSendOffer(id, templateId, extFields);
}
#endregion

@ -28242,6 +28242,16 @@
面试地点
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghrh_ResumeDto.IsAllowChangeDate">
<summary>
是否可以改期
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghrh_ResumeDto.IsAllowCancel">
<summary>
是否可以取消
</summary>
</member>
<member name="T:Tiobon.Core.Model.Models.Ghrh_ResumeEduBGDto">
<summary>
教育背景(Dto.View1)

@ -1335,6 +1335,14 @@
<param name="id">简历ID</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_OfferApplyOrderController.TempAdd(System.Int64,Tiobon.Core.Model.Models.InsertGhrh_OfferApplyOrderInput)">
<summary>
临时新增
</summary>
<param name="resumeId">简历ID</param>
<param name="entity">简历ID</param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghrh_OfferApplyOrderSalaryController">
<summary>
录用审批单薪资(Controller)
@ -1514,11 +1522,13 @@
<param name="InterviewStaffs">面试官列表</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.TransferHasSendOffer(System.Collections.Generic.List{System.Int64})">
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.TransferHasSendOffer(System.Int64,System.Int64,System.Collections.Generic.Dictionary{System.String,System.String})">
<summary>
转入已发Offer
</summary>
<param name="ids">简历Id,列表</param>
<param name="id">简历Id</param>
<param name="extFields">扩展栏位</param>
<param name="templateId">扩展栏位</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.SendOffer(System.Int64,System.Int64,System.Collections.Generic.Dictionary{System.String,System.String})">

@ -10,4 +10,6 @@ namespace Tiobon.Core.IServices;
public interface IGhrh_OfferApplyOrderServices : IBaseServices<Ghrh_OfferApplyOrder, Ghrh_OfferApplyOrderDto, InsertGhrh_OfferApplyOrderInput, EditGhrh_OfferApplyOrderInput>
{
Task<ServiceResult<dynamic>> QueryResume(long resumeId);
Task<long> TempAdd(long resumeId, InsertGhrh_OfferApplyOrderInput entity);
}

@ -52,7 +52,7 @@ public interface IGhrh_ResumeServices : IBaseServices<Ghrh_Resume, Ghrh_ResumeDt
Task<ServiceResult> ModifyInterviewer(long id, List<ResumeRecommendFormStaff> InterviewStaffs);
Task<ServiceResult> TransferHasSendOffer(List<long> ids);
Task<ServiceResult> TransferHasSendOffer(long id, long templateId, Dictionary<string, string> extFields);
Task<ServiceResult> SendOffer(long id, long templateId, Dictionary<string, string> extFields);
Task<ServiceResult> RemindHasOffer(List<long> ids);

@ -252,4 +252,14 @@ public class Ghrh_ResumeDto : Ghrh_Resume
/// </summary>
public string InterviewAddress { get; set; }
/// <summary>
/// 是否可以改期
/// </summary>
public bool IsAllowChangeDate { get; set; } = false;
/// <summary>
/// 是否可以取消
/// </summary>
public bool IsAllowCancel { get; set; } = false;
}

@ -1767,24 +1767,36 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
icon = "ess-icon-reject",
position = "left"
});
result.JM_PageControlT1.Toolbar.Add(new Toolbar()
{
display = true,
fnKey = "TBD23YN",
fnTitle = "改期",
fnType = "row",
icon = "ess-icon-reject",
position = "left"
});
result.JM_PageControlT1.Toolbar.Add(new Toolbar()
{
display = true,
fnKey = "TBD24YN",
fnTitle = "取消",
fnType = "row",
icon = "ess-icon-reject",
position = "left"
});
//sql = $@"SELECT A.RoleId, B.RoleNo, B.RoleName
// FROM Ghrs_UserRole A LEFT JOIN Ghrs_Role B ON A.RoleId = B.RoleId
// WHERE A.UserID = {App.User.ID}
// AND A.IsEnable = 1
// AND B.IsEnable = 1
// AND B.RoleNo LIKE 'RecruitResume%'";
//toolbarRoles = DbAccess.QueryList<ToolbarRole>(sql);
//if (toolbarRoles != null && toolbarRoles.Any())
//{
// if (toolbarRoles.Where(x => x.RoleNo == "RecruitResumeESSChangeDate").Any())
// result.JM_PageControlT1.Toolbar.Add(new Toolbar()
// {
// display = true,
// fnKey = "TBD23YN",
// fnTitle = "改期",
// fnType = "row",
// icon = "ess-icon-reject",
// position = "left"
// });
// if (toolbarRoles.Where(x => x.RoleNo == "RecruitResumeESSCancel").Any())
// result.JM_PageControlT1.Toolbar.Add(new Toolbar()
// {
// display = true,
// fnKey = "TBD24YN",
// fnTitle = "取消",
// fnType = "row",
// icon = "ess-icon-reject",
// position = "left"
// });
//}
break;
case "F_OfferTemplate":
toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "NewYN").FirstOrDefault();

@ -171,6 +171,35 @@ public class Ghrh_OfferApplyOrderServices : BaseServices<Ghrh_OfferApplyOrder, G
return id;
}
public async Task<long> TempAdd(long resumeId, InsertGhrh_OfferApplyOrderInput entity)
{
entity.OrderNo = await GenerateContinuousSequence("Ghrh_OfferApplyOrder", "OrderNo", "LYSQ");
entity.ApplicantId = GetStaffId();
entity.ApplyTime = DateTime.Now;
var id = await base.Add(entity);
#region 写入数据,并判断是否有错误
var sql = $"SELECT ISNULL(MAX(id)+1,1) FROM Ghrh_OfferApplyOrder WHERE Id !='{id}'";
var id1 = await Db.Ado.GetLongAsync(sql);
sql = $"UPDATE Ghrh_OfferApplyOrder SET Id={id1} WHERE Id ='{id}'";
await Db.Ado.ExecuteCommandAsync(sql);
id = id1;
#endregion
if (entity.Items.IsNotEmptyOrNull())
{
entity.Items.ForEach(x =>
{
x.OrderId = id;
});
await _ghrh_OfferApplyOrderSalaryServices.Add(entity.Items);
}
return id;
}
public override async Task<bool> Update(long Id, EditGhrh_OfferApplyOrderInput editModel)
{

@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.Extensions.Hosting;
using System.ComponentModel;
using System.Drawing;
using System.IO.Compression;
using static Tiobon.Core.Model.Consts;
@ -314,7 +315,7 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins
//【简历库-录用-已发offer】配置按钮
var sendOfferConfig = await Db.Queryable<Ghrh_Config>().Where(x => x.ConfigCode == "ESS_Recruit_Custom_Transfer_Staff").FirstAsync();
var applyOrders = await Db.Queryable<Ghrh_OfferApplyOrder>().Where(x => x.ResumeId != null && ids.Contains(x.ResumeId.Value) && x.WorkState == 0).ToListAsync();
var applyOrders = await Db.Queryable<Ghrh_OfferApplyOrder>().Where(x => x.ResumeId != null && ids.Contains(x.ResumeId.Value) && x.WorkState == 0 && x.WorkNo != null).ToListAsync();
#endregion
list.ForEach(async x =>
@ -366,20 +367,16 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins
//x.InterviewResult = "推荐中";
x.AppointmentFeedback = order.AppointmentFeedback.IsNotEmptyOrNull() ? order.AppointmentFeedback : "(约面反馈未填写)";
}
else if (x.Status == DIC_INTERVIEW_ORDER_STATUS.HasInterview && x.IsPass == true)
{
//x.InterviewResult = "推荐中";
x.OfferApplyType = offerApplyConfig?.ConfigValue ?? "System";
if (applyOrders.Any(o => o.ResumeId == x.ResumeId))
x.OfferApplyExist = true;
}
if (x.Status == DIC_INTERVIEW_ORDER_STATUS.HasSendOffer)
{
//x.InterviewResult = "推荐中";
x.TransferStaffType = sendOfferConfig?.ConfigValue ?? "System";
}
//x.InterviewResult = "推荐中";
x.OfferApplyType = offerApplyConfig?.ConfigValue ?? "System";
if (applyOrders.Any(o => o.ResumeId == x.ResumeId))
x.OfferApplyExist = true;
x.InterviewTime1 = order.InterviewTime;
x.InterviewContent = order.InterviewContent;
@ -2174,29 +2171,49 @@ END";
#endregion
#region 转入已发Offer
public async Task<ServiceResult> TransferHasSendOffer(List<long> ids)
public async Task<ServiceResult> TransferHasSendOffer(long id, long templateId, Dictionary<string, string> extFields)
{
for (int i = 0; i < ids.Count; i++)
{
var id = ids[i];
var entity = await base.QueryById(id);
if (entity == null)
return ServiceResult.OprateFailed("无效的简历ID!");
var entity = await base.QueryById(id);
if (entity == null)
return ServiceResult.OprateFailed("无效的简历ID!");
await UpdateResumeStatus(entity, DIC_INTERVIEW_ORDER_STATUS.HasSendOffer);
var content = (await _ghrh_TemplateServices.Preview(id, templateId, extFields)).Data;
var offerFileUrl = await GenerateOffer(entity, content);
var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id);
if (order != null)
{
await UpdateResumeStatus(entity, DIC_INTERVIEW_ORDER_STATUS.HasSendOffer);
await UpdateInterviewOrderStatus(order, DIC_INTERVIEW_ORDER_STATUS.HasSendOffer);
await UpdateInterviewRecordStatus(order, DIC_INTERVIEW_ORDER_STATUS.HasSendOffer);
var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id);
if (order != null)
{
await UpdateInterviewOrderStatus(order, DIC_INTERVIEW_ORDER_STATUS.HasSendOffer);
await UpdateInterviewRecordStatus(order, DIC_INTERVIEW_ORDER_STATUS.HasSendOffer);
await LogRecord(order.Id, "变更状态为:已发offer!", id, null, "TransferHasSendOffer");
}
else
await LogRecord(null, "变更状态为:已发offer!", id, null, "TransferHasSendOffer");
await _ghrh_InterviewLogServices.Add(new InsertGhrh_InterviewLogInput()
{
InterviewOrderId = order.Id,
ResumeId = id,
StaffId = App.User.StaffId,
StaffName = App.User.StaffName + "(" + App.User.StaffNo + ")",
Source = "TransferHasSendOffer",
Reverse1 = offerFileUrl,
UserId = App.User.ID,
UserName = App.User.Name,
RemarkSz = $"变更状态为:已发offer!",
});
}
else
await _ghrh_InterviewLogServices.Add(new InsertGhrh_InterviewLogInput()
{
InterviewOrderId = null,
ResumeId = id,
StaffId = App.User.StaffId,
StaffName = App.User.StaffName + "(" + App.User.StaffNo + ")",
Source = "TransferHasSendOffer",
Reverse1 = offerFileUrl,
UserId = App.User.ID,
UserName = App.User.Name,
RemarkSz = $"变更状态为:已发offer!",
});
return ServiceResult.OprateSuccess();
}
@ -2234,6 +2251,38 @@ END";
var id1 = await Db.Insertable(mailOutbox).ExecuteReturnIdentityAsync();
#endregion
#region 生成Offer PDf
entity.OfferFileUrl = await GenerateOffer(entity, content);
await Update(entity, ["OfferFileUrl"]);
await _ghrh_InterviewLogServices.Add(new InsertGhrh_InterviewLogInput()
{
InterviewOrderId = order.Id,
ResumeId = id,
StaffId = App.User.StaffId,
StaffName = App.User.StaffName + "(" + App.User.StaffNo + ")",
Source = "SendOffer",
Reverse1 = entity.OfferFileUrl,
UserId = App.User.ID,
UserName = App.User.Name,
RemarkSz = $"给【{entity.StaffName}】发送Offer!",
});
#endregion
return ServiceResult.OprateSuccess();
}
/// <summary>
/// 生成Offer
/// </summary>
/// <param name="id"></param>
/// <param name="templateId"></param>
/// <param name="extFields"></param>
/// <returns></returns>
public async Task<string> GenerateOffer(Ghrh_ResumeDto entity, string content)
{
#region 生成Offer PDf
var globalSettings = new GlobalSettings
{
@ -2269,25 +2318,10 @@ END";
await file.CopyToAsync(fs);
fs.Flush();
}
entity.OfferFileUrl = "/Advanced/files/pdf_files/" + fileName;
await Update(entity, ["OfferFileUrl"]);
return "/Advanced/files/pdf_files/" + fileName;
await _ghrh_InterviewLogServices.Add(new InsertGhrh_InterviewLogInput()
{
InterviewOrderId = order.Id,
ResumeId = id,
StaffId = App.User.StaffId,
StaffName = App.User.StaffName + "(" + App.User.StaffNo + ")",
Source = "SendOffer",
Reverse1 = entity.OfferFileUrl,
UserId = App.User.ID,
UserName = App.User.Name,
RemarkSz = $"给【{entity.StaffName}】发送Offer!",
});
#endregion
return ServiceResult.OprateSuccess();
}
#endregion
@ -2746,6 +2780,14 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status";
var tags = await _ghrh_ResumeTagServices.QueryDto(x => tagIds.Contains(x.Id));
var orders = await _ghrh_InterviewOrderServices.QueryDto(x => x.ResumeId != null && ids.Contains(x.ResumeId.Value));
sql = $@"SELECT A.RoleId, B.RoleNo, B.RoleName
FROM Ghrs_UserRole A LEFT JOIN Ghrs_Role B ON A.RoleId = B.RoleId
WHERE A.UserID = {App.User.ID}
AND A.IsEnable = 1
AND B.IsEnable = 1
AND B.RoleNo LIKE 'RecruitResume%'";
var toolbarRoles = DbAccess.QueryList<ToolbarRole>(sql);
list.ForEach(async x =>
{
//x.ResumeId = x.Id;
@ -2786,6 +2828,11 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status";
x.InterviewTime1 = "已改期";
}
if (toolbarRoles.Where(x => x.RoleNo == "RecruitResumeESSChangeDate").Any())
x.IsAllowChangeDate = true;
if (toolbarRoles.Where(x => x.RoleNo == "RecruitResumeESSCancel").Any())
x.IsAllowCancel = true;
});
return new ServicePageResult<Ghrh_ResumeDto>(filter.pageNum, totalCount, filter.pageSize, list);
@ -3695,41 +3742,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status";
var content = (await _ghrh_TemplateServices.Preview(id, templateId, extFields)).Data;
#region 生成Offer PDf
var globalSettings = new GlobalSettings
{
ColorMode = ColorMode.Color,
Orientation = Orientation.Portrait,
PaperSize = PaperKind.A4,
DocumentTitle = entity.StaffName,
};
var objectSettings = new ObjectSettings
{
PagesCount = true,
HtmlContent = content,
WebSettings = { DefaultEncoding = "utf-8" },
};
var pdf = new HtmlToPdfDocument()
{
GlobalSettings = globalSettings,
Objects = { objectSettings }
};
var fileBytes = _converter.Convert(pdf);
string pathHeader = "wwwroot/files/pdf_files";
if (!Directory.Exists(pathHeader))
Directory.CreateDirectory(pathHeader);
var ms = new MemoryStream(fileBytes);
var file = new FormFile(ms, 0, ms.Length, Path.GetFileNameWithoutExtension(pathHeader), Path.GetFileName(pathHeader));
var fileName = entity.StaffName + "_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".pdf";
await using (var fs = System.IO.File.Create(pathHeader + "/" + fileName))
{
await file.CopyToAsync(fs);
fs.Flush();
}
entity.OfferFileUrl = "/Advanced/files/pdf_files/" + fileName;
entity.OfferFileUrl = await GenerateOffer(entity, content);
await Update(entity, ["OfferFileUrl"]);
await _ghrh_InterviewLogServices.Add(new InsertGhrh_InterviewLogInput()

@ -1335,6 +1335,14 @@
<param name="id">简历ID</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_OfferApplyOrderController.TempAdd(System.Int64,Tiobon.Core.Model.Models.InsertGhrh_OfferApplyOrderInput)">
<summary>
临时新增
</summary>
<param name="resumeId">简历ID</param>
<param name="entity">简历ID</param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghrh_OfferApplyOrderSalaryController">
<summary>
录用审批单薪资(Controller)
@ -1514,11 +1522,13 @@
<param name="InterviewStaffs">面试官列表</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.SendOffer(System.Collections.Generic.List{System.Int64})">
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.TransferHasSendOffer(System.Int64,System.Int64,System.Collections.Generic.Dictionary{System.String,System.String})">
<summary>
发offer
转入已发Offer
</summary>
<param name="ids">简历Id,列表</param>
<param name="id">简历Id</param>
<param name="extFields">扩展栏位</param>
<param name="templateId">扩展栏位</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.SendOffer(System.Int64,System.Int64,System.Collections.Generic.Dictionary{System.String,System.String})">

Loading…
Cancel
Save