Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner

This commit is contained in:
pserimal
2023-06-21 15:33:13 +08:00
18 changed files with 170 additions and 79 deletions

View File

@@ -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_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_5 = "yyyy.MM.dd HH:mm";
public static final String DATE_FORMAT_SEC_6 = "yyyy.MM.dd"; 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 * @param d

View File

@@ -10,6 +10,8 @@ import org.springframework.stereotype.Repository;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @author zhangchenbiao * @author zhangchenbiao
@@ -98,4 +100,9 @@ public class EnterpriseUserDAO {
} }
return enterpriseUserMapper.getUserListByRegionIds(regionIds); 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()));
}
} }

View File

@@ -89,12 +89,12 @@ public class HyOpenAreaInfoDAO {
return hyOpenAreaInfoMapper.selectByIds(ids); return hyOpenAreaInfoMapper.selectByIds(ids);
} }
public Map<Long, String> selectNameMapByIds(List<Long> ids){ public Map<String, String> selectNameMapByIds(List<Long> ids){
if (CollectionUtils.isEmpty(ids)){ if (CollectionUtils.isEmpty(ids)){
return Maps.newHashMap(); return Maps.newHashMap();
} }
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOS = hyOpenAreaInfoMapper.selectByIds(ids); 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()));
} }

View File

@@ -34,6 +34,11 @@ public class HyPartnerBaseInfoDAO {
return hyPartnerBaseInfoMapper.updateByPrimaryKeySelective(record); return hyPartnerBaseInfoMapper.updateByPrimaryKeySelective(record);
} }
public int updateByPrimaryKey(HyPartnerBaseInfoDO record){
return hyPartnerBaseInfoMapper.updateByPrimaryKey(record);
}
public int updateByPartnerId(String userName,String mobile,String partnerId){ public int updateByPartnerId(String userName,String mobile,String partnerId){
return hyPartnerBaseInfoMapper.updateByPartnerId(userName,mobile,partnerId); return hyPartnerBaseInfoMapper.updateByPartnerId(userName,mobile,partnerId);
} }
@@ -57,10 +62,10 @@ public class HyPartnerBaseInfoDAO {
return hyPartnerBaseInfoMapper.getByPartnerLineId(partnerLineId); return hyPartnerBaseInfoMapper.getByPartnerLineId(partnerLineId);
} }
public Long getLineIdByIdCard(String idCard){ public HyPartnerBaseInfoDO getByIdCard(String idCard){
if (StringUtils.isEmpty(idCard)){ if (StringUtils.isEmpty(idCard)){
return null; return null;
} }
return hyPartnerBaseInfoMapper.getLineIdByIdCard(idCard); return hyPartnerBaseInfoMapper.getByIdCard(idCard);
} }
} }

View File

@@ -23,6 +23,9 @@ public interface HyPartnerBaseInfoMapper {
*/ */
int updateByPrimaryKeySelective(@Param("record") HyPartnerBaseInfoDO record); int updateByPrimaryKeySelective(@Param("record") HyPartnerBaseInfoDO record);
int updateByPrimaryKey(@Param("record") HyPartnerBaseInfoDO record);
/** /**
* 根据加盟商ID修改用户名称与手机号 * 根据加盟商ID修改用户名称与手机号
* @param userName * @param userName
@@ -38,7 +41,7 @@ public interface HyPartnerBaseInfoMapper {
HyPartnerBaseInfoDO getByPartnerLineId(@Param("partnerLineId") Long partnerLineId); HyPartnerBaseInfoDO getByPartnerLineId(@Param("partnerLineId") Long partnerLineId);
Long getLineIdByIdCard(@Param("idCard") String idCard); HyPartnerBaseInfoDO getByIdCard(@Param("idCard") String idCard);
int cleanIdCardInfoByPartnerLineId(@Param("idCard") String idCard, int cleanIdCardInfoByPartnerLineId(@Param("idCard") String idCard,
@Param("idCardPhotoFront") String idCardPhotoFront, @Param("idCardPhotoFront") String idCardPhotoFront,

View File

@@ -203,6 +203,18 @@
where id = #{record.id} where id = #{record.id}
</update> </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 id="updateByPartnerId">
update hy_partner_base_info update hy_partner_base_info
@@ -231,9 +243,9 @@
where partner_line_id = #{partnerLineId} where partner_line_id = #{partnerLineId}
</select> </select>
<select id="getLineIdByIdCard" resultType="java.lang.Long"> <select id="getByIdCard" resultMap="BaseResultMap">
select select
partner_line_id <include refid="Base_Column_List"></include>
from hy_partner_base_info from hy_partner_base_info
where id_card = #{idCard} where id_card = #{idCard}
</select> </select>

View File

@@ -323,7 +323,7 @@
<include refid="Base_Column_List"></include> <include refid="Base_Column_List"></include>
from hy_partner_line_info from hy_partner_line_info
<where> <where>
<if test="userId"> <if test="userId != null">
and investment_manager = #{userId} and investment_manager = #{userId}
</if> </if>
<if test="lastMonthTodayDate!=null"> <if test="lastMonthTodayDate!=null">

View File

@@ -1,10 +1,19 @@
package com.cool.store.vo; 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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
@@ -16,7 +25,6 @@ import java.util.Date;
@ApiModel @ApiModel
public class PartnerIntentApplyInfoVO { public class PartnerIntentApplyInfoVO {
@ApiModelProperty("") @ApiModelProperty("")
private Long id; private Long id;
@@ -45,7 +53,7 @@ public class PartnerIntentApplyInfoVO {
private Integer acceptAdjustType; private Integer acceptAdjustType;
@ApiModelProperty("截止时间") @ApiModelProperty("截止时间")
private Date deadline; private String deadline;
@ApiModelProperty("阶段提交时间") @ApiModelProperty("阶段提交时间")
private Date partnerSubmitTime; private Date partnerSubmitTime;
@@ -53,4 +61,31 @@ public class PartnerIntentApplyInfoVO {
@ApiModelProperty("阶段状态") @ApiModelProperty("阶段状态")
private String WorkflowStatus; 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;
}
} }

View File

@@ -1,11 +1,15 @@
package com.cool.store.vo; 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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/** /**
* @Author suzhuhong * @Author suzhuhong
@@ -41,7 +45,7 @@ public class PartnerLineInfoVO {
private String developmentManager; private String developmentManager;
@ApiModelProperty("截止时间") @ApiModelProperty("截止时间")
private Date deadline; private String deadline;
@ApiModelProperty("通过原因") @ApiModelProperty("通过原因")
private String passReason; private String passReason;
@@ -65,11 +69,43 @@ public class PartnerLineInfoVO {
private String partnerUserPhone; private String partnerUserPhone;
@ApiModelProperty("结束操作人ID") @ApiModelProperty("结束操作人ID")
private String closeUserId ; private String closeUserId ;
@ApiModelProperty("结束操作人名称") @ApiModelProperty("结束操作人名称")
private String closeUserName ; private String closeUserName ;
@ApiModelProperty("结束时间") @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;
}
} }

View File

@@ -84,7 +84,7 @@ public class PrivateSeaLineListVo {
private String recommendPartnerName; 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<>(); List<PrivateSeaLineListVo> resultList = new ArrayList<>();
for (PrivateSeaLineDTO x : list) { for (PrivateSeaLineDTO x : list) {
PrivateSeaLineListVo privateSeaLineListVo = new PrivateSeaLineListVo(); PrivateSeaLineListVo privateSeaLineListVo = new PrivateSeaLineListVo();

View File

@@ -34,7 +34,7 @@ public class CustomExceptionHandler {
@ExceptionHandler(value = ServiceException.class) @ExceptionHandler(value = ServiceException.class)
public void handleCustomException(ServiceException e, HttpServletResponse httpServletResponse) { public void handleCustomException(ServiceException e, HttpServletResponse httpServletResponse) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
ResponseResult responseResult = new ResponseResult(e.getErrorCode(), e.getMessage()); ResponseResult responseResult = new ResponseResult(e.getErrorCode(), e.getErrorMessage());
responseResult(httpServletResponse, responseResult); responseResult(httpServletResponse, responseResult);
} }
@@ -52,7 +52,6 @@ public class CustomExceptionHandler {
responseResult(httpServletResponse, responseResult); responseResult(httpServletResponse, responseResult);
} }
private void responseResult(HttpServletResponse response, ResponseResult result) { private void responseResult(HttpServletResponse response, ResponseResult result) {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("Content-type", "application/json;charset=UTF-8"); response.setHeader("Content-type", "application/json;charset=UTF-8");

View File

@@ -1,5 +1,6 @@
package com.cool.store.service; package com.cool.store.service;
import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.request.AddTagsRequest; import com.cool.store.request.AddTagsRequest;
import com.cool.store.request.PartnerBaseInfoRequest; import com.cool.store.request.PartnerBaseInfoRequest;
import com.cool.store.vo.PartnerBaseInfoVO; import com.cool.store.vo.PartnerBaseInfoVO;
@@ -26,7 +27,7 @@ public interface HyPartnerBaseInfoService {
PartnerBaseInfoVO getByPartnerLineId(Long lineId); PartnerBaseInfoVO getByPartnerLineId(Long lineId);
Long getLineIdByIdCard(String idCard); HyPartnerBaseInfoDO getByIdCard(String idCard);
Boolean changeBinding(String idCard, Long lineId, PartnerUserInfoVO currentUser); Boolean changeBinding(String idCard, Long lineId, PartnerUserInfoVO currentUser);

View File

@@ -128,7 +128,7 @@ public interface HyPartnerLineInfoService {
* @param lineId * @param lineId
* @return * @return
*/ */
Boolean assignFollowUser(String partnerId); Boolean assignFollowUser(String partnerId, String wantShopArea, Integer acceptAdjustType);
/** /**
* 线索状态 * 线索状态

View File

@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.Date;
/** /**
* @Author suzhuhong * @Author suzhuhong
@@ -120,15 +121,15 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
} }
@Override @Override
public Long getLineIdByIdCard(String idCard) { public HyPartnerBaseInfoDO getByIdCard(String idCard) {
return hyPartnerBaseInfoDAO.getLineIdByIdCard(idCard); return hyPartnerBaseInfoDAO.getByIdCard(idCard);
} }
@Override @Override
public Boolean changeBinding(String idCard, Long lineId, PartnerUserInfoVO currentUser) { public Boolean changeBinding(String idCard, Long lineId, PartnerUserInfoVO currentUser) {
// 把旧线索的身份证号置空,状态改为待提交 // 把旧线索的身份证号置空,状态改为待提交
Long oldLineId = hyPartnerBaseInfoDAO.getLineIdByIdCard(idCard); HyPartnerBaseInfoDO oldBaseInfo = hyPartnerBaseInfoDAO.getByIdCard(idCard);
HyPartnerLineInfoDO oldLineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(oldLineId); HyPartnerLineInfoDO oldLineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(oldBaseInfo.getPartnerLineId());
// 该身份证当前申请状态同步至该账号下,原账号变为【加盟意向申请 待提交状态】 // 该身份证当前申请状态同步至该账号下,原账号变为【加盟意向申请 待提交状态】
HyPartnerLineInfoDO newLineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(lineId); HyPartnerLineInfoDO newLineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(lineId);
newLineInfo.setWorkflowStage(oldLineInfo.getWorkflowStage()); newLineInfo.setWorkflowStage(oldLineInfo.getWorkflowStage());
@@ -139,11 +140,32 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
oldLineInfo.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode()); oldLineInfo.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
oldLineInfo.setLineStatus(LineStatusEnum.PUBLIC_SEAS.getCode()); oldLineInfo.setLineStatus(LineStatusEnum.PUBLIC_SEAS.getCode());
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(oldLineInfo); 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; 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) { private void fillBaseInfo(HyPartnerBaseInfoDO baseInfoDO, PartnerBaseInfoRequest request) {
baseInfoDO.setPartnerId(request.getPartnerId()); baseInfoDO.setPartnerId(request.getPartnerId());
baseInfoDO.setPartnerLineId(request.getPartnerLineId()); baseInfoDO.setPartnerLineId(request.getPartnerLineId());

View File

@@ -6,6 +6,7 @@ import com.cool.store.constants.CommonConstants;
import com.cool.store.constants.RedisConstant; import com.cool.store.constants.RedisConstant;
import com.cool.store.dao.*; import com.cool.store.dao.*;
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO; 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.HyOpenAreaInfoDO;
import com.cool.store.entity.HyPartnerIntentInfoDO; import com.cool.store.entity.HyPartnerIntentInfoDO;
import com.cool.store.entity.HyPartnerUserInfoDO; 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<String> partnerIds = list.stream().map(PartnerIntentApplyInfoDTO::getPartnerId).collect(Collectors.toList());
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIds); List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIds);
Map<String, HyPartnerUserInfoDO> infoDOMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, data -> data)); Map<String, HyPartnerUserInfoDO> infoDOMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, data -> data));
List<PartnerIntentApplyInfoVO> result = new ArrayList<>(); List<Long> wantShopAreaList = list.stream().map(PartnerIntentApplyInfoDTO::getWantShopArea).map(Long::parseLong).distinct().collect(Collectors.toList());
String finalWorkflowStatus = workflowStatus; Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList);
list.stream().forEach(x->{ List<PartnerIntentApplyInfoVO> resultList = PartnerIntentApplyInfoVO.convertList(list, infoDOMap, wantShopAreaNameMap, workflowStatus);
PartnerIntentApplyInfoVO pat = partnerIntentApplyInfoDTOToVo(x); partnerIntentApplyInfo.setList(resultList);
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);
return partnerIntentApplyInfo; return partnerIntentApplyInfo;
} }
@@ -179,7 +173,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
intentInfoDO.setMaxBudget(request.getMaxBudget()); intentInfoDO.setMaxBudget(request.getMaxBudget());
intentInfoDO.setMoneySource(request.getMoneySource()); intentInfoDO.setMoneySource(request.getMoneySource());
if(CollectionUtils.isNotEmpty(request.getMoneyProve())){ if(CollectionUtils.isNotEmpty(request.getMoneyProve())){
intentInfoDO.setMoneyProve(String.join(",", request.getMoneyProve())); intentInfoDO.setMoneyProve(JSONObject.toJSONString(request.getMoneyProve()));
} }
intentInfoDO.setEducation(request.getEducation()); intentInfoDO.setEducation(request.getEducation());
intentInfoDO.setWorkYear(request.getWorkYear()); intentInfoDO.setWorkYear(request.getWorkYear());
@@ -193,23 +187,6 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
intentInfoDO.setWeakness(request.getWeakness()); 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;
}
/** /**

View File

@@ -103,22 +103,11 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
PageHelper.startPage(pageNumber,pageSize); PageHelper.startPage(pageNumber,pageSize);
String lastMonthTodayDate = DateUtil.format(CoolDateUtils.getDateBefore(new Date(),-30), CoolDateUtils.DATE_FORMAT_SEC); String lastMonthTodayDate = DateUtil.format(CoolDateUtils.getDateBefore(new Date(),-30), CoolDateUtils.DATE_FORMAT_SEC);
PageInfo hyPartnerLineInfoDOPageInfo = new PageInfo(hyPartnerLineInfoDAO.lastMonthCloseLine(userId, lastMonthTodayDate)); PageInfo hyPartnerLineInfoDOPageInfo = new PageInfo(hyPartnerLineInfoDAO.lastMonthCloseLine(userId, lastMonthTodayDate));
List<HyPartnerLineInfoDO> list = hyPartnerLineInfoDOPageInfo.getList(); List<HyPartnerLineInfoDO> list = hyPartnerLineInfoDOPageInfo.getList();
List<String> partnerIdList = list.stream().map(HyPartnerLineInfoDO::getPartnerId).collect(Collectors.toList()); List<String> closeUserIds = list.stream().filter(o -> Objects.nonNull(o.getCloseUserId())).map(HyPartnerLineInfoDO::getCloseUserId).distinct().collect(Collectors.toList());
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIdList); Map<String, String> userNamePhoneMap = enterpriseUserDAO.getUserNameAndMobile(closeUserIds);
Map<String, HyPartnerUserInfoDO> stringMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, data->data)); List<PartnerLineInfoVO> resultList = PartnerLineInfoVO.convertList(list, userNamePhoneMap);
List<PartnerLineInfoVO> result = new ArrayList<>(); hyPartnerLineInfoDOPageInfo.setList(resultList);
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);
return hyPartnerLineInfoDOPageInfo; 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())); PageInfo blackListDTOPageInfo = new PageInfo(hyPartnerLineInfoDAO.getBlackList(LineRequest.getUserNameKeyword(), LineRequest.getPhoneKeyword(),LineRequest.getIntentArea(), LineRequest.getAcceptAdjustType()));
List<PartnerBlackListDTO> list = blackListDTOPageInfo.getList(); List<PartnerBlackListDTO> list = blackListDTOPageInfo.getList();
List<String> closeUserIdList = list.stream().map(PartnerBlackListDTO::getCloseUserId).collect(Collectors.toList()); List<String> closeUserIdList = list.stream().map(PartnerBlackListDTO::getCloseUserId).collect(Collectors.toList());
List<EnterpriseUserDO> userInfoByUserIds = enterpriseUserDAO.getUserInfoByUserIds(closeUserIdList); Map<String, String> userPhoneMap = enterpriseUserDAO.getUserNameAndMobile(closeUserIdList);
Map<String, String> userPhoneMap = userInfoByUserIds.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getMobile));
List<BlackListVO> result = new ArrayList<>(); List<BlackListVO> result = new ArrayList<>();
list.stream().forEach(x->{ list.stream().forEach(x->{
BlackListVO blackListVO = convertPartnerBlackListDTOToVo(x); BlackListVO blackListVO = convertPartnerBlackListDTOToVo(x);
@@ -345,7 +333,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
devManagerMap = devManagerList.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getName)); 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()); 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); List<PrivateSeaLineListVo> result = PrivateSeaLineListVo.convertList(list, devManagerMap, wantShopAreaNameMap);
privateLineList.setList(result); privateLineList.setList(result);
return privateLineList; return privateLineList;
@@ -384,10 +372,14 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
} }
@Override @Override
public Boolean assignFollowUser(String partnerId) { public Boolean assignFollowUser(String partnerId, String wantShopArea, Integer acceptAdjustType) {
List<HyPartnerLineInfoDO> lineFollowHistoryList = hyPartnerLineInfoDAO.getLineFollowHistoryList(partnerId); List<HyPartnerLineInfoDO> lineFollowHistoryList = hyPartnerLineInfoDAO.getLineFollowHistoryList(partnerId);
//当前加盟商线索 //当前加盟商线索
HyPartnerLineInfoDO HyPartnerLineInfo = hyPartnerLineInfoDAO.getByPartnerId(partnerId); HyPartnerLineInfoDO HyPartnerLineInfo = hyPartnerLineInfoDAO.getByPartnerId(partnerId);
if(HyPartnerLineInfo == null){
Boolean lineStatus = getLineStatus(Long.valueOf(wantShopArea), acceptAdjustType);
return lineStatus;
}
//如果是私海线索 不需要重新分配招商经理 或者跟进次数大于1 //如果是私海线索 不需要重新分配招商经理 或者跟进次数大于1
if (HyPartnerLineInfo.getLineStatus()==1||CollectionUtils.isEmpty(lineFollowHistoryList)){ if (HyPartnerLineInfo.getLineStatus()==1||CollectionUtils.isEmpty(lineFollowHistoryList)){
return Boolean.FALSE; return Boolean.FALSE;

View File

@@ -107,7 +107,7 @@ public class PartnerUserInfoServiceImpl implements PartnerUserInfoService {
hyPartnerLineInfoDO.setPartnerId(hyPartnerUserInfoDO.getPartnerId()); hyPartnerLineInfoDO.setPartnerId(hyPartnerUserInfoDO.getPartnerId());
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode()); hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.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()); hyPartnerLineInfoDO.setLineStatus(flag ? LineStatusEnum.PRIVATE_SEAS.getCode() : LineStatusEnum.PUBLIC_SEAS.getCode());
if (flag){ if (flag){
hyPartnerLineInfoDO.setInvestmentManager("ou_7a6a19ae800afde783b0ec2dabaabf95"); hyPartnerLineInfoDO.setInvestmentManager("ou_7a6a19ae800afde783b0ec2dabaabf95");

View File

@@ -2,6 +2,7 @@ package com.cool.store.controller;
import com.cool.store.constants.RedisConstant; import com.cool.store.constants.RedisConstant;
import com.cool.store.context.PartnerUserHolder; import com.cool.store.context.PartnerUserHolder;
import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.enums.ErrorCodeEnum; import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.IDCardSideEnum; import com.cool.store.enums.IDCardSideEnum;
import com.cool.store.enums.WorkflowStatusEnum; import com.cool.store.enums.WorkflowStatusEnum;
@@ -70,10 +71,10 @@ public class PartnerController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "idCard", value = "身份证号码", required = false), @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); HyPartnerBaseInfoDO baseInfoDO = hyPartnerBaseInfoService.getByIdCard(idCard);
return ResponseResult.success(lineId != null && lineId > 0L); return ResponseResult.success(baseInfoDO != null && baseInfoDO.getPartnerLineId() > 0L);
} }
@@ -136,7 +137,7 @@ public class PartnerController {
@PostMapping(path = "/delCoolDownFirstLoginFlag") @PostMapping(path = "/delCoolDownFirstLoginFlag")
@ApiOperation("删除冷静期是否首次登录缓存") @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); String coolingPeriodFirstLoginCacheKey = MessageFormat.format(RedisConstant.COOLINGPERIOD_FIRSTLOGIN_KEY, lineId);
redisUtilPool.delKey(coolingPeriodFirstLoginCacheKey); redisUtilPool.delKey(coolingPeriodFirstLoginCacheKey);
return ResponseResult.success(true); return ResponseResult.success(true);