面试/面谈

This commit is contained in:
zhangchenbiao
2024-03-26 14:43:22 +08:00
parent d291666334
commit 1262c04d26
2 changed files with 33 additions and 16 deletions

View File

@@ -88,7 +88,7 @@ public enum ErrorCodeEnum {
INTERVIEW_PLAN_NOT_EXIST(1021107, "面审计划不存在!", null), INTERVIEW_PLAN_NOT_EXIST(1021107, "面审计划不存在!", null),
FEISHU_DELETE_SCHEDULE_ERROR(1021108, "删除原面审安排失败!", null), FEISHU_DELETE_SCHEDULE_ERROR(1021108, "删除原面审安排失败!", null),
CREATE_CALENDAR_EVENT_FAIL(1021109, "创建面审安排失败!", null), CREATE_CALENDAR_EVENT_FAIL(1021109, "创建面审安排失败!", null),
FEISHU_UPDATE_SCHEDULE_ERROR(1021110, "修改面审安排失败", null), FEISHU_UPDATE_SCHEDULE_ERROR(1021110, "开始前10分钟不允许修改时间", null),
INTERVIEW_STATUS_ERROR(1021111, "当前面审状态不允许该操作!", null), INTERVIEW_STATUS_ERROR(1021111, "当前面审状态不允许该操作!", null),
INTERVIEW_PLAN_ALREADY_EXIST(1021112, "面审计划已存在,请勿重复申请!", null), INTERVIEW_PLAN_ALREADY_EXIST(1021112, "面审计划已存在,请勿重复申请!", null),
INTERVIEW_LINE_ID_IS_NULL(1021113, "线索id为空", null), INTERVIEW_LINE_ID_IS_NULL(1021113, "线索id为空", null),

View File

@@ -1,5 +1,6 @@
package com.cool.store.service.impl; package com.cool.store.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants; import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.*; import com.cool.store.dao.*;
@@ -32,6 +33,8 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@@ -101,11 +104,18 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
throw new ServiceException(ErrorCodeEnum.LINE_STATUS_NOT_ALLOW_OPERATE); throw new ServiceException(ErrorCodeEnum.LINE_STATUS_NOT_ALLOW_OPERATE);
} }
InterviewTypeEnum interviewType = WorkflowSubStageEnum.getInterviewType(lineInfo.getWorkflowSubStage()); InterviewTypeEnum interviewType = WorkflowSubStageEnum.getInterviewType(lineInfo.getWorkflowSubStage());
UserRoleEnum userRole = InterviewTypeEnum.MEET.equals(interviewType) ? UserRoleEnum.INVESTMENT_MANAGER : UserRoleEnum.REGION_MANAGER; String interviewerUserId, firstInterviewer = null, secondInterviewer = null;
//获取面试官 if(!WorkflowSubStageStatusEnum.isReappointmentStatus(lineInfo.getWorkflowSubStageStatus())){
String interviewerUserId = InterviewTypeEnum.MEET.equals(interviewType) ? lineInfo.getInvestmentManager() : commonService.getUserIdByAreaAndUserRole(lineInfo.getWantShopAreaId(), userRole); interviewerUserId = lineInfo.getInvestmentManager();
String firstInterviewer = InterviewTypeEnum.INTERVIEW.equals(interviewType) ? interviewerUserId : null; if(!InterviewTypeEnum.MEET.equals(interviewType)){
String secondInterviewer = InterviewTypeEnum.SECOND_INTERVIEW.equals(interviewType) ? interviewerUserId : null; interviewerUserId = commonService.getUserIdByAreaAndUserRole(lineInfo.getWantShopAreaId(), UserRoleEnum.REGION_MANAGER);
}
firstInterviewer = InterviewTypeEnum.INTERVIEW.equals(interviewType) ? interviewerUserId : null;
secondInterviewer = InterviewTypeEnum.SECOND_INTERVIEW.equals(interviewType) ? interviewerUserId : null;
}else{
//重新预约直接拿线索对应的面试官
interviewerUserId = InterviewTypeEnum.INTERVIEW.equals(interviewType) ? lineInfo.getFirstInterviewer() : lineInfo.getSecondInterviewer();
}
Boolean occupied = lineCalendarsEventDAO.isOccupied(interviewType.getCode(), lineInfo.getRegionId(), interviewerUserId, request.getStartTime(), request.getEndTime(), null); Boolean occupied = lineCalendarsEventDAO.isOccupied(interviewType.getCode(), lineInfo.getRegionId(), interviewerUserId, request.getStartTime(), request.getEndTime(), null);
if(occupied){ if(occupied){
throw new ServiceException(ErrorCodeEnum.TIME_OCCUPIED); throw new ServiceException(ErrorCodeEnum.TIME_OCCUPIED);
@@ -158,16 +168,23 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
if(occupied){ if(occupied){
throw new ServiceException(ErrorCodeEnum.TIME_OCCUPIED); throw new ServiceException(ErrorCodeEnum.TIME_OCCUPIED);
} }
interviewInfo.setInterviewDate(startTime); LocalDateTime startDateTime = LocalDateTime.ofInstant(startTime.toInstant(), ZoneId.systemDefault()).minusMinutes(10);
interviewInfo.setStartTime(startTime); LocalDateTime now = LocalDateTime.ofInstant(new Date().toInstant(), ZoneId.systemDefault());
interviewInfo.setEndTime(endTime); if(startDateTime.isBefore(now)){
lineInterviewDAO.updateInterviewInfo(interviewInfo); throw new ServiceException(ErrorCodeEnum.FEISHU_UPDATE_SCHEDULE_ERROR);
LineCalendarsEventDO update = new LineCalendarsEventDO(); }
update.setId(interviewInfo.getCalendarsEventId()); LineInterviewDO updateInterview = new LineInterviewDO();
update.setStartTime(startTime); updateInterview.setId(interviewInfo.getId());
update.setEndTime(endTime); updateInterview.setInterviewDate(startTime);
update.setInterviewDate(startTime); updateInterview.setStartTime(startTime);
lineCalendarsEventDAO.updateCalendarsEvent(update); updateInterview.setEndTime(endTime);
lineInterviewDAO.updateInterviewInfo(updateInterview);
LineCalendarsEventDO updateEvent = new LineCalendarsEventDO();
updateEvent.setId(interviewInfo.getCalendarsEventId());
updateEvent.setStartTime(startTime);
updateEvent.setEndTime(endTime);
updateEvent.setInterviewDate(startTime);
lineCalendarsEventDAO.updateCalendarsEvent(updateEvent);
return true; return true;
} }