修改面试状态同时修改对应子流程状态及根据面试房间状态限制部分面试操作

This commit is contained in:
pserimal
2023-06-25 18:28:29 +08:00
parent be9399d1cb
commit fb6122c961
12 changed files with 180 additions and 19 deletions

View File

@@ -1,11 +1,11 @@
package com.cool.store.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.HyInterviewDAO;
import com.cool.store.dto.mdm.AccessTokenDTO;
import com.cool.store.dto.response.MDMResultDTO;
import com.cool.store.entity.*;
@@ -81,6 +81,9 @@ public class FlowServiceImpl implements FlowService {
@Autowired
private OSSServer ossServer;
@Autowired
private HyInterviewDAO interviewDAO;
@Override
@Transactional
public void createQualifyVerify(CreateQualifyVerifyReq request) throws ApiException {
@@ -155,8 +158,9 @@ public class FlowServiceImpl implements FlowService {
throw new ServiceException(ErrorCodeEnum.INTERVIEW_NOT_EXIST);
}
hyPartnerInterviewDO.setUpdateTime(new Date());
//更新
hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_5.getCode()));
//更新面试信息
//更新面试状态
interviewDAO.updateInterviewWorkflowStatus(request.getInterviewPlanId(), WorkflowStatusEnum.INTERVIEW_5);
hyPartnerInterviewDO.setAuthCode(authCode);
hyPartnerInterviewMapper.updateByPrimaryKeySelective(hyPartnerInterviewDO);
@@ -177,16 +181,16 @@ public class FlowServiceImpl implements FlowService {
log.error("MDM回调入参缺失request{}", JSON.toJSONString(request));
throw new ServiceException("MDM回调错误");
}
//根据审核流程 id 获取面试会议 id
//根据审核流程 id 获取面试会议相关 id
String interviewId = hyPartnerCertificationInfoMapper.getInterviewIdByQualifyVerifyId(request.getInstanceId());
if (StringUtils.isEmpty(interviewId)) {
String interviewPlanId = hyPartnerCertificationInfoMapper.getInterviewPlanIdByQualifyVerifyId(request.getInstanceId());
if (StringUtils.isEmpty(interviewPlanId)) {
throw new ServiceException(ErrorCodeEnum.INTERVIEW_NOT_EXIST);
}
HyPartnerInterviewDO interviewDO = new HyPartnerInterviewDO();
interviewDO.setId(Long.parseLong(interviewId));
//审核通过
if ("FINISHED".equals(request.getSequenceStatus())) {
interviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_6.getCode()));
//更新面试状态
interviewDAO.updateInterviewWorkflowStatus(interviewPlanId, WorkflowStatusEnum.INTERVIEW_6);
//2. 准备需要的信息
String partnerName = request.getIntendedSigner();
String verifyCity = hyPartnerInterviewMapper.getVerifyCityByInterviewId(interviewId);
@@ -207,9 +211,8 @@ public class FlowServiceImpl implements FlowService {
genPassLetterAndUpdateDB(partnerName, verifyCity, passDate, interviewId);
//审核未通过
} else if ("CANCELED".equals(request.getSequenceStatus())) {
interviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_7.getCode()));
interviewDAO.updateInterviewWorkflowStatus(interviewPlanId, WorkflowStatusEnum.INTERVIEW_7);
}
hyPartnerInterviewMapper.updateByPrimaryKeySelective(interviewDO);
}

View File

@@ -5,6 +5,7 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.cool.store.dao.HyInterviewDAO;
import com.cool.store.dto.calendar.*;
import com.cool.store.dto.message.SendCardMessageDTO;
import com.cool.store.dto.partner.EnterInterviewDto;
@@ -86,6 +87,9 @@ public class InterviewServiceImpl implements InterviewService {
@Autowired
private HyPartnerLineInfoService hyPartnerLineInfoService;
@Autowired
private HyInterviewDAO interviewDAO;
@Override
public List<InterviewVO> getInterviewList(GetInterviewListReq request) {
List<InterviewVO> interviewList = hyPartnerInterviewPlanMapper.getInterviewList(request);
@@ -134,7 +138,11 @@ public class InterviewServiceImpl implements InterviewService {
@Override
@Transactional
public void entrustOthers(EntrustOthersReq request) throws ApiException {
//只有房间状态是待开放才可以委托他人
Integer roomStatus = hyPartnerInterviewPlanMapper.getRoomStatus(request.getInterviewPlanId());
if (!roomStatus.equals(RoomStatus.WAIT_FOR_OPEN.getCode())) {
throw new ApiException(ErrorCodeEnum.ROOM_STATUS_ERROR);
}
InterviewVO interviewInfo = hyPartnerInterviewPlanMapper.getInterviewInfo(request.getInterviewPlanId());
//如果面试信息为空,抛出异常
if (interviewInfo == null) {
@@ -188,6 +196,11 @@ public class InterviewServiceImpl implements InterviewService {
*/
@Override
public void modifyInterviewTime(ModifyInterviewTimeReq request) throws ApiException {
//只有房间状态是待开放才可以修改时间
Integer roomStatus = hyPartnerInterviewPlanMapper.getRoomStatus(request.getInterviewPlanId());
if (!roomStatus.equals(RoomStatus.WAIT_FOR_OPEN.getCode())) {
throw new ApiException(ErrorCodeEnum.ROOM_STATUS_ERROR);
}
InterviewVO interviewInfo = hyPartnerInterviewPlanMapper.getInterviewInfo(request.getInterviewPlanId());
//如果面试信息为空,抛出异常
if (interviewInfo == null) {
@@ -223,7 +236,8 @@ public class InterviewServiceImpl implements InterviewService {
//更新面试信息
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
hyPartnerInterviewDO.setInterviewPlanId(Long.valueOf(interviewInfo.getInterviewPlanId()));
hyPartnerInterviewDO.setStatus(Integer.parseInt(WorkflowStatusEnum.INTERVIEW_4.getCode()));
interviewDAO.updateInterviewWorkflowStatus(interviewInfo.getInterviewPlanId(), WorkflowStatusEnum.INTERVIEW_4);
// hyPartnerInterviewDO.setStatus(Integer.parseInt(WorkflowStatusEnum.INTERVIEW_4.getCode()));
hyPartnerInterviewDO.setUpdateTime(now);
hyPartnerInterviewMapper.updateByPrimaryKeySelective(hyPartnerInterviewDO);
}
@@ -239,10 +253,16 @@ public class InterviewServiceImpl implements InterviewService {
@Transactional
public EnterInterviewVO enterInterviewRoom(EnterInterviewDto dto) {
try {
//如果面试间状态不是已开放,就不让进
Integer roomStatus = hyPartnerInterviewPlanMapper.getRoomStatus(dto.getInterviewPlanId());
if (!roomStatus.equals(RoomStatus.OPEN.getCode())) {
throw new RuntimeException();
}
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
hyPartnerInterviewDO.setInterviewPlanId(Long.parseLong(dto.getInterviewPlanId()));
//1. 将面试状态改为 --> 2已开始
hyPartnerInterviewDO.setStatus(2);
interviewDAO.updateInterviewWorkflowStatus(dto.getInterviewPlanId(), WorkflowStatusEnum.INTERVIEW_3);
// hyPartnerInterviewDO.setStatus(Integer.parseInt(WorkflowStatusEnum.INTERVIEW_3.getCode()));
//2. 修改加盟商或面试官进入面试时间
//加盟商
if (dto.getUserType().equals(2)) {
@@ -392,7 +412,9 @@ public class InterviewServiceImpl implements InterviewService {
//更新面试信息
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
hyPartnerInterviewDO.setId(Long.valueOf(interviewVO.getInterviewId()));
hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_2.getCode()));
//更新面试状态和线索子流程状态
interviewDAO.updateInterviewWorkflowStatus(request.getInterviewPlanId(), WorkflowStatusEnum.INTERVIEW_2);
// hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_2.getCode()));
hyPartnerInterviewDO.setUpdateTime(new Date());
hyPartnerInterviewMapper.updateByPrimaryKeySelective(hyPartnerInterviewDO);
@@ -400,7 +422,7 @@ public class InterviewServiceImpl implements InterviewService {
HyPartnerLineInfoDO hyPartnerLineDO = new HyPartnerLineInfoDO();
hyPartnerLineDO.setId(request.getPartnerLineId());
hyPartnerLineDO.setWorkflowStage(WorkflowStageEnum.INTERVIEW.getCode());
hyPartnerLineDO.setWorkflowStatus(WorkflowStatusEnum.INTERVIEW_2.getCode());
// hyPartnerLineDO.setWorkflowStatus(WorkflowStatusEnum.INTERVIEW_2.getCode());
hyPartnerLineDO.setUpdateTime(new Date());
hyPartnerLineInfoMapper.updateByPrimaryKeySelective(hyPartnerLineDO);
//异步发送短信给加盟商

View File

@@ -3,6 +3,7 @@ package com.cool.store.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.cool.store.dao.HyInterviewDAO;
import com.cool.store.dto.partner.EnterInterviewDto;
import com.cool.store.entity.HyPartnerInterviewDO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
@@ -39,6 +40,9 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
@Autowired
private HyPartnerInterviewPlanMapper interviewPlanMapper;
@Autowired
private HyInterviewDAO interviewDAO;
@Value("${trtc.sdkAppId}")
private Long sdkAppId;
@@ -67,10 +71,16 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
@Transactional
public EnterInterviewVO enterInterviewRoom(EnterInterviewDto dto) {
try {
//如果面试间状态不是已开放,就不让进
Integer roomStatus = interviewPlanMapper.getRoomStatus(dto.getInterviewPlanId());
if (!roomStatus.equals(RoomStatus.OPEN.getCode())) {
throw new RuntimeException();
}
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
hyPartnerInterviewDO.setInterviewPlanId(Long.parseLong(dto.getInterviewPlanId()));
//1. 将面试状态改为 --> 2已开始
hyPartnerInterviewDO.setStatus(2);
interviewDAO.updateInterviewWorkflowStatus(dto.getInterviewPlanId(), WorkflowStatusEnum.INTERVIEW_3);
// hyPartnerInterviewDO.setStatus(Integer.parseInt(WorkflowStatusEnum.INTERVIEW_3.getCode()));
//2. 修改加盟商或面试官进入面试时间
//加盟商
if (dto.getUserType().equals(2)) {