预约申请

This commit is contained in:
俞扬
2023-06-20 15:29:07 +08:00
parent ac1ad6c502
commit 828084ef6e
4 changed files with 38 additions and 20 deletions

View File

@@ -5,10 +5,9 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel(description = "面试预约")
public class CreateAppointmentReq {
@ApiModelProperty(value = "加盟商用户ID", required = true)
@ApiModelProperty(value = "加盟商用户ID")
private String partnerId;
@ApiModelProperty(value = "面试官id", required = true)
@ApiModelProperty(value = "面试官id")
private String interviewerId;
@ApiModelProperty(value = "预约开始时间 (YYYY-MM-DD hh:mm:ss)", required = true)
@@ -16,7 +15,7 @@ public class CreateAppointmentReq {
@ApiModelProperty(value = "预约结束时间 (YYYY-MM-DD hh:mm:ss)", required = true)
private String endBookingTime;
@ApiModelProperty(value = "线索id", required = true)
@ApiModelProperty(value = "线索id(如果面试官id会根据加盟商id和线索id查询面试官)")
private Long partnerLineId;
public String getPartnerId() {
@@ -59,5 +58,4 @@ public class CreateAppointmentReq {
this.endBookingTime = endBookingTime;
}
}

View File

@@ -64,4 +64,6 @@ public interface InterviewService {
void approveAppointment(ApproveAppointmentReq request) throws ApiException;
void reInterview(ReInterviewReq request) throws ApiException;
void rejectInterview(RejectInterviewReq request) throws ApiException;
public String getInterviewerByPartner(String partnerId,String lineId)throws ApiException;
}

View File

@@ -13,6 +13,7 @@ import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.cool.store.request.GetFreeBusyListReq;
import com.cool.store.service.FeiShuService;
import com.cool.store.service.InterviewService;
import com.cool.store.vo.interview.CalendarInfo;
import com.cool.store.vo.interview.FreeBusyInfo;
import com.cool.store.vo.interview.GetFreeBusyListVO;
@@ -39,7 +40,7 @@ public class FeiShuServiceImpl implements FeiShuService {
private HyPartnerInterviewPlanMapper hyPartnerInterviewPlanMapper;
@Autowired
private HyPartnerLineInfoMapper hyPartnerLineInfoMapper;
private InterviewService interviewService;
@Override
public GetFreeBusyListVO getFreeBusyList(GetFreeBusyListReq request) throws ApiException {
@@ -55,17 +56,7 @@ public class FeiShuServiceImpl implements FeiShuService {
}
//如果加盟商用户ID不为空且面试官ID为空
if (StringUtils.isNotEmpty(partnerId) && StringUtils.isNotEmpty(lineId)) {
//根据加盟商用户ID查询面试官ID
HyPartnerInterviewPlanDO hyPartnerInterviewPlanDO = new HyPartnerInterviewPlanDO();
hyPartnerInterviewPlanDO.setPartnerId(partnerId);
List<HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
//如果查询结果为空,则去线索中获取招商经理,面试官只有两个阶段,一个是在第一次申请时不存在面试安排直接取招商经理,第二个时面试信息中可修改面试官信息,这个时候以面试信息中为准
if (CollectionUtils.isEmpty(hyPartnerInterviewPlanDOS)) {
HyPartnerLineInfoDO hyPartnerLineInfoDO = hyPartnerLineInfoMapper.selectByPrimaryKeySelective(Long.valueOf(lineId));
interviewerId = hyPartnerLineInfoDO.getInvestmentManager();
}else {
interviewerId = hyPartnerInterviewPlanDOS.get(0).getInterviewer();
}
interviewerId = interviewService.getInterviewerByPartner(partnerId, lineId);
}
long startTime = 0L;
long endTime = 0L;

View File

@@ -10,6 +10,7 @@ import com.cool.store.dto.message.SendCardMessageDTO;
import com.cool.store.dto.partner.EnterInterviewDto;
import com.cool.store.entity.HyPartnerInterviewDO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.MessageTypeEnum;
import com.cool.store.enums.RoomStatus;
@@ -19,6 +20,7 @@ import com.cool.store.exception.ServiceException;
import com.cool.store.http.ISVHttpRequest;
import com.cool.store.mapper.HyPartnerInterviewMapper;
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.cool.store.request.*;
import com.cool.store.service.InterviewService;
import com.cool.store.utils.StringUtil;
@@ -29,11 +31,11 @@ import com.cool.store.vo.interview.CreateAppointmentVO;
import com.cool.store.vo.interview.InterviewVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.Arrays;
import java.util.Date;
@@ -65,6 +67,9 @@ public class InterviewServiceImpl implements InterviewService {
@Autowired
private ISVHttpRequest isvHttpRequest;
@Autowired
private HyPartnerLineInfoMapper hyPartnerLineInfoMapper;
@Override
public List<InterviewVO> getInterviewList(GetInterviewListReq request) {
List<InterviewVO> interviewList = hyPartnerInterviewPlanMapper.getInterviewList(request);
@@ -215,6 +220,10 @@ public class InterviewServiceImpl implements InterviewService {
if(CollectionUtils.isNotEmpty(hyPartnerInterviewPlanDOS)){
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_ALREADY_EXIST);
}
String interviewrId = request.getInterviewerId();
if(StringUtils.isEmpty(interviewrId)){
interviewrId = getInterviewerByPartner(request.getPartnerId(),String.valueOf(request.getPartnerLineId()));
}
CreateAppointmentVO vo = new CreateAppointmentVO();
//1.创建面试计划
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
@@ -227,7 +236,7 @@ public class InterviewServiceImpl implements InterviewService {
record.setEndTime(Convert.toDate(request.getEndBookingTime()));
record.setPartnerId(request.getPartnerId());
record.setPartnerLineId(request.getPartnerLineId());
record.setInterviewer(request.getInterviewerId());
record.setInterviewer(interviewrId);
record.setIsPartnerInterview(0);
//生成房间号
record.setRoomId(StringUtil.generateRoomId(startBookingTime));
@@ -248,7 +257,7 @@ public class InterviewServiceImpl implements InterviewService {
hyPartnerInterviewDO.setInterviewPlanId(interviewPlanId);
hyPartnerInterviewDO.setPartnerLineId(request.getPartnerLineId());
hyPartnerInterviewDO.setPartnerId(request.getPartnerId());
hyPartnerInterviewDO.setInterviewer(request.getInterviewerId());
hyPartnerInterviewDO.setInterviewer(interviewrId);
hyPartnerInterviewDO.setCreateTime(new Date());
hyPartnerInterviewDO.setUpdateTime(new Date());
hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.RESERVATION_1.getCode()));
@@ -322,5 +331,23 @@ public class InterviewServiceImpl implements InterviewService {
.append(DateUtil.format(DateUtil.parse(interviewTime), "yyyy年MM月dd日 HH:mm"));
return sb.toString();
}
@Override
public String getInterviewerByPartner(String partnerId,String lineId){
String interviewerId = null;
if (StringUtils.isNotEmpty(partnerId) && StringUtils.isNotEmpty(lineId)) {
//根据加盟商用户ID查询面试官ID
HyPartnerInterviewPlanDO hyPartnerInterviewPlanDO = new HyPartnerInterviewPlanDO();
hyPartnerInterviewPlanDO.setPartnerId(partnerId);
List<HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
//如果查询结果为空,则去线索中获取招商经理,面试官只有两个阶段,一个是在第一次申请时不存在面试安排直接取招商经理,第二个时面试信息中可修改面试官信息,这个时候以面试信息中为准
if (org.springframework.util.CollectionUtils.isEmpty(hyPartnerInterviewPlanDOS)) {
HyPartnerLineInfoDO hyPartnerLineInfoDO = hyPartnerLineInfoMapper.selectByPrimaryKeySelective(Long.valueOf(lineId));
interviewerId = hyPartnerLineInfoDO.getInvestmentManager();
}else {
interviewerId = hyPartnerInterviewPlanDOS.get(0).getInterviewer();
}
}
return interviewerId;
}
}