Merge remote-tracking branch 'xfsg/cc_partner_init' into cc_partner_init

This commit is contained in:
苏竹红
2024-03-27 18:07:53 +08:00
16 changed files with 181 additions and 28 deletions

View File

@@ -1,5 +1,6 @@
package com.cool.store.service;
import com.cool.store.entity.LeaseBaseInfoDO;
import com.cool.store.request.TrainingExperienceDistributionRequest;
public interface TrainingExperienceService {
@@ -18,4 +19,5 @@ public interface TrainingExperienceService {
*/
void experienceStatusChange(Long lineId, Integer status, String abandonCause);
LeaseBaseInfoDO getTrainingExperience(Long lineId);
}

View File

@@ -1,11 +1,14 @@
package com.cool.store.service.impl;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.MemberQuestionDO;
import com.cool.store.entity.SigningBaseInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.JoinTypeEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.IntentAgreementMapper;
import com.cool.store.mapper.JoinIntentionMapper;
import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.request.IntentAgreementSubmitRequest;
import com.cool.store.response.SigningBaseInfoResponse;
@@ -32,6 +35,9 @@ public class IntentAgreementServiceImpl implements IntentAgreementService {
@Resource
LineInfoMapper lineInfoMapper;
@Resource
JoinIntentionMapper joinIntentionMapper;
@Override
@Transactional(rollbackFor = Exception.class)
@@ -62,6 +68,8 @@ public class IntentAgreementServiceImpl implements IntentAgreementService {
return null;
}
SigningBaseInfoResponse response = SigningBaseInfoResponse.from(signingBaseInfoDO);
MemberQuestionDO byLineId = joinIntentionMapper.getByLineId(lineId);
response.setType(byLineId.getJoinType());
return response;
}
}

View File

@@ -1,16 +1,21 @@
package com.cool.store.service.impl;
import com.cool.store.dao.HyOpenAreaInfoDAO;
import com.cool.store.entity.HyOpenAreaInfoDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.MemberQuestionDO;
import com.cool.store.entity.PartnerBaseInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.WorkflowStageEnum;
import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.HyOpenAreaInfoMapper;
import com.cool.store.mapper.JoinIntentionMapper;
import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.request.JoinIntentionRequest;
import com.cool.store.service.JoinIntentionService;
import com.cool.store.service.OpenAreaService;
import com.cool.store.vo.PartnerBaseInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -36,25 +41,32 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
@Resource
LineInfoMapper lineInfoMapper;
@Resource
HyOpenAreaInfoMapper openAreaInfoMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public boolean submit(JoinIntentionRequest request) {
if (Objects.isNull(request)){
if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
MemberQuestionDO memberQuestionDO = request.toMemberQuestionDO();
boolean submitStatus = joinIntentionMapper.insertOrUpdate(memberQuestionDO);
if (submitStatus){
//更改线索流程子状态为【待审核】
LineInfoDO lineInfoParam = request.toLineInfoDO();
lineInfoParam.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_5.getCode());
if (Objects.isNull(lineInfoParam)){
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
}
lineInfoMapper.insertOrUpdate(lineInfoParam);
return Boolean.TRUE;
//更改线索流程子状态为【待审核】
LineInfoDO lineInfoParam = request.toLineInfoDO();
lineInfoParam.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
lineInfoParam.setWorkflowSubStage(WorkflowSubStageEnum.INTEND.getCode());
lineInfoParam.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_5.getCode());
if (Objects.isNull(lineInfoParam)) {
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
}
return Boolean.FALSE;
//todo 目前写死为进入私海
lineInfoParam.setLineStatus(1);
lineInfoMapper.insertOrUpdate(lineInfoParam);
MemberQuestionDO memberQuestionDO = request.toMemberQuestionDO();
memberQuestionDO.setLineId(lineInfoParam.getId());
joinIntentionMapper.insertOrUpdate(memberQuestionDO);
return Boolean.TRUE;
}
@Override
@@ -84,10 +96,12 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
public PartnerBaseInfoVO getByLineId(Long lineId) {
MemberQuestionDO result = joinIntentionMapper.getByLineId(lineId);
LineInfoDO byLineId = lineInfoMapper.getByLineId(lineId);
if (Objects.isNull(result)){
if (Objects.isNull(result)) {
throw new ServiceException(LINE_ID_IS_NOT_EXIST);
}
PartnerBaseInfoVO response = PartnerBaseInfoVO.from(result,byLineId);
PartnerBaseInfoVO response = PartnerBaseInfoVO.from(result, byLineId);
HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(Long.valueOf(response.getAreaCode()));
response.setArea(openAreaInfoDO.getAreaPath());
return response;
}
}

View File

@@ -56,4 +56,10 @@ public class TrainingExperienceServiceImpl implements TrainingExperienceService
}
}
@Override
public LeaseBaseInfoDO getTrainingExperience(Long lineId) {
LeaseBaseInfoDO leaseBaseInfoDO = trainingExperienceMapper.selectByLineId(lineId);
return leaseBaseInfoDO;
}
}