预约申请

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

@@ -69,6 +69,7 @@ public enum ErrorCodeEnum {
CREATE_CALENDAR_EVENT_FAIL(1021109, "创建面试安排失败!", null),
FEISHU_UPDATE_SCHEDULE_ERROR(1021110, "修改面试安排失败!", null),
INTERVIEW_STATUS_ERROR(1021111, "面试状态错误!", null),
INTERVIEW_PLAN_ALREADY_EXIST(1021112, "面试计划已存在,请勿重复申请!", null),
SIGN_FAIL(600000, "验签失败", null),
GET_ACCESSTOKEN_ERROR(600001, "获取小程序TOKEN错误", null),
NEW_MOBILE_HAS_EXIST(600002,"加盟商用户信息已存在",null),

View File

@@ -14,8 +14,8 @@
<result column="record_time" jdbcType="TIMESTAMP" property="recordTime" />
<result column="summary" jdbcType="VARCHAR" property="summary" />
<result column="auth_code" jdbcType="VARCHAR" property="authCode" />
<result column="qualify_verify_id" jdbcType="VARCHAR" property="qualifyVerifyId" />
<result column="pass_file_url" jdbcType="VARCHAR" property="passFileUrl" />
<result column="pass_pdf_url" jdbcType="VARCHAR" property="passPdfUrl" />
<result column="pass_image_url" jdbcType="VARCHAR" property="passImageUrl" />
<result column="expiry_date" jdbcType="TIMESTAMP" property="expiryDate" />
<result column="latest_log_message" jdbcType="VARCHAR" property="latestLogMessage" />
<result column="pass_reason" jdbcType="VARCHAR" property="passReason" />
@@ -87,8 +87,11 @@
<if test="record.authCode != null">
auth_code,
</if>
<if test="record.passFileUrl != null">
pass_file_url,
<if test="record.passPdfUrl != null">
pass_pdf_url,
</if>
<if test="record.passImageUrl != null">
pass_image_url,
</if>
<if test="record.expiryDate != null">
expiry_date,
@@ -152,8 +155,11 @@
<if test="record.authCode != null">
#{record.authCode},
</if>
<if test="record.passFileUrl != null">
#{record.passFileUrl},
<if test="record.passPdfUrl != null">
#{record.passPdfUrl},
</if>
<if test="record.passImageUrl != null">
#{record.passImageUrl},
</if>
<if test="record.expiryDate != null">
#{record.expiryDate},

View File

@@ -9,6 +9,7 @@
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="is_partner_interview" jdbcType="TINYINT" property="isPartnerInterview" />
<result column="application_approved" jdbcType="TINYINT" property="applicationApproved" />
<result column="actual_start_time" jdbcType="TIMESTAMP" property="actualStartTime" />
<result column="actual_end_time" jdbcType="TIMESTAMP" property="actualEndTime" />
<result column="room_id" jdbcType="VARCHAR" property="roomId" />
@@ -74,6 +75,9 @@
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.applicationApproved != null">
application_approved,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.partnerLineId != null">
@@ -121,6 +125,9 @@
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.applicationApproved != null">
#{record.applicationApproved},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">

View File

@@ -66,6 +66,9 @@ public class HyPartnerInterviewPlanDO implements Serializable {
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("预约是否通过审核0.未审核1.通过审核")
private Integer applicationApproved;
@ApiModelProperty("飞书日历id")
private String feishuCalendarId;

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());
//如果面试计划不存在,抛出异常

View File

@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
@Api(tags = "加盟商资格面试")
@RestController
@RequestMapping("interview")
@RequestMapping("/interview")
public class InterviewController {
@Autowired
@@ -47,7 +47,7 @@ public class InterviewController {
@PostMapping("/appointment/submit")
@ApiOperation("预约面试")
public ResponseResult<CreateAppointmentVO> createAppointment(@RequestBody CreateAppointmentReq request) {
public ResponseResult<CreateAppointmentVO> createAppointment(@RequestBody CreateAppointmentReq request) throws ApiException {
return ResponseResult.success(interviewBaseService.createAppointment(request));
}