意向书

This commit is contained in:
wxp01309236
2023-06-16 18:05:55 +08:00
parent fe34145788
commit 012059c3ae
9 changed files with 69 additions and 18 deletions

View File

@@ -189,6 +189,11 @@ public class RedisConstant {
public static final String STOREWORK_NOTICE_KEY = "storeWorkNoticeCache:{0}:{1}:{2}:{3}";
/**
* 冷静期内是否首次登录 冷静期首次登录 是-true 否-false
*/
public static final String COOLINGPERIOD_FIRSTLOGIN_KEY = "coolingPeriodFirstLoginCache:{0}";
/**
* 七天
*/

View File

@@ -45,4 +45,10 @@ public class HyPartnerBaseInfoDAO {
return hyPartnerBaseInfoMapper.getByPartnerIdAndLineId(partnerId, partnerLineId);
}
public Long getLineIdByIdCard(String idCard){
if (StringUtils.isEmpty(idCard)){
return null;
}
return hyPartnerBaseInfoMapper.getLineIdByIdCard(idCard);
}
}

View File

@@ -36,4 +36,6 @@ public interface HyPartnerBaseInfoMapper {
HyPartnerBaseInfoDO getByPartnerIdAndLineId(@Param("partnerId") String partnerId, @Param("partnerLineId") Long partnerLineId);
Long getLineIdByIdCard(@Param("idCard") String idCard);
}

View File

@@ -224,4 +224,11 @@
where partner_id = #{partnerId} and partner_line_id = #{partnerLineId}
</select>
<select id="getLineIdByIdCard" resultType="java.lang.Long">
select
partner_line_id
from hy_partner_base_info
where id_card = #{idCard}
</select>
</mapper>

View File

@@ -22,4 +22,8 @@ public interface HyPartnerBaseInfoService {
Boolean submitPartnerBaseInfo(PartnerBaseInfoRequest request);
PartnerBaseInfoVO queryPartnerBaseInfo(String partnerId, Long lineId);
Long getLineIdByIdCard(String idCard);
}

View File

@@ -104,5 +104,7 @@ public interface HyPartnerLineInfoService {
*/
PageInfo<PublicSeaLineListVo> publicSeaLineList(String userId,LineRequest lineRequest);
PartnerLineBaseInfoVO getPartnerLinBaseInfo(String partnerId);
}

View File

@@ -67,6 +67,11 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
return baseInfoVO;
}
@Override
public Long getLineIdByIdCard(String idCard) {
return hyPartnerBaseInfoDAO.getLineIdByIdCard(idCard);
}
private void fillBaseInfo(HyPartnerBaseInfoDO baseInfoDO, PartnerBaseInfoRequest request) {
baseInfoDO.setPartnerId(request.getPartnerId());
baseInfoDO.setPartnerLineId(request.getPartnerLineId());

View File

@@ -1,7 +1,9 @@
package com.cool.store.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.RedisConstant;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.HyPartnerLineInfoDAO;
import com.cool.store.dao.HyPartnerUserInfoDAO;
@@ -17,19 +19,21 @@ import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.CloseFollowRequest;
import com.cool.store.request.LineRequest;
import com.cool.store.service.EnterpriseUserService;
import com.cool.store.service.HyPartnerLineInfoService;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.StringUtil;
import com.cool.store.vo.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.MessageFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -49,6 +53,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
EnterpriseUserDAO enterpriseUserDAO;
@Resource
UserRegionMappingDAO userRegionMappingDAO;
@Resource
private RedisUtilPool redisUtilPool;
@Override
public StageCountVO selectStagePendingCount(String userId) {
@@ -291,6 +297,18 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
return publicSeaLineList;
}
@Override
public PartnerLineBaseInfoVO getPartnerLinBaseInfo(String partnerId) {
PartnerLineBaseInfoVO lineBaseInfoVO = new PartnerLineBaseInfoVO();
// todo wxp 需要加条件
HyPartnerLineInfoDO lineInfoDO = hyPartnerLineInfoDAO.getByPartnerId(partnerId);
BeanUtil.copyProperties(lineInfoDO, lineBaseInfoVO);
String coolingPeriodFirstLoginCacheKey = MessageFormat.format(RedisConstant.COOLINGPERIOD_FIRSTLOGIN_KEY, partnerId);
String value = redisUtilPool.getString(coolingPeriodFirstLoginCacheKey);
lineBaseInfoVO.setCoolDownFirstLoginFlag(StringUtils.isNotBlank(value));
return lineBaseInfoVO;
}
/**
* convertPartnerBlackListDTOToVo
* @param partnerBlackListDTO

View File

@@ -1,5 +1,6 @@
package com.cool.store.controller;
import com.cool.store.constants.RedisConstant;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.IDCardSideEnum;
@@ -9,11 +10,8 @@ import com.cool.store.request.PartnerBaseInfoRequest;
import com.cool.store.request.PartnerClerkInfoRequest;
import com.cool.store.request.PartnerIntentInfoRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.AliyunService;
import com.cool.store.service.HyPartnerBaseInfoService;
import com.cool.store.service.HyPartnerClerkService;
import com.cool.store.service.HyPartnerIntentInfoService;
import com.cool.store.service.PartnerUserInfoService;
import com.cool.store.service.*;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.vo.*;
import com.cool.store.vo.cuser.IdentityCardInfoVO;
import io.swagger.annotations.Api;
@@ -24,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.text.MessageFormat;
import java.util.List;
/**
@@ -39,18 +38,18 @@ public class PartnerController {
@Resource
private PartnerUserInfoService partnerUserInfoService;
@Resource
private HyPartnerIntentInfoService hyPartnerIntentInfoService;
@Resource
private AliyunService aliyunService;
@Resource
private HyPartnerBaseInfoService hyPartnerBaseInfoService;
@Resource
private HyPartnerClerkService hyPartnerClerkService;
@Resource
private HyPartnerLineInfoService hyPartnerLineInfoService;
@Resource
private RedisUtilPool redisUtilPool;
@@ -77,8 +76,8 @@ public class PartnerController {
})
public ResponseResult<Boolean> getLineByIdCard(@RequestParam(value = "idCard",required = false)String idCard){
return ResponseResult.success();
Long lineId = hyPartnerBaseInfoService.getLineIdByIdCard(idCard);
return ResponseResult.success(lineId != null);
}
@@ -134,18 +133,21 @@ public class PartnerController {
return ResponseResult.success(hyPartnerIntentInfoService.submitPartnerIntentInfo(partnerIntentInfoRequest));
}
@GetMapping(path = "/getPartnerLineBaseInfo")
@ApiOperation("查询加盟商线索详情(适用全部流程) 包括冷静期是否首次登录")
@ApiImplicitParams({
@ApiImplicitParam(name = "partnerId", value = "C端用户基本信息ID", required = false),
})
public ResponseResult<PartnerLineBaseInfoVO> getPartnerLinBaseInfo(@RequestParam(value = "partnerId",required = false)Long partnerId){
public ResponseResult<PartnerLineBaseInfoVO> getPartnerLinBaseInfo(@RequestParam(value = "partnerId",required = false)String partnerId){
return ResponseResult.success(hyPartnerLineInfoService.getPartnerLinBaseInfo(partnerId));
}
return ResponseResult.success();
@PostMapping(path = "/delCoolDownFirstLoginFlag")
@ApiOperation("删除冷静期是否首次登录缓存")
public ResponseResult<Boolean> delCoolDownFirstLoginFlag(@RequestParam(value = "partnerId",required = true)String partnerId){
String coolingPeriodFirstLoginCacheKey = MessageFormat.format(RedisConstant.COOLINGPERIOD_FIRSTLOGIN_KEY, partnerId);
redisUtilPool.delKey(coolingPeriodFirstLoginCacheKey);
return ResponseResult.success(true);
}