diff --git a/coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java b/coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java index df99ce566..4e8573fe9 100644 --- a/coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java +++ b/coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java @@ -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), diff --git a/coolstore-partner-dao/src/main/resources/mapper/HyPartnerInterviewMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/HyPartnerInterviewMapper.xml index c5dd07b03..ef8ff2273 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/HyPartnerInterviewMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/HyPartnerInterviewMapper.xml @@ -14,8 +14,8 @@ - - + + @@ -87,8 +87,11 @@ auth_code, - - pass_file_url, + + pass_pdf_url, + + + pass_image_url, expiry_date, @@ -152,8 +155,11 @@ #{record.authCode}, - - #{record.passFileUrl}, + + #{record.passPdfUrl}, + + + #{record.passImageUrl}, #{record.expiryDate}, diff --git a/coolstore-partner-dao/src/main/resources/mapper/HyPartnerInterviewPlanMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/HyPartnerInterviewPlanMapper.xml index 4f8569509..ab58eb601 100644 --- a/coolstore-partner-dao/src/main/resources/mapper/HyPartnerInterviewPlanMapper.xml +++ b/coolstore-partner-dao/src/main/resources/mapper/HyPartnerInterviewPlanMapper.xml @@ -9,6 +9,7 @@ + @@ -74,6 +75,9 @@ update_time, + + application_approved, + @@ -121,6 +125,9 @@ #{record.updateTime}, + + #{record.applicationApproved}, + diff --git a/coolstore-partner-model/src/main/java/com/cool/store/entity/HyPartnerInterviewPlanDO.java b/coolstore-partner-model/src/main/java/com/cool/store/entity/HyPartnerInterviewPlanDO.java index 018cff038..3358ec262 100644 --- a/coolstore-partner-model/src/main/java/com/cool/store/entity/HyPartnerInterviewPlanDO.java +++ b/coolstore-partner-model/src/main/java/com/cool/store/entity/HyPartnerInterviewPlanDO.java @@ -66,6 +66,9 @@ public class HyPartnerInterviewPlanDO implements Serializable { @ApiModelProperty("更新时间") private Date updateTime; + @ApiModelProperty("预约是否通过审核:0.未审核1.通过审核") + private Integer applicationApproved; + @ApiModelProperty("飞书日历id") private String feishuCalendarId; diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/InterviewService.java b/coolstore-partner-service/src/main/java/com/cool/store/service/InterviewService.java index 2d387e950..6e343168e 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/InterviewService.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/InterviewService.java @@ -54,7 +54,7 @@ public interface InterviewService { * @param request * @return */ - CreateAppointmentVO createAppointment(CreateAppointmentReq request); + CreateAppointmentVO createAppointment(CreateAppointmentReq request) throws ApiException; /** * 同意面试预约 diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java index 03d894d4b..9b12d5b38 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/InterviewServiceImpl.java @@ -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 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 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()); //如果面试计划不存在,抛出异常 diff --git a/coolstore-partner-webc/src/main/java/com/cool/store/controller/InterviewController.java b/coolstore-partner-webc/src/main/java/com/cool/store/controller/InterviewController.java index 179b48ccf..546837d9e 100644 --- a/coolstore-partner-webc/src/main/java/com/cool/store/controller/InterviewController.java +++ b/coolstore-partner-webc/src/main/java/com/cool/store/controller/InterviewController.java @@ -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 createAppointment(@RequestBody CreateAppointmentReq request) { + public ResponseResult createAppointment(@RequestBody CreateAppointmentReq request) throws ApiException { return ResponseResult.success(interviewBaseService.createAppointment(request)); }