同意面试预约
This commit is contained in:
@@ -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()+" 线上面试";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user