diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs index 32086d03..032566f3 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs @@ -218,4 +218,17 @@ public class Ghrh_ResumeController : BaseController + /// 简历库已推荐提醒 + /// + /// 简历Id + /// + [HttpPost, Route("RemindHasRecommend/{id}")] + public async Task RemindHasRecommend(long id) + { + return await _service.RemindHasRecommend(id); + } + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index d4169be8..0db0e4aa 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -1352,6 +1352,13 @@ 简历Id + + + 简历库已推荐提醒 + + 简历Id + + 教育背景(Controller) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs index fa476d67..62c32813 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs @@ -34,4 +34,6 @@ public interface IGhrh_ResumeServices : IBaseServices> Export(QueryBody filter, string condition, bool? IsEnable = true); Task Recommend(long id, ResumeRecommendForm recommend); + + Task RemindHasRecommend(long id); } \ No newline at end of file diff --git a/Tiobon.Core.Model/ViewModels/Extend/ResumeViewTab.cs b/Tiobon.Core.Model/ViewModels/Extend/ResumeViewTab.cs index 330d1657..d9ecd73e 100644 --- a/Tiobon.Core.Model/ViewModels/Extend/ResumeViewTab.cs +++ b/Tiobon.Core.Model/ViewModels/Extend/ResumeViewTab.cs @@ -81,7 +81,7 @@ public class ResumeRecommendFormStaff /// /// 员工ID /// - public long StaffId { get; set; } + public int StaffId { get; set; } /// /// 邮箱 diff --git a/Tiobon.Core.Services/BASE/BaseServices.cs b/Tiobon.Core.Services/BASE/BaseServices.cs index f7daecd2..43d7ade0 100644 --- a/Tiobon.Core.Services/BASE/BaseServices.cs +++ b/Tiobon.Core.Services/BASE/BaseServices.cs @@ -1961,5 +1961,39 @@ public class BaseServices : IBaseServ // } //} + #region 发送站内信 + public async Task SendMessage(List staffIds, string title, string content) + { + for (int i = 0; i < staffIds.Count; i++) + { + //string sql = @$"select UserId from Ghrs_User where UserStaffID={staffIds[i]}"; + + //var userId = await Db.Ado.GetIntAsync(sql); + + + var id = await Db.Insertable(new Ghrm_MessageText() + { + GroupType = "Staff", + Title = title, + Content = content, + SortNo = 0, + IsDefault = 0, + IsEnable = 1 + }).ExecuteReturnIdentityAsync(); + await Db.Insertable(new Ghrm_MessageUser() + { + MessageTextID = id, + SenderStaffID = 0, + ReceiveStaffID = staffIds[i], + SortNo = 0, + IsDefault = 0, + IsEnable = 1 + }).ExecuteReturnIdentityAsync(); + + } + + } + #endregion + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs index 0cf28ce7..f2217277 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs @@ -1,4 +1,5 @@ -using Tiobon.Core.IServices; +using System.Collections.Generic; +using Tiobon.Core.IServices; using static Tiobon.Core.Model.Consts; namespace Tiobon.Core.Services; @@ -1204,7 +1205,7 @@ END"; RequestId = recommend.RequestId, RecommendTime = DateTime.Now, RecommendId = App.User.ID, - ReceiverIds = JsonHelper.ObjToJson(recommend), + ReceiverIds = JsonHelper.ObjToJson(recommend.InterviewStaffs), Status = DIC_INTERVIEW_ORDER_STATUS.HasRecommended }); @@ -1213,14 +1214,14 @@ END"; #endregion #region 简历库已推荐提醒 - public async Task HasRecommendRemind(long id) + public async Task RemindHasRecommend(long id) { var entity = await base.QueryById(id); if (entity == null) return ServiceResult.OprateFailed("无效的简历ID!"); if (entity.Status != DIC_INTERVIEW_ORDER_STATUS.HasRecommended) - return ServiceResult.OprateFailed("只有在已推荐状态下简历才能发送提醒!"); + return ServiceResult.OprateFailed("非已推荐状态下简历不可发送提醒!"); var order = await Db.Queryable().FirstAsync(x => x.ResumeId == id); if (order != null) @@ -1228,10 +1229,15 @@ END"; if (order.FirstViewTime.IsNotEmptyOrNull()) return ServiceResult.OprateFailed("面试官已查看简历,暂不可发送提醒!"); + if (order.ReceiverIds.IsNotEmptyOrNull()) + { + var staffs = JsonHelper.JsonToObj>(order.ReceiverIds); + await SendMessage(staffs.Select(x => x.StaffId).ToList(), "简历提醒", "您有个简历推荐,请及时查看!"); + } } - return ServiceResult.OprateSuccess(); - } - #endregion -} \ No newline at end of file + return ServiceResult.OprateSuccess(); + } + #endregion + } \ No newline at end of file