意向基本信息
This commit is contained in:
@@ -45,6 +45,13 @@ public class HyPartnerBaseInfoDAO {
|
||||
return hyPartnerBaseInfoMapper.getByPartnerIdAndLineId(partnerId, partnerLineId);
|
||||
}
|
||||
|
||||
public HyPartnerBaseInfoDO getByPartnerLineId(Long partnerLineId){
|
||||
if (partnerLineId == null){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerBaseInfoMapper.getByPartnerLineId(partnerLineId);
|
||||
}
|
||||
|
||||
public Long getLineIdByIdCard(String idCard){
|
||||
if (StringUtils.isEmpty(idCard)){
|
||||
return null;
|
||||
|
||||
@@ -36,6 +36,8 @@ public interface HyPartnerBaseInfoMapper {
|
||||
|
||||
HyPartnerBaseInfoDO getByPartnerIdAndLineId(@Param("partnerId") String partnerId, @Param("partnerLineId") Long partnerLineId);
|
||||
|
||||
HyPartnerBaseInfoDO getByPartnerLineId(@Param("partnerLineId") Long partnerLineId);
|
||||
|
||||
Long getLineIdByIdCard(@Param("idCard") String idCard);
|
||||
|
||||
}
|
||||
@@ -224,6 +224,13 @@
|
||||
where partner_id = #{partnerId} and partner_line_id = #{partnerLineId}
|
||||
</select>
|
||||
|
||||
<select id="getByPartnerLineId" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_base_info
|
||||
where partner_line_id = #{partnerLineId}
|
||||
</select>
|
||||
|
||||
<select id="getLineIdByIdCard" resultType="java.lang.Long">
|
||||
select
|
||||
partner_line_id
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/5/30 9:49
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class PartnerUserInfoRequest {
|
||||
|
||||
@ApiModelProperty("partnerId")
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("申请人姓名")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("常驻区域")
|
||||
private String liveArea;
|
||||
|
||||
@ApiModelProperty("意向开店区域ID")
|
||||
private String wantShopArea;
|
||||
|
||||
@ApiModelProperty("意向开店区域Name")
|
||||
private Long wantShopAreaName;
|
||||
|
||||
@ApiModelProperty("0不接受调剂、1全国调剂、2省内调剂、3市内调剂")
|
||||
private Integer acceptAdjustType;
|
||||
|
||||
@ApiModelProperty("邀请码")
|
||||
private String inviteCode;
|
||||
|
||||
@ApiModelProperty("店铺编码")
|
||||
private String shopCode;
|
||||
|
||||
@ApiModelProperty("店铺名称")
|
||||
private String shopName;
|
||||
|
||||
@ApiModelProperty("店铺ID")
|
||||
private String shopId;
|
||||
|
||||
@ApiModelProperty("推荐加盟商id")
|
||||
private String recommendPartnerId;
|
||||
|
||||
@ApiModelProperty("推荐加盟商姓名")
|
||||
private String recommendPartnerName;
|
||||
|
||||
@ApiModelProperty("推荐加盟商手机号")
|
||||
private String recommendPartnerMobile;
|
||||
|
||||
}
|
||||
@@ -51,4 +51,7 @@ public class PartnerBaseInfoVO {
|
||||
@ApiModelProperty("住址")
|
||||
private String liveAddress;
|
||||
|
||||
@ApiModelProperty("0待提交、1待审核、2已通过、3未通过")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
||||
@@ -55,6 +55,9 @@ public class PartnerUserInfoVO {
|
||||
@ApiModelProperty("是否需要提交意向信息")
|
||||
private Boolean needSubmitWantInfo;
|
||||
|
||||
@ApiModelProperty("线索id")
|
||||
private Long partnerLineId;
|
||||
|
||||
public Boolean getNeedSubmitWantInfo() {
|
||||
if(StringUtils.isBlank(username)
|
||||
|| StringUtils.isBlank(mobile)
|
||||
|
||||
@@ -23,7 +23,11 @@ public interface HyPartnerBaseInfoService {
|
||||
|
||||
PartnerBaseInfoVO queryPartnerBaseInfo(String partnerId, Long lineId);
|
||||
|
||||
PartnerBaseInfoVO getByPartnerLineId(Long lineId);
|
||||
|
||||
Long getLineIdByIdCard(String idCard);
|
||||
|
||||
Boolean changeBinding(String idCard, Long lineId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.request.PartnerUserInfoRequest;
|
||||
import com.cool.store.vo.InviteCodeDetailVO;
|
||||
|
||||
public interface PartnerUserInfoService {
|
||||
@@ -12,4 +13,7 @@ public interface PartnerUserInfoService {
|
||||
Boolean completeJoinNotice(String partnerId);
|
||||
|
||||
InviteCodeDetailVO selectInviteCodeDetail(String partnerId);
|
||||
|
||||
Boolean updatePartnerUserInfo(PartnerUserInfoRequest partnerUserInfoRequest);
|
||||
|
||||
}
|
||||
|
||||
@@ -67,11 +67,29 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
return baseInfoVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartnerBaseInfoVO getByPartnerLineId(Long lineId) {
|
||||
HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(lineId);
|
||||
if (hyPartnerBaseInfoDO == null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARTNER_BASEINFO_NOT_EXIST);
|
||||
}
|
||||
PartnerBaseInfoVO baseInfoVO = new PartnerBaseInfoVO();
|
||||
BeanUtil.copyProperties(hyPartnerBaseInfoDO, baseInfoVO);
|
||||
return baseInfoVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getLineIdByIdCard(String idCard) {
|
||||
return hyPartnerBaseInfoDAO.getLineIdByIdCard(idCard);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean changeBinding(String idCard, Long lineId) {
|
||||
// 先把之前状态置为 待提交,清空身份证号 ,把新的绑定身份证号
|
||||
HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(lineId);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void fillBaseInfo(HyPartnerBaseInfoDO baseInfoDO, PartnerBaseInfoRequest request) {
|
||||
baseInfoDO.setPartnerId(request.getPartnerId());
|
||||
baseInfoDO.setPartnerLineId(request.getPartnerLineId());
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.cool.store.dao.HyPartnerUserInfoDAO;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.BaseUserInfoRequest;
|
||||
import com.cool.store.request.PartnerUserInfoRequest;
|
||||
import com.cool.store.service.PartnerUserInfoService;
|
||||
import com.cool.store.vo.InviteCodeDetailVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -53,4 +55,26 @@ public class PartnerUserInfoServiceImpl implements PartnerUserInfoService {
|
||||
inviteCodeDetailVO.setStoreName(hyPartnerUserInfoDO.getShopName());
|
||||
return inviteCodeDetailVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updatePartnerUserInfo(PartnerUserInfoRequest partnerUserInfoRequest) {
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(String.valueOf(partnerUserInfoRequest.getPartnerId()));
|
||||
if (hyPartnerUserInfoDO==null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARTNER_USER_NOT_EXIST);
|
||||
}
|
||||
hyPartnerUserInfoDO.setUsername(partnerUserInfoRequest.getUsername());
|
||||
hyPartnerUserInfoDO.setMobile(partnerUserInfoRequest.getMobile());
|
||||
hyPartnerUserInfoDO.setLiveArea(partnerUserInfoRequest.getLiveArea());
|
||||
hyPartnerUserInfoDO.setWantShopArea(partnerUserInfoRequest.getWantShopArea());
|
||||
hyPartnerUserInfoDO.setAcceptAdjustType(partnerUserInfoRequest.getAcceptAdjustType());
|
||||
hyPartnerUserInfoDO.setInviteCode(partnerUserInfoRequest.getInviteCode());
|
||||
hyPartnerUserInfoDO.setShopCode(partnerUserInfoRequest.getShopCode());
|
||||
hyPartnerUserInfoDO.setShopName(partnerUserInfoRequest.getShopName());
|
||||
hyPartnerUserInfoDO.setShopId(partnerUserInfoRequest.getShopId());
|
||||
hyPartnerUserInfoDO.setRecommendPartnerId(partnerUserInfoRequest.getRecommendPartnerId());
|
||||
hyPartnerUserInfoDO.setRecommendPartnerName(partnerUserInfoRequest.getRecommendPartnerName());
|
||||
hyPartnerUserInfoDO.setRecommendPartnerMobile(partnerUserInfoRequest.getRecommendPartnerMobile());
|
||||
hyPartnerUserInfoDAO.updateByPrimaryKeySelective(hyPartnerUserInfoDO);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,8 +253,7 @@ public class DeskController {
|
||||
@ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
|
||||
})
|
||||
public ResponseResult<PartnerBaseInfoVO> queryPartnerBaseInfo(@RequestParam(value = "lineId",required = false)Long lineId){
|
||||
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(hyPartnerBaseInfoService.queryPartnerBaseInfo(userInfoVO.getPartnerId(), lineId));
|
||||
return ResponseResult.success(hyPartnerBaseInfoService.getByPartnerLineId(lineId));
|
||||
}
|
||||
|
||||
@PostMapping(path = "/updatePartnerIntentInfo")
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
@@ -10,6 +13,8 @@ import java.io.IOException;
|
||||
* @Date: 2022-6-12 10:35
|
||||
* @Description:
|
||||
*/
|
||||
@Component
|
||||
@Order(2)
|
||||
public class BodyWrapperFilter implements Filter {
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @Author: JCccc
|
||||
* @Date: 2022-6-23 10:52
|
||||
* @Description:
|
||||
*/
|
||||
@Configuration
|
||||
public class WebApplicationConfig {
|
||||
|
||||
@Bean
|
||||
BodyWrapperFilter getBodyWrapperFilter(){
|
||||
return new BodyWrapperFilter();
|
||||
}
|
||||
@Bean("bodyWrapperFilter")
|
||||
public FilterRegistrationBean<BodyWrapperFilter> checkUserFilter(BodyWrapperFilter bodyWrapperFilter) {
|
||||
FilterRegistrationBean<BodyWrapperFilter> registrationBean = new FilterRegistrationBean();
|
||||
registrationBean.setFilter(bodyWrapperFilter);
|
||||
registrationBean.addUrlPatterns("/*");
|
||||
registrationBean.setOrder(1);
|
||||
registrationBean.setAsyncSupported(true);
|
||||
return registrationBean;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,11 +4,9 @@ import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.IDCardSideEnum;
|
||||
import com.cool.store.enums.WorkflowStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.BaseUserInfoRequest;
|
||||
import com.cool.store.request.PartnerBaseInfoRequest;
|
||||
import com.cool.store.request.PartnerClerkInfoRequest;
|
||||
import com.cool.store.request.PartnerIntentInfoRequest;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
@@ -54,9 +52,9 @@ public class PartnerController {
|
||||
|
||||
|
||||
@PostMapping(path = "/applyBaseInfo")
|
||||
@ApiOperation("提交基本信息")
|
||||
public ResponseResult<Boolean> applyBaseInfo(@RequestBody BaseUserInfoRequest baseUserInfoRequest){
|
||||
return ResponseResult.success(hyPartnerIntentInfoService.updatePartnerIntentInfo(baseUserInfoRequest));
|
||||
@ApiOperation("提交加盟商基本信息")
|
||||
public ResponseResult<Boolean> applyBaseInfo(@RequestBody PartnerUserInfoRequest partnerUserInfoRequest){
|
||||
return ResponseResult.success(partnerUserInfoService.updatePartnerUserInfo(partnerUserInfoRequest));
|
||||
}
|
||||
|
||||
|
||||
@@ -64,8 +62,9 @@ public class PartnerController {
|
||||
@ApiOperation("获取提交意向申请标识 true 已提交 false 未提交")
|
||||
public ResponseResult<Boolean> getSubmitIntentionApplyFlag(){
|
||||
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
|
||||
|
||||
return ResponseResult.success();
|
||||
PartnerBaseInfoVO partnerBaseInfoVO = hyPartnerBaseInfoService.queryPartnerBaseInfo(userInfoVO.getPartnerId(), userInfoVO.getPartnerLineId());
|
||||
Boolean submitFlag = partnerBaseInfoVO.getStatus() > Integer.valueOf(WorkflowStatusEnum.INTENT_0.getCode());
|
||||
return ResponseResult.success(submitFlag);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +76,7 @@ public class PartnerController {
|
||||
public ResponseResult<Boolean> getLineByIdCard(@RequestParam(value = "idCard",required = false)String idCard){
|
||||
|
||||
Long lineId = hyPartnerBaseInfoService.getLineIdByIdCard(idCard);
|
||||
return ResponseResult.success(lineId != null);
|
||||
return ResponseResult.success(lineId != null && lineId > 0L);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,12 +89,12 @@ public class PartnerController {
|
||||
public ResponseResult<Boolean> changeBinding(@RequestParam(value = "idCard",required = false)String idCard,
|
||||
@RequestParam(value = "lineId",required = false)Long lineId){
|
||||
|
||||
return ResponseResult.success();
|
||||
return ResponseResult.success(hyPartnerBaseInfoService.changeBinding(idCard, lineId));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path = "/submitPartnerBaseInfo")
|
||||
@ApiOperation("提交加盟商基本信息")
|
||||
@ApiOperation("提交意向书基本信息")
|
||||
public ResponseResult<Boolean> submitPartnerBaseInfo(@RequestBody PartnerBaseInfoRequest baseInfoRequest){
|
||||
//前提 未提交加盟申请
|
||||
//成功 意向区域变更成功 失败 您已进入意向申请流程,当前不可变更意向区域
|
||||
@@ -103,7 +102,7 @@ public class PartnerController {
|
||||
}
|
||||
|
||||
@PostMapping(path = "/submitPartnerClerkInfo")
|
||||
@ApiOperation("提交加盟商店员信息")
|
||||
@ApiOperation("提交意向书店员信息")
|
||||
public ResponseResult<Boolean> submitPartnerClerkInfo(@RequestBody PartnerClerkInfoRequest partnerClerkInfoRequest){
|
||||
|
||||
return ResponseResult.success(hyPartnerClerkService.submitPartnerClerkInfo(partnerClerkInfoRequest));
|
||||
@@ -111,7 +110,7 @@ public class PartnerController {
|
||||
|
||||
|
||||
@PostMapping(path = "/submitPartnerIntentInfo")
|
||||
@ApiOperation("提交加盟商意向信息/行业认知")
|
||||
@ApiOperation("提意向书意向信息/行业认知")
|
||||
public ResponseResult<Boolean> submitPartnerIntentInfo(@RequestBody PartnerIntentInfoRequest partnerIntentInfoRequest){
|
||||
return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest));
|
||||
}
|
||||
@@ -119,7 +118,7 @@ public class PartnerController {
|
||||
|
||||
|
||||
@PostMapping(path = "/changePartnerClerkInfo")
|
||||
@ApiOperation("修改加盟商店员信息")
|
||||
@ApiOperation("修改意向书店员信息")
|
||||
public ResponseResult<Boolean> changePartnerClerkInfo(@RequestBody PartnerClerkInfoRequest partnerClerkInfoRequest){
|
||||
|
||||
return ResponseResult.success(hyPartnerClerkService.submitPartnerClerkInfo(partnerClerkInfoRequest));
|
||||
@@ -127,7 +126,7 @@ public class PartnerController {
|
||||
|
||||
|
||||
@PostMapping(path = "/changePartnerIntentInfo")
|
||||
@ApiOperation("修改加盟商意向信息/行业认知")
|
||||
@ApiOperation("修改意向书意向信息/行业认知")
|
||||
public ResponseResult<Boolean> changePartnerIntentInfo(@RequestBody PartnerIntentInfoRequest partnerIntentInfoRequest){
|
||||
|
||||
return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest));
|
||||
@@ -158,8 +157,7 @@ public class PartnerController {
|
||||
@ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
|
||||
})
|
||||
public ResponseResult<PartnerBaseInfoVO> queryPartnerBaseInfo(@RequestParam(value = "lineId",required = false)Long lineId){
|
||||
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(hyPartnerBaseInfoService.queryPartnerBaseInfo(userInfoVO.getPartnerId(), lineId));
|
||||
return ResponseResult.success(hyPartnerBaseInfoService.getByPartnerLineId(lineId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user