Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
This commit is contained in:
@@ -4,6 +4,7 @@ import com.cool.store.dto.content.ContentAddDto;
|
||||
import com.cool.store.dto.content.ContentQueryListDto;
|
||||
import com.cool.store.dto.content.ContentUpdateDto;
|
||||
import com.cool.store.entity.HyContentInfoDO;
|
||||
import com.cool.store.vo.HyContentInfoVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -31,7 +32,7 @@ public interface ContentService {
|
||||
/**
|
||||
* 查询动态列表
|
||||
*/
|
||||
List<HyContentInfoDO> queryContentList(ContentQueryListDto dto);
|
||||
List<HyContentInfoVO> queryContentList(ContentQueryListDto dto);
|
||||
|
||||
/**
|
||||
* 查询动态详情
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.EntrustOthersReq;
|
||||
import com.cool.store.request.FinishInterviewReq;
|
||||
import com.cool.store.request.GetInterviewListReq;
|
||||
import com.cool.store.request.ModifyInterviewTimeReq;
|
||||
import com.cool.store.vo.interview.InterviewVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: young.yu
|
||||
* @Date: 2023-06-06 15:01
|
||||
* @Description :面试service
|
||||
*/
|
||||
public interface InterviewService {
|
||||
List<InterviewVO> getInterviewList(GetInterviewListReq request);
|
||||
|
||||
/**
|
||||
* 根据面试会议id查询面试信息
|
||||
* @param interviewId
|
||||
* @return
|
||||
*/
|
||||
InterviewVO getInterviewInfo(String interviewId);
|
||||
|
||||
/**
|
||||
* 委托他人
|
||||
* @param request
|
||||
*/
|
||||
void entrustOthers(EntrustOthersReq request);
|
||||
/**
|
||||
* 修改面试时间
|
||||
* @param request
|
||||
*/
|
||||
void modifyInterviewTime(ModifyInterviewTimeReq request);
|
||||
|
||||
/**
|
||||
* 结束面试
|
||||
* @param request
|
||||
*/
|
||||
void finishInterview(FinishInterviewReq request);
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.dto.partner.EnterInterviewDto;
|
||||
import com.cool.store.vo.PartnerEnterInterviewVO;
|
||||
import com.cool.store.vo.PartnerInterviewInfoVO;
|
||||
import com.cool.store.vo.PartnerPassLetterDetailVO;
|
||||
|
||||
public interface PartnerInterviewService {
|
||||
|
||||
@@ -11,4 +14,17 @@ public interface PartnerInterviewService {
|
||||
*/
|
||||
PartnerInterviewInfoVO queryByPartnerId(String partnerId);
|
||||
|
||||
/**
|
||||
* 进入面试间的方法
|
||||
* 修改一些面试状态
|
||||
* 最后返回 userSign 用于进入腾讯云音视频房间
|
||||
* @return userSign 进入视频所需签名
|
||||
*/
|
||||
PartnerEnterInterviewVO enterInterviewRoom(EnterInterviewDto dto);
|
||||
|
||||
/**
|
||||
* 获取通知函详情
|
||||
*/
|
||||
PartnerPassLetterDetailVO passLetterDetail(String interviewId);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.cool.store.dto.content.ContentUpdateDto;
|
||||
import com.cool.store.entity.HyContentInfoDO;
|
||||
import com.cool.store.mapper.HyContentInfoMapper;
|
||||
import com.cool.store.service.ContentService;
|
||||
import com.cool.store.vo.HyContentInfoVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -60,7 +61,7 @@ public class ContentServiceImpl implements ContentService {
|
||||
* 查询动态列表
|
||||
*/
|
||||
@Override
|
||||
public List<HyContentInfoDO> queryContentList(ContentQueryListDto dto) {
|
||||
public List<HyContentInfoVO> queryContentList(ContentQueryListDto dto) {
|
||||
return contentInfoMapper.queryContentList(dto);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.cool.store.entity.HyPartnerInterviewDO;
|
||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.cool.store.mapper.HyPartnerInterviewMapper;
|
||||
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
|
||||
import com.cool.store.request.EntrustOthersReq;
|
||||
import com.cool.store.request.FinishInterviewReq;
|
||||
import com.cool.store.request.GetInterviewListReq;
|
||||
import com.cool.store.request.ModifyInterviewTimeReq;
|
||||
import com.cool.store.service.InterviewService;
|
||||
import com.cool.store.vo.interview.InterviewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: young.yu
|
||||
* @Date: 2023-06-06 15:19
|
||||
* @Description:
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class InterviewServiceImpl implements InterviewService {
|
||||
|
||||
@Autowired
|
||||
private HyPartnerInterviewPlanMapper hyPartnerInterviewPlanMapper;
|
||||
|
||||
@Autowired
|
||||
private HyPartnerInterviewMapper hyPartnerInterviewMapper;
|
||||
@Override
|
||||
public List<InterviewVO> getInterviewList(GetInterviewListReq request) {
|
||||
List<InterviewVO> interviewList = hyPartnerInterviewPlanMapper.getInterviewList(request);
|
||||
return interviewList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InterviewVO getInterviewInfo(String interviewId) {
|
||||
return hyPartnerInterviewPlanMapper.getInterviewInfo(interviewId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void entrustOthers(EntrustOthersReq request) {
|
||||
//TODO 1.原面试官日程删除
|
||||
|
||||
//TODO 2.新面试官日程新增
|
||||
|
||||
//TODO 3.面试信息变更
|
||||
|
||||
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
|
||||
record.setId(Long.valueOf(request.getInterviewId()));
|
||||
record.setInterviewer(request.getInterviewId());
|
||||
record.setUpdateTime(new Date());
|
||||
hyPartnerInterviewPlanMapper.updateByPrimaryKeySelective(record);
|
||||
|
||||
|
||||
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
|
||||
hyPartnerInterviewDO.setInterviewPlanId(Long.valueOf(request.getInterviewId()));
|
||||
hyPartnerInterviewDO.setInterviewer(request.getNewInterviewerId());
|
||||
hyPartnerInterviewDO.setUpdateTime(new Date());
|
||||
hyPartnerInterviewMapper.updateByPrimaryKeySelective(hyPartnerInterviewDO);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyInterviewTime(ModifyInterviewTimeReq request) {
|
||||
//TODO 修改面试时间
|
||||
|
||||
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
|
||||
record.setId(Long.valueOf(request.getInterviewId()));
|
||||
record.setStartTime(Convert.toDate(request.getNewStartBookingTime()));
|
||||
record.setUpdateTime(new Date());
|
||||
hyPartnerInterviewPlanMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishInterview(FinishInterviewReq request) {
|
||||
//更新面试计划信息
|
||||
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
|
||||
record.setId(Long.valueOf(request.getInterviewId()));
|
||||
record.setRoomStatus(0);
|
||||
record.setUpdateTime(new Date());
|
||||
hyPartnerInterviewPlanMapper.updateByPrimaryKeySelective(record);
|
||||
|
||||
//更新面试信息
|
||||
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
|
||||
hyPartnerInterviewDO.setInterviewPlanId(Long.valueOf(request.getInterviewId()));
|
||||
hyPartnerInterviewDO.setStatus(3);
|
||||
hyPartnerInterviewDO.setUpdateTime(new Date());
|
||||
hyPartnerInterviewMapper.updateByPrimaryKeySelective(hyPartnerInterviewDO);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,10 +1,26 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.cool.store.dto.partner.EnterInterviewDto;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.HyPartnerInterviewMapper;
|
||||
import com.cool.store.service.PartnerInterviewService;
|
||||
import com.cool.store.utils.PDFUtils;
|
||||
import com.cool.store.utils.PassLetterUtils;
|
||||
import com.cool.store.utils.TRTCUtils;
|
||||
import com.cool.store.vo.PartnerEnterInterviewVO;
|
||||
import com.cool.store.vo.PartnerInterviewInfoVO;
|
||||
import com.cool.store.vo.PartnerPassLetterDetailVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
@Service
|
||||
public class PartnerInterviewServiceImpl implements PartnerInterviewService {
|
||||
@@ -12,8 +28,15 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
|
||||
@Autowired
|
||||
private HyPartnerInterviewMapper interviewMapper;
|
||||
|
||||
@Value("${trtc.sdkAppId}")
|
||||
private Long sdkAppId;
|
||||
|
||||
@Value("${trtc.secretKey}")
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 加盟商查询面试信息
|
||||
*
|
||||
* @param partnerId
|
||||
* @return
|
||||
*/
|
||||
@@ -22,4 +45,70 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
|
||||
return interviewMapper.queryByPartnerId(partnerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入面试间的方法
|
||||
* 修改一些面试状态
|
||||
* 最后返回 userSign 用于进入腾讯云音视频房间
|
||||
*
|
||||
* @return userSign 进入视频所需签名
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public PartnerEnterInterviewVO enterInterviewRoom(EnterInterviewDto dto) {
|
||||
try {
|
||||
//1. 将面试状态改为 --> 2已开始
|
||||
interviewMapper.updateInterviewStatus(dto.getInterviewId(), 2);
|
||||
//3. 修改面试实际开始时间,以第一个人进来的时间为准,后续不再修改
|
||||
interviewMapper.updateActualStartTime(dto.getInterviewId(), DateUtil.now());
|
||||
//4. 修改加盟商或面试官进入面试时间
|
||||
interviewMapper.updateEnterTime(dto.getInterviewId(), dto.getUserType(), DateUtil.now());
|
||||
//5. 加盟商如果进入了,就修改面试计划表 is_partner_interview 字段
|
||||
interviewMapper.updateWhetherPartnerEnter(dto.getInterviewId());
|
||||
//6. 查询对应的面试官id
|
||||
String interviewId = interviewMapper.getInterviewerByInterviewId(dto.getInterviewId());
|
||||
//生成 userSign
|
||||
String userSig = TRTCUtils.genUserSig(sdkAppId, key, dto.getUserId());
|
||||
PartnerEnterInterviewVO vo = new PartnerEnterInterviewVO();
|
||||
vo.setUserSign(userSig);
|
||||
vo.setInterviewerId(interviewId);
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_ENTER_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取通知函详情
|
||||
* TODO 暂时将生成通过函文件的功能放在这里方便测试和联调,审批通过的回调方法完成后应该放到该方法中
|
||||
*/
|
||||
@Override
|
||||
public PartnerPassLetterDetailVO passLetterDetail(String interviewId) {
|
||||
PartnerPassLetterDetailVO vo = interviewMapper.getPassLetterDetail(interviewId);
|
||||
//有效期为审批通过次日起第 60 天的 23:59:59,由此倒推 createTime
|
||||
DateTime expiryDate = DateUtil.parseDate(vo.getExpiryDate());
|
||||
DateTime createTime = DateUtil.offsetDay(expiryDate, -61);
|
||||
vo.setCreateTime(DateUtil.format(createTime, "yyyy-MM-dd"));
|
||||
//解析意向开店区域为市级行政区
|
||||
String verifyCity = vo.getVerifyCity();
|
||||
if (verifyCity == null) {
|
||||
String passCode = PassLetterUtils.genPassLetter(vo.getPartnerName(), verifyCity, vo.getPassCode(), createTime);
|
||||
vo.setPassCode(passCode);
|
||||
return vo;
|
||||
}
|
||||
String[] split = verifyCity.split("/");
|
||||
//根据长度来取市级行政区域
|
||||
if (split.length == 2) {
|
||||
vo.setVerifyCity(split[1]);
|
||||
} else if (split.length == 3) {
|
||||
vo.setVerifyCity(split[1]);
|
||||
} else if (split.length == 4) {
|
||||
vo.setVerifyCity(split[2]);
|
||||
} else {
|
||||
System.out.println("wrong");
|
||||
}
|
||||
String passCode = PassLetterUtils.genPassLetter(vo.getPartnerName(), verifyCity, vo.getPassCode(), createTime);
|
||||
vo.setPassCode(passCode);
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user