Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
This commit is contained in:
@@ -25,6 +25,7 @@ public class CoolDateUtils {
|
||||
public static final String DATE_FORMAT_SEC_4 = "yyyy.MM.dd HH:mm";
|
||||
public static final String DATE_FORMAT_SEC_5 = "yyyy.MM.dd HH:mm";
|
||||
public static final String DATE_FORMAT_SEC_6 = "yyyy.MM.dd";
|
||||
public static final String DATE_FORMAT_SEC_7 = "yyyy/MM/dd HH:mm";
|
||||
/**
|
||||
* 几天后的当前
|
||||
* @param d
|
||||
|
||||
@@ -10,6 +10,8 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -98,4 +100,9 @@ public class EnterpriseUserDAO {
|
||||
}
|
||||
return enterpriseUserMapper.getUserListByRegionIds(regionIds);
|
||||
}
|
||||
|
||||
public Map<String, String> getUserNameAndMobile(List<String> userIds){
|
||||
List<EnterpriseUserDO> userList = getUserInfoByUserIds(userIds);
|
||||
return userList.stream().filter(o->!StringUtils.isAnyBlank(o.getMobile(), o.getName())).collect(Collectors.toMap(k -> k.getUserId(), v -> v.getName() + " " + v.getMobile()));
|
||||
}
|
||||
}
|
||||
@@ -89,12 +89,12 @@ public class HyOpenAreaInfoDAO {
|
||||
return hyOpenAreaInfoMapper.selectByIds(ids);
|
||||
}
|
||||
|
||||
public Map<Long, String> selectNameMapByIds(List<Long> ids){
|
||||
public Map<String, String> selectNameMapByIds(List<Long> ids){
|
||||
if (CollectionUtils.isEmpty(ids)){
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOS = hyOpenAreaInfoMapper.selectByIds(ids);
|
||||
return ListUtils.emptyIfNull(hyOpenAreaInfoDOS).stream().collect(Collectors.toMap(k->k.getId(), v->v.getAreaName()));
|
||||
return ListUtils.emptyIfNull(hyOpenAreaInfoDOS).stream().collect(Collectors.toMap(k->String.valueOf(k.getId()), v->v.getAreaName()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_line_info
|
||||
<where>
|
||||
<if test="userId">
|
||||
<if test="userId != null">
|
||||
and investment_manager = #{userId}
|
||||
</if>
|
||||
<if test="lastMonthTodayDate!=null">
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -16,7 +25,6 @@ import java.util.Date;
|
||||
@ApiModel
|
||||
public class PartnerIntentApplyInfoVO {
|
||||
|
||||
|
||||
@ApiModelProperty("")
|
||||
private Long id;
|
||||
|
||||
@@ -45,7 +53,7 @@ public class PartnerIntentApplyInfoVO {
|
||||
private Integer acceptAdjustType;
|
||||
|
||||
@ApiModelProperty("截止时间")
|
||||
private Date deadline;
|
||||
private String deadline;
|
||||
|
||||
@ApiModelProperty("阶段提交时间")
|
||||
private Date partnerSubmitTime;
|
||||
@@ -53,4 +61,31 @@ public class PartnerIntentApplyInfoVO {
|
||||
@ApiModelProperty("阶段状态")
|
||||
private String WorkflowStatus;
|
||||
|
||||
|
||||
public static List<PartnerIntentApplyInfoVO> convertList(List<PartnerIntentApplyInfoDTO> list, Map<String, HyPartnerUserInfoDO> infoDOMap, Map<String, String> wantShopAreaNameMap, String workflowStatus){
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<PartnerIntentApplyInfoVO> resultList = new ArrayList<>();
|
||||
for (PartnerIntentApplyInfoDTO partnerIntentApplyInfoDTO : list) {
|
||||
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO();
|
||||
partnerIntentApplyInfoVO.setId(partnerIntentApplyInfoDTO.getId());
|
||||
partnerIntentApplyInfoVO.setPartnerId(partnerIntentApplyInfoDTO.getPartnerId());
|
||||
partnerIntentApplyInfoVO.setLineId(partnerIntentApplyInfoDTO.getPartnerLineId());
|
||||
partnerIntentApplyInfoVO.setPartnerSubmitTime(partnerIntentApplyInfoDTO.getPartnerSubmitTime());
|
||||
partnerIntentApplyInfoVO.setAcceptAdjustType(partnerIntentApplyInfoDTO.getAcceptAdjustType());
|
||||
partnerIntentApplyInfoVO.setLiveArea(partnerIntentApplyInfoDTO.getLiveArea());
|
||||
partnerIntentApplyInfoVO.setWantShopArea(partnerIntentApplyInfoDTO.getWantShopArea());
|
||||
String deadLine = DateUtil.format(partnerIntentApplyInfoDTO.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC);
|
||||
partnerIntentApplyInfoVO.setDeadline(deadLine);
|
||||
HyPartnerUserInfoDO infoDOMapOrDefault = infoDOMap.getOrDefault(partnerIntentApplyInfoDTO.getPartnerId(), new HyPartnerUserInfoDO());
|
||||
partnerIntentApplyInfoVO.setPartnerUserName(infoDOMapOrDefault.getUsername());
|
||||
partnerIntentApplyInfoVO.setPartnerUserPhone(infoDOMapOrDefault.getMobile());
|
||||
partnerIntentApplyInfoVO.setWorkflowStatus(workflowStatus);
|
||||
partnerIntentApplyInfoVO.setWantShopAreaName(wantShopAreaNameMap.get(partnerIntentApplyInfoDTO.getWantShopArea()));
|
||||
resultList.add(partnerIntentApplyInfoVO);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package com.cool.store.vo;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -41,7 +45,7 @@ public class PartnerLineInfoVO {
|
||||
private String developmentManager;
|
||||
|
||||
@ApiModelProperty("截止时间")
|
||||
private Date deadline;
|
||||
private String deadline;
|
||||
|
||||
@ApiModelProperty("通过原因")
|
||||
private String passReason;
|
||||
@@ -65,11 +69,43 @@ public class PartnerLineInfoVO {
|
||||
private String partnerUserPhone;
|
||||
|
||||
@ApiModelProperty("结束操作人ID")
|
||||
private String closeUserId ;
|
||||
private String closeUserId ;
|
||||
|
||||
@ApiModelProperty("结束操作人名称")
|
||||
private String closeUserName ;
|
||||
private String closeUserName ;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
private Date closeDate ;
|
||||
private String closeDate ;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param lineList
|
||||
* @return
|
||||
*/
|
||||
public static List<PartnerLineInfoVO> convertList(List<HyPartnerLineInfoDO> lineList, Map<String, String> userNamePhoneMap){
|
||||
List<PartnerLineInfoVO> resultList = new ArrayList<>();
|
||||
for (HyPartnerLineInfoDO line : lineList) {
|
||||
PartnerLineInfoVO result = new PartnerLineInfoVO();
|
||||
result.setLineId(line.getId());
|
||||
result.setPartnerId(line.getPartnerId());
|
||||
result.setCertifyFile(line.getCertifyFile());
|
||||
result.setWorkflowStage(line.getWorkflowStage());
|
||||
result.setWorkflowStatus(line.getWorkflowStatus());
|
||||
result.setLineStatus(line.getLineStatus());
|
||||
String deadLine = DateUtil.format(line.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC);
|
||||
result.setDeadline(deadLine);
|
||||
result.setPassReason(line.getPassReason());
|
||||
result.setRejectPublicReason(line.getRejectPublicReason());
|
||||
result.setRejectRealReason(line.getRejectRealReason());
|
||||
result.setCertifyFile(line.getCertifyFile());
|
||||
result.setCloseUserId(line.getCloseUserId());
|
||||
result.setCloseUserName(userNamePhoneMap.get(line.getCloseUserId()));
|
||||
String closeDate = DateUtil.format(line.getCloseTime(), CoolDateUtils.DATE_FORMAT_SEC_7);
|
||||
result.setCloseDate(closeDate);
|
||||
resultList.add(result);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class PrivateSeaLineListVo {
|
||||
private String recommendPartnerName;
|
||||
|
||||
|
||||
public static List<PrivateSeaLineListVo> convertList(List<PrivateSeaLineDTO> list, Map<String, String> finalDevManagerMap, Map<Long, String> wantShopAreaNameMap){
|
||||
public static List<PrivateSeaLineListVo> convertList(List<PrivateSeaLineDTO> list, Map<String, String> finalDevManagerMap, Map<String, String> wantShopAreaNameMap){
|
||||
List<PrivateSeaLineListVo> resultList = new ArrayList<>();
|
||||
for (PrivateSeaLineDTO x : list) {
|
||||
PrivateSeaLineListVo privateSeaLineListVo = new PrivateSeaLineListVo();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class CustomExceptionHandler {
|
||||
@ExceptionHandler(value = ServiceException.class)
|
||||
public void handleCustomException(ServiceException e, HttpServletResponse httpServletResponse) {
|
||||
log.error(e.getMessage(), e);
|
||||
ResponseResult responseResult = new ResponseResult(e.getErrorCode(), e.getMessage());
|
||||
ResponseResult responseResult = new ResponseResult(e.getErrorCode(), e.getErrorMessage());
|
||||
responseResult(httpServletResponse, responseResult);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ public class CustomExceptionHandler {
|
||||
responseResult(httpServletResponse, responseResult);
|
||||
}
|
||||
|
||||
|
||||
private void responseResult(HttpServletResponse response, ResponseResult result) {
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setHeader("Content-type", "application/json;charset=UTF-8");
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.dto.partner.PrivateSeaLineDTO;
|
||||
import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||
import com.cool.store.entity.HyPartnerIntentInfoDO;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
@@ -78,17 +79,10 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
List<String> partnerIds = list.stream().map(PartnerIntentApplyInfoDTO::getPartnerId).collect(Collectors.toList());
|
||||
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIds);
|
||||
Map<String, HyPartnerUserInfoDO> infoDOMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, data -> data));
|
||||
List<PartnerIntentApplyInfoVO> result = new ArrayList<>();
|
||||
String finalWorkflowStatus = workflowStatus;
|
||||
list.stream().forEach(x->{
|
||||
PartnerIntentApplyInfoVO pat = partnerIntentApplyInfoDTOToVo(x);
|
||||
HyPartnerUserInfoDO infoDOMapOrDefault = infoDOMap.getOrDefault(x.getPartnerId(), new HyPartnerUserInfoDO());
|
||||
pat.setPartnerUserName(infoDOMapOrDefault.getUsername());
|
||||
pat.setPartnerUserPhone(infoDOMapOrDefault.getMobile());
|
||||
pat.setWorkflowStatus(finalWorkflowStatus);
|
||||
result.add(pat);
|
||||
});
|
||||
partnerIntentApplyInfo.setList(result);
|
||||
List<Long> wantShopAreaList = list.stream().map(PartnerIntentApplyInfoDTO::getWantShopArea).map(Long::parseLong).distinct().collect(Collectors.toList());
|
||||
Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList);
|
||||
List<PartnerIntentApplyInfoVO> resultList = PartnerIntentApplyInfoVO.convertList(list, infoDOMap, wantShopAreaNameMap, workflowStatus);
|
||||
partnerIntentApplyInfo.setList(resultList);
|
||||
return partnerIntentApplyInfo;
|
||||
}
|
||||
|
||||
@@ -179,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());
|
||||
@@ -193,23 +187,6 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
intentInfoDO.setWeakness(request.getWeakness());
|
||||
}
|
||||
|
||||
/**
|
||||
* partnerIntentApplyInfoDTOToVo
|
||||
* @param partnerIntentApplyInfoDTO
|
||||
* @return
|
||||
*/
|
||||
private PartnerIntentApplyInfoVO partnerIntentApplyInfoDTOToVo(PartnerIntentApplyInfoDTO partnerIntentApplyInfoDTO){
|
||||
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO();
|
||||
partnerIntentApplyInfoVO.setId(partnerIntentApplyInfoDTO.getId());
|
||||
partnerIntentApplyInfoVO.setPartnerId(partnerIntentApplyInfoDTO.getPartnerId());
|
||||
partnerIntentApplyInfoVO.setLineId(partnerIntentApplyInfoDTO.getPartnerLineId());
|
||||
partnerIntentApplyInfoVO.setPartnerSubmitTime(partnerIntentApplyInfoDTO.getPartnerSubmitTime());
|
||||
partnerIntentApplyInfoVO.setAcceptAdjustType(partnerIntentApplyInfoDTO.getAcceptAdjustType());
|
||||
partnerIntentApplyInfoVO.setLiveArea(partnerIntentApplyInfoDTO.getLiveArea());
|
||||
partnerIntentApplyInfoVO.setWantShopArea(partnerIntentApplyInfoDTO.getWantShopArea());
|
||||
partnerIntentApplyInfoVO.setDeadline(partnerIntentApplyInfoDTO.getDeadline());
|
||||
return partnerIntentApplyInfoVO;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -103,22 +103,11 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
PageHelper.startPage(pageNumber,pageSize);
|
||||
String lastMonthTodayDate = DateUtil.format(CoolDateUtils.getDateBefore(new Date(),-30), CoolDateUtils.DATE_FORMAT_SEC);
|
||||
PageInfo hyPartnerLineInfoDOPageInfo = new PageInfo(hyPartnerLineInfoDAO.lastMonthCloseLine(userId, lastMonthTodayDate));
|
||||
|
||||
List<HyPartnerLineInfoDO> list = hyPartnerLineInfoDOPageInfo.getList();
|
||||
List<String> partnerIdList = list.stream().map(HyPartnerLineInfoDO::getPartnerId).collect(Collectors.toList());
|
||||
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIdList);
|
||||
Map<String, HyPartnerUserInfoDO> stringMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, data->data));
|
||||
List<PartnerLineInfoVO> result = new ArrayList<>();
|
||||
list.stream().forEach(x->{
|
||||
PartnerLineInfoVO partnerLineInfoVO = new PartnerLineInfoVO();
|
||||
BeanUtils.copyProperties(x,partnerLineInfoVO);
|
||||
partnerLineInfoVO.setPartnerId(x.getPartnerId());
|
||||
partnerLineInfoVO.setPartnerUserName(stringMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getUsername());
|
||||
partnerLineInfoVO.setPartnerUserPhone(stringMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getMobile());
|
||||
partnerLineInfoVO.setLineId(x.getId());
|
||||
result.add(partnerLineInfoVO);
|
||||
});
|
||||
hyPartnerLineInfoDOPageInfo.setList(result);
|
||||
List<String> closeUserIds = list.stream().filter(o -> Objects.nonNull(o.getCloseUserId())).map(HyPartnerLineInfoDO::getCloseUserId).distinct().collect(Collectors.toList());
|
||||
Map<String, String> userNamePhoneMap = enterpriseUserDAO.getUserNameAndMobile(closeUserIds);
|
||||
List<PartnerLineInfoVO> resultList = PartnerLineInfoVO.convertList(list, userNamePhoneMap);
|
||||
hyPartnerLineInfoDOPageInfo.setList(resultList);
|
||||
return hyPartnerLineInfoDOPageInfo;
|
||||
}
|
||||
|
||||
@@ -169,8 +158,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
PageInfo blackListDTOPageInfo = new PageInfo(hyPartnerLineInfoDAO.getBlackList(LineRequest.getUserNameKeyword(), LineRequest.getPhoneKeyword(),LineRequest.getIntentArea(), LineRequest.getAcceptAdjustType()));
|
||||
List<PartnerBlackListDTO> list = blackListDTOPageInfo.getList();
|
||||
List<String> closeUserIdList = list.stream().map(PartnerBlackListDTO::getCloseUserId).collect(Collectors.toList());
|
||||
List<EnterpriseUserDO> userInfoByUserIds = enterpriseUserDAO.getUserInfoByUserIds(closeUserIdList);
|
||||
Map<String, String> userPhoneMap = userInfoByUserIds.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getMobile));
|
||||
Map<String, String> userPhoneMap = enterpriseUserDAO.getUserNameAndMobile(closeUserIdList);
|
||||
List<BlackListVO> result = new ArrayList<>();
|
||||
list.stream().forEach(x->{
|
||||
BlackListVO blackListVO = convertPartnerBlackListDTOToVo(x);
|
||||
@@ -345,7 +333,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
devManagerMap = devManagerList.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getName));
|
||||
}
|
||||
List<Long> wantShopAreaList = list.stream().map(PrivateSeaLineDTO::getWantShopArea).map(Long::parseLong).distinct().collect(Collectors.toList());
|
||||
Map<Long, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList);
|
||||
Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList);
|
||||
List<PrivateSeaLineListVo> result = PrivateSeaLineListVo.convertList(list, devManagerMap, wantShopAreaNameMap);
|
||||
privateLineList.setList(result);
|
||||
return privateLineList;
|
||||
@@ -384,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