招聘工作台

招聘看板
master
xiaochanghai 6 months ago
parent fdfadd01f5
commit 9ba78e4ecd
  1. 26
      Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs
  2. 15
      Tiobon.Core.Api/Tiobon.Core.xml
  3. 5
      Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs
  4. 388
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs
  5. 15
      Tiobon.Core/Tiobon.Core.xml

@ -1,4 +1,5 @@
using Tiobon.Core.Model.ViewModels.Extend;
using Newtonsoft.Json.Linq;
using Tiobon.Core.Model.ViewModels.Extend;
using static Tiobon.Core.Model.Consts;
namespace Tiobon.Core.Api.Controllers;
@ -530,4 +531,27 @@ public class Ghrh_ResumeController : BaseController<IGhrh_ResumeServices, Ghrh_R
public async Task Shihua_OA_Sync(long id) => await _service.Shihua_OA_Sync();
#endregion
#region 招聘工作台初始化接口
/// <summary>
/// 招聘工作台初始化接口
/// </summary>
/// <param name="langId">语言别</param>
/// <param name="menuName">meuName</param>
/// <returns></returns>
[HttpPost, Route("QueryWorkStationInit/{langId}")]
public async Task<ServiceResult<JArray>> QueryWorkstationInit(int langId, string menuName) => await _service.QueryWorkstationInit(langId, menuName);
#endregion
#region 招聘工作台招聘统计
/// <summary>
/// 招聘工作台招聘统计
/// </summary>
/// <param name="langId">语言别</param>
/// <returns></returns>
[HttpPost, Route("QueryWorkStationStatisticsChart/{langId}")]
public async Task<ServiceResult<dynamic>> QueryWorkStationStatisticsChart(int langId) => await _service.QueryWorkStationStatisticsChart(langId);
#endregion
}

@ -1632,6 +1632,21 @@
<param name="templateId">扩展栏位</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.QueryWorkstationInit(System.Int32,System.String)">
<summary>
招聘工作台初始化接口
</summary>
<param name="langId">语言别</param>
<param name="menuName">meuName</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.QueryWorkStationStatisticsChart(System.Int32)">
<summary>
招聘工作台招聘统计
</summary>
<param name="langId">语言别</param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghrh_ResumeEduBGController">
<summary>
教育背景(Controller)

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using Tiobon.Core.Common;
using Tiobon.Core.IServices.BASE;
using Tiobon.Core.Model;
@ -83,4 +84,8 @@ public interface IGhrh_ResumeServices : IBaseServices<Ghrh_Resume, Ghrh_ResumeDt
Task<bool> SyncToStaff(long id);
Task<ServiceResult<JArray>> QueryWorkstationInit(int langId , string menuName);
Task<ServiceResult<dynamic>> QueryWorkStationStatisticsChart(int langId = 1);
}

@ -1,9 +1,12 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Hosting;
using NPOI.SS.Formula.Functions;
using System.IO.Compression;
using WkHtmlToPdfDotNet;
using WkHtmlToPdfDotNet.Contracts;
using static NPOI.POIFS.Crypt.CryptoFunctions;
using static System.Runtime.InteropServices.JavaScript.JSType;
using static Tiobon.Core.Model.Consts;
namespace Tiobon.Core.Services;
@ -4230,6 +4233,391 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1
}
#endregion
#region 招聘工作台初始化接口
public async Task<ServiceResult<JArray>> QueryWorkstationInit(int langId, string menuName)
{
var columns = new JArray();
var Detail = new JObject { };
var item = new JObject { };
if (menuName == "F_ESS_RecruitmentBoard")
{
var group = await Db.Queryable<Ghrh_InterviewRecord>()
.Where(x => x.StaffId == GetStaffId()).GroupBy(x => x.Status)
.Select(g => new
{
g.Status,
Count = SqlFunc.AggregateCount(g.Id)
}).ToListAsync();
#region 待筛选
Detail = new JObject
{
new JProperty("Count", group.Where(x=>x.Status=="HasRecommended").FirstOrDefault()?.Count??0),
new JProperty("Unit","人"),
new JProperty("MenuName","F_ESS_Candidate"),
new JProperty("TabKey","HasRecommended"),
};
item = new JObject
{
new JProperty("CanMore", 1),
new JProperty("ColNum", 0),
new JProperty("RowNum", 0),
new JProperty("Height", 17.2),
new JProperty("Width", 2),
new JProperty("Id", "112701"),
new JProperty("CardType", "RecruitmentCountCard"),
new JProperty("IsStatic", "0"),
new JProperty("Title", "待筛选"),
new JProperty("Detail",Detail),
};
columns.Add(item);
#endregion
#region 待预约
Detail = new JObject
{
new JProperty("Count", group.Where(x=>x.Status=="WaitAppointment").FirstOrDefault()?.Count??0),
new JProperty("Unit","人"),
new JProperty("MenuName","F_ESS_Candidate"),
new JProperty("TabKey","WaitAppointment"),
};
item = new JObject
{
new JProperty("CanMore", 1),
new JProperty("ColNum", 2),
new JProperty("RowNum", 0),
new JProperty("Height", 17.2),
new JProperty("Width", 2),
new JProperty("Id", "112702"),
new JProperty("CardType", "RecruitmentCountCard"),
new JProperty("IsStatic", "0"),
new JProperty("Title", "待预约"),
new JProperty("Detail",Detail),
};
columns.Add(item);
#endregion
#region 待面试
Detail = new JObject
{
new JProperty("Count", group.Where(x=>x.Status=="WaitInterview").FirstOrDefault()?.Count??0),
new JProperty("Unit","人"),
new JProperty("MenuName","F_ESS_Candidate"),
new JProperty("TabKey","WaitInterview"),
};
item = new JObject
{
new JProperty("CanMore", 1),
new JProperty("ColNum", 4),
new JProperty("RowNum", 0),
new JProperty("Height", 17.2),
new JProperty("Width", 2),
new JProperty("Id", "112703"),
new JProperty("CardType", "RecruitmentCountCard"),
new JProperty("IsStatic", "0"),
new JProperty("Title", "待面试"),
new JProperty("Detail",Detail),
};
columns.Add(item);
#endregion
#region 已面试
var sum = group.Where(x => x.Status == "HasInterview" || x.Status == "WaitSendOffer" || x.Status == "HasSendOffer").Sum(x => x.Count);
Detail = new JObject
{
new JProperty("Count", sum),
new JProperty("Unit","人"),
new JProperty("MenuName","F_ESS_Candidate"),
new JProperty("TabKey","HasInterview"),
};
item = new JObject
{
new JProperty("CanMore", 0),
new JProperty("ColNum", 6),
new JProperty("RowNum", 0),
new JProperty("Height", 17.2),
new JProperty("Width", 2),
new JProperty("Id", "112704"),
new JProperty("CardType", "RecruitmentCountCard"),
new JProperty("IsStatic", "0"),
new JProperty("Title", "已面试"),
new JProperty("Detail",Detail),
};
columns.Add(item);
#endregion
#region 已录用
var group1 = await Db.Queryable<Ghrh_Resume>()
.GroupBy(x => x.Status).Select(g => new
{
Status = g.Status,
Count = SqlFunc.AggregateCount(g.Id)
}).ToListAsync();
Detail = new JObject {
new JProperty("Count", group1.Where(x=>x.Status=="HasOffer").FirstOrDefault()?.Count??0),
new JProperty("Unit","人"),
new JProperty("MenuName","F_ESS_Candidate"),
new JProperty("TabKey","HasOffer"),
};
item = new JObject
{
new JProperty("CanMore", 0),
new JProperty("ColNum", 8),
new JProperty("RowNum", 0),
new JProperty("Height", 17.2),
new JProperty("Width", 2),
new JProperty("Id", "112705"),
new JProperty("CardType", "RecruitmentCountCard"),
new JProperty("IsStatic", "0"),
new JProperty("Title", "已录用"),
new JProperty("Detail",Detail),
};
columns.Add(item);
#endregion
}
else
{
var group = await Db.Queryable<Ghrh_Resume>()
.GroupBy(x => x.Status).Select(g => new
{
Status = g.Status,
Count = SqlFunc.AggregateCount(g.Id)
}).ToListAsync();
#region 已推荐
Detail = new JObject
{
new JProperty("Count", group.Where(x=>x.Status=="HasRecommended").FirstOrDefault()?.Count??0),
new JProperty("Unit","人"),
new JProperty("MenuName","F_ResumeMaintenance"),
new JProperty("TabKey","HasRecommended"),
};
item = new JObject
{
new JProperty("CanMore", 1),
new JProperty("ColNum", 0),
new JProperty("RowNum", 0),
new JProperty("Height", 17.2),
new JProperty("Width", 2),
new JProperty("Id", "112701"),
new JProperty("CardType", "RecruitmentCountCard"),
new JProperty("IsStatic", "0"),
new JProperty("Title", "已推荐"),
new JProperty("Detail",Detail),
};
columns.Add(item);
#endregion
#region 待预约
Detail = new JObject
{
new JProperty("Count", group.Where(x=>x.Status=="WaitAppointment").FirstOrDefault()?.Count??0),
new JProperty("Unit","人"),
new JProperty("MenuName","F_ResumeMaintenance"),
new JProperty("TabKey","WaitAppointment"),
};
item = new JObject
{
new JProperty("CanMore", 1),
new JProperty("ColNum", 2),
new JProperty("RowNum", 0),
new JProperty("Height", 17.2),
new JProperty("Width", 2),
new JProperty("Id", "112702"),
new JProperty("CardType", "RecruitmentCountCard"),
new JProperty("IsStatic", "0"),
new JProperty("Title", "待预约"),
new JProperty("Detail",Detail),
};
columns.Add(item);
#endregion
#region 待面试
Detail = new JObject
{
new JProperty("Count", group.Where(x=>x.Status=="WaitInterview").FirstOrDefault()?.Count??0),
new JProperty("Unit","人"),
new JProperty("MenuName","F_ResumeMaintenance"),
new JProperty("TabKey","WaitInterview"),
};
item = new JObject
{
new JProperty("CanMore", 1),
new JProperty("ColNum", 4),
new JProperty("RowNum", 0),
new JProperty("Height", 17.2),
new JProperty("Width", 2),
new JProperty("Id", "112703"),
new JProperty("CardType", "RecruitmentCountCard"),
new JProperty("IsStatic", "0"),
new JProperty("Title", "待面试"),
new JProperty("Detail",Detail),
};
columns.Add(item);
#endregion
#region 已面试
var sum = group.Where(x => x.Status == "HasInterview" || x.Status == "WaitSendOffer" || x.Status == "HasSendOffer").Sum(x => x.Count);
Detail = new JObject
{
new JProperty("Count", sum),
new JProperty("Unit","人"),
new JProperty("MenuName","F_ResumeMaintenance"),
new JProperty("TabKey","HasInterview"),
};
item = new JObject
{
new JProperty("CanMore", 1),
new JProperty("ColNum", 6),
new JProperty("RowNum", 0),
new JProperty("Height", 17.2),
new JProperty("Width", 2),
new JProperty("Id", "112704"),
new JProperty("CardType", "RecruitmentCountCard"),
new JProperty("IsStatic", "0"),
new JProperty("Title", "已面试"),
new JProperty("Detail",Detail),
};
columns.Add(item);
#endregion
#region 已报到
Detail = new JObject {
new JProperty("Count", group.Where(x=>x.Status=="HasOffer").FirstOrDefault()?.Count??0),
new JProperty("Unit","人"),
new JProperty("MenuName","F_ResumeMaintenance"),
new JProperty("TabKey","HasOffer"),
};
item = new JObject
{
new JProperty("CanMore", 1),
new JProperty("ColNum", 8),
new JProperty("RowNum", 0),
new JProperty("Height", 17.2),
new JProperty("Width", 2),
new JProperty("Id", "112705"),
new JProperty("CardType", "RecruitmentCountCard"),
new JProperty("IsStatic", "0"),
new JProperty("Title", "已报到"),
new JProperty("Detail",Detail),
};
columns.Add(item);
#endregion
}
#region 招聘统计
Detail = new JObject
{
};
item = new JObject
{
new JProperty("CanMore", 0),
new JProperty("ColNum", 0),
new JProperty("RowNum", 10),
new JProperty("Height", 43),
new JProperty("Width", 10),
new JProperty("Id", "112706"),
new JProperty("CardType", "RecruitStatisticsChart"),
new JProperty("IsStatic", "0"),
new JProperty("Title", "招聘统计"),
new JProperty("Detail",Detail),
};
columns.Add(item);
#endregion
#region 招聘平均耗费时长
Detail = new JObject
{
};
item = new JObject
{
new JProperty("CanMore", 0),
new JProperty("ColNum", 0),
new JProperty("RowNum", 20),
new JProperty("Height", 45),
new JProperty("Width", 10),
new JProperty("Id", "112707"),
new JProperty("CardType", "AverageTimeConsumption"),
new JProperty("IsStatic", "0"),
new JProperty("Title", "招聘平均耗费时长"),
new JProperty("Detail",Detail),
};
columns.Add(item);
#endregion
return ServiceResult<JArray>.OprateSuccess("获取成功", columns);
}
#endregion
#region 招聘工作台招聘统计
public async Task<ServiceResult<dynamic>> QueryWorkStationStatisticsChart(int langId = 1)
{
dynamic data = new ExpandoObject();
var series = new JArray();
var XAxis = new List<string>();
var date = DateTime.Now.AddMonths(-11);
var data1 = new List<int>();
var data2 = new List<int>();
var data3 = new List<decimal>();
var random = new Random();
for (int i = 1; i <= 12; i++)
{
var date1 = DateTimeHelper.ConvertToMonthString(date);
XAxis.Add(date1);
var group = await Db.Queryable<Ghrh_InterviewOrder>()
.Where(x => x.RecommendTime != null && x.RecommendTime.Value.Date.Month == date.Month && x.RecommendTime.Value.Date.Year == date.Year)
.Select(g => new
{
g.Status
}).ToListAsync();
var count = group.Count;
var count1 = group.Where(x => x.Status == "HasOffer").Count();
data1.Add(count);
data2.Add(count1);
decimal count3 = 0;
if (count1 > 0 && count > 0)
count3 = ((decimal)count1 / count) * 100;
data3.Add(StringHelper.TrimDecimal(count3, 2));
date = date.AddMonths(1);
}
var item = new JObject
{
new JProperty("color", "rgba(84, 112, 198, 1)"),
new JProperty("data", data1),
new JProperty("name", "面试人数"),
};
series.Add(item);
item = new JObject
{
new JProperty("color", "rgba(145, 204, 117, 1)"),
new JProperty("data", data2),
new JProperty("name", "录用人数"),
};
series.Add(item);
item = new JObject
{
new JProperty("color", "rgba(255, 147, 0, 1)"),
new JProperty("data", data3),
new JProperty("name", "面试成功率"),
};
series.Add(item);
data.XAxis = XAxis;
data.series = series;
return ServiceResult<dynamic>.OprateSuccess("获取成功", data);
}
#endregion
#region 通用方法
/// <summary>
/// 记录日志

@ -1632,6 +1632,21 @@
<param name="templateId">扩展栏位</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.QueryWorkstationInit(System.Int32,System.String)">
<summary>
招聘工作台初始化接口
</summary>
<param name="langId">语言别</param>
<param name="menuName">meuName</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.QueryWorkStationStatisticsChart(System.Int32)">
<summary>
招聘工作台招聘统计
</summary>
<param name="langId">语言别</param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghrh_ResumeEduBGController">
<summary>
教育背景(Controller)

Loading…
Cancel
Save