招商经理直接预约面试

This commit is contained in:
feng.li
2023-11-08 17:13:02 +08:00
parent b600d80d10
commit f1c458a280
6 changed files with 100 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ public enum OperateTypeEnum {
CLOSE_FOLLOW("close_follow", "结束跟进", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, REJECT_PUBLIC_REASON, REJECT_REAL_REASON, CERTIFY_FILE)), CLOSE_FOLLOW("close_follow", "结束跟进", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, REJECT_PUBLIC_REASON, REJECT_REAL_REASON, CERTIFY_FILE)),
TRANSFER_INVESTMENT_MANAGER("transfer_investment_manager", "转让招商经理", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_INVESTMENT_MANAGER_USERNAME, BEFORE_INVESTMENT_MANAGER_MOBILE, AFTER_INVESTMENT_MANAGER_USERNAME, AFTER_INVESTMENT_MANAGER_MOBILE)), TRANSFER_INVESTMENT_MANAGER("transfer_investment_manager", "转让招商经理", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_INVESTMENT_MANAGER_USERNAME, BEFORE_INVESTMENT_MANAGER_MOBILE, AFTER_INVESTMENT_MANAGER_USERNAME, AFTER_INVESTMENT_MANAGER_MOBILE)),
INTERVIEW_APPOINTMENT("interview_appointment", "预约面试时间", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME)), INTERVIEW_APPOINTMENT("interview_appointment", "预约面试时间", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME)),
INTERVIEWER_BOOK_INTERVIEW("interviewer_book_interview", "招商经理主动预约面试时间", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME)),
MODIFY_INTERVIEW_TIME("modify_interview_time", "修改面试时间", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_INTERVIEW_TIME, AFTER_INTERVIEW_TIME)), MODIFY_INTERVIEW_TIME("modify_interview_time", "修改面试时间", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_INTERVIEW_TIME, AFTER_INTERVIEW_TIME)),
ENTRUST_OTHERS("entrust_others", "委托他人", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, BEFORE_INTERVIEWR_NAME, AFTER_INTERVIEWR_NAME, BEFORE_INTERVIEWR_MOBILE, AFTER_INTERVIEWR_MOBILE)), ENTRUST_OTHERS("entrust_others", "委托他人", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, BEFORE_INTERVIEWR_NAME, AFTER_INTERVIEWR_NAME, BEFORE_INTERVIEWR_MOBILE, AFTER_INTERVIEWR_MOBILE)),

View File

@@ -7,7 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
public class CreateAppointmentReq { public class CreateAppointmentReq {
@ApiModelProperty(value = "加盟商用户ID", required = true) @ApiModelProperty(value = "加盟商用户ID", required = true)
private String partnerId; private String partnerId;
@ApiModelProperty(value = "面试官id") @ApiModelProperty(value = "面试官idPC 端招商经理主动预约可以不传")
private String interviewerId; private String interviewerId;
@ApiModelProperty(value = "预约开始时间 (YYYY-MM-DD hh:mm:ss)", required = true) @ApiModelProperty(value = "预约开始时间 (YYYY-MM-DD hh:mm:ss)", required = true)

View File

@@ -13,6 +13,13 @@ public class CreateAppointmentVO {
@ApiModelProperty("面试安排id") @ApiModelProperty("面试安排id")
private String interviewPlanId; private String interviewPlanId;
public CreateAppointmentVO() {
}
public CreateAppointmentVO(String interviewPlanId) {
this.interviewPlanId = interviewPlanId;
}
public String getInterviewPlanId() { public String getInterviewPlanId() {
return interviewPlanId; return interviewPlanId;
} }

View File

@@ -78,4 +78,10 @@ public interface InterviewService {
* @return {@link GetFreeBusyListVO} * @return {@link GetFreeBusyListVO}
*/ */
GetFreeBusyListVO getFreeBusyList(GetFreeBusyListReq request); GetFreeBusyListVO getFreeBusyList(GetFreeBusyListReq request);
/**
* 招商经理主动预约面试
* @param request {@link com.cool.store.request.CreateAppointmentReq}
*/
CreateAppointmentVO bookInterview(CreateAppointmentReq request) throws ApiException;
} }

View File

@@ -79,7 +79,6 @@ public class InterviewServiceImpl implements InterviewService {
@Autowired @Autowired
private EnterpriseUserService enterpriseUserService; private EnterpriseUserService enterpriseUserService;
// @Autowired // @Autowired
// private SmsService smsService; // private SmsService smsService;
@@ -770,4 +769,81 @@ public class InterviewServiceImpl implements InterviewService {
return freeBusyListVO; return freeBusyListVO;
} }
@Transactional
@Override
public CreateAppointmentVO bookInterview(CreateAppointmentReq request) throws ApiException {
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);
List<HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
if(CollectionUtils.isNotEmpty(hyPartnerInterviewPlanDOS)&&hyPartnerInterviewPlanDOS.get(0).getId()!=null){
throw new ApiException(ErrorCodeEnum.INTERVIEW_PLAN_ALREADY_EXIST);
}
String interviewrId = request.getInterviewerId();
if(StringUtils.isEmpty(interviewrId)){
interviewrId = getInterviewerByPartner(request.getPartnerId(),String.valueOf(request.getPartnerLineId()));
}
//1.创建面试计划
Date now = new Date();
HyPartnerInterviewPlanDO interviewPlanDO = new HyPartnerInterviewPlanDO();
String startBookingTime = request.getStartBookingTime();
String startDate = startBookingTime.substring(0, 10);
interviewPlanDO.setInterviewDate(Convert.toDate(startDate));
interviewPlanDO.setCreateTime(now);
interviewPlanDO.setUpdateTime(now);
interviewPlanDO.setStartTime(Convert.toDate(request.getStartBookingTime()));
interviewPlanDO.setEndTime(Convert.toDate(request.getEndBookingTime()));
interviewPlanDO.setPartnerId(request.getPartnerId());
interviewPlanDO.setPartnerLineId(request.getPartnerLineId());
interviewPlanDO.setInterviewer(interviewrId);
interviewPlanDO.setIsPartnerInterview(0);
interviewPlanDO.setApplicationApproved(1);
//1.2 生成房间号
interviewPlanDO.setRoomId(StringUtil.generateRoomId(startBookingTime));
interviewPlanDO.setRoomStatus(RoomStatus.WAIT_FOR_OPEN.getCode());
hyPartnerInterviewPlanMapper.insertSelective(interviewPlanDO);
//2.创建面试信息
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
hyPartnerInterviewDO.setInterviewPlanId(interviewPlanDO.getId());
hyPartnerInterviewDO.setStatus(Integer.parseInt(WorkflowStatusEnum.INTERVIEW_2.getCode()));
hyPartnerInterviewDO.setPartnerLineId(request.getPartnerLineId());
hyPartnerInterviewDO.setPartnerId(request.getPartnerId());
hyPartnerInterviewDO.setInterviewer(interviewrId);
hyPartnerInterviewDO.setCreateTime(now);
hyPartnerInterviewDO.setUpdateTime(now);
hyPartnerInterviewDO.setDeleted(false);
HyPartnerLineInfoDO hyPartnerLineDO = new HyPartnerLineInfoDO();
hyPartnerInterviewDO.setUpdateTime(now);
hyPartnerInterviewMapper.insertSelective(hyPartnerInterviewDO);
//3. 修改线索流程状态
hyPartnerLineDO.setId(request.getPartnerLineId());
hyPartnerLineDO.setUpdateTime(now);
hyPartnerLineDO.setWorkflowStage(WorkflowStageEnum.INTERVIEW.getCode());
hyPartnerLineDO.setWorkflowStatus(WorkflowStatusEnum.INTERVIEW_2.getCode());
hyPartnerLineInfoMapper.updateByPrimaryKeySelective(hyPartnerLineDO);
//4. 异步发送短信给加盟商
HyPartnerBaseInfoDO partnerBaseInfo = hyPartnerBaseInfoMapper.getByPartnerLineId(request.getPartnerLineId());
if(partnerBaseInfo == null){
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
}
eventCenterHttpRequest.sendSmsVariable(partnerBaseInfo.getMobile(), SMSMsgEnum.INTERVIEW_APPOINTMENT_PASS, DateUtil.format(DateUtil.parseDateTime(request.getStartBookingTime()), DatePattern.NORM_DATETIME_MINUTE_PATTERN), wechatMiniAppService.getMiniAppUrl());
//5. 记录日志
PartnerUserInfoVO operator = PartnerUserHolder.getUser();
LogBasicDTO log = LogBasicDTO.builder().mobile(operator.getMobile()).operateUserId(operator.getPartnerId()).operateUsername(operator.getUsername()).operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC)).mobile(operator.getMobile()).build();
logService.recordPartnerBizLog(operator, request.getPartnerLineId(), OperateTypeEnum.INTERVIEWER_BOOK_INTERVIEW,log);
return new CreateAppointmentVO(interviewPlanDO.getId().toString());
}
} }

View File

@@ -7,6 +7,7 @@ import com.cool.store.response.ResponseResult;
import com.cool.store.service.FeiShuService; import com.cool.store.service.FeiShuService;
import com.cool.store.service.InterviewService; import com.cool.store.service.InterviewService;
import com.cool.store.vo.EnterInterviewVO; import com.cool.store.vo.EnterInterviewVO;
import com.cool.store.vo.interview.CreateAppointmentVO;
import com.cool.store.vo.interview.GetFreeBusyListVO; import com.cool.store.vo.interview.GetFreeBusyListVO;
import com.cool.store.vo.interview.InterviewVO; import com.cool.store.vo.interview.InterviewVO;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@@ -56,13 +57,19 @@ public class InterviewController {
return ResponseResult.success(); return ResponseResult.success();
} }
@PostMapping("/interviewer/freebusy/list") @PostMapping("/freebusy/list")
@ApiOperation("查询各预约时间段情况") @ApiOperation("查询各预约时间段情况")
public ResponseResult<GetFreeBusyListVO> getFreeBusyList(@RequestBody GetFreeBusyListReq request) throws ApiException { public ResponseResult<GetFreeBusyListVO> getFreeBusyList(@RequestBody GetFreeBusyListReq request) throws ApiException {
GetFreeBusyListVO getFreeBusyListVO= interviewService.getFreeBusyList(request); GetFreeBusyListVO getFreeBusyListVO= interviewService.getFreeBusyList(request);
return ResponseResult.success(getFreeBusyListVO); return ResponseResult.success(getFreeBusyListVO);
} }
@PostMapping("/appointment/booking")
@ApiOperation("招商经理主动预约面试")
public ResponseResult<CreateAppointmentVO> bookInterview(@RequestBody CreateAppointmentReq request) throws ApiException {
return ResponseResult.success(interviewService.bookInterview(request));
}
@PostMapping("/modifyInterviewTime") @PostMapping("/modifyInterviewTime")
@ApiOperation("修改面试时间") @ApiOperation("修改面试时间")
public ResponseResult modifyInterviewTime(@RequestBody ModifyInterviewTimeReq request) throws ApiException { public ResponseResult modifyInterviewTime(@RequestBody ModifyInterviewTimeReq request) throws ApiException {