Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
2026-01-26 21:13:07 +08:00
9 changed files with 195 additions and 3 deletions

View File

@@ -0,0 +1,32 @@
package com.vetti.hotake.domain.vo;
import com.vetti.common.entity.verification.BaseTemplateEmail;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 面试邀请 请求实体
*
* @author wangxiangshun
* @date 2025-12-14
*/
@Data
@Accessors(chain = true)
public class HotakeInterviewInvitationVo extends BaseTemplateEmail {
@ApiModelProperty("候选人名称")
private String candidate_name;
@ApiModelProperty("岗位")
private String position_name;
@ApiModelProperty("公司名称")
private String company_name;
@ApiModelProperty("面试时间")
private String interview_date;
@ApiModelProperty("当前年")
private String current_year;
}

View File

@@ -97,4 +97,11 @@ public interface IHotakeMeetingCalendarInfoService
public List<HotakeMeetingCalendarDataDto> selectHotakeMeetingCalendarDataDtoList();
/**
* 获取当前候选人即将开始的会议信息
*
* @return 会议日历记录主
*/
public HotakeMeetingCalendarInfo selectCandidateStartCalendarInfo();
}

View File

@@ -1,5 +1,6 @@
package com.vetti.hotake.service.impl;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -7,16 +8,24 @@ import java.util.Map;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.format.DatePrinter;
import cn.hutool.core.util.StrUtil;
import com.vetti.common.config.TwilioConfig;
import com.vetti.common.core.domain.entity.SysUser;
import com.vetti.common.core.service.BaseServiceImpl;
import com.vetti.common.enums.FillTypeEnum;
import com.vetti.common.enums.MeetingCalendarStatus;
import com.vetti.common.enums.StageEnum;
import com.vetti.common.exception.ServiceException;
import com.vetti.common.service.verification.VerificationService;
import com.vetti.common.service.verification.impl.VerificationServiceImpl;
import com.vetti.common.utils.SecurityUtils;
import com.vetti.hotake.domain.HotakeMeetingCalendarDetail;
import com.vetti.hotake.domain.HotakeRolesApplyInfo;
import com.vetti.hotake.domain.HotakeRolesInfo;
import com.vetti.hotake.domain.dto.HotakeMeetingCalendarDataDto;
import com.vetti.hotake.domain.vo.HotakeInterviewInvitationVo;
import com.vetti.hotake.domain.vo.HotakeMeetingCalendarInfoVo;
import com.vetti.hotake.domain.vo.HotakeMeetingCalendarVo;
import com.vetti.hotake.mapper.HotakeMeetingCalendarDetailMapper;
@@ -32,6 +41,8 @@ import com.vetti.hotake.mapper.HotakeMeetingCalendarInfoMapper;
import com.vetti.hotake.domain.HotakeMeetingCalendarInfo;
import com.vetti.hotake.service.IHotakeMeetingCalendarInfoService;
import javax.annotation.Resource;
/**
* 会议日历记录主Service业务层处理
*
@@ -60,10 +71,16 @@ public class HotakeMeetingCalendarInfoServiceImpl extends BaseServiceImpl implem
@Autowired
private HotakeRolesApplyInfoMapper hotakeRolesApplyInfoMapper;
@Autowired
private VerificationService verificationService;
@Autowired
private ISysUserService userService;
@Resource
private TwilioConfig twilioConfig;
/**
* 查询会议日历记录主
*
@@ -343,6 +360,27 @@ public class HotakeMeetingCalendarInfoServiceImpl extends BaseServiceImpl implem
applyInfo.setStage(StageEnum.INTERVIEW.getCode());
hotakeRolesApplyInfoMapper.updateHotakeRolesApplyInfo(applyInfo);
//发送信息-邮件信息
try{
if(StrUtil.isNotEmpty(calendarInfoVo.getMessageVia())){
SysUser user = userService.selectUserById(calendarInfoVo.getCandidateId());
HotakeRolesApplyInfo applyInfo1 = hotakeRolesApplyInfoMapper.selectHotakeRolesApplyInfoById(calendarVo.getRoleApplyId());
HotakeRolesInfo rolesInfo = hotakeRolesInfoMapper.selectHotakeRolesInfoById(applyInfo1.getRoleId());
if (calendarInfoVo.getMessageVia().contains("Email")){
HotakeInterviewInvitationVo vo = new HotakeInterviewInvitationVo();
vo.setCandidate_name(user.getNickName());
vo.setCompany_name(rolesInfo.getCompanyName());
vo.setPosition_name(rolesInfo.getRoleName());
vo.setInterview_date(calendarInfoVo.getMeetingDate() + " "+calendarInfoVo.getTimes());
vo.setCurrent_year(String.valueOf(DateUtil.year(DateUtil.date())));
verificationService.sendInterviewTemplate(user.getEmail(),twilioConfig.getTemplateIds().getInterviewTemplateCode(),vo);
}
}
}catch (Exception e){
e.printStackTrace();
}
}
}
}
@@ -383,4 +421,43 @@ public class HotakeMeetingCalendarInfoServiceImpl extends BaseServiceImpl implem
return new ArrayList<>();
}
}
/**
* 获取当前候选人即将开始的会议信息
* @return
*/
@Override
public HotakeMeetingCalendarInfo selectCandidateStartCalendarInfo() {
//获取候选人所有的日程信息
HotakeMeetingCalendarDetail queryDetai = new HotakeMeetingCalendarDetail();
queryDetai.setCandidateId(SecurityUtils.getUserId());
List<HotakeMeetingCalendarDetail> calendarDetailList = calendarDetailService.selectHotakeMeetingCalendarDetailList(queryDetai);
if(CollectionUtil.isEmpty(calendarDetailList)) {
throw new ServiceException("Currently, you have no upcoming scheduled meetings");
}
List<Long> meetingIds = calendarDetailList.stream().map(HotakeMeetingCalendarDetail::getMeetingId).collect(Collectors.toList());
//查询对应的会议列表数据
HotakeMeetingCalendarInfo queryCalendarInfo = new HotakeMeetingCalendarInfo();
queryCalendarInfo.setMeetingIds(meetingIds);
List<HotakeMeetingCalendarInfo> calendarInfoList = selectHotakeMeetingCalendarInfoList(queryCalendarInfo);
//获取符合当前时间的会议日程信息
String day = DateUtil.format(DateUtil.date(), "MM/dd/yyyy");
Boolean flag = true;
HotakeMeetingCalendarInfo calendarInfoResultData = null;
for(HotakeMeetingCalendarInfo calendarInfo : calendarInfoList) {
if (day.equals(calendarInfo.getMeetingDate())) {
String times = DateUtil.format(DateUtil.date(), "hh");
String timesType = DateUtil.isAM(DateUtil.date()) ? "AM" : "PM";
if(calendarInfo.getTimes().startsWith(times+" "+timesType)){
flag = false;
calendarInfoResultData = calendarInfo;
break;
}
}
}
if(flag){
throw new ServiceException("Currently, you have no upcoming scheduled meetings");
}
return calendarInfoResultData;
}
}