预约申请

This commit is contained in:
俞扬
2023-06-20 14:06:05 +08:00
parent 8296e70f26
commit 33e90cf542
7 changed files with 43 additions and 16 deletions

View File

@@ -54,7 +54,7 @@ public interface InterviewService {
* @param request
* @return
*/
CreateAppointmentVO createAppointment(CreateAppointmentReq request);
CreateAppointmentVO createAppointment(CreateAppointmentReq request) throws ApiException;
/**
* 同意面试预约

View File

@@ -28,11 +28,11 @@ import com.cool.store.vo.EnterpriseUserBaseInfoVO;
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.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.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.Arrays;
@@ -208,7 +208,13 @@ public class InterviewServiceImpl implements InterviewService {
@Override
@Transactional
public CreateAppointmentVO createAppointment(CreateAppointmentReq request) {
public CreateAppointmentVO createAppointment(CreateAppointmentReq request) throws ApiException {
HyPartnerInterviewPlanDO hyPartnerInterviewPlanDO = new HyPartnerInterviewPlanDO();
hyPartnerInterviewPlanDO.setPartnerLineId(request.getPartnerLineId());
List<HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
if(CollectionUtils.isNotEmpty(hyPartnerInterviewPlanDOS)){
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_ALREADY_EXIST);
}
CreateAppointmentVO vo = new CreateAppointmentVO();
//1.创建面试计划
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
@@ -227,16 +233,19 @@ public class InterviewServiceImpl implements InterviewService {
record.setRoomId(StringUtil.generateRoomId(startBookingTime));
record.setRoomStatus(RoomStatus.WAIT_FOR_OPEN.getCode());
record.setDeleted(false);
record.setApplicationApproved(0);
hyPartnerInterviewPlanMapper.insertSelective(record);
HyPartnerInterviewPlanDO hyPartnerInterviewPlanDO = new HyPartnerInterviewPlanDO();
hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
// vo.setInterviewPlanId(String.valueOf(interviewPlanId));
List<HyPartnerInterviewPlanDO> interviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
if(CollectionUtils.isEmpty(interviewPlanDOS)){
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_NOT_EXIST);
}
Long interviewPlanId = interviewPlanDOS.get(0).getId();
vo.setInterviewPlanId(String.valueOf(interviewPlanId));
//2.创建面试信息
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
// hyPartnerInterviewDO.setInterviewPlanId(interviewPlanId);
hyPartnerInterviewDO.setInterviewPlanId(interviewPlanId);
hyPartnerInterviewDO.setPartnerLineId(request.getPartnerLineId());
hyPartnerInterviewDO.setPartnerId(request.getPartnerId());
hyPartnerInterviewDO.setInterviewer(request.getInterviewerId());
@@ -250,6 +259,7 @@ public class InterviewServiceImpl implements InterviewService {
@Override
public void approveAppointment(ApproveAppointmentReq request) throws ApiException {
//查询面试计划信息
InterviewVO interviewVO = hyPartnerInterviewPlanMapper.getInterviewInfo(request.getInterviewPlanId());
//如果面试计划不存在,抛出异常