面审时间新增校验

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

@@ -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);