面试预约时间增加报错信息

This commit is contained in:
俞扬
2023-09-06 17:47:27 +08:00
parent 7bd7474858
commit 2786d8adb8
3 changed files with 10 additions and 0 deletions

View File

@@ -91,6 +91,8 @@ public enum ErrorCodeEnum {
CALL_RECORD_NOT_EXIST_ERROR(10211158, "通话记录不存在!", null),
CALL_UP_ERROR(10211159, "拨出电话异常!", null),
CREATE_CALL_REQUEST_ERROR(10211160, "创建电话请求失败!", null),
CREATE_APPOINTMENT_TIME_ERROR(10211161, "当前时间不可预约面试,请选择其他时间", null),
CONTENT_DUPLICATED(10211200, "动态标题重复!", null),
SIGN_FAIL(600000, "验签失败", null),
GET_ACCESSTOKEN_ERROR(600001, "获取小程序TOKEN错误", null),

View File

@@ -419,6 +419,10 @@ public class InterviewServiceImpl implements InterviewService {
if(request.getPartnerLineId() == null || request.getPartnerLineId()<=0){
throw new ApiException(ErrorCodeEnum.INTERVIEW_LINE_ID_IS_NULL);
}
//如果开始时间小于当前时间需要报错
if(DateUtil.date().isAfter(DateUtil.parse(request.getStartBookingTime()))){
throw new ApiException(ErrorCodeEnum.CREATE_APPOINTMENT_TIME_ERROR);
}
HyPartnerInterviewPlanDO hyPartnerInterviewPlanDO = new HyPartnerInterviewPlanDO();
hyPartnerInterviewPlanDO.setPartnerLineId(request.getPartnerLineId());
hyPartnerInterviewPlanDO.setDeleted(false);

View File

@@ -184,6 +184,10 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
if(RoomStatus.WAIT_FOR_OPEN.getCode() != Integer.parseInt(interviewInfo.getRoomStatus())){
throw new ApiException(ErrorCodeEnum.ROOM_STATUS_ERROR);
}
//如果开始时间小于当前时间需要报错
if(DateUtil.date().isAfter(DateUtil.parse(request.getNewStartBookingTime()))){
throw new ApiException(ErrorCodeEnum.CREATE_APPOINTMENT_TIME_ERROR);
}
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
record.setId(Long.valueOf(request.getInterviewPlanId()));
record.setStartTime(Convert.toDate(request.getNewStartBookingTime()));