面试开始前一天及30分钟前提醒

This commit is contained in:
feng.li
2023-09-22 14:23:15 +08:00
parent e0cba31388
commit bd78c693c8
7 changed files with 131 additions and 6 deletions

View File

@@ -10,7 +10,11 @@ public enum SMSMsgEnum {
INTERVIEW_APPOINTMENT_PASS("预约面试通过通知","【沪上阿姨】你已成功预约{$var}进行沪上阿姨加盟资格面试届时请通过沪姨合伙人小程序进行面试面试时间约40分钟请提前仔细阅读面试准备材料以及观看加盟说明视频做好面试相应准备。请务必提前安排好您的时间。点击转跳沪姨合伙人小程序{$var}"),
INTERVIEW_PASS("面试通过通知","【沪上阿姨】恭喜您通过了加盟资格面试,接下来我们会为您安排专业的选址开发顾问协助您进行选址,请保持电话畅通,祝您早日选址成功!点击转跳沪姨合伙人小程序:{$var}");
INTERVIEW_PASS("面试通过通知","【沪上阿姨】恭喜您通过了加盟资格面试,接下来我们会为您安排专业的选址开发顾问协助您进行选址,请保持电话畅通,祝您早日选址成功!点击转跳沪姨合伙人小程序:{$var}"),
INTERVIEW_BEGIN_IN_DAY("面试开始前一天", "【沪上阿姨】您预约的沪上阿姨加盟资格面试将于明天 {$var}{$var})开始,为保证您能够更加顺利的通过面试,请提前通过沪上阿姨合伙人小程序仔细阅读面试准备材料并做好相应准备。点击转跳小程序:{$var}"),
INTERVIEW_BEGIN_IN_MINUTES("面试开始前30分钟", "【沪上阿姨】您预约的沪上阿姨加盟资格面试将在30分钟后开始。面试预计持续40分钟请务必提前安排好您的时间。点击跳转沪上阿姨小程序快速进入面试房间{$var}");
private String title;
private String content;

View File

@@ -4,11 +4,11 @@ import com.cool.store.dto.message.RemindInterviewMsgDTO;
import com.cool.store.dto.partner.AdvanceLineDTO;
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
import com.cool.store.entity.HyInterviewRemindDO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
import com.cool.store.request.GetInterviewListReq;
import com.cool.store.vo.EnterpriseUserBaseInfoVO;
import com.cool.store.vo.interview.InterviewVO;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
@@ -173,5 +173,16 @@ public interface HyPartnerInterviewPlanMapper {
int updateLineId(@Param("newPartnerId") String newPartnerId, @Param("newLineId") Long newLineId, @Param("oldLineId") Long oldLineId);
/**
* 获取明天开始面试的面试开始时间和 partnerId17:00 前确定为明天面试的)
*
* @return
*/
List<HyInterviewRemindDO> getTomorrowInterview();
/**
* 获取 30 分钟后开始的面试预约30分钟之内的面试不发获取
* @return
*/
List<HyInterviewRemindDO> remindInterviewStartMinutes();
}

View File

@@ -542,4 +542,28 @@
set partner_line_id = #{newLineId} , partner_id = #{newPartnerId}
where partner_line_id = #{oldLineId}
</update>
<!--获取明天开始面试的面试开始时间和 partnerId17:00 前确定为明天面试的)-->
<select id="getTomorrowInterview" resultType="com.cool.store.entity.HyInterviewRemindDO">
SELECT t1.start_time, t3.mobile
FROM hy_partner_interview_plan t1
LEFT JOIN hy_partner_interview t2 ON t1.id = t2.interview_plan_id
LEFT JOIN hy_partner_user_info t3 ON t1.partner_id = t3.partner_id
WHERE t1.deleted = 0 ANd t2.deleted = 0
AND t2.`status` = 2
AND DATE(start_time) = DATE_ADD(CURDATE(), INTERVAL 1 DAY)
AND t1.update_time &lt; CONCAT(CURDATE(), ' 17:00:00')
</select>
<!--获取 30 分钟后开始的面试预约30分钟之内的面试不发获取-->
<select id="remindInterviewStartMinutes" resultType="com.cool.store.entity.HyInterviewRemindDO">
SELECT t1.start_time, t3.mobile
FROM hy_partner_interview_plan t1
LEFT JOIN hy_partner_interview t2 ON t1.id = t2.interview_plan_id
LEFT JOIN hy_partner_user_info t3 ON t1.partner_id = t3.partner_id
WHERE t1.deleted = 0 ANd t2.deleted = 0
AND t2.`status` = 2
AND start_time &gt; NOW() AND start_time &lt;= DATE_ADD(NOW(), INTERVAL 30 MINUTE)
</select>
</mapper>

View File

@@ -0,0 +1,23 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @author Fun Li 2023/9/22 10:52
* @version 1.0
* 面试提醒短信所需信息
*/
@Data
public class HyInterviewRemindDO implements Serializable {
@ApiModelProperty("面试开始时间")
private Date startTime;
@ApiModelProperty("加盟商手机号")
private String mobile;
}

View File

@@ -111,4 +111,31 @@ public class JobHandler {
}
}
@XxlJob("remindInterviewStartTomorrow")
public void remindInterviewStartTomorrow() {
try {
log.info("面试开始前一天20:00提醒开始");
hyPartnerInterviewPlanService.remindInterviewStartTomorrow();
log.info("面试开始前一天20:00提醒结束");
XxlJobHelper.handleSuccess();
} catch (Exception e) {
log.error("面试开始前一天20:00提醒异常", e);
XxlJobHelper.log("面试开始前一天20:00提醒异常" + e.getMessage());
}
}
//每半小时执行一次,查询有无面试时间 x 在当前时间 y < x <= y + 30m 内,有就发短信
@XxlJob("remindInterviewStartMinutes")
public void remindInterviewStartMinutes() {
try {
log.info("面试开始前一天20:00提醒开始");
hyPartnerInterviewPlanService.remindInterviewStartMinutes();
log.info("面试开始前一天20:00提醒结束");
XxlJobHelper.handleSuccess();
} catch (Exception e) {
log.error("面试开始前一天20:00提醒异常", e);
XxlJobHelper.log("面试开始前一天20:00提醒异常" + e.getMessage());
}
}
}

View File

@@ -63,4 +63,14 @@ public interface HyPartnerInterviewPlanService {
*/
void updateAbsentInterview() throws ApiException;
void approvalReminder() throws ApiException;
/**
* 面试前一天 20:00 提醒
*/
void remindInterviewStartTomorrow();
/**
* 面试前 30 分钟提醒
*/
void remindInterviewStartMinutes();
}

View File

@@ -17,10 +17,7 @@ import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.cool.store.mapper.HyPartnerUserChannelMapper;
import com.cool.store.request.CloseFollowRequest;
import com.cool.store.request.GetInterviewListReq;
import com.cool.store.service.HyPartnerInterviewPlanService;
import com.cool.store.service.HyPartnerLineInfoService;
import com.cool.store.service.InterviewService;
import com.cool.store.service.LabelService;
import com.cool.store.service.*;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.vo.InterviewDetailInfoVO;
import com.cool.store.vo.PartnerInterviewInfoVO;
@@ -36,6 +33,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -91,6 +89,13 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
@Autowired
private ISVHttpRequest isvHttpRequest;
@Autowired
private SmsService smsService;
@Autowired
private WechatMiniAppService wechatMiniAppService;
@Override
public List<InterviewDetailInfoVO> getInterviewPlanList(String userId,Date dateTime) {
String currentDay = DateUtil.format(dateTime, CoolDateUtils.DATE_FORMAT_DAY);
@@ -354,4 +359,25 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
return partnerInterviewInfoVO;
}
@Override
public void remindInterviewStartTomorrow() {
List<HyInterviewRemindDO> tomorrowInterviewInfos = hyPartnerInterviewPlanMapper.getTomorrowInterview();
SimpleDateFormat timeFormatter = new SimpleDateFormat("HH:mm");
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy年MM月dd日");
Date startTime;
for (HyInterviewRemindDO tomorrowInterviewInfo : tomorrowInterviewInfos) {
startTime = tomorrowInterviewInfo.getStartTime();
smsService.sendSmsVariable(tomorrowInterviewInfo.getMobile(), SMSMsgEnum.INTERVIEW_BEGIN_IN_DAY, timeFormatter.format(startTime), dateFormatter.format(startTime), wechatMiniAppService.getMiniAppUrl());
}
}
//每半小时执行一次,查询有无面试时间 x 在当前时间 y < x <= y + 30m 内,有就发短信
@Override
public void remindInterviewStartMinutes() {
List<HyInterviewRemindDO> tomorrowInterviewInfos = hyPartnerInterviewPlanMapper.remindInterviewStartMinutes();
for (HyInterviewRemindDO tomorrowInterviewInfo : tomorrowInterviewInfos) {
smsService.sendSmsVariable(tomorrowInterviewInfo.getMobile(), SMSMsgEnum.INTERVIEW_BEGIN_IN_MINUTES, wechatMiniAppService.getMiniAppUrl());
}
}
}