面试预约申请
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
package com.cool.store.enums;
|
||||||
|
|
||||||
|
public enum RoomStatus {
|
||||||
|
WAIT_FOR_OPEN(0, "待开放"),
|
||||||
|
OPEN(1, "已开放"),
|
||||||
|
CLOSED(2, "已关闭");
|
||||||
|
|
||||||
|
private final int code;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
RoomStatus(int code, String description) {
|
||||||
|
this.code = code;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ public enum WorkflowStatusEnum {
|
|||||||
|
|
||||||
//预约面试阶段
|
//预约面试阶段
|
||||||
RESERVATION_0("0","待预约"),
|
RESERVATION_0("0","待预约"),
|
||||||
RESERVATION_1("1","待审核"),
|
RESERVATION_1("1","预约时间待审核"),
|
||||||
RESERVATION_7("7","到期未预约"),
|
RESERVATION_7("7","到期未预约"),
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.cool.store.utils;
|
package com.cool.store.utils;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
@@ -241,4 +243,15 @@ public class StringUtil extends org.apache.commons.lang3.StringUtils {
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成房间号
|
||||||
|
* @param dateTime
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String generateRoomId(String dateTime) {
|
||||||
|
//YYYY-MM-DD HH:mm:ss 转换成yyyyMMddHHmmss
|
||||||
|
String format = DateUtil.format(DateUtil.parse(dateTime, "YYYY-MM-DD HH:mm:ss"), "yyyyMMddHHmmss");
|
||||||
|
String numbers = RandomUtil.randomNumbers(5);
|
||||||
|
return format + numbers;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class HyPartnerInterviewDO implements Serializable {
|
|||||||
@ApiModelProperty("")
|
@ApiModelProperty("")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@ApiModelProperty("预约状态 0 待预约;1待面试;2已开始;3待审核;4审批中;5审批通过;6拒绝")
|
@ApiModelProperty("预约状态 0 待预约;1预约时间待审核2.待面试;3已开始;4待审核;5审批中;6审批通过;7拒绝")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
@ApiModelProperty("hy_partner_line_info.id")
|
@ApiModelProperty("hy_partner_line_info.id")
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.cool.store.request;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
@ApiModel(description = "面试预约")
|
||||||
|
public class CreateAppointmentReq {
|
||||||
|
@ApiModelProperty(value = "加盟商用户ID", required = true)
|
||||||
|
private String partnerId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "面试官id", required = true)
|
||||||
|
private String interviewerId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预约开始时间 (YYYY-MM-DD hh:mm:ss)", required = true)
|
||||||
|
private String startBookingTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预约结束时间 (YYYY-MM-DD hh:mm:ss)", required = true)
|
||||||
|
private String endBookingTime;
|
||||||
|
@ApiModelProperty(value = "线索id", required = true)
|
||||||
|
private Long partnerLineId;
|
||||||
|
|
||||||
|
public String getPartnerId() {
|
||||||
|
return partnerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPartnerId(String partnerId) {
|
||||||
|
this.partnerId = partnerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInterviewerId() {
|
||||||
|
return interviewerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterviewerId(String interviewerId) {
|
||||||
|
this.interviewerId = interviewerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPartnerLineId() {
|
||||||
|
return partnerLineId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPartnerLineId(Long partnerLineId) {
|
||||||
|
this.partnerLineId = partnerLineId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartBookingTime() {
|
||||||
|
return startBookingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartBookingTime(String startBookingTime) {
|
||||||
|
this.startBookingTime = startBookingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndBookingTime() {
|
||||||
|
return endBookingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndBookingTime(String endBookingTime) {
|
||||||
|
this.endBookingTime = endBookingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.cool.store.vo.interview;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: young.yu
|
||||||
|
* @Date: 2023-06-18 18:17
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@ApiModel(description = "创建面试预约信息")
|
||||||
|
public class CreateAppointmentVO {
|
||||||
|
@ApiModelProperty("面试安排id")
|
||||||
|
private String interviewPlanId;
|
||||||
|
|
||||||
|
public String getInterviewPlanId() {
|
||||||
|
return interviewPlanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterviewPlanId(String interviewPlanId) {
|
||||||
|
this.interviewPlanId = interviewPlanId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
package com.cool.store.service;
|
package com.cool.store.service;
|
||||||
|
|
||||||
import com.cool.store.dto.partner.EnterInterviewDto;
|
import com.cool.store.dto.partner.EnterInterviewDto;
|
||||||
import com.cool.store.request.EntrustOthersReq;
|
import com.cool.store.request.*;
|
||||||
import com.cool.store.request.FinishInterviewReq;
|
|
||||||
import com.cool.store.request.GetInterviewListReq;
|
|
||||||
import com.cool.store.request.ModifyInterviewTimeReq;
|
|
||||||
import com.cool.store.vo.EnterInterviewVO;
|
import com.cool.store.vo.EnterInterviewVO;
|
||||||
|
import com.cool.store.vo.interview.CreateAppointmentVO;
|
||||||
import com.cool.store.vo.interview.InterviewVO;
|
import com.cool.store.vo.interview.InterviewVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -50,4 +48,11 @@ public interface InterviewService {
|
|||||||
*/
|
*/
|
||||||
EnterInterviewVO enterInterviewRoom(EnterInterviewDto dto);
|
EnterInterviewVO enterInterviewRoom(EnterInterviewDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建面试预约信息
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CreateAppointmentVO createAppointment(CreateAppointmentReq request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,17 +6,18 @@ import com.cool.store.dto.partner.EnterInterviewDto;
|
|||||||
import com.cool.store.entity.HyPartnerInterviewDO;
|
import com.cool.store.entity.HyPartnerInterviewDO;
|
||||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.RoomStatus;
|
||||||
|
import com.cool.store.enums.WorkflowStatusEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.mapper.HyPartnerInterviewMapper;
|
import com.cool.store.mapper.HyPartnerInterviewMapper;
|
||||||
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
|
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
|
||||||
import com.cool.store.request.EntrustOthersReq;
|
import com.cool.store.request.*;
|
||||||
import com.cool.store.request.FinishInterviewReq;
|
|
||||||
import com.cool.store.request.GetInterviewListReq;
|
|
||||||
import com.cool.store.request.ModifyInterviewTimeReq;
|
|
||||||
import com.cool.store.service.InterviewService;
|
import com.cool.store.service.InterviewService;
|
||||||
|
import com.cool.store.utils.StringUtil;
|
||||||
import com.cool.store.utils.TRTCUtils;
|
import com.cool.store.utils.TRTCUtils;
|
||||||
import com.cool.store.vo.EnterInterviewVO;
|
import com.cool.store.vo.EnterInterviewVO;
|
||||||
import com.cool.store.vo.EnterpriseUserBaseInfoVO;
|
import com.cool.store.vo.EnterpriseUserBaseInfoVO;
|
||||||
|
import com.cool.store.vo.interview.CreateAppointmentVO;
|
||||||
import com.cool.store.vo.interview.InterviewVO;
|
import com.cool.store.vo.interview.InterviewVO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -152,5 +153,42 @@ public class InterviewServiceImpl implements InterviewService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CreateAppointmentVO createAppointment(CreateAppointmentReq request) {
|
||||||
|
CreateAppointmentVO vo = new CreateAppointmentVO();
|
||||||
|
//1.创建面试计划
|
||||||
|
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
|
||||||
|
String startBookingTime = request.getStartBookingTime();
|
||||||
|
String startDate = startBookingTime.substring(0, 10);
|
||||||
|
record.setInterviewDate(Convert.toDate(startDate));
|
||||||
|
record.setCreateTime(new Date());
|
||||||
|
record.setUpdateTime(new Date());
|
||||||
|
record.setStartTime(Convert.toDate(request.getStartBookingTime()));
|
||||||
|
record.setEndTime(Convert.toDate(request.getEndBookingTime()));
|
||||||
|
record.setPartnerId(request.getPartnerId());
|
||||||
|
record.setPartnerLineId(request.getPartnerLineId());
|
||||||
|
record.setInterviewer(request.getInterviewerId());
|
||||||
|
record.setIsPartnerInterview(0);
|
||||||
|
//生成房间号
|
||||||
|
record.setRoomId(StringUtil.generateRoomId(startBookingTime));
|
||||||
|
record.setRoomStatus(RoomStatus.WAIT_FOR_OPEN.getCode());
|
||||||
|
record.setDeleted(false);
|
||||||
|
long interviewPlanId = hyPartnerInterviewPlanMapper.insertSelective(record);
|
||||||
|
vo.setInterviewPlanId(String.valueOf(interviewPlanId));
|
||||||
|
|
||||||
|
//2.创建面试信息
|
||||||
|
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
|
||||||
|
hyPartnerInterviewDO.setInterviewPlanId(interviewPlanId);
|
||||||
|
hyPartnerInterviewDO.setPartnerId(request.getPartnerId());
|
||||||
|
hyPartnerInterviewDO.setPartnerLineId(request.getPartnerLineId());
|
||||||
|
hyPartnerInterviewDO.setInterviewer(request.getInterviewerId());
|
||||||
|
hyPartnerInterviewDO.setCreateTime(new Date());
|
||||||
|
hyPartnerInterviewDO.setUpdateTime(new Date());
|
||||||
|
hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.RESERVATION_1.getCode()));
|
||||||
|
hyPartnerInterviewMapper.insertSelective(hyPartnerInterviewDO);
|
||||||
|
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.cool.store.request.*;
|
|||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.InterviewService;
|
import com.cool.store.service.InterviewService;
|
||||||
import com.cool.store.vo.EnterInterviewVO;
|
import com.cool.store.vo.EnterInterviewVO;
|
||||||
|
import com.cool.store.vo.interview.CreateAppointmentVO;
|
||||||
import com.cool.store.vo.interview.InterviewVO;
|
import com.cool.store.vo.interview.InterviewVO;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
@@ -68,9 +69,14 @@ public class InterviewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/enter")
|
@PostMapping("/enter")
|
||||||
@ApiOperation("进入面试间")
|
@ApiOperation("进入面试房间")
|
||||||
public ResponseResult<EnterInterviewVO> enterInterviewRoom(@RequestBody EnterInterviewDto dto) {
|
public ResponseResult<EnterInterviewVO> enterInterviewRoom(@RequestBody EnterInterviewDto dto) {
|
||||||
return ResponseResult.success(interviewService.enterInterviewRoom(dto));
|
return ResponseResult.success(interviewService.enterInterviewRoom(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/appointment")
|
||||||
|
@ApiOperation("预约面试")
|
||||||
|
public ResponseResult<CreateAppointmentVO> createAppointment(@RequestBody CreateAppointmentReq request) {
|
||||||
|
return ResponseResult.success(interviewService.createAppointment(request));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user