submitWantShopInfo
This commit is contained in:
@@ -220,6 +220,11 @@ public class RedisConstant {
|
|||||||
|
|
||||||
public static final String PARTNER_INTENTINFO_CACHE_KEY = "partnerIntentInfoCache:{0}:{1}";
|
public static final String PARTNER_INTENTINFO_CACHE_KEY = "partnerIntentInfoCache:{0}:{1}";
|
||||||
|
|
||||||
|
public static final String PARTNER_WANTSHOPINFO_CACHE_KEY = "partnerWantShopInfoCache:{0}:{1}";
|
||||||
|
|
||||||
|
public static final String PARTNER_INDUSTRYCOGNITIONINFO_CACHE_KEY = "partnerIndustryCognitionInfoCache:{0}:{1}";
|
||||||
|
|
||||||
|
|
||||||
public static final String DEVICE_OPEN_TOKEN = "device_open_token:{0}:{1}:{2}";
|
public static final String DEVICE_OPEN_TOKEN = "device_open_token:{0}:{1}:{2}";
|
||||||
|
|
||||||
public static final String PHONE_NUMBER= "phone_number_";
|
public static final String PHONE_NUMBER= "phone_number_";
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.cool.store.request;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2023/5/30 15:14
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel
|
||||||
|
public class IndustryCognitionInfoRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("线索表ID")
|
||||||
|
private Long partnerLineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("加盟商C端用户表ID partnerId ")
|
||||||
|
private String partnerId;
|
||||||
|
|
||||||
|
@ApiModelProperty("学历")
|
||||||
|
private String education;
|
||||||
|
|
||||||
|
@ApiModelProperty("工作年限")
|
||||||
|
private String workYear;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否具有工作经验")
|
||||||
|
private Integer isHaveWorkExp;
|
||||||
|
|
||||||
|
@ApiModelProperty("工作或经商经验")
|
||||||
|
private String workExp;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否是消费者")
|
||||||
|
private Integer isConsumer;
|
||||||
|
|
||||||
|
@ApiModelProperty("其他品牌")
|
||||||
|
private String otherBand;
|
||||||
|
|
||||||
|
@ApiModelProperty("品牌优势")
|
||||||
|
private String brandStrength;
|
||||||
|
|
||||||
|
@ApiModelProperty("需要改进")
|
||||||
|
private String needImprove;
|
||||||
|
|
||||||
|
@ApiModelProperty("优势")
|
||||||
|
private String strength;
|
||||||
|
|
||||||
|
@ApiModelProperty("劣势")
|
||||||
|
private String weakness;
|
||||||
|
|
||||||
|
@ApiModelProperty("提交标识 提交-true 暂存-false")
|
||||||
|
private Boolean submitFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.cool.store.request;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author wxp
|
||||||
|
* @Date 2023/5/30 15:14
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel
|
||||||
|
public class PartnerWantShopInfoRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("线索表ID")
|
||||||
|
private Long partnerLineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("加盟商C端用户表ID partnerId ")
|
||||||
|
private String partnerId;
|
||||||
|
|
||||||
|
@ApiModelProperty("常驻区域")
|
||||||
|
private String liveArea;
|
||||||
|
|
||||||
|
@ApiModelProperty("意向开店区域")
|
||||||
|
private String wantShopArea;
|
||||||
|
|
||||||
|
@ApiModelProperty("0不接受调剂、1全国调剂、2省内调剂、3市内调剂")
|
||||||
|
private Integer acceptAdjustType;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否有意向铺位")
|
||||||
|
private Integer isHaveWantShop;
|
||||||
|
|
||||||
|
@ApiModelProperty("意向铺位信息,json字段,最多5个")
|
||||||
|
private List<WantShopInfoRequest> wantShopInfo;
|
||||||
|
|
||||||
|
@ApiModelProperty("最大预算")
|
||||||
|
private String maxBudget;
|
||||||
|
|
||||||
|
@ApiModelProperty("资金来源 1自有资金;2借贷资金;3部分自有、部分借代;4部分自有、部分亲友借代")
|
||||||
|
private String moneySource;
|
||||||
|
|
||||||
|
@ApiModelProperty("资金证明")
|
||||||
|
private List<String> moneyProve;
|
||||||
|
|
||||||
|
@ApiModelProperty("提交标识 提交-true 暂存-false")
|
||||||
|
private Boolean submitFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.cool.store.service;
|
package com.cool.store.service;
|
||||||
|
|
||||||
import com.cool.store.request.BaseUserInfoRequest;
|
import com.cool.store.request.BaseUserInfoRequest;
|
||||||
|
import com.cool.store.request.IndustryCognitionInfoRequest;
|
||||||
import com.cool.store.request.PartnerIntentInfoRequest;
|
import com.cool.store.request.PartnerIntentInfoRequest;
|
||||||
|
import com.cool.store.request.PartnerWantShopInfoRequest;
|
||||||
import com.cool.store.vo.PartnerIntentApplyInfoVO;
|
import com.cool.store.vo.PartnerIntentApplyInfoVO;
|
||||||
import com.cool.store.vo.PartnerIntentInfoVO;
|
import com.cool.store.vo.PartnerIntentInfoVO;
|
||||||
import com.cool.store.vo.PartnerUserInfoVO;
|
import com.cool.store.vo.PartnerUserInfoVO;
|
||||||
@@ -41,6 +43,10 @@ public interface HyPartnerIntentInfoService {
|
|||||||
|
|
||||||
String submitPartnerIntentInfo(PartnerIntentInfoRequest partnerIntentInfoRequest);
|
String submitPartnerIntentInfo(PartnerIntentInfoRequest partnerIntentInfoRequest);
|
||||||
|
|
||||||
|
String submitWantShopInfo(PartnerWantShopInfoRequest request);
|
||||||
|
|
||||||
|
String submitIndustryCognitionInfo(IndustryCognitionInfoRequest request);
|
||||||
|
|
||||||
PartnerIntentInfoVO queryPartnerIntentInfo(PartnerUserInfoVO userInfoVO, Long lineId);
|
PartnerIntentInfoVO queryPartnerIntentInfo(PartnerUserInfoVO userInfoVO, Long lineId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ import com.cool.store.enums.WorkflowStageEnum;
|
|||||||
import com.cool.store.enums.WorkflowStatusEnum;
|
import com.cool.store.enums.WorkflowStatusEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.request.BaseUserInfoRequest;
|
import com.cool.store.request.BaseUserInfoRequest;
|
||||||
|
import com.cool.store.request.IndustryCognitionInfoRequest;
|
||||||
import com.cool.store.request.PartnerIntentInfoRequest;
|
import com.cool.store.request.PartnerIntentInfoRequest;
|
||||||
|
import com.cool.store.request.PartnerWantShopInfoRequest;
|
||||||
import com.cool.store.service.HyPartnerIntentInfoService;
|
import com.cool.store.service.HyPartnerIntentInfoService;
|
||||||
import com.cool.store.utils.RedisUtilPool;
|
import com.cool.store.utils.RedisUtilPool;
|
||||||
import com.cool.store.utils.StringUtil;
|
import com.cool.store.utils.StringUtil;
|
||||||
@@ -48,7 +50,6 @@ import java.util.stream.Collectors;
|
|||||||
@Service
|
@Service
|
||||||
public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoService {
|
public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoService {
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
HyPartnerIntentInfoDAO hyPartnerIntentInfoDAO;
|
HyPartnerIntentInfoDAO hyPartnerIntentInfoDAO;
|
||||||
@Resource
|
@Resource
|
||||||
@@ -131,11 +132,6 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
|||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||||
}
|
}
|
||||||
String cacheKey = MessageFormat.format(RedisConstant.PARTNER_INTENTINFO_CACHE_KEY, request.getPartnerId(), request.getPartnerLineId());
|
String cacheKey = MessageFormat.format(RedisConstant.PARTNER_INTENTINFO_CACHE_KEY, request.getPartnerId(), request.getPartnerLineId());
|
||||||
if (StringUtils.isNotBlank(redisUtilPool.getString(cacheKey))) {
|
|
||||||
PartnerIntentInfoRequest oldRequest = JSONObject.parseObject(redisUtilPool.getString(cacheKey), PartnerIntentInfoRequest.class);
|
|
||||||
BeanUtil.copyProperties(request, oldRequest);
|
|
||||||
request = oldRequest;
|
|
||||||
}
|
|
||||||
if(!request.getSubmitFlag()){
|
if(!request.getSubmitFlag()){
|
||||||
// 自动保存时
|
// 自动保存时
|
||||||
redisUtilPool.setString(cacheKey, JSONObject.toJSONString(request), RedisConstant.ONE_DAY_SECONDS);
|
redisUtilPool.setString(cacheKey, JSONObject.toJSONString(request), RedisConstant.ONE_DAY_SECONDS);
|
||||||
@@ -163,6 +159,66 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String submitWantShopInfo(PartnerWantShopInfoRequest request) {
|
||||||
|
|
||||||
|
log.info("HyPartnerClerkServiceImpl#submitWantShopInfo request:{}", JSONObject.toJSONString(request));
|
||||||
|
if (StringUtil.isBlank(request.getPartnerId()) || Objects.isNull(request.getPartnerLineId())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||||
|
}
|
||||||
|
String cacheKey = MessageFormat.format(RedisConstant.PARTNER_WANTSHOPINFO_CACHE_KEY, request.getPartnerId(), request.getPartnerLineId());
|
||||||
|
if(!request.getSubmitFlag()){
|
||||||
|
// 自动保存时
|
||||||
|
redisUtilPool.setString(cacheKey, JSONObject.toJSONString(request), RedisConstant.ONE_DAY_SECONDS);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
HyPartnerIntentInfoDO intentInfoDO = hyPartnerIntentInfoDAO.getByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
|
||||||
|
if(intentInfoDO == null){
|
||||||
|
intentInfoDO = new HyPartnerIntentInfoDO();
|
||||||
|
fillWantShopInfo(intentInfoDO, request);
|
||||||
|
hyPartnerIntentInfoDAO.insertSelective(intentInfoDO);
|
||||||
|
}else {
|
||||||
|
fillWantShopInfo(intentInfoDO, request);
|
||||||
|
hyPartnerIntentInfoDAO.updateByPrimaryKeySelective(intentInfoDO);
|
||||||
|
}
|
||||||
|
redisUtilPool.delKey(cacheKey);
|
||||||
|
if(StringUtils.isNotBlank(request.getWantShopArea())){
|
||||||
|
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(request.getPartnerId());
|
||||||
|
hyPartnerUserInfoDO.setWantShopArea(request.getWantShopArea());
|
||||||
|
hyPartnerUserInfoDO.setLiveArea(request.getLiveArea());
|
||||||
|
hyPartnerUserInfoDO.setAcceptAdjustType(request.getAcceptAdjustType());
|
||||||
|
hyPartnerUserInfoDAO.updateByPrimaryKeySelective(hyPartnerUserInfoDO);
|
||||||
|
HyOpenAreaInfoDO hyOpenAreaInfoDO = hyOpenAreaInfoDAO.selectById(Long.valueOf(request.getWantShopArea()));
|
||||||
|
return hyOpenAreaInfoDO != null ? hyOpenAreaInfoDO.getAreaStatus() : null;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String submitIndustryCognitionInfo(IndustryCognitionInfoRequest request) {
|
||||||
|
log.info("HyPartnerClerkServiceImpl#submitPartnerIntentInfo request:{}", JSONObject.toJSONString(request));
|
||||||
|
if (StringUtil.isBlank(request.getPartnerId()) || Objects.isNull(request.getPartnerLineId())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||||
|
}
|
||||||
|
String cacheKey = MessageFormat.format(RedisConstant.PARTNER_INDUSTRYCOGNITIONINFO_CACHE_KEY, request.getPartnerId(), request.getPartnerLineId());
|
||||||
|
if(!request.getSubmitFlag()){
|
||||||
|
// 自动保存时
|
||||||
|
redisUtilPool.setString(cacheKey, JSONObject.toJSONString(request), RedisConstant.ONE_DAY_SECONDS);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
HyPartnerIntentInfoDO intentInfoDO = hyPartnerIntentInfoDAO.getByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
|
||||||
|
if(intentInfoDO == null){
|
||||||
|
intentInfoDO = new HyPartnerIntentInfoDO();
|
||||||
|
fillIndustryCognitionInfo(intentInfoDO, request);
|
||||||
|
hyPartnerIntentInfoDAO.insertSelective(intentInfoDO);
|
||||||
|
}else {
|
||||||
|
fillIndustryCognitionInfo(intentInfoDO, request);
|
||||||
|
hyPartnerIntentInfoDAO.updateByPrimaryKeySelective(intentInfoDO);
|
||||||
|
}
|
||||||
|
redisUtilPool.delKey(cacheKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PartnerIntentInfoVO queryPartnerIntentInfo(PartnerUserInfoVO userInfoVO, Long lineId) {
|
public PartnerIntentInfoVO queryPartnerIntentInfo(PartnerUserInfoVO userInfoVO, Long lineId) {
|
||||||
String cacheKey = MessageFormat.format(RedisConstant.PARTNER_INTENTINFO_CACHE_KEY, userInfoVO.getPartnerId(), lineId);
|
String cacheKey = MessageFormat.format(RedisConstant.PARTNER_INTENTINFO_CACHE_KEY, userInfoVO.getPartnerId(), lineId);
|
||||||
@@ -189,6 +245,38 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
|||||||
return intentInfoVO;
|
return intentInfoVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void fillWantShopInfo(HyPartnerIntentInfoDO intentInfoDO, PartnerWantShopInfoRequest request) {
|
||||||
|
intentInfoDO.setPartnerId(request.getPartnerId());
|
||||||
|
intentInfoDO.setPartnerLineId(request.getPartnerLineId());
|
||||||
|
intentInfoDO.setLiveArea(request.getLiveArea());
|
||||||
|
intentInfoDO.setWantShopArea(request.getWantShopArea());
|
||||||
|
intentInfoDO.setAcceptAdjustType(request.getAcceptAdjustType());
|
||||||
|
intentInfoDO.setIsHaveWantShop(request.getIsHaveWantShop());
|
||||||
|
if (CollectionUtils.isNotEmpty(request.getWantShopInfo())){
|
||||||
|
intentInfoDO.setWantShopInfo(JSONObject.toJSONString(request.getWantShopInfo()));
|
||||||
|
}
|
||||||
|
intentInfoDO.setMaxBudget(request.getMaxBudget());
|
||||||
|
intentInfoDO.setMoneySource(request.getMoneySource());
|
||||||
|
if(CollectionUtils.isNotEmpty(request.getMoneyProve())){
|
||||||
|
intentInfoDO.setMoneyProve(JSONObject.toJSONString(request.getMoneyProve()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fillIndustryCognitionInfo(HyPartnerIntentInfoDO intentInfoDO, IndustryCognitionInfoRequest request) {
|
||||||
|
intentInfoDO.setPartnerId(request.getPartnerId());
|
||||||
|
intentInfoDO.setPartnerLineId(request.getPartnerLineId());
|
||||||
|
intentInfoDO.setEducation(request.getEducation());
|
||||||
|
intentInfoDO.setWorkYear(request.getWorkYear());
|
||||||
|
intentInfoDO.setIsHaveWorkExp(request.getIsHaveWorkExp());
|
||||||
|
intentInfoDO.setWorkExp(request.getWorkExp());
|
||||||
|
intentInfoDO.setIsConsumer(request.getIsConsumer());
|
||||||
|
intentInfoDO.setOtherBand(request.getOtherBand());
|
||||||
|
intentInfoDO.setBrandStrength(request.getBrandStrength());
|
||||||
|
intentInfoDO.setNeedImprove(request.getNeedImprove());
|
||||||
|
intentInfoDO.setStrength(request.getStrength());
|
||||||
|
intentInfoDO.setWeakness(request.getWeakness());
|
||||||
|
}
|
||||||
|
|
||||||
private void fillIntentInfo(HyPartnerIntentInfoDO intentInfoDO, PartnerIntentInfoRequest request) {
|
private void fillIntentInfo(HyPartnerIntentInfoDO intentInfoDO, PartnerIntentInfoRequest request) {
|
||||||
intentInfoDO.setPartnerId(request.getPartnerId());
|
intentInfoDO.setPartnerId(request.getPartnerId());
|
||||||
intentInfoDO.setPartnerLineId(request.getPartnerLineId());
|
intentInfoDO.setPartnerLineId(request.getPartnerLineId());
|
||||||
|
|||||||
@@ -110,11 +110,16 @@ public class PartnerController {
|
|||||||
return ResponseResult.success(hyPartnerClerkService.submitPartnerClerkInfo(partnerClerkInfoRequest));
|
return ResponseResult.success(hyPartnerClerkService.submitPartnerClerkInfo(partnerClerkInfoRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(path = "/submitWantShopInfo")
|
||||||
|
@ApiOperation("提意向书意向信息")
|
||||||
|
public ResponseResult<String> submitWantShopInfo(@RequestBody PartnerWantShopInfoRequest request){
|
||||||
|
return ResponseResult.success(hyPartnerIntentInfoService.submitWantShopInfo(request));
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping(path = "/submitPartnerIntentInfo")
|
@PostMapping(path = "/submitIndustryCognitionInfo")
|
||||||
@ApiOperation("提意向书意向信息/行业认知")
|
@ApiOperation("提意向书行业认知")
|
||||||
public ResponseResult<String> submitPartnerIntentInfo(@RequestBody PartnerIntentInfoRequest partnerIntentInfoRequest){
|
public ResponseResult<String> submitIndustryCognitionInfo(@RequestBody IndustryCognitionInfoRequest request){
|
||||||
return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest));
|
return ResponseResult.success(hyPartnerIntentInfoService.submitIndustryCognitionInfo(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(path = "/changePartnerClerkInfo")
|
@PostMapping(path = "/changePartnerClerkInfo")
|
||||||
|
|||||||
Reference in New Issue
Block a user