面审时间新增校验

This commit is contained in:
zhangchenbiao
2024-05-27 10:22:21 +08:00
parent ef6bec0bee
commit 5204f57ee4
2 changed files with 13 additions and 4 deletions

View File

@@ -83,6 +83,7 @@ public enum ErrorCodeEnum {
TIME_OCCUPIED(500018, "预约时间被占用", null),
LINE_PAY_IS_NOT_EXIST(500019, "意向金信息不存在!", null),
INTENT_PASS(500020, "审核已通过,请刷新页面!", null),
APPOINTMENT_TIME_FAIL(500020, "当前时间不可预约", null),
POINT_NOT_COMPLETE(600000, "铺位信息未填写完全,请完善后生成评估报告", null),
POINT_NOT_EXIST(600001, "铺位信息不存在", null),

View File

@@ -115,6 +115,12 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean appointmentTime(AppointmentTimeRequest request) {
Date startTime = DateUtils.strToDate(request.getStartTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
Date endTime = DateUtils.strToDate(request.getEndTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
Date now = new Date();
if(now.getTime() >= startTime.getTime()){
throw new ServiceException(ErrorCodeEnum.APPOINTMENT_TIME_FAIL);
}
//查询线索信息
//如果是面谈获取招商经理 如果是面试获取大区经理
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
@@ -138,8 +144,6 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
if(occupied){
throw new ServiceException(ErrorCodeEnum.TIME_OCCUPIED);
}
Date startTime = DateUtils.strToDate(request.getStartTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
Date endTime = DateUtils.strToDate(request.getEndTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
LineCalendarsEventDO calendarsEvent = LineCalendarsEventDO.convertDO(lineInfo, interviewType.getCode(), startTime, endTime, interviewerUserId);
Long eventId = lineCalendarsEventDAO.addCalendarsEvent(calendarsEvent);
WorkflowSubStageStatusEnum workflowSubStageStatus = InterviewTypeEnum.getWorkflowSubStageStatus(interviewType);
@@ -181,6 +185,12 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean modifyAppointmentTime(AppointmentTimeRequest request) {
Date startTime = DateUtils.strToDate(request.getStartTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
Date endTime = DateUtils.strToDate(request.getEndTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
Date nowTime = new Date();
if(nowTime.getTime() >= startTime.getTime()){
throw new ServiceException(ErrorCodeEnum.APPOINTMENT_TIME_FAIL);
}
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
if(Objects.isNull(lineInfo)){
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
@@ -199,8 +209,6 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
if(Objects.isNull(interviewInfo)){
throw new ServiceException(ErrorCodeEnum.INTERVIEW_NOT_EXIST);
}
Date startTime = DateUtils.strToDate(request.getStartTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
Date endTime = DateUtils.strToDate(request.getEndTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
Boolean occupied = lineCalendarsEventDAO.isOccupied(interviewType.getCode(), lineInfo.getRegionId(), interviewInfo.getInterviewerUserId(), request.getStartTime(), request.getEndTime(), interviewInfo.getId());
if(occupied){
throw new ServiceException(ErrorCodeEnum.TIME_OCCUPIED);