会销开始面试接口
This commit is contained in:
@@ -126,6 +126,9 @@ public enum ErrorCodeEnum {
|
||||
EXHIBITION_GROUP_NOT_NULL(106001, "会销组中必须添加至少一个会销", null),
|
||||
EXHIBITION_GROUP_NOT_EXIST(106002, "会销组不存在或被删除", null),
|
||||
EXHIBITION_NOT_EXIST(106003, "会销不存在或被删除", null),
|
||||
EXHIBITION_NOT_SIGNED(106004, "线索未进行会销签到", null),
|
||||
EXHIBITION_NOT_SUBMIT_INTENTION(106005, "线索未提交意向申请", null),
|
||||
EXHIBITION_LINE_INTERVIEWED(106006, "线索已预约面试", null),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @author Fun Li 2023/12/6 13:48
|
||||
* @version 1.0
|
||||
*/
|
||||
public enum ExhibitionPartnerStatus {
|
||||
|
||||
REGISTERED(0, "已报名"),
|
||||
SIGNED(1, "已签到"),
|
||||
APPLIED(2, "已提交意向申请"),
|
||||
INTERVIEWING(3, "面试中"),
|
||||
INTERVIEWED(4, "面试完成"),
|
||||
INTERVIEW_PASS(5, "面试通过"),
|
||||
INTERVIEW_REJECT(6, "面试不通过"),
|
||||
SIGN_CANCELED(7, "取消报名")
|
||||
;
|
||||
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String status;
|
||||
|
||||
ExhibitionPartnerStatus(Integer code, String status) {
|
||||
this.code = code;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import com.tencentyun.TLSSigAPIv2;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 腾讯实时音视频TRTC工具类
|
||||
*/
|
||||
@Component
|
||||
public class TRTCUtils {
|
||||
|
||||
/**
|
||||
@@ -12,6 +15,12 @@ public class TRTCUtils {
|
||||
*/
|
||||
private static final Long expired = 30L;
|
||||
|
||||
@Value("${trtc.sdkAppId:null}")
|
||||
private Long sdkAppId;
|
||||
|
||||
@Value("${trtc.secretKey:null}")
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 生成 userSig 用于进入会议
|
||||
* 详见 https://cloud.tencent.com/document/product/647/17275#.E8.B0.83.E8.AF.95.E8.B7.91.E9.80.9A.E9.98.B6.E6.AE.B5.E5.A6.82.E4.BD.95.E8.AE.A1.E7.AE.97-UserSig.EF.BC.9F
|
||||
@@ -26,4 +35,9 @@ public class TRTCUtils {
|
||||
return tlsSigAPIv2.genUserSig(userId, expiredTime);
|
||||
}
|
||||
|
||||
public String genUserSig(String userId) {
|
||||
TLSSigAPIv2 tlsSigAPIv2 = new TLSSigAPIv2(sdkAppId, key);
|
||||
return tlsSigAPIv2.genUserSig(userId, expired);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,6 +38,13 @@ public class HyPartnerExhibitionDAO {
|
||||
return hyPartnerExhibitionMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public HyPartnerExhibitionDO querySelective(HyPartnerExhibitionDO record){
|
||||
if (record == null){
|
||||
return new HyPartnerExhibitionDO();
|
||||
}
|
||||
return hyPartnerExhibitionMapper.querySelective(record);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
|
||||
@@ -48,4 +48,6 @@ public interface HyPartnerExhibitionMapper {
|
||||
* @return
|
||||
*/
|
||||
List<ExhibitionLineDTO> getExhibitionLine(String exhibitionCode);
|
||||
|
||||
HyPartnerExhibitionDO querySelective(HyPartnerExhibitionDO record);
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.cool.store.request.GetInterviewListReq;
|
||||
import com.cool.store.vo.EnterInterviewVO;
|
||||
import com.cool.store.vo.PartnerInterviewInfoVO;
|
||||
import com.cool.store.vo.PartnerPassLetterDetailVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -13,6 +14,7 @@ import java.util.List;
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-06-09 05:51
|
||||
*/
|
||||
@Mapper
|
||||
public interface HyPartnerInterviewMapper {
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.calendar.UserFreeBusyInfoDTO;
|
||||
import com.cool.store.dto.message.RemindInterviewMsgDTO;
|
||||
import com.cool.store.dto.partner.AdvanceLineDTO;
|
||||
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
|
||||
@@ -11,6 +10,7 @@ import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.cool.store.request.GetInterviewListReq;
|
||||
import com.cool.store.vo.EnterpriseUserBaseInfoVO;
|
||||
import com.cool.store.vo.interview.InterviewVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -20,6 +20,7 @@ import java.util.List;
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-29 03:52
|
||||
*/
|
||||
@Mapper
|
||||
public interface HyPartnerInterviewPlanMapper {
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -29,6 +29,57 @@
|
||||
from hy_partner_exhibition
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
|
||||
<select id="querySelective" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from hy_partner_exhibition
|
||||
<where>
|
||||
<if test="exhibitionCode != null">
|
||||
and exhibition_code = #{exhibitionCode,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="partnerLineId != null">
|
||||
and partner_line_id = #{partnerLineId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="partnerId != null">
|
||||
and partner_id = #{partnerId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="wantShopArea != null">
|
||||
and want_shop_area = #{wantShopArea,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="investmentManagerName != null">
|
||||
and investment_manager_name = #{investmentManagerName,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="expectedVisitorsCount != null">
|
||||
and expected_visitors_count = #{expectedVisitorsCount,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="expectedInformation != null">
|
||||
and expected_information = #{expectedInformation,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="participationStatus != null">
|
||||
and participation_status = #{participationStatus,jdbcType=TINYINT}
|
||||
</if>
|
||||
<if test="interviewPlanId != null">
|
||||
and interview_plan_id = #{interviewPlanId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
and creator = #{creator,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
and updater = #{updater,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
and deleted = #{deleted,jdbcType=BIT}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from hy_partner_exhibition
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<result column="allot_time" jdbcType="TIMESTAMP" property="allotTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, partner_id, workflow_stage, workflow_status, line_status, investment_manager,
|
||||
id, partner_id, workflow_stage, workflow_status, line_status, whether_in_exhibition, investment_manager,
|
||||
development_director, development_manager, deadline, pass_reason, reject_public_reason,
|
||||
reject_real_reason, certify_file, deleted, create_time, update_time, close_time,
|
||||
close_user_id,create_user_id,create_user_mobile,operator_type,update_user_id,allot_time
|
||||
@@ -92,6 +92,9 @@
|
||||
<if test="record.lineStatus != null">
|
||||
line_status,
|
||||
</if>
|
||||
<if test="record.whetherInExhibition != null">
|
||||
whether_in_exhibition,
|
||||
</if>
|
||||
<if test="record.investmentManager != null">
|
||||
investment_manager,
|
||||
</if>
|
||||
@@ -160,6 +163,9 @@
|
||||
<if test="record.lineStatus != null">
|
||||
#{record.lineStatus},
|
||||
</if>
|
||||
<if test="record.whetherInExhibition != null">
|
||||
#{record.whetherInExhibition},
|
||||
</if>
|
||||
<if test="record.investmentManager != null">
|
||||
#{record.investmentManager},
|
||||
</if>
|
||||
@@ -231,6 +237,9 @@
|
||||
<if test="record.lineStatus != null">
|
||||
line_status = #{record.lineStatus},
|
||||
</if>
|
||||
<if test="record.whetherInExhibition != null">
|
||||
whether_in_exhibition = #{record.whetherInExhibition},
|
||||
</if>
|
||||
<if test="record.investmentManager != null">
|
||||
investment_manager = #{record.investmentManager},
|
||||
</if>
|
||||
@@ -290,6 +299,7 @@
|
||||
workflow_stage = #{record.workflowStage},
|
||||
workflow_status = #{record.workflowStatus},
|
||||
line_status = #{record.lineStatus},
|
||||
whether_in_exhibition = #{record.whetherInExhibition},
|
||||
investment_manager = #{record.investmentManager},
|
||||
development_director = #{record.developmentDirector},
|
||||
development_manager = #{record.developmentManager},
|
||||
@@ -351,6 +361,7 @@
|
||||
a.partner_id as partnerId,
|
||||
a.workflow_stage as workflowStage,
|
||||
a.line_status as lineStatus,
|
||||
a.whether_in_exhibition as whetherInExhibition,
|
||||
a.workflow_status as workflowStatus,
|
||||
a.partner_id as partnerUserId,
|
||||
a.investment_manager as investmentManager,
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.cool.store.dto.exhibition;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Fun Li 2023/11/30 15:03
|
||||
* @version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ExhibitionEnterInterviewDTO {
|
||||
|
||||
@ApiModelProperty("线索id")
|
||||
private String partnerLineId;
|
||||
|
||||
@ApiModelProperty("会销编号")
|
||||
private String exhibitionCode;
|
||||
|
||||
}
|
||||
@@ -65,6 +65,9 @@ public class PartnerLineInfoAndBaseInfoDTO {
|
||||
|
||||
private Integer lineStatus;
|
||||
|
||||
@ApiModelProperty("是否处在会销中")
|
||||
private Boolean whetherInExhibition;
|
||||
|
||||
@ApiModelProperty("常驻区域")
|
||||
private String liveArea;
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@ public class HyPartnerLineInfoDO implements Serializable {
|
||||
@ApiModelProperty("线索状态:0公海线索;1跟进中;2合作中;3黑名单")
|
||||
private Integer lineStatus;
|
||||
|
||||
@ApiModelProperty("是否处在会销中")
|
||||
private Boolean whetherInExhibition;
|
||||
|
||||
@ApiModelProperty("招商经理")
|
||||
private String investmentManager;
|
||||
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dto.exhibition.ExhibitionDTO;
|
||||
import com.cool.store.dto.exhibition.ExhibitionEnterInterviewDTO;
|
||||
import com.cool.store.dto.exhibition.ExhibitionGroupDTO;
|
||||
import com.cool.store.dto.exhibition.MyExhibitionGroupDTO;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.vo.exhibition.*;
|
||||
import com.cool.store.vo.EnterInterviewVO;
|
||||
import com.cool.store.vo.exhibition.ExhibitionDetailVO;
|
||||
import com.cool.store.vo.exhibition.ExhibitionGroupDetailVO;
|
||||
import com.cool.store.vo.exhibition.MyExhibitionGroupVO;
|
||||
import com.cool.store.vo.exhibition.MyExhibitionVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.models.auth.In;
|
||||
|
||||
/**
|
||||
* @author Fun Li 2023/11/30 14:42
|
||||
@@ -16,6 +18,14 @@ import io.swagger.models.auth.In;
|
||||
*/
|
||||
public interface ExhibitionService {
|
||||
|
||||
/**
|
||||
* 会销开始面试
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
EnterInterviewVO startExhibitionInterview(ExhibitionEnterInterviewDTO dto) throws ApiException;
|
||||
|
||||
|
||||
/**
|
||||
* 新增会销组
|
||||
* xin
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.dto.partner.EnterInterviewDto;
|
||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.vo.EnterInterviewVO;
|
||||
@@ -9,6 +10,7 @@ import com.cool.store.vo.interview.GetFreeBusyListVO;
|
||||
import com.cool.store.vo.interview.InterviewVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: young.yu
|
||||
@@ -84,4 +86,14 @@ public interface InterviewService {
|
||||
* @param request {@link com.cool.store.request.CreateAppointmentReq}
|
||||
*/
|
||||
CreateAppointmentVO bookInterview(CreateAppointmentReq request) throws ApiException;
|
||||
|
||||
/**
|
||||
* 直接进入面试待开始或已开始阶段,无需线索预约面试
|
||||
* @param request {@link CreateAppointmentReq}
|
||||
* @param whetherBeginInterview 是否直接开始面试
|
||||
* @param interviewerId 面试官 userId
|
||||
* @return interview: {@link com.cool.store.entity.HyPartnerInterviewDO}; interviewPlan: {@link com.cool.store.entity.HyPartnerInterviewPlanDO}
|
||||
* @throws ApiException
|
||||
*/
|
||||
Map<String, Object> agreeInterviewWithoutBook(CreateAppointmentReq request, Boolean whetherBeginInterview, String interviewerId) throws ApiException;
|
||||
}
|
||||
|
||||
@@ -832,20 +832,25 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
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()));
|
||||
String interviewerId = request.getInterviewerId();
|
||||
if(StringUtils.isEmpty(interviewerId)){
|
||||
interviewerId = getInterviewerByPartner(request.getPartnerId(),String.valueOf(request.getPartnerLineId()));
|
||||
}
|
||||
Date now = new Date();
|
||||
//主动预约时是否是当前时间段的面试
|
||||
boolean whetherBeginInterview = false;
|
||||
DateTime interviewStartTime = DateUtil.offsetMinute(DateUtil.parseDateTime(request.getStartBookingTime()), -5);
|
||||
if (interviewStartTime.isBeforeOrEquals(now)) {
|
||||
if (interviewStartTime.isBeforeOrEquals(new Date())) {
|
||||
whetherBeginInterview = true;
|
||||
}
|
||||
HyPartnerInterviewPlanDO interviewPlanDO = (HyPartnerInterviewPlanDO) agreeInterviewWithoutBook(request, whetherBeginInterview, interviewerId).get("interviewPlan");
|
||||
return new CreateAppointmentVO(interviewPlanDO.getId().toString());
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Map<String, Object> agreeInterviewWithoutBook(CreateAppointmentReq request, Boolean whetherBeginInterview, String interviewerId) throws ApiException {
|
||||
//1.创建面试计划
|
||||
HyPartnerInterviewPlanDO interviewPlanDO = new HyPartnerInterviewPlanDO();
|
||||
Date now = new Date();
|
||||
String startBookingTime = request.getStartBookingTime();
|
||||
String startDate = startBookingTime.substring(0, 10);
|
||||
interviewPlanDO.setInterviewDate(Convert.toDate(startDate));
|
||||
@@ -855,7 +860,7 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
interviewPlanDO.setEndTime(Convert.toDate(request.getEndBookingTime()));
|
||||
interviewPlanDO.setPartnerId(request.getPartnerId());
|
||||
interviewPlanDO.setPartnerLineId(request.getPartnerLineId());
|
||||
interviewPlanDO.setInterviewer(interviewrId);
|
||||
interviewPlanDO.setInterviewer(interviewerId);
|
||||
interviewPlanDO.setIsPartnerInterview(0);
|
||||
interviewPlanDO.setApplicationApproved(1);
|
||||
//1.2 生成房间号
|
||||
@@ -879,7 +884,7 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
}
|
||||
hyPartnerInterviewDO.setPartnerLineId(request.getPartnerLineId());
|
||||
hyPartnerInterviewDO.setPartnerId(request.getPartnerId());
|
||||
hyPartnerInterviewDO.setInterviewer(interviewrId);
|
||||
hyPartnerInterviewDO.setInterviewer(interviewerId);
|
||||
hyPartnerInterviewDO.setCreateTime(now);
|
||||
hyPartnerInterviewDO.setUpdateTime(now);
|
||||
hyPartnerInterviewDO.setDeleted(false);
|
||||
@@ -911,7 +916,10 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
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());
|
||||
HashMap<String, Object> res = new HashMap<>();
|
||||
res.put("interview", hyPartnerInterviewDO);
|
||||
res.put("interviewPlan", interviewPlanDO);
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,38 +5,37 @@ import com.alibaba.excel.util.DateUtils;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.HyExhibitionDAO;
|
||||
import com.cool.store.dao.HyExhibitionGroupDAO;
|
||||
import com.cool.store.dao.HyPartnerExhibitionDAO;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.exhibition.*;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.FeiShuNoticeMsgEnum;
|
||||
import com.cool.store.enums.SMSMsgEnum;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.http.EventCenterHttpRequest;
|
||||
import com.cool.store.mapper.HyPartnerExhibitionMapper;
|
||||
import com.cool.store.mapper.HyPartnerInterviewMapper;
|
||||
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
|
||||
import com.cool.store.request.CreateAppointmentReq;
|
||||
import com.cool.store.service.ExhibitionService;
|
||||
import com.cool.store.service.InterviewService;
|
||||
import com.cool.store.service.WechatMiniAppService;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.utils.TRTCUtils;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import com.cool.store.vo.EnterInterviewVO;
|
||||
import com.cool.store.vo.exhibition.*;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -48,8 +47,6 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
public class ExhibitionServiceImpl implements ExhibitionService {
|
||||
|
||||
@Autowired
|
||||
private HyPartnerExhibitionDAO exhibitionDAO;
|
||||
@Autowired
|
||||
private HyExhibitionGroupDAO hyExhibitionGroupDAO;
|
||||
@Autowired
|
||||
@@ -63,7 +60,90 @@ public class ExhibitionServiceImpl implements ExhibitionService {
|
||||
@Resource
|
||||
WechatMiniAppService wechatMiniAppService;
|
||||
|
||||
@Autowired
|
||||
private HyPartnerInterviewMapper interviewMapper;
|
||||
|
||||
@Autowired
|
||||
private HyPartnerLineInfoDAO hyPartnerLineInfoDAO;
|
||||
|
||||
@Autowired
|
||||
private InterviewService interviewService;
|
||||
|
||||
@Autowired
|
||||
private HyPartnerInterviewPlanMapper interviewPlanMapper;
|
||||
|
||||
@Autowired
|
||||
private TRTCUtils trtcUtils;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public EnterInterviewVO startExhibitionInterview(ExhibitionEnterInterviewDTO dto) throws ApiException {
|
||||
//1. 核验线索状态
|
||||
HyPartnerLineInfoDO partnerLineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(Long.parseLong(dto.getPartnerLineId()));
|
||||
if (ObjectUtils.isEmpty(partnerLineInfo)) {
|
||||
throw new ApiException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
//1.1 获取线索参加会销状态
|
||||
HyPartnerExhibitionDO hyPartnerExhibitionDO = new HyPartnerExhibitionDO();
|
||||
hyPartnerExhibitionDO.setDeleted(Boolean.FALSE);
|
||||
hyPartnerExhibitionDO.setExhibitionCode(dto.getExhibitionCode());
|
||||
hyPartnerExhibitionDO.setPartnerLineId(hyPartnerExhibitionDO.getPartnerLineId());
|
||||
hyPartnerExhibitionDO = hyPartnerExhibitionDAO.querySelective(hyPartnerExhibitionDO);
|
||||
//1.2 核验会销签到状态
|
||||
if (
|
||||
hyPartnerExhibitionDO == null ||
|
||||
//线索未会销签到并且提交意向申请或未处在预约面试阶段
|
||||
!(hyPartnerExhibitionDO.getParticipationStatus().equals(ExhibitionPartnerStatus.SIGNED.getCode())))
|
||||
{
|
||||
throw new ApiException(ErrorCodeEnum.EXHIBITION_NOT_SIGNED);
|
||||
}
|
||||
//1.3 核验是否提交意向申请
|
||||
if (partnerLineInfo.getWorkflowStage().equals(WorkflowStageEnum.INTENT.getCode()) && partnerLineInfo.getWorkflowStatus().equals(WorkflowStatusEnum.INTENT_0.getCode())) {
|
||||
throw new ApiException(ErrorCodeEnum.EXHIBITION_NOT_SUBMIT_INTENTION);
|
||||
}
|
||||
//1.4 核验是否未预约面试
|
||||
if (partnerLineInfo.getWorkflowStage().equals(WorkflowStageEnum.RESERVATION.getCode()) && !partnerLineInfo.getWorkflowStatus().equals(WorkflowStatusEnum.RESERVATION_0.getCode()) ||
|
||||
partnerLineInfo.getWorkflowStage().equals(WorkflowStageEnum.INTERVIEW.getCode())) {
|
||||
throw new ApiException(ErrorCodeEnum.EXHIBITION_LINE_INTERVIEWED);
|
||||
}
|
||||
|
||||
//2. 调用招商经理服务的直接进入面试方法
|
||||
CreateAppointmentReq createAppointmentReq = new CreateAppointmentReq();
|
||||
createAppointmentReq.setPartnerId(partnerLineInfo.getPartnerId());
|
||||
createAppointmentReq.setPartnerLineId(partnerLineInfo.getId());
|
||||
String bookStartTime = nearestInterviewTime();
|
||||
String bookEndTime = DateUtil.offsetMinute(DateUtil.parseDateTime(bookStartTime), 30).toString("yyyy-MM-dd HH:mm:ss");
|
||||
createAppointmentReq.setStartBookingTime(bookStartTime);
|
||||
createAppointmentReq.setEndBookingTime(bookEndTime);
|
||||
Map<String, Object> interviewInfoMap = interviewService.agreeInterviewWithoutBook(createAppointmentReq, Boolean.TRUE, CurrentUserHolder.getUserId());
|
||||
HyPartnerInterviewPlanDO interviewPlan = (HyPartnerInterviewPlanDO) interviewInfoMap.get("interviewPlan");
|
||||
HyPartnerInterviewDO interviewInfo = (HyPartnerInterviewDO) interviewInfoMap.get("interview");
|
||||
|
||||
//3. 修改线索参加会销状态
|
||||
HyPartnerExhibitionDO updatePartnerExhibition = new HyPartnerExhibitionDO();
|
||||
updatePartnerExhibition.setId(hyPartnerExhibitionDO.getId());
|
||||
updatePartnerExhibition.setParticipationStatus(ExhibitionPartnerStatus.INTERVIEWING.getCode());
|
||||
hyPartnerExhibitionDAO.updateByPrimaryKeySelective(updatePartnerExhibition);
|
||||
|
||||
//4. 修改面试相关信息
|
||||
//4.1 面试计划相关信息
|
||||
HyPartnerInterviewPlanDO interviewPlanDO = new HyPartnerInterviewPlanDO();
|
||||
interviewPlanDO.setId(interviewPlan.getId());
|
||||
interviewPlanDO.setActualStartTime(new Date());
|
||||
interviewPlanDO.setIsPartnerInterview(1);
|
||||
interviewPlanMapper.updateByPrimaryKeySelective(interviewPlanDO);
|
||||
//4.2 面试信息相关
|
||||
HyPartnerInterviewDO interviewDO = new HyPartnerInterviewDO();
|
||||
interviewDO.setId(interviewInfo.getId());
|
||||
interviewDO.setPartnerEnterTime(new Date());
|
||||
interviewDO.setInterviewerEnterTime(new Date());
|
||||
interviewMapper.updateByPrimaryKeySelective(interviewDO);
|
||||
|
||||
//5. 返回进入面试间所需信息
|
||||
EnterInterviewVO enterInterviewVO = interviewMapper.getInterviewerByInterviewPlanId(interviewPlan.getId().toString());
|
||||
enterInterviewVO.setUserSign(trtcUtils.genUserSig(CurrentUserHolder.getUserId()));
|
||||
return enterInterviewVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -416,4 +496,26 @@ public class ExhibitionServiceImpl implements ExhibitionService {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回时间
|
||||
* @return YYYY-MM-DD HH:mm:ss
|
||||
*/
|
||||
private String nearestInterviewTime() {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
int minute = now.getMinute();
|
||||
LocalDateTime nearestDateTime;
|
||||
|
||||
//1. 在 00-30 范围内,最近的面试开始时间为 00
|
||||
if (minute < 30) {
|
||||
nearestDateTime = now.withMinute(0).withSecond(0).withNano(0);
|
||||
//2. 在 30-00 范围内,最近的面试开始时间为 30
|
||||
} else {
|
||||
nearestDateTime = now.withMinute(30).withSecond(0).withNano(0);
|
||||
}
|
||||
|
||||
// 格式化为字符串
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
return nearestDateTime.format(formatter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,16 +3,17 @@ package com.cool.store.controller;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dto.exhibition.ExhibitionDTO;
|
||||
import com.cool.store.dto.exhibition.ExhibitionEnterInterviewDTO;
|
||||
import com.cool.store.dto.exhibition.ExhibitionGroupDTO;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.ExhibitionService;
|
||||
import com.cool.store.vo.EnterInterviewVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* @author Fun Li 2023/11/30 14:44
|
||||
@@ -79,4 +80,10 @@ public class ExhibitionController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("会销面试")
|
||||
@PostMapping("/enter/interview")
|
||||
public ResponseResult<EnterInterviewVO> enterInterview(@RequestBody ExhibitionEnterInterviewDTO dto) throws ApiException {
|
||||
return ResponseResult.success(exhibitionService.startExhibitionInterview(dto));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.request.GetTipsInfoReq;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
|
||||
|
||||
/**
|
||||
* @author Fun Li 2023/12/4 14:51
|
||||
* @version 1.0
|
||||
*/
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@Slf4j
|
||||
class CommonServiceImplTest extends AbstractJUnit4SpringContextTests {
|
||||
|
||||
@Autowired
|
||||
private CommonService commonService;
|
||||
|
||||
@Test
|
||||
void testGetTipsInfo() throws ApiException {
|
||||
GetTipsInfoReq getTipsInfoReq = new GetTipsInfoReq();
|
||||
getTipsInfoReq.setPartnerLineId("237272");
|
||||
String tipsInfo = commonService.getTipsInfo(getTipsInfoReq);
|
||||
log.debug(tipsInfo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
|
||||
|
||||
/**
|
||||
* @author Fun Li 2023/12/6 16:17
|
||||
* @version 1.0
|
||||
*/
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@Slf4j
|
||||
class ExhibitionServiceTest extends AbstractJUnit4SpringContextTests {
|
||||
|
||||
@Autowired
|
||||
private ExhibitionService exhibitionService;
|
||||
|
||||
@Test
|
||||
void testStartExhibitionInterview() {
|
||||
log.debug("");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user