Merge remote-tracking branch 'xfsg/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.enums.IDCardSideEnum;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.vo.BusinessLicenseInfoVO;
|
||||
import com.cool.store.vo.IdentityCardInfoVO;
|
||||
|
||||
public interface AliyunService {
|
||||
/**
|
||||
* ORC识别身份证信息
|
||||
* @param faceImageUrl
|
||||
* @param sideEnum
|
||||
* @return
|
||||
* @throws ApiException
|
||||
*/
|
||||
IdentityCardInfoVO getIdentityCardInfo(String faceImageUrl, IDCardSideEnum sideEnum) throws ApiException;
|
||||
|
||||
BusinessLicenseInfoVO getBusinessLicenseInfo(String imageUrl) throws ApiException;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.IntentAgreementSubmitRequest;
|
||||
|
||||
public interface IntentAgreementService {
|
||||
/**
|
||||
* 签署意向协议
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
boolean submit(IntentAgreementSubmitRequest request);
|
||||
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public interface LineInterviewService {
|
||||
* @param videoUrlList
|
||||
* @return
|
||||
*/
|
||||
Boolean uploadVideo(Long interviewId, List<String> videoUrlList);
|
||||
Integer uploadVideo(Long interviewId, List<String> videoUrlList);
|
||||
|
||||
/**
|
||||
* 重新预约面审
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyun.ocr20191230.models.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.IDCardSideEnum;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.service.AliyunService;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.vo.BusinessLicenseInfoVO;
|
||||
import com.cool.store.vo.IdentityCardInfoVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AliyunServiceImpl implements AliyunService {
|
||||
|
||||
@Value("${aliyun.accessKeyId:null}")
|
||||
private String accessKeyId;
|
||||
|
||||
@Value("${aliyun.accessKeySecret:null}")
|
||||
private String accessKeySecret;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IdentityCardInfoVO getIdentityCardInfo(String faceImageUrl,
|
||||
IDCardSideEnum sideEnum) throws ApiException {
|
||||
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||
.setAccessKeyId(accessKeyId)
|
||||
.setAccessKeySecret(accessKeySecret);
|
||||
// 访问的域名
|
||||
config.endpoint = "ocr.cn-shanghai.aliyuncs.com";
|
||||
try {
|
||||
com.aliyun.ocr20191230.Client client = new com.aliyun.ocr20191230.Client(config);
|
||||
URL url = new URL(faceImageUrl);
|
||||
InputStream inputStream = url.openConnection().getInputStream();
|
||||
com.aliyun.ocr20191230.models.RecognizeIdentityCardAdvanceRequest recognizeIdentityCardAdvanceRequest = new com.aliyun.ocr20191230.models.RecognizeIdentityCardAdvanceRequest()
|
||||
.setImageURLObject(inputStream)
|
||||
.setSide(sideEnum.getCode());
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
RecognizeIdentityCardResponse idCardResponse = client.recognizeIdentityCardAdvance(recognizeIdentityCardAdvanceRequest, runtime);
|
||||
log.info("身份证解析结果:{}", JSONObject.toJSONString(idCardResponse));
|
||||
RecognizeIdentityCardResponseBody.RecognizeIdentityCardResponseBodyDataFrontResult frontResult = Optional.ofNullable(idCardResponse).map(o -> o.getBody()).map(o -> o.data).map(o -> o.frontResult).orElse(null);
|
||||
if(Objects.nonNull(frontResult)){
|
||||
String username = frontResult.name;
|
||||
String liveAddress = frontResult.address;
|
||||
String birthdate = frontResult.birthDate;
|
||||
if(StringUtils.isNotBlank(birthdate)){
|
||||
birthdate = convertDate(birthdate, "yyyyMMdd");
|
||||
}
|
||||
String sex = frontResult.gender;
|
||||
String idCard = frontResult.IDNumber;
|
||||
String nation = frontResult.nationality;
|
||||
IdentityCardInfoVO result = new IdentityCardInfoVO(username, liveAddress, birthdate, sex, idCard, nation);
|
||||
log.info("身份证解析:{}", JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
} catch (com.aliyun.tea.TeaException e) {
|
||||
log.error("身份证解析报错TeaException:{}", e);
|
||||
throw new ApiException(e.getMessage());
|
||||
} catch (MalformedURLException e) {
|
||||
log.error("身份证解析报错MalformedURLException:{}", e);
|
||||
throw new ApiException(e.getMessage());
|
||||
} catch (IOException e) {
|
||||
log.error("身份证解析报错IOException:{}", e);
|
||||
throw new ApiException(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("身份证解析报错Exception:{}", e);
|
||||
throw new ApiException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static String convertDate(String date, String format) {
|
||||
try {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
||||
LocalDate localDate = LocalDate.parse(date, formatter);
|
||||
return localDate.toString();
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(ErrorCodeEnum.DATA_CONVERT_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusinessLicenseInfoVO getBusinessLicenseInfo(String imageUrl) throws ApiException {
|
||||
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||
.setAccessKeyId(accessKeyId)
|
||||
.setAccessKeySecret(accessKeySecret);
|
||||
config.endpoint = "ocr.cn-shanghai.aliyuncs.com";
|
||||
try {
|
||||
com.aliyun.ocr20191230.Client client = new com.aliyun.ocr20191230.Client(config);
|
||||
//非上海区域OSS必须使用流转换后使用
|
||||
URL url = new URL(imageUrl);
|
||||
InputStream inputStream = url.openConnection().getInputStream();
|
||||
RecognizeBusinessLicenseAdvanceRequest recognizeBusinessLicenseRequest = new RecognizeBusinessLicenseAdvanceRequest()
|
||||
.setImageURLObject(inputStream);
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
// RecognizeBusinessLicenseResponse recognizeBusinessLicenseResponse = client.recognizeBusinessLicenseWithOptions(RecognizeBusinessLicenseAdvanceRequest, runtime);
|
||||
RecognizeBusinessLicenseResponse recognizeBusinessLicenseResponse = client.recognizeBusinessLicenseAdvance(recognizeBusinessLicenseRequest, runtime);
|
||||
log.info("营业执照解析结果:{}", JSONObject.toJSONString(recognizeBusinessLicenseResponse));
|
||||
RecognizeBusinessLicenseResponseBody.RecognizeBusinessLicenseResponseBodyData result = Optional.ofNullable(recognizeBusinessLicenseResponse).map(o -> o.getBody()).map(o -> o.data).orElse(null);
|
||||
if (Objects.nonNull(result)){
|
||||
String address = result.address;
|
||||
String registerNumber = result.registerNumber;
|
||||
BusinessLicenseInfoVO response = new BusinessLicenseInfoVO(registerNumber,address);
|
||||
return response;
|
||||
}
|
||||
return null;
|
||||
} catch (com.aliyun.tea.TeaException e) {
|
||||
log.error("营业执照解析报错TeaException:{}", e);
|
||||
throw new ApiException(e.getMessage());
|
||||
} catch (MalformedURLException e) {
|
||||
log.error("营业执照解析报错MalformedURLException:{}", e);
|
||||
throw new ApiException(e.getMessage());
|
||||
} catch (IOException e) {
|
||||
log.error("营业执照解析报错IOException:{}", e);
|
||||
throw new ApiException(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("营业执照解析报错Exception:{}", e);
|
||||
throw new ApiException(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.enums.UserRoleEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: CommonService
|
||||
@@ -16,9 +20,22 @@ public class CommonService {
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
@Resource
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
|
||||
public LineFlowService getLineFlowService(Integer workflowSubStage){
|
||||
WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(workflowSubStage);
|
||||
return (LineFlowService)applicationContext.getBean(workflowSubStageEnum.getClazz());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户id
|
||||
* @param areaId 城市id
|
||||
* @param userRole
|
||||
* @return
|
||||
*/
|
||||
public String getUserIdByAreaAndUserRole(Long areaId, UserRoleEnum userRole){
|
||||
//随机一个
|
||||
return enterpriseUserDAO.getUserInfoByUserIds(null).stream().findAny().get().getUserId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.SigningBaseInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.IntentAgreementMapper;
|
||||
import com.cool.store.mapper.LineInfoMapper;
|
||||
import com.cool.store.request.IntentAgreementSubmitRequest;
|
||||
import com.cool.store.service.IntentAgreementService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class IntentAgreementServiceImpl implements IntentAgreementService {
|
||||
|
||||
|
||||
@Resource
|
||||
IntentAgreementMapper intentAgreementMapper;
|
||||
|
||||
@Resource
|
||||
LineInfoMapper lineInfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean submit(IntentAgreementSubmitRequest request) {
|
||||
SigningBaseInfoDO signingBaseInfoDO = request.toSigningBaseInfoDO();
|
||||
boolean submitStatus = intentAgreementMapper.insert(signingBaseInfoDO);
|
||||
if (submitStatus){
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByPartnerId(request.getPartnerId());
|
||||
if (Objects.isNull(lineInfoDO)){
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
|
||||
}
|
||||
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_60.getCode());
|
||||
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
|
||||
return Boolean.TRUE;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -46,8 +46,9 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
||||
}
|
||||
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_5.getCode());
|
||||
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.AuditPassRequest;
|
||||
import com.cool.store.request.AuditRejectRequest;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@@ -34,6 +35,7 @@ public abstract class LineFlowService {
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean auditPass(AuditPassRequest request){
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
if(!lineInfo.getWorkflowSubStage().equals(request.getWorkflowSubStage())){
|
||||
@@ -55,6 +57,7 @@ public abstract class LineFlowService {
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean auditReject(AuditRejectRequest request){
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
if(!lineInfo.getWorkflowSubStage().equals(request.getWorkflowSubStage())){
|
||||
@@ -77,6 +80,7 @@ public abstract class LineFlowService {
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean auditClose(AuditRejectRequest request){
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
if(!lineInfo.getWorkflowSubStage().equals(request.getWorkflowSubStage())){
|
||||
@@ -91,8 +95,10 @@ public abstract class LineFlowService {
|
||||
auditInfo.setRejectRealReason(request.getRejectRealReason());
|
||||
auditInfo.setCertifyFile(JSONObject.toJSONString(request.getCertifyFile()));
|
||||
Long auditId = lineAuditInfoDAO.addAuditInfo(auditInfo);
|
||||
lineInfo.setLineStatus(LineStatusEnum.PUBLIC_SEAS.getCode());
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
LineInfoDO updateLineInfo = new LineInfoDO();
|
||||
updateLineInfo.setId(request.getLineId());
|
||||
updateLineInfo.setLineStatus(LineStatusEnum.PUBLIC_SEAS.getCode());
|
||||
lineInfoDAO.updateLineInfo(updateLineInfo);
|
||||
return auditClose(auditId, lineInfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
@@ -63,6 +64,8 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
private HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
|
||||
@Resource
|
||||
private LineAuditInfoDAO lineAuditInfoDAO;
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
|
||||
@Override
|
||||
public List<AppointmentTimeVO> getAppointmentTime(Long lineId, Integer interviewType, LocalDate appointmentDate) {
|
||||
@@ -84,6 +87,7 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean appointmentTime(AppointmentTimeRequest request) {
|
||||
//查询线索信息
|
||||
//如果是面谈获取招商经理 如果是面试获取大区经理
|
||||
@@ -97,17 +101,22 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_STATUS_NOT_ALLOW_OPERATE);
|
||||
}
|
||||
InterviewTypeEnum interviewType = WorkflowSubStageEnum.getInterviewType(lineInfo.getWorkflowSubStage());
|
||||
String interviewer = InterviewTypeEnum.MEET.equals(interviewType) ? lineInfo.getInvestmentManager() : InterviewTypeEnum.INTERVIEW.equals(interviewType) ? lineInfo.getFirstInterviewer() : lineInfo.getSecondInterviewer();
|
||||
Boolean occupied = lineCalendarsEventDAO.isOccupied(interviewType.getCode(), lineInfo.getRegionId(), interviewer, request.getStartTime(), request.getEndTime());
|
||||
UserRoleEnum userRole = InterviewTypeEnum.MEET.equals(interviewType) ? UserRoleEnum.INVESTMENT_MANAGER : UserRoleEnum.REGION_MANAGER;
|
||||
//获取面试官
|
||||
String interviewerUserId = InterviewTypeEnum.MEET.equals(interviewType) ? lineInfo.getInvestmentManager() : commonService.getUserIdByAreaAndUserRole(lineInfo.getWantShopAreaId(), userRole);
|
||||
String firstInterviewer = InterviewTypeEnum.INTERVIEW.equals(interviewType) ? interviewerUserId : null;
|
||||
String secondInterviewer = InterviewTypeEnum.SECOND_INTERVIEW.equals(interviewType) ? interviewerUserId : null;
|
||||
Boolean occupied = lineCalendarsEventDAO.isOccupied(interviewType.getCode(), lineInfo.getRegionId(), interviewerUserId, request.getStartTime(), request.getEndTime(), null);
|
||||
if(occupied){
|
||||
throw new ServiceException(ErrorCodeEnum.TIME_OCCUPIED);
|
||||
}
|
||||
Date startTime = DateUtils.strToDate(request.getStartTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
|
||||
Date endTime = DateUtils.strToDate(request.getEndTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
|
||||
LineCalendarsEventDO calendarsEvent = LineCalendarsEventDO.convertDO(lineInfo, interviewType.getCode(), startTime, endTime, interviewer);
|
||||
LineCalendarsEventDO calendarsEvent = LineCalendarsEventDO.convertDO(lineInfo, interviewType.getCode(), startTime, endTime, interviewerUserId);
|
||||
Long eventId = lineCalendarsEventDAO.addCalendarsEvent(calendarsEvent);
|
||||
WorkflowSubStageStatusEnum workflowSubStageStatus = InterviewTypeEnum.getWorkflowSubStageStatus(interviewType);
|
||||
//跟新线索状态为已预约
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
lineInfoDAO.updateWorkflowStageAndInterviewer(lineInfo.getId(), workflowSubStageStatus, firstInterviewer, secondInterviewer);
|
||||
LineInterviewDO interviewInfo = lineInterviewDAO.getInterviewInfo(lineInfo.getId(), interviewType);
|
||||
if(Objects.nonNull(interviewInfo)){
|
||||
if(!WorkflowSubStageStatusEnum.isReappointmentStatus(lineInfo.getWorkflowSubStageStatus())){
|
||||
@@ -117,12 +126,13 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
//删除该面试记录
|
||||
lineInterviewDAO.deleteInterviewInfo(interviewInfo.getId());
|
||||
}
|
||||
LineInterviewDO addInterview = LineInterviewDO.convertDO(lineInfo, startTime, endTime, UUIDUtils.get8UUID(), interviewer, interviewType.getCode(), eventId);
|
||||
LineInterviewDO addInterview = LineInterviewDO.convertDO(lineInfo, startTime, endTime, UUIDUtils.get8UUID(), interviewerUserId, interviewType.getCode(), eventId);
|
||||
lineInterviewDAO.addInterviewInfo(addInterview);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean modifyAppointmentTime(AppointmentTimeRequest request) {
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
if(Objects.isNull(lineInfo)){
|
||||
@@ -144,6 +154,10 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
}
|
||||
Date startTime = DateUtils.strToDate(request.getStartTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
|
||||
Date endTime = DateUtils.strToDate(request.getEndTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
|
||||
Boolean occupied = lineCalendarsEventDAO.isOccupied(interviewType.getCode(), lineInfo.getRegionId(), interviewInfo.getInterviewerUserId(), request.getStartTime(), request.getEndTime(), interviewInfo.getId());
|
||||
if(occupied){
|
||||
throw new ServiceException(ErrorCodeEnum.TIME_OCCUPIED);
|
||||
}
|
||||
interviewInfo.setInterviewDate(startTime);
|
||||
interviewInfo.setStartTime(startTime);
|
||||
interviewInfo.setEndTime(endTime);
|
||||
@@ -227,6 +241,7 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer finishInterview(Long interviewId, String userId) {
|
||||
LineInterviewDO interviewInfo = lineInterviewDAO.getInterviewInfoById(interviewId);
|
||||
if(Objects.isNull(interviewInfo)){
|
||||
@@ -236,20 +251,25 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
if (interviewInfo.getRoomStatus().equals(RoomStatus.CLOSED.getCode())) {
|
||||
throw new ServiceException(ErrorCodeEnum.ROOM_STATUS_ERROR);
|
||||
}
|
||||
interviewInfo.setRoomStatus(RoomStatus.CLOSED.getCode());
|
||||
interviewInfo.setActualEndTime(new Date());
|
||||
interviewInfo.setInterviewStatus(InterviewStatusEnum.WAIT_AUDIT.getCode());
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(interviewInfo.getLineId());
|
||||
if(!WorkflowSubStageEnum.isReappointmentStage(lineInfo.getWorkflowSubStage())){
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_STATUS_NOT_ALLOW_OPERATE);
|
||||
}
|
||||
LineInterviewDO updateInterviewInfo = new LineInterviewDO();
|
||||
updateInterviewInfo.setId(interviewId);
|
||||
updateInterviewInfo.setRoomStatus(RoomStatus.CLOSED.getCode());
|
||||
updateInterviewInfo.setActualEndTime(new Date());
|
||||
updateInterviewInfo.setInterviewStatus(InterviewStatusEnum.WAIT_AUDIT.getCode());
|
||||
//更新线索状态
|
||||
LineInfoDO lineInfo = new LineInfoDO();
|
||||
lineInfo.setId(interviewInfo.getLineId());
|
||||
WorkflowSubStageStatusEnum workflowSubStageStatus = null;
|
||||
if(InterviewTypeEnum.INTERVIEW.getCode().equals(interviewInfo.getInterviewType())){
|
||||
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.FIRST_INTERVIEWS_35.getCode());
|
||||
workflowSubStageStatus = WorkflowSubStageStatusEnum.FIRST_INTERVIEWS_35;
|
||||
}
|
||||
if(InterviewTypeEnum.SECOND_INTERVIEW.getCode().equals(interviewInfo.getInterviewType())){
|
||||
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_110.getCode());
|
||||
workflowSubStageStatus = WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_110;
|
||||
}
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
return lineInterviewDAO.updateInterviewInfo(interviewInfo);
|
||||
lineInfoDAO.updateWorkflowStage(interviewInfo.getLineId(), null, workflowSubStageStatus);
|
||||
return lineInterviewDAO.updateInterviewInfo(updateInterviewInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -271,7 +291,7 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean uploadVideo(Long interviewId, List<String> videoUrlList) {
|
||||
public Integer uploadVideo(Long interviewId, List<String> videoUrlList) {
|
||||
LineInterviewDO interviewInfo = lineInterviewDAO.getInterviewInfoById(interviewId);
|
||||
if(Objects.isNull(interviewInfo)){
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_NOT_EXIST);
|
||||
@@ -281,8 +301,10 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
videoList = new ArrayList<>();
|
||||
}
|
||||
videoList.addAll(videoUrlList);
|
||||
interviewInfo.setVideoUrl(JSONObject.toJSONString(videoList.stream().distinct().collect(Collectors.toList())));
|
||||
return lineInterviewDAO.updateInterviewInfo(interviewInfo) > 0;
|
||||
LineInterviewDO updateInterviewInfo = new LineInterviewDO();
|
||||
updateInterviewInfo.setId(interviewId);
|
||||
updateInterviewInfo.setVideoUrl(JSONObject.toJSONString(videoList.stream().distinct().collect(Collectors.toList())));
|
||||
return lineInterviewDAO.updateInterviewInfo(updateInterviewInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -295,15 +317,14 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
log.info("当前线索状态不允许重新预约");
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_STATUS_NOT_ALLOW_OPERATE);
|
||||
}
|
||||
Integer workflowSubStageStatus = null;
|
||||
WorkflowSubStageStatusEnum workflowSubStageStatus = null;
|
||||
if(WorkflowSubStageEnum.FIRST_INTERVIEWS.getCode().equals(lineInfo.getWorkflowSubStage())){
|
||||
workflowSubStageStatus = WorkflowSubStageStatusEnum.FIRST_INTERVIEWS_41.getCode();
|
||||
workflowSubStageStatus = WorkflowSubStageStatusEnum.FIRST_INTERVIEWS_41;
|
||||
}
|
||||
if(WorkflowSubStageEnum.SECOND_INTERVIEWS.getCode().equals(lineInfo.getWorkflowSubStage())){
|
||||
workflowSubStageStatus = WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_120.getCode();
|
||||
workflowSubStageStatus = WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_120;
|
||||
}
|
||||
lineInfo.setWorkflowSubStageStatus(workflowSubStageStatus);
|
||||
return lineInfoDAO.updateLineInfo(lineInfo);
|
||||
return lineInfoDAO.updateWorkflowStage(lineInfo.getId(), null, workflowSubStageStatus);
|
||||
}
|
||||
|
||||
|
||||
@@ -314,44 +335,33 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
|
||||
@Override
|
||||
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo) {
|
||||
InterviewTypeEnum interviewType = null;
|
||||
InterviewTypeEnum interviewType = WorkflowSubStageEnum.getInterviewType(lineInfo.getWorkflowSubStage());
|
||||
WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage());
|
||||
WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage();
|
||||
Integer nextStageInitStatus = nextStage.getInitStatus().getCode();
|
||||
if(WorkflowSubStageEnum.INVITING_INTERVIEWS.getCode().equals(lineInfo.getWorkflowSubStage())){
|
||||
interviewType = InterviewTypeEnum.MEET;
|
||||
}
|
||||
if(WorkflowSubStageEnum.FIRST_INTERVIEWS.getCode().equals(lineInfo.getWorkflowSubStage())){
|
||||
interviewType = InterviewTypeEnum.INTERVIEW;
|
||||
}
|
||||
if(WorkflowSubStageEnum.SECOND_INTERVIEWS.getCode().equals(lineInfo.getWorkflowSubStage())){
|
||||
interviewType = InterviewTypeEnum.SECOND_INTERVIEW;
|
||||
nextStageInitStatus = InterviewStatusEnum.PASS.getCode();
|
||||
}
|
||||
LineInterviewDO interviewInfo = lineInterviewDAO.getInterviewInfo(lineInfo.getId(), interviewType);
|
||||
interviewInfo.setAuditId(auditId);
|
||||
interviewInfo.setInterviewStatus(InterviewStatusEnum.PASS.getCode());
|
||||
lineInfo.setWorkflowSubStage(nextStage.getCode());
|
||||
lineInfo.setWorkflowSubStageStatus(nextStageInitStatus);
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
return lineInterviewDAO.updateInterviewInfo(interviewInfo) > 0;
|
||||
if(Objects.isNull(interviewInfo)){
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_NOT_EXIST);
|
||||
}
|
||||
LineInterviewDO updateInterviewInfo = new LineInterviewDO();
|
||||
updateInterviewInfo.setId(interviewInfo.getId());
|
||||
updateInterviewInfo.setAuditId(auditId);
|
||||
updateInterviewInfo.setInterviewStatus(InterviewStatusEnum.PASS.getCode());
|
||||
//更新线索阶段
|
||||
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus());
|
||||
return lineInterviewDAO.updateInterviewInfo(updateInterviewInfo) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean auditReject(Long auditId, LineInfoDO lineInfo) {
|
||||
InterviewTypeEnum interviewType = null;
|
||||
if(WorkflowSubStageEnum.INVITING_INTERVIEWS.getCode().equals(lineInfo.getWorkflowSubStage())){
|
||||
interviewType = InterviewTypeEnum.MEET;
|
||||
}
|
||||
if(WorkflowSubStageEnum.FIRST_INTERVIEWS.getCode().equals(lineInfo.getWorkflowSubStage())){
|
||||
interviewType = InterviewTypeEnum.INTERVIEW;
|
||||
}
|
||||
if(WorkflowSubStageEnum.SECOND_INTERVIEWS.getCode().equals(lineInfo.getWorkflowSubStage())){
|
||||
interviewType = InterviewTypeEnum.SECOND_INTERVIEW;
|
||||
}
|
||||
InterviewTypeEnum interviewType = WorkflowSubStageEnum.getInterviewType(lineInfo.getWorkflowSubStage());
|
||||
LineInterviewDO interviewInfo = lineInterviewDAO.getInterviewInfo(lineInfo.getId(), interviewType);
|
||||
interviewInfo.setAuditId(auditId);
|
||||
interviewInfo.setInterviewStatus(InterviewStatusEnum.NOT_PASS.getCode());
|
||||
if(Objects.isNull(interviewInfo)){
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_NOT_EXIST);
|
||||
}
|
||||
LineInterviewDO updateInterviewInfo = new LineInterviewDO();
|
||||
updateInterviewInfo.setId(interviewInfo.getId());
|
||||
updateInterviewInfo.setAuditId(auditId);
|
||||
updateInterviewInfo.setInterviewStatus(InterviewStatusEnum.NOT_PASS.getCode());
|
||||
return lineInterviewDAO.updateInterviewInfo(interviewInfo) > 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user