diff --git a/Tiobon.Core.Api/Controllers/ReportController.cs b/Tiobon.Core.Api/Controllers/ReportController.cs index 22630959..7d2134ff 100644 --- a/Tiobon.Core.Api/Controllers/ReportController.cs +++ b/Tiobon.Core.Api/Controllers/ReportController.cs @@ -25,7 +25,7 @@ public class ReportController : BaseController /// /// - [HttpPost, Route("QueryNewStaff")] + [HttpPost("QueryNewStaff")] public async Task> QueryNewStaffAsync([FromBody] QueryBody filter, string condition) => await _service.QueryNewStaffAsync(filter, condition, true); #endregion @@ -35,7 +35,17 @@ public class ReportController : BaseController /// langId /// - [HttpPost, Route("QueryESSResumeScreenPassRate/{langId}")] + [HttpPost("QueryESSResumeScreenPassRate/{langId}")] public async Task> QueryESSResumeScreenPassRate(int langId) => await _service.QueryESSResumeScreenPassRate(langId); + #endregion + + #region 面试官-简历筛选通过率 + /// + /// 面试官-简历筛选通过率 + /// + /// langId + /// + [HttpPost("QueryESSInterviewPassRate/{langId}")] + public async Task> QueryESSInterviewPassRate(int langId) => await _service.QueryESSInterviewPassRate(langId); #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index dce1eeee..826e4ff8 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -597,6 +597,13 @@ langId + + + 面试官-简历筛选通过率 + + langId + + 分页获取 diff --git a/Tiobon.Core.IServices/IReportServices.cs b/Tiobon.Core.IServices/IReportServices.cs index 51df9f43..eef9fafd 100644 --- a/Tiobon.Core.IServices/IReportServices.cs +++ b/Tiobon.Core.IServices/IReportServices.cs @@ -13,4 +13,6 @@ public interface IReportServices : IBaseServices> QueryNewStaffAsync(QueryBody filter, string condition, bool? IsEnable = true); Task> QueryESSResumeScreenPassRate(int langId = 1); + + Task> QueryESSInterviewPassRate(int langId = 1); } diff --git a/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs index 41827db2..738b897a 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs @@ -1134,7 +1134,7 @@ public class Ghre_CourseServices : BaseServices>> QueryBySceneId(long courseSceneId) { - var entitys = await base.Query(x => x.CourseSceneId == courseSceneId); + var entitys = await base.Query(x => x.CourseSceneId == courseSceneId && x.Status == Consts.DIC_COURSE_STATUS.RELEASED); var courseWareIds = entitys.Select(x => x.CourseWareId).Distinct().ToList(); var attachments = await Db.Queryable().Where(x => courseWareIds.Contains(x.CourseWareId)).ToListAsync(); //var attachments = await _ghre_CourseWareAttachmentServices.Query(x => x.CourseWareId != null && attachmentIds.Contains(x.CourseWareId.Value)); diff --git a/Tiobon.Core.Services/ReportServices.cs b/Tiobon.Core.Services/ReportServices.cs index 45435182..487bd3ef 100644 --- a/Tiobon.Core.Services/ReportServices.cs +++ b/Tiobon.Core.Services/ReportServices.cs @@ -93,7 +93,7 @@ public partial class ReportServices : BaseServices x.Status == DIC_INTERVIEW_ORDER_STATUS.Fail).Count(); - var count2 = count - count1; + var count2 = count - count1; data1.Add(count); data2.Add(count2); decimal count3 = 0; @@ -132,4 +132,88 @@ public partial class ReportServices : BaseServices.OprateSuccess("获取成功", data); } #endregion + + #region 面试官-面试通过率 + /// + /// 面试官-面试通过率:面试官面试通过人数 / 已面试人数 × 100% + /// + /// + /// + public async Task> QueryESSInterviewPassRate(int langId = 1) + { + + dynamic data = new ExpandoObject(); + var series = new JArray(); + var XAxis = new List(); + var date = DateTime.Now.AddMonths(-11); + var data1 = new List(); + var data2 = new List(); + var data3 = new List(); + + var startDate = DateTime.Now.AddMonths(-11); + var endDate = DateTime.Now.AddMonths(1); + + startDate = new DateTime(startDate.Year, startDate.Month, 1); + endDate = new DateTime(endDate.Year, endDate.Month, 1); + + var orderIds = await Db.Queryable() + .Where(x => x.StaffId == App.User.StaffId && x.CreateTime >= startDate && x.CreateTime < endDate) + .Select(x => x.OrderId) + .Distinct() + .ToListAsync(); + + var orders = await Db.Queryable().Where(x => + orderIds.Contains(x.Id) && + x.Status != DIC_INTERVIEW_ORDER_STATUS.Fail && + x.Status != DIC_INTERVIEW_ORDER_STATUS.HasRecommended).ToListAsync(); + for (int i = 1; i <= 12; i++) + { + var date1 = DateTimeHelper.ConvertToMonthString(date); + XAxis.Add(date1); + + var group = orders + .Where(x => x.RecommendTime != null && x.RecommendTime.Value.Date.Month == date.Month && x.RecommendTime.Value.Date.Year == date.Year) + .ToList(); + + var count = group.Count; + var count1 = group.Where(x => x.IsPass == true).Count(); + var count2 = count - count1; + data1.Add(count); + data2.Add(count2); + decimal count3 = 0; + if (count2 > 0 && count > 0) + count3 = ((decimal)count2 / count) * 100; + data3.Add(StringHelper.TrimDecimal(count3, 2)); + date = date.AddMonths(1); + } + + var item = new JObject + { + new JProperty("color", "rgba(43, 165, 177, 1)"), + new JProperty("data", data1), + new JProperty("name", await QueryLangValue("F_ResumeMaintenance_0234", "已面试人数")), + }; + series.Add(item); + + item = new JObject + { + new JProperty("color", "rgba(255, 152, 18, 1)"), + new JProperty("data", data2), + new JProperty("name", await QueryLangValue("F_ResumeMaintenance_0235", "面试通过人数")), + }; + series.Add(item); + + item = new JObject + { + new JProperty("color", "rgba(255, 147, 0, 1)"), + new JProperty("data", data3), + new JProperty("name", await QueryLangValue("F_ResumeMaintenance_0233", "面试官面试通过率")), + }; + series.Add(item); + + data.XAxis = XAxis; + data.series = series; + return ServiceResult.OprateSuccess("获取成功", data); + } + #endregion } diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index 4c913ca6..dce1eeee 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -576,12 +576,11 @@ 公共服务 - + 构造函数 - - - + + @@ -591,6 +590,13 @@ + + + 面试官-简历筛选通过率 + + langId + + 分页获取