联调
This commit is contained in:
@@ -34,6 +34,11 @@ public class HyPartnerBaseInfoDAO {
|
||||
return hyPartnerBaseInfoMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
public int updateByPrimaryKey(HyPartnerBaseInfoDO record){
|
||||
return hyPartnerBaseInfoMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
|
||||
|
||||
public int updateByPartnerId(String userName,String mobile,String partnerId){
|
||||
return hyPartnerBaseInfoMapper.updateByPartnerId(userName,mobile,partnerId);
|
||||
}
|
||||
@@ -57,10 +62,10 @@ public class HyPartnerBaseInfoDAO {
|
||||
return hyPartnerBaseInfoMapper.getByPartnerLineId(partnerLineId);
|
||||
}
|
||||
|
||||
public Long getLineIdByIdCard(String idCard){
|
||||
public HyPartnerBaseInfoDO getByIdCard(String idCard){
|
||||
if (StringUtils.isEmpty(idCard)){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerBaseInfoMapper.getLineIdByIdCard(idCard);
|
||||
return hyPartnerBaseInfoMapper.getByIdCard(idCard);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ public interface HyPartnerBaseInfoMapper {
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyPartnerBaseInfoDO record);
|
||||
|
||||
int updateByPrimaryKey(@Param("record") HyPartnerBaseInfoDO record);
|
||||
|
||||
|
||||
/**
|
||||
* 根据加盟商ID修改用户名称与手机号
|
||||
* @param userName
|
||||
@@ -38,7 +41,7 @@ public interface HyPartnerBaseInfoMapper {
|
||||
|
||||
HyPartnerBaseInfoDO getByPartnerLineId(@Param("partnerLineId") Long partnerLineId);
|
||||
|
||||
Long getLineIdByIdCard(@Param("idCard") String idCard);
|
||||
HyPartnerBaseInfoDO getByIdCard(@Param("idCard") String idCard);
|
||||
|
||||
int cleanIdCardInfoByPartnerLineId(@Param("idCard") String idCard,
|
||||
@Param("idCardPhotoFront") String idCardPhotoFront,
|
||||
|
||||
@@ -203,6 +203,18 @@
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<update id="updateByPrimaryKey">
|
||||
update hy_partner_base_info
|
||||
set
|
||||
nation = #{record.nation},
|
||||
birthdate = #{record.birthdate},
|
||||
id_card = #{record.idCard},
|
||||
id_card_photo_front = #{record.idCardPhotoFront},
|
||||
id_card_photo_black = #{record.idCardPhotoBlack},
|
||||
live_address = #{record.liveAddress}
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateByPartnerId">
|
||||
update hy_partner_base_info
|
||||
@@ -231,9 +243,9 @@
|
||||
where partner_line_id = #{partnerLineId}
|
||||
</select>
|
||||
|
||||
<select id="getLineIdByIdCard" resultType="java.lang.Long">
|
||||
<select id="getByIdCard" resultMap="BaseResultMap">
|
||||
select
|
||||
partner_line_id
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_base_info
|
||||
where id_card = #{idCard}
|
||||
</select>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.entity.HyPartnerBaseInfoDO;
|
||||
import com.cool.store.request.AddTagsRequest;
|
||||
import com.cool.store.request.PartnerBaseInfoRequest;
|
||||
import com.cool.store.vo.PartnerBaseInfoVO;
|
||||
@@ -26,7 +27,7 @@ public interface HyPartnerBaseInfoService {
|
||||
|
||||
PartnerBaseInfoVO getByPartnerLineId(Long lineId);
|
||||
|
||||
Long getLineIdByIdCard(String idCard);
|
||||
HyPartnerBaseInfoDO getByIdCard(String idCard);
|
||||
|
||||
Boolean changeBinding(String idCard, Long lineId, PartnerUserInfoVO currentUser);
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ public interface HyPartnerLineInfoService {
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
Boolean assignFollowUser(String partnerId);
|
||||
Boolean assignFollowUser(String partnerId, String wantShopArea, Integer acceptAdjustType);
|
||||
|
||||
/**
|
||||
* 线索状态
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -120,15 +121,15 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getLineIdByIdCard(String idCard) {
|
||||
return hyPartnerBaseInfoDAO.getLineIdByIdCard(idCard);
|
||||
public HyPartnerBaseInfoDO getByIdCard(String idCard) {
|
||||
return hyPartnerBaseInfoDAO.getByIdCard(idCard);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean changeBinding(String idCard, Long lineId, PartnerUserInfoVO currentUser) {
|
||||
// 把旧线索的身份证号置空,状态改为待提交
|
||||
Long oldLineId = hyPartnerBaseInfoDAO.getLineIdByIdCard(idCard);
|
||||
HyPartnerLineInfoDO oldLineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(oldLineId);
|
||||
HyPartnerBaseInfoDO oldBaseInfo = hyPartnerBaseInfoDAO.getByIdCard(idCard);
|
||||
HyPartnerLineInfoDO oldLineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(oldBaseInfo.getPartnerLineId());
|
||||
// 该身份证当前申请状态同步至该账号下,原账号变为【加盟意向申请 待提交状态】
|
||||
HyPartnerLineInfoDO newLineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(lineId);
|
||||
newLineInfo.setWorkflowStage(oldLineInfo.getWorkflowStage());
|
||||
@@ -139,11 +140,32 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
oldLineInfo.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
|
||||
oldLineInfo.setLineStatus(LineStatusEnum.PUBLIC_SEAS.getCode());
|
||||
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(oldLineInfo);
|
||||
hyPartnerBaseInfoDAO.cleanIdCardInfoByPartnerLineId(null, null, null, oldLineId);
|
||||
// 新线索绑定身份证号
|
||||
HyPartnerBaseInfoDO newBaseInfo = hyPartnerBaseInfoDAO.getByPartnerIdAndLineId(currentUser.getPartnerId(), lineId);
|
||||
fillBaseInfoIdCard(newBaseInfo, oldBaseInfo.getIdCard(), oldBaseInfo.getIdCardPhotoFront(), oldBaseInfo.getIdCardPhotoBlack(), oldBaseInfo.getUsername(),
|
||||
oldBaseInfo.getSex(), oldBaseInfo.getBirthdate(), oldBaseInfo.getNation(), oldBaseInfo.getLiveAddress(), oldBaseInfo.getStatus());
|
||||
newBaseInfo.setStatus(oldBaseInfo.getStatus());
|
||||
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(newBaseInfo);
|
||||
// 老的身份证信息置空
|
||||
fillBaseInfoIdCard(oldBaseInfo, null, null, null, null, null, null, null, null, null);
|
||||
oldBaseInfo.setStatus(Integer.valueOf(WorkflowStatusEnum.INTENT_0.getCode()));
|
||||
hyPartnerBaseInfoDAO.updateByPrimaryKey(oldBaseInfo);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void fillBaseInfoIdCard(HyPartnerBaseInfoDO newBaseInfo, String idCard, String idCardPhotoFront, String idCardPhotoBlack,
|
||||
String username, Integer sex, Date birthdate, String nation, String liveAddress, Integer status) {
|
||||
newBaseInfo.setIdCard(idCard);
|
||||
newBaseInfo.setIdCardPhotoBlack(idCardPhotoFront);
|
||||
newBaseInfo.setIdCardPhotoFront(idCardPhotoBlack);
|
||||
newBaseInfo.setUsername(username);
|
||||
newBaseInfo.setSex(sex);
|
||||
newBaseInfo.setBirthdate(birthdate);
|
||||
newBaseInfo.setNation(nation);
|
||||
newBaseInfo.setLiveAddress(liveAddress);
|
||||
newBaseInfo.setStatus(status);
|
||||
}
|
||||
|
||||
private void fillBaseInfo(HyPartnerBaseInfoDO baseInfoDO, PartnerBaseInfoRequest request) {
|
||||
baseInfoDO.setPartnerId(request.getPartnerId());
|
||||
baseInfoDO.setPartnerLineId(request.getPartnerLineId());
|
||||
|
||||
@@ -173,7 +173,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
intentInfoDO.setMaxBudget(request.getMaxBudget());
|
||||
intentInfoDO.setMoneySource(request.getMoneySource());
|
||||
if(CollectionUtils.isNotEmpty(request.getMoneyProve())){
|
||||
intentInfoDO.setMoneyProve(String.join(",", request.getMoneyProve()));
|
||||
intentInfoDO.setMoneyProve(JSONObject.toJSONString(request.getMoneyProve()));
|
||||
}
|
||||
intentInfoDO.setEducation(request.getEducation());
|
||||
intentInfoDO.setWorkYear(request.getWorkYear());
|
||||
|
||||
@@ -372,10 +372,14 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean assignFollowUser(String partnerId) {
|
||||
public Boolean assignFollowUser(String partnerId, String wantShopArea, Integer acceptAdjustType) {
|
||||
List<HyPartnerLineInfoDO> lineFollowHistoryList = hyPartnerLineInfoDAO.getLineFollowHistoryList(partnerId);
|
||||
//当前加盟商线索
|
||||
HyPartnerLineInfoDO HyPartnerLineInfo = hyPartnerLineInfoDAO.getByPartnerId(partnerId);
|
||||
if(HyPartnerLineInfo == null){
|
||||
Boolean lineStatus = getLineStatus(Long.valueOf(wantShopArea), acceptAdjustType);
|
||||
return lineStatus;
|
||||
}
|
||||
//如果是私海线索 不需要重新分配招商经理 或者跟进次数大于1
|
||||
if (HyPartnerLineInfo.getLineStatus()==1||CollectionUtils.isEmpty(lineFollowHistoryList)){
|
||||
return Boolean.FALSE;
|
||||
|
||||
@@ -107,7 +107,7 @@ public class PartnerUserInfoServiceImpl implements PartnerUserInfoService {
|
||||
hyPartnerLineInfoDO.setPartnerId(hyPartnerUserInfoDO.getPartnerId());
|
||||
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
|
||||
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
|
||||
Boolean flag = hyPartnerLineInfoService.assignFollowUser(hyPartnerLineInfoDO.getPartnerId());
|
||||
Boolean flag = hyPartnerLineInfoService.assignFollowUser(hyPartnerLineInfoDO.getPartnerId(), partnerUserInfoRequest.getWantShopArea(), partnerUserInfoRequest.getAcceptAdjustType());
|
||||
hyPartnerLineInfoDO.setLineStatus(flag ? LineStatusEnum.PRIVATE_SEAS.getCode() : LineStatusEnum.PUBLIC_SEAS.getCode());
|
||||
if (flag){
|
||||
hyPartnerLineInfoDO.setInvestmentManager("ou_7a6a19ae800afde783b0ec2dabaabf95");
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.controller;
|
||||
|
||||
import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.entity.HyPartnerBaseInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.IDCardSideEnum;
|
||||
import com.cool.store.enums.WorkflowStatusEnum;
|
||||
@@ -70,10 +71,10 @@ public class PartnerController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "idCard", value = "身份证号码", required = false),
|
||||
})
|
||||
public ResponseResult<Boolean> getLineByIdCard(@RequestParam(value = "idCard",required = false)String idCard){
|
||||
public ResponseResult<Boolean> getByIdCard(@RequestParam(value = "idCard",required = false)String idCard){
|
||||
|
||||
Long lineId = hyPartnerBaseInfoService.getLineIdByIdCard(idCard);
|
||||
return ResponseResult.success(lineId != null && lineId > 0L);
|
||||
HyPartnerBaseInfoDO baseInfoDO = hyPartnerBaseInfoService.getByIdCard(idCard);
|
||||
return ResponseResult.success(baseInfoDO != null && baseInfoDO.getPartnerLineId() > 0L);
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +137,7 @@ public class PartnerController {
|
||||
|
||||
@PostMapping(path = "/delCoolDownFirstLoginFlag")
|
||||
@ApiOperation("删除冷静期是否首次登录缓存")
|
||||
public ResponseResult<Boolean> delCoolDownFirstLoginFlag(@RequestParam(value = "lineId",required = true)String lineId){
|
||||
public ResponseResult<Boolean> delCoolDownFirstLoginFlag(@RequestParam(value = "lineId",required = true)Long lineId){
|
||||
String coolingPeriodFirstLoginCacheKey = MessageFormat.format(RedisConstant.COOLINGPERIOD_FIRSTLOGIN_KEY, lineId);
|
||||
redisUtilPool.delKey(coolingPeriodFirstLoginCacheKey);
|
||||
return ResponseResult.success(true);
|
||||
|
||||
Reference in New Issue
Block a user