同意面试预约

This commit is contained in:
俞扬
2023-06-21 10:21:58 +08:00
parent e24ddf5b01
commit 57af6a656b
6 changed files with 50 additions and 9 deletions

View File

@@ -70,7 +70,8 @@ public enum ErrorCodeEnum {
FEISHU_UPDATE_SCHEDULE_ERROR(1021110, "修改面试安排失败!", null),
INTERVIEW_STATUS_ERROR(1021111, "面试状态错误!", null),
INTERVIEW_PLAN_ALREADY_EXIST(1021112, "面试计划已存在,请勿重复申请!", null),
INTERVIEW_PLAN_ID_IS_NULL(1021113, "面试计划Id为空", null),
INTERVIEW_LINE_ID_IS_NULL(1021113, "线索id为空", null),
INTERVIEW_INTERVIEW_TIME_IS_UNUSABLE(1021114, "当前预约时间不可用,请和线索用户协商其他时间后确定预约时间\n面试人{0} 手机号:{1}", null),
SIGN_FAIL(600000, "验签失败", null),
GET_ACCESSTOKEN_ERROR(600001, "获取小程序TOKEN错误", null),
NEW_MOBILE_HAS_EXIST(600002,"加盟商用户信息已存在",null),

View File

@@ -184,6 +184,9 @@
<if test="record.feishuScheduleId != null">
feishu_schedule_id = #{record.feishuScheduleId},
</if>
<if test="record.applicationApproved != null">
application_approved = #{record.applicationApproved},
</if>
</set>
where id = #{record.id}
</update>

View File

@@ -16,6 +16,17 @@ public class ApproveAppointmentReq {
@ApiModelProperty(value = "面试官ID", required = true)
private String interviewerId;
@ApiModelProperty(value = "线索ID", required = true)
private Long partnerLineId;
public Long getPartnerLineId() {
return partnerLineId;
}
public void setPartnerLineId(Long partnerLineId) {
this.partnerLineId = partnerLineId;
}
public String getInterviewPlanId() {
return interviewPlanId;
}

View File

@@ -17,4 +17,7 @@ public class EntrustOthersReq {
@ApiModelProperty("新面试官编号")
private String newInterviewerId;
@ApiModelProperty(value = "线索ID", required = true)
private Long partnerLineId;
}

View File

@@ -21,6 +21,9 @@ public class InterviewVO {
@ApiModelProperty(value = "会议id", required = true)
private String interviewId;
@ApiModelProperty(value = "线索id", required = true)
private Long partnerLineId;
@ApiModelProperty("资质审核流程id")
private String qualifyVerifyId;

View File

@@ -2,12 +2,10 @@ package com.cool.store.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import com.cool.store.dto.calendar.CreateCalendarEventDTO;
import com.cool.store.dto.calendar.DeleteCalendarEventDTO;
import com.cool.store.dto.calendar.UpdateCalendarEventDTO;
import com.cool.store.dto.calendar.UserCalendarsEventDTO;
import com.cool.store.dto.calendar.*;
import com.cool.store.dto.message.SendCardMessageDTO;
import com.cool.store.dto.partner.EnterInterviewDto;
import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.entity.HyPartnerInterviewDO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
import com.cool.store.entity.HyPartnerLineInfoDO;
@@ -18,6 +16,7 @@ import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException;
import com.cool.store.http.ISVHttpRequest;
import com.cool.store.mapper.HyPartnerBaseInfoMapper;
import com.cool.store.mapper.HyPartnerInterviewMapper;
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
@@ -70,6 +69,9 @@ public class InterviewServiceImpl implements InterviewService {
@Autowired
private HyPartnerLineInfoMapper hyPartnerLineInfoMapper;
@Autowired
private HyPartnerBaseInfoMapper hyPartnerBaseInfoMapper;
@Override
public List<InterviewVO> getInterviewList(GetInterviewListReq request) {
List<InterviewVO> interviewList = hyPartnerInterviewPlanMapper.getInterviewList(request);
@@ -117,6 +119,8 @@ public class InterviewServiceImpl implements InterviewService {
createCalendarEventDTO.setStartTime(DateUtil.parseDate(interviewInfo.getStartTime()).getTime());
createCalendarEventDTO.setEndTime(DateUtil.parseDate(interviewInfo.getEndTime()).getTime());
createCalendarEventDTO.setUserId(request.getNewInterviewerId());
createCalendarEventDTO.setJoinUserIds(Arrays.asList(request.getNewInterviewerId()));
createCalendarEventDTO.setSummary(generateInterviewTitle(request.getPartnerLineId()));
UserCalendarsEventDTO userCalendarEvent = isvHttpRequest.createUserCalendarEvent(createCalendarEventDTO);
if(userCalendarEvent == null ){
throw new ApiException(ErrorCodeEnum.CREATE_CALENDAR_EVENT_FAIL);
@@ -214,13 +218,13 @@ public class InterviewServiceImpl implements InterviewService {
@Transactional
public CreateAppointmentVO createAppointment(CreateAppointmentReq request) throws ApiException {
if(request.getPartnerLineId() == null || request.getPartnerLineId()<=0){
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_ID_IS_NULL);
throw new ApiException(ErrorCodeEnum.INTERVIEW_LINE_ID_IS_NULL);
}
HyPartnerInterviewPlanDO hyPartnerInterviewPlanDO = new HyPartnerInterviewPlanDO();
hyPartnerInterviewPlanDO.setPartnerLineId(request.getPartnerLineId());
List<HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
if(CollectionUtils.isNotEmpty(hyPartnerInterviewPlanDOS)&&hyPartnerInterviewPlanDOS.get(0).getId()!=null){
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_ID_IS_NULL);
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_ALREADY_EXIST);
}
String interviewrId = request.getInterviewerId();
if(StringUtils.isEmpty(interviewrId)){
@@ -277,11 +281,20 @@ public class InterviewServiceImpl implements InterviewService {
if (interviewVO == null||StringUtil.isEmpty(interviewVO.getInterviewPlanId())) {
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PLAN_NOT_EXIST);
}
HyPartnerBaseInfoDO partnerBaseInfo = hyPartnerBaseInfoMapper.getByPartnerLineId(interviewVO.getPartnerLineId());
List<UserFreeBusyInfoDTO> UserFreeBusyInfoList = isvHttpRequest.getFreeBusyList(request.getInterviewerId(), DateUtil.parse(interviewVO.getStartTime()).getTime(), DateUtil.parse(interviewVO.getEndTime()).getTime());
if (CollectionUtils.isNotEmpty(UserFreeBusyInfoList)) {
throw new ServiceException(ErrorCodeEnum.INTERVIEW_INTERVIEW_TIME_IS_UNUSABLE);
}
//创建日程信息
CreateCalendarEventDTO createCalendarEventDTO = new CreateCalendarEventDTO();
createCalendarEventDTO.setStartTime(DateUtil.parseDate(interviewVO.getStartTime()).getTime());
createCalendarEventDTO.setEndTime(DateUtil.parseDate(interviewVO.getEndTime()).getTime());
createCalendarEventDTO.setStartTime(DateUtil.parse(interviewVO.getStartTime()).getTime());
createCalendarEventDTO.setEndTime(DateUtil.parse(interviewVO.getEndTime()).getTime());
createCalendarEventDTO.setUserId(request.getInterviewerId());
createCalendarEventDTO.setJoinUserIds(Arrays.asList(request.getInterviewerId()));
createCalendarEventDTO.setSummary(generateInterviewTitle(request.getPartnerLineId()));
UserCalendarsEventDTO userCalendarEvent = isvHttpRequest.createUserCalendarEvent(createCalendarEventDTO);
if (userCalendarEvent == null || StringUtil.isEmpty(userCalendarEvent.getEventId())) {
throw new ServiceException(ErrorCodeEnum.CREATE_CALENDAR_EVENT_FAIL);
@@ -291,6 +304,7 @@ public class InterviewServiceImpl implements InterviewService {
record.setId(Long.valueOf(request.getInterviewPlanId()));
record.setFeishuCalendarId(userCalendarEvent.getCalendarId());
record.setFeishuScheduleId(userCalendarEvent.getEventId());
record.setApplicationApproved(1);
record.setUpdateTime(new Date());
hyPartnerInterviewPlanMapper.updateByPrimaryKeySelective(record);
@@ -352,4 +366,10 @@ public class InterviewServiceImpl implements InterviewService {
return interviewerId;
}
public String generateInterviewTitle(Long partnerLineId){
HyPartnerBaseInfoDO partnerBaseInfo = hyPartnerBaseInfoMapper.getByPartnerLineId(partnerLineId);
return "意向 "+partnerBaseInfo.getUsername()+" 线上面试";
}
}