意向加盟
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
public enum JoinTypeEnum {
|
||||
JOIN_TYPE_ONE(1,"个人加盟"),
|
||||
JOIN_TYPE_TWO(2,"企业加盟"),
|
||||
|
||||
;
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String typeName;
|
||||
|
||||
JoinTypeEnum(Integer code, String typeName) {
|
||||
this.code = code;
|
||||
this.typeName = typeName;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public void setTypeName(String typeName) {
|
||||
this.typeName = typeName;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.response;
|
||||
|
||||
import com.cool.store.entity.SigningBaseInfoDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -43,6 +44,9 @@ public class SigningBaseInfoResponse {
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("加盟身份 1个人加盟 2企业加盟")
|
||||
private Integer type;
|
||||
|
||||
|
||||
public static SigningBaseInfoResponse from(SigningBaseInfoDO signingBaseInfoDO) {
|
||||
if (signingBaseInfoDO == null) {
|
||||
|
||||
@@ -25,6 +25,8 @@ public class PartnerBaseInfoVO {
|
||||
private String mobile;
|
||||
@ApiModelProperty("1男 2女")
|
||||
private Integer sex;
|
||||
@ApiModelProperty("意向加盟区域")
|
||||
private String area;
|
||||
@ApiModelProperty("意向区域编码")
|
||||
private String areaCode;
|
||||
@ApiModelProperty("常驻区域详细地址(居住地址)")
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
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;
|
||||
@@ -7,10 +9,12 @@ import com.cool.store.enums.ErrorCodeEnum;
|
||||
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 +40,28 @@ 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.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_5.getCode());
|
||||
if (Objects.isNull(lineInfoParam)) {
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
lineInfoMapper.insertOrUpdate(lineInfoParam);
|
||||
|
||||
MemberQuestionDO memberQuestionDO = request.toMemberQuestionDO();
|
||||
memberQuestionDO.setLineId(lineInfoParam.getId());
|
||||
joinIntentionMapper.insertOrUpdate(memberQuestionDO);
|
||||
return Boolean.TRUE;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,10 +91,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.response.SigningBaseInfoResponse;
|
||||
import com.cool.store.service.IntentAgreementService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/pc/IntentAgreement"})
|
||||
@Slf4j
|
||||
@Api(tags = "PC意向协议")
|
||||
public class PCIntentAgreementController {
|
||||
|
||||
@Resource
|
||||
IntentAgreementService intentAgreementService;
|
||||
|
||||
@PostMapping(path = "/get")
|
||||
@ApiOperation("查询意向协议信息")
|
||||
public ResponseResult<SigningBaseInfoResponse> getMiniIntentAgreement(
|
||||
@RequestParam(value = "partnerId", required = false) String partnerId,
|
||||
@RequestParam(value = "lineId", required = false) Long lineId) {
|
||||
SigningBaseInfoResponse resp = intentAgreementService.getMiniIntentAgreement(partnerId, lineId);
|
||||
return ResponseResult.success(resp);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user