Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.JoinIntentionRequest;
|
||||
import com.cool.store.vo.PartnerBaseInfoVO;
|
||||
|
||||
public interface JoinIntentionService {
|
||||
/**
|
||||
@@ -9,4 +10,5 @@ public interface JoinIntentionService {
|
||||
*/
|
||||
boolean submit(JoinIntentionRequest request);
|
||||
|
||||
PartnerBaseInfoVO getByLineId(Long lineId);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
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.WorkflowSubStageEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageStatusEnum;
|
||||
@@ -9,6 +11,7 @@ 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.vo.PartnerBaseInfoVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -16,6 +19,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cool.store.enums.ErrorCodeEnum.LINE_ID_IS_NOT_EXIST;
|
||||
|
||||
/**
|
||||
* @author guohb
|
||||
* @ClassName JoinIntentionServiceImpl
|
||||
@@ -32,20 +37,21 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
||||
LineInfoMapper lineInfoMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean submit(JoinIntentionRequest request) {
|
||||
if (Objects.isNull(request)){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
boolean submitStatus = joinIntentionMapper.insert(request);
|
||||
MemberQuestionDO memberQuestionDO = request.toMemberQuestionDO();
|
||||
boolean submitStatus = joinIntentionMapper.insertOrUpdate(memberQuestionDO);
|
||||
if (submitStatus){
|
||||
//更改线索流程子状态为【待审核】
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByPartnerId(request.getPartnerId());
|
||||
if (Objects.isNull(lineInfoDO)){
|
||||
LineInfoDO lineInfoParam = request.toLineInfoDO();
|
||||
lineInfoParam.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_5.getCode());
|
||||
if (Objects.isNull(lineInfoParam)){
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
|
||||
}
|
||||
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_5.getCode());
|
||||
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
|
||||
lineInfoMapper.insertOrUpdate(lineInfoParam);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
@@ -73,4 +79,15 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
||||
protected Boolean auditClose(Long auditId, LineInfoDO lineInfo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartnerBaseInfoVO getByLineId(Long lineId) {
|
||||
MemberQuestionDO result = joinIntentionMapper.getByLineId(lineId);
|
||||
LineInfoDO byLineId = lineInfoMapper.getByLineId(lineId);
|
||||
if (Objects.isNull(result)){
|
||||
throw new ServiceException(LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
PartnerBaseInfoVO response = PartnerBaseInfoVO.from(result,byLineId);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user