1.3期 列表+全量私海
This commit is contained in:
@@ -5,6 +5,7 @@ import com.cool.store.entity.HyPartnerIntentInfoDO;
|
||||
import com.cool.store.mapper.HyPartnerIntentInfoMapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -40,11 +41,12 @@ public class HyPartnerIntentInfoDAO {
|
||||
}
|
||||
|
||||
|
||||
public List<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(String userId, String workflowStage, String workflowStatus){
|
||||
public List<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(String userId, String workflowStage, String workflowStatus, String keyword, Integer callStatus,
|
||||
List<String> userPortraitIdList, String lastFollowStartTime, String lastFollowEndTime, String userChannelIdList){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return hyPartnerIntentInfoMapper.selectPartnerIntentApplyInfoList(userId,workflowStage,workflowStatus);
|
||||
return hyPartnerIntentInfoMapper.selectPartnerIntentApplyInfoList(userId,workflowStage,workflowStatus,keyword,callStatus,userPortraitIdList,lastFollowStartTime,lastFollowEndTime,userChannelIdList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,8 +38,14 @@ public interface HyPartnerIntentInfoMapper {
|
||||
* @return
|
||||
*/
|
||||
List<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(@Param("userId") String userId,
|
||||
@Param("workflowStage") String workflowStage ,
|
||||
@Param("workflowStatus") String workflowStatus);
|
||||
@Param("workflowStage") String workflowStage ,
|
||||
@Param("workflowStatus") String workflowStatus,
|
||||
@Param("keyword") String keyword,
|
||||
@Param("callStatus") Integer callStatus,
|
||||
@Param("userPortraitIdList") List<String> userPortraitIdList,
|
||||
@Param("lastFollowStartTime") String lastFollowStartTime,
|
||||
@Param("lastFollowEndTime") String lastFollowEndTime,
|
||||
@Param("userChannelIdList") String userChannelIdList);
|
||||
|
||||
/**
|
||||
* 根据线索ID查询数据
|
||||
|
||||
@@ -33,4 +33,6 @@ public interface HyPartnerLabelMapper {
|
||||
* @param labelGroupId 标签组 id
|
||||
*/
|
||||
Boolean whetherGroupInUse(@Param("labelGroupId") Long labelGroupId);
|
||||
|
||||
List<HyPartnerLabelDO> getLabelListByIds(@Param("labelIds") List<Long> labelIds);
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import com.cool.store.entity.HyPartnerUserChannelDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface HyPartnerUserChannelMapper {
|
||||
@@ -22,4 +24,8 @@ public interface HyPartnerUserChannelMapper {
|
||||
HyPartnerUserChannelDO selectByChannelId(@Param("channelId") Long id);
|
||||
|
||||
HyPartnerUserChannelDO selectByChannelName(@Param("channelName") String channelName);
|
||||
|
||||
List<HyPartnerUserChannelDO> getAllUserChannel();
|
||||
|
||||
List<HyPartnerUserChannelDO> getUserChannelByIds(List<Integer> userChannelIds);
|
||||
}
|
||||
@@ -261,13 +261,47 @@
|
||||
b.id as id,
|
||||
b.create_time as partnerSubmitTime,
|
||||
b.deadline as deadline,
|
||||
bi.user_portrait as userPortrait,
|
||||
hpuinfo.mobile as mobile,
|
||||
hpuinfo.username as partnerUserName,
|
||||
hpuinfo.user_channel_id as userChannelId,
|
||||
hpuinfo.live_area as liveArea,
|
||||
hpuinfo.want_shop_area as wantShopArea,
|
||||
hpuinfo.accept_adjust_type as acceptAdjustType
|
||||
hpuinfo.accept_adjust_type as acceptAdjustType,
|
||||
cr.create_time as lastFollowTime,
|
||||
cr.call_status as callStatus
|
||||
from hy_partner_line_info a
|
||||
left join hy_partner_intent_info b on a.id = b.partner_line_id
|
||||
left join hy_partner_base_info bi on a.id = bi.partner_line_id
|
||||
LEFT JOIN hy_partner_user_info hpuinfo ON a.partner_id = hpuinfo.partner_id
|
||||
LEFT join call_record cr on a.id = cr.partner_line_id
|
||||
where deleted = 0 and line_status!=3
|
||||
and (cr.id in (
|
||||
select max(id) maxId
|
||||
from call_record group by partner_line_id) or cr.id is null)
|
||||
<if test="keyword!=null and keyword!=''">
|
||||
and (hpuinfo.mobile like concat('%',#{keyword},'%') or hpuinfo.username like concat('%',#{keyword},'%'))
|
||||
</if>
|
||||
<if test="callStatus!=null and callStatus==1">
|
||||
and cr.call_status = #{callStatus}
|
||||
</if>
|
||||
<if test="callStatus!=null and callStatus==0">
|
||||
and cr.call_status != 1
|
||||
</if>
|
||||
<if test="lastFollowStartTime!=null and lastFollowEndTime!=null">
|
||||
and cr.create_time>#{lastFollowStartTime} and cr.create_time <![CDATA[<]]> #{lastFollowEndTime}
|
||||
</if>
|
||||
<if test="userChannelIdList!=null and userChannelIdList.size>0">
|
||||
<foreach collection="userChannelIdList" open="and hpuinfo.user_channel_id in (" close=")" separator="," item="userChannelId">
|
||||
#{userChannelId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userPortraitIdList!=null and userPortraitIdList.size>0">
|
||||
and
|
||||
<foreach collection="userPortraitIdList" separator="or" open="(" close=")" item="userPortraitId">
|
||||
bi.user_portrait like concat("%,", #{userPortraitId}, ",%")
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and a.investment_manager = #{userId}
|
||||
</if>
|
||||
|
||||
@@ -302,6 +302,9 @@
|
||||
hpli.partner_id as partnerId,
|
||||
hpli.deadline as deadline,
|
||||
hpli.workflow_status as status,
|
||||
cr.create_time as lastFollowTime,
|
||||
cr.call_status as callStatus,
|
||||
bi.user_portrait as userPortrait,
|
||||
a.id as interviewId,
|
||||
a.auth_code as authCode,
|
||||
a.approve_time as approveTime,
|
||||
@@ -315,24 +318,26 @@
|
||||
hpci.intention_contract_no as intentionContractNo
|
||||
from hy_partner_line_info hpli
|
||||
left join hy_partner_interview a on hpli.id = a.partner_line_id
|
||||
left join hy_partner_base_info bi on hpli.id = bi.partner_line_id
|
||||
left join hy_partner_interview_plan b on a.interview_plan_id = b.id
|
||||
left join hy_partner_certification_info hpci on hpci.partner_interview_id = a.id
|
||||
<where>
|
||||
and hpli.deleted = 0 and hpli.line_status!=3
|
||||
<if test="filter">
|
||||
and b.deleted = 0
|
||||
</if>
|
||||
<if test="workflowStage!=null and workflowStage!=''">
|
||||
and hpli.workflow_stage = #{workflowStage}
|
||||
</if>
|
||||
<if test="workflowStatus!=null and workflowStatus!=''">
|
||||
and hpli.workflow_status = #{workflowStatus}
|
||||
</if>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and hpli.investment_manager = #{userId}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
LEFT join call_record cr on hpli.id = cr.partner_line_id
|
||||
where hpli.deleted = 0 and hpli.line_status!=3
|
||||
and (cr.id in (
|
||||
select max(id) maxId
|
||||
from call_record group by partner_line_id) or cr.id is null)
|
||||
<if test="filter">
|
||||
and b.deleted = 0
|
||||
</if>
|
||||
<if test="workflowStage!=null and workflowStage!=''">
|
||||
and hpli.workflow_stage = #{workflowStage}
|
||||
</if>
|
||||
<if test="workflowStatus!=null and workflowStatus!=''">
|
||||
and hpli.workflow_status = #{workflowStatus}
|
||||
</if>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and hpli.investment_manager = #{userId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getInterviewList" resultType="com.cool.store.vo.interview.InterviewVO">
|
||||
|
||||
@@ -222,4 +222,13 @@
|
||||
AND label_group_id = #{labelGroupId}
|
||||
</select>
|
||||
|
||||
<select id="getLabelListByIds" resultMap="BaseResultMap">
|
||||
select * from hy_partner_label where deleted = 0
|
||||
<if test="labelIds!=null and labelIds.size>0">
|
||||
<foreach collection="labelIds" item="labelId" open="and id in (" close=")" separator=",">
|
||||
#{labelId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -441,12 +441,15 @@
|
||||
a.update_time as updateTime,
|
||||
b.partner_id as partner_id,
|
||||
b.mobile as mobile,
|
||||
b.user_channel_id as userChannelId,
|
||||
b.username as userName,
|
||||
b.want_shop_area as wantShopArea,
|
||||
b.accept_adjust_type as acceptAdjustType,
|
||||
bi.user_portrait as userPortrait,
|
||||
hpl.phone_address as phoneAddress
|
||||
FROM hy_partner_line_info a
|
||||
inner JOIN hy_partner_user_info b on a.partner_id = b.partner_id
|
||||
left join hy_partner_base_info bi on hpli.id = bi.partner_line_id
|
||||
LEFT JOIN hy_open_area_info hoai ON hoai.id = b.want_shop_area
|
||||
LEFT JOIN hy_phone_location hpl ON hpl.phone_number = b.mobile
|
||||
where a.line_status = 0 and a.deleted = 0
|
||||
@@ -485,6 +488,7 @@
|
||||
hpli.development_manager as developmentManager,
|
||||
hpli.line_status as lineStatus,
|
||||
hpli.update_time as updateTime,
|
||||
hpuinfo.user_channel_id as userChannelId,
|
||||
hpuinfo.want_shop_area as wantShopArea,
|
||||
hpuinfo.accept_adjust_type as acceptAdjustType,
|
||||
hpuinfo.username as partnerUserName,
|
||||
@@ -493,11 +497,13 @@
|
||||
hpuinfo.shop_name as storeName,
|
||||
hpuinfo.recommend_partner_name as recommendPartnerName,
|
||||
hpuinfo.recommend_partner_mobile as recommendPartnerMobile,
|
||||
bi.user_portrait as userPortrait,
|
||||
eu.name as investmentManagerName,
|
||||
eu.mobile as investmentManagerMobile
|
||||
FROM
|
||||
hy_partner_line_info hpli
|
||||
LEFT JOIN hy_partner_intent_info hpii ON hpli.id = hpii.partner_line_id
|
||||
left join hy_partner_base_info bi on hpli.id = bi.partner_line_id
|
||||
LEFT JOIN hy_partner_user_info hpuinfo ON hpli.partner_id = hpuinfo.partner_id
|
||||
LEFT JOIN enterprise_user eu ON hpli.investment_manager = eu.user_id
|
||||
LEFT JOIN hy_open_area_info hoai ON hoai.id = hpuinfo.want_shop_area
|
||||
|
||||
@@ -90,4 +90,19 @@
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<select id="getAllUserChannel" resultMap="BaseResultMap">
|
||||
select * from hy_partner_user_channel
|
||||
</select>
|
||||
|
||||
<select id="getUserChannelByIds" resultMap="BaseResultMap">
|
||||
select * from hy_partner_user_channel
|
||||
<where>
|
||||
<if test="userChannelIds!=null and userChannelIds.size>0">
|
||||
<foreach collection="userChannelIds" item="userChannelId" open="channel_id in (" close=")" separator=",">
|
||||
#{userChannelId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -19,6 +19,8 @@ public class PartnerIntentApplyInfoDTO {
|
||||
@ApiModelProperty("加盟商用户名称")
|
||||
private String partnerUserName;
|
||||
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("hy_partner_user_info.partner_id")
|
||||
private String partnerId;
|
||||
|
||||
@@ -46,4 +48,17 @@ public class PartnerIntentApplyInfoDTO {
|
||||
@ApiModelProperty("子流程状态")
|
||||
private String workflowStatus;
|
||||
|
||||
@ApiModelProperty("上次跟进时间")
|
||||
private String lastFollowTime;
|
||||
|
||||
@ApiModelProperty("接通状态")
|
||||
private Integer callStatus;
|
||||
|
||||
@ApiModelProperty("来源名称")
|
||||
private String userChannelName;
|
||||
|
||||
private Integer userChannelId;
|
||||
|
||||
private String userPortrait;
|
||||
|
||||
}
|
||||
|
||||
@@ -61,4 +61,12 @@ public class PartnerInterviewInfoDTO {
|
||||
@ApiModelProperty("过程信息")
|
||||
private String processInfo;
|
||||
|
||||
@ApiModelProperty("上次跟进时间")
|
||||
private Date lastFollowTime;
|
||||
|
||||
@ApiModelProperty("接通状态")
|
||||
private Integer callStatus;
|
||||
|
||||
private String userPortrait;
|
||||
|
||||
}
|
||||
|
||||
@@ -77,4 +77,8 @@ public class PrivateSeaLineDTO {
|
||||
|
||||
private String recommendPartnerMobile;
|
||||
|
||||
private Integer userChannelId;
|
||||
|
||||
private String userPortrait;
|
||||
|
||||
}
|
||||
|
||||
@@ -29,4 +29,8 @@ public class PublicSeaLineDTO {
|
||||
private Date updateTime;
|
||||
|
||||
private String phoneAddress;
|
||||
|
||||
private Integer userChannelId;
|
||||
|
||||
private String userPortrait;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.cool.store.dto.partner;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/8/10 11:12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class UserChannelDTO {
|
||||
|
||||
private Long userChannelId;
|
||||
|
||||
private String userChannelName;
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.cool.store.entity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -18,5 +18,5 @@ public class AddTagsRequest {
|
||||
@ApiModelProperty("加盟申请基本信息ID")
|
||||
private Long partnerBaseInfoId;
|
||||
@ApiModelProperty("标签列表")
|
||||
private List<String> Tags;
|
||||
private List<Long> Tags;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/8/11 14:30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class BatchTransferInvestmentManagerRequest {
|
||||
|
||||
private List<Long> lineIds;
|
||||
|
||||
private String userId;
|
||||
|
||||
}
|
||||
@@ -8,8 +8,11 @@ import com.google.common.collect.Lists;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -23,6 +26,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Slf4j
|
||||
public class PartnerIntentApplyInfoVO {
|
||||
|
||||
@ApiModelProperty("")
|
||||
@@ -61,8 +65,20 @@ public class PartnerIntentApplyInfoVO {
|
||||
@ApiModelProperty("阶段状态")
|
||||
private String WorkflowStatus;
|
||||
|
||||
@ApiModelProperty("用户画像")
|
||||
private List<String> userPortraitList;
|
||||
|
||||
public static List<PartnerIntentApplyInfoVO> convertList(List<PartnerIntentApplyInfoDTO> list, Map<String, HyPartnerUserInfoDO> infoDOMap, Map<String, String> wantShopAreaNameMap, String workflowStatus){
|
||||
@ApiModelProperty("上次跟进时间")
|
||||
private String lastFollowTime;
|
||||
|
||||
@ApiModelProperty("接通状态")
|
||||
private Integer callStatus;
|
||||
|
||||
@ApiModelProperty("来源名称")
|
||||
private String userChannelName;
|
||||
|
||||
public static List<PartnerIntentApplyInfoVO> convertList(List<PartnerIntentApplyInfoDTO> list, Map<String, String> wantShopAreaNameMap, String workflowStatus,
|
||||
Map<Long, String> userChannelMap,Map<Long,String> userPortraitMap ){
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
@@ -78,11 +94,34 @@ public class PartnerIntentApplyInfoVO {
|
||||
partnerIntentApplyInfoVO.setWantShopArea(partnerIntentApplyInfoDTO.getWantShopArea());
|
||||
String deadLine = DateUtil.format(partnerIntentApplyInfoDTO.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_2);
|
||||
partnerIntentApplyInfoVO.setDeadline(deadLine);
|
||||
HyPartnerUserInfoDO infoDOMapOrDefault = infoDOMap.getOrDefault(partnerIntentApplyInfoDTO.getPartnerId(), new HyPartnerUserInfoDO());
|
||||
partnerIntentApplyInfoVO.setPartnerUserName(infoDOMapOrDefault.getUsername());
|
||||
partnerIntentApplyInfoVO.setPartnerUserPhone(infoDOMapOrDefault.getMobile());
|
||||
partnerIntentApplyInfoVO.setPartnerUserName(partnerIntentApplyInfoDTO.getPartnerUserName());
|
||||
partnerIntentApplyInfoVO.setPartnerUserPhone(partnerIntentApplyInfoDTO.getMobile());
|
||||
partnerIntentApplyInfoVO.setWorkflowStatus(workflowStatus);
|
||||
partnerIntentApplyInfoVO.setWantShopAreaName(wantShopAreaNameMap.get(partnerIntentApplyInfoDTO.getWantShopArea()));
|
||||
|
||||
partnerIntentApplyInfoVO.setLastFollowTime(partnerIntentApplyInfoDTO.getLastFollowTime());
|
||||
Integer callStatus = null;
|
||||
if(partnerIntentApplyInfoDTO.getCallStatus()!=null){
|
||||
callStatus = partnerIntentApplyInfoDTO.getCallStatus()==1?partnerIntentApplyInfoDTO.getCallStatus():0;
|
||||
}
|
||||
partnerIntentApplyInfoVO.setCallStatus(callStatus);
|
||||
partnerIntentApplyInfoVO.setUserChannelName(userChannelMap.getOrDefault(partnerIntentApplyInfoDTO.getUserChannelId(),""));
|
||||
|
||||
List<String> userPortraitList= new ArrayList<>();
|
||||
if(StringUtils.isNotEmpty(partnerIntentApplyInfoDTO.getUserPortrait())){
|
||||
String[] parts = partnerIntentApplyInfoDTO.getUserPortrait().split(",");
|
||||
for (String part : parts) {
|
||||
String trimmedPart = part.trim();
|
||||
if (!trimmedPart.isEmpty()) {
|
||||
try {
|
||||
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
|
||||
} catch (NumberFormatException e) {
|
||||
log.info("Invalid format: {}" , trimmedPart);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
partnerIntentApplyInfoVO.setUserPortraitList(userPortraitList);
|
||||
resultList.add(partnerIntentApplyInfoVO);
|
||||
}
|
||||
return resultList;
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -71,4 +72,16 @@ public class PartnerInterviewInfoVO {
|
||||
|
||||
@ApiModelProperty("审批发起时间")
|
||||
private String approveTime;
|
||||
|
||||
@ApiModelProperty("用户画像")
|
||||
private List<String> userPortraitList;
|
||||
|
||||
@ApiModelProperty("上次跟进时间")
|
||||
private String lastFollowTime;
|
||||
|
||||
@ApiModelProperty("接通状态")
|
||||
private Integer callStatus;
|
||||
|
||||
@ApiModelProperty("来源名称")
|
||||
private String userChannelName;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.cool.store.utils.CoolDateUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -21,6 +23,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
@Slf4j
|
||||
public class PrivateSeaLineListVo {
|
||||
|
||||
|
||||
@@ -92,8 +95,15 @@ public class PrivateSeaLineListVo {
|
||||
|
||||
private String investmentManagerMobile;
|
||||
|
||||
@ApiModelProperty("用户画像")
|
||||
private List<String> userPortraitList;
|
||||
|
||||
public static List<PrivateSeaLineListVo> convertList(List<PrivateSeaLineDTO> list, Map<String, String> finalDevManagerMap, Map<String, String> wantShopAreaNameMap,Map<Long, HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOMap){
|
||||
@ApiModelProperty("来源名称")
|
||||
private String userChannelName;
|
||||
|
||||
|
||||
public static List<PrivateSeaLineListVo> convertList(List<PrivateSeaLineDTO> list, Map<String, String> finalDevManagerMap, Map<String, String> wantShopAreaNameMap,
|
||||
Map<Long, HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOMap,Map<Long, String> channelMap,Map<Long, String> userPortraitMap){
|
||||
List<PrivateSeaLineListVo> resultList = new ArrayList<>();
|
||||
for (PrivateSeaLineDTO x : list) {
|
||||
PrivateSeaLineListVo privateSeaLineListVo = new PrivateSeaLineListVo();
|
||||
@@ -127,6 +137,22 @@ public class PrivateSeaLineListVo {
|
||||
privateSeaLineListVo.setStartTime(hyPartnerInterviewPlanDOMap.getOrDefault(x.getLineId(),new HyPartnerInterviewPlanDO()).getStartTime());
|
||||
privateSeaLineListVo.setInterviewPlanId(hyPartnerInterviewPlanDOMap.getOrDefault(x.getLineId(),new HyPartnerInterviewPlanDO()).getId());
|
||||
privateSeaLineListVo.setDevelopmentManagerName(finalDevManagerMap.get(x.getDevelopmentManager()));
|
||||
privateSeaLineListVo.setUserChannelName(channelMap.get(x.getUserChannelId()));
|
||||
List<String> userPortraitList= new ArrayList<>();
|
||||
if(StringUtils.isNotEmpty(x.getUserPortrait())){
|
||||
String[] parts = x.getUserPortrait().split(",");
|
||||
for (String part : parts) {
|
||||
String trimmedPart = part.trim();
|
||||
if (!trimmedPart.isEmpty()) {
|
||||
try {
|
||||
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
|
||||
} catch (NumberFormatException e) {
|
||||
log.info("Invalid format: {}" , trimmedPart);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
privateSeaLineListVo.setUserPortraitList(userPortraitList);
|
||||
resultList.add(privateSeaLineListVo);
|
||||
}
|
||||
return resultList;
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -71,4 +72,10 @@ public class PublicSeaLineListVo {
|
||||
|
||||
private String updateTime;
|
||||
|
||||
@ApiModelProperty("用户画像")
|
||||
private List<String> userPortraitList;
|
||||
|
||||
@ApiModelProperty("来源名称")
|
||||
private String userChannelName;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import com.cool.store.vo.PartnerIntentInfoVO;
|
||||
import com.cool.store.vo.PartnerUserInfoVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/9 14:54
|
||||
@@ -26,7 +28,8 @@ public interface HyPartnerIntentInfoService {
|
||||
* @param pageNumber
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber);
|
||||
PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber,String keyword, Integer callStatus,
|
||||
List<String> userPortraitIdList, Long lastFollowStartTime, Long lastFollowEndTime, String userChannelIdList);
|
||||
|
||||
/**
|
||||
* 根据线索查询加盟商意向申请信息
|
||||
|
||||
@@ -3,10 +3,7 @@ package com.cool.store.service;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.request.CloseFollowRequest;
|
||||
import com.cool.store.request.LineRequest;
|
||||
import com.cool.store.request.PrivateSeaLineListRequest;
|
||||
import com.cool.store.request.TransferInvestmentManagerRequest;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.vo.*;
|
||||
import com.cool.store.vo.interview.InterviewVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
@@ -60,6 +57,8 @@ public interface HyPartnerLineInfoService {
|
||||
*/
|
||||
Boolean transferInvestmentManager(LoginUserInfo user, TransferInvestmentManagerRequest request) throws ApiException;
|
||||
|
||||
Boolean batchTransferInvestmentManager(LoginUserInfo user, BatchTransferInvestmentManagerRequest request) throws ApiException;
|
||||
|
||||
/**
|
||||
* 分配招商经理
|
||||
* @param userId
|
||||
@@ -117,7 +116,7 @@ public interface HyPartnerLineInfoService {
|
||||
* @param privateSeaLineListRequest
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PrivateSeaLineListVo> privateSeaLineList(String userId, PrivateSeaLineListRequest privateSeaLineListRequest) ;
|
||||
PageInfo<PrivateSeaLineListVo> privateSeaLineList(String userId, PrivateSeaLineListRequest privateSeaLineListRequest,Boolean allPrivateSeaFlag) ;
|
||||
|
||||
PartnerLineBaseInfoVO getPartnerLinBaseInfo(String partnerId);
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.dto.partner.UserChannelDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/8/10 11:12
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface HyPartnerUserChannelService {
|
||||
|
||||
/**
|
||||
* 查询所有的线索来源
|
||||
* @return
|
||||
*/
|
||||
List<UserChannelDTO> queryAllUserChannelList();
|
||||
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.vo.LabelListVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Fun Li 2023/8/10 14:23
|
||||
@@ -28,6 +29,21 @@ public interface LabelService {
|
||||
*/
|
||||
void addLabel(LabelAddDTO dto) throws ApiException;
|
||||
|
||||
/**
|
||||
* 标签MAP
|
||||
* @param userPortraitStrList
|
||||
* @return
|
||||
*/
|
||||
Map<Long,String> getUserPortraitMap(List<String> userPortraitStrList);
|
||||
|
||||
/**
|
||||
* 查询标签中文名称集合
|
||||
* @param userPortraitMap
|
||||
* @param userPortraitStr
|
||||
* @return
|
||||
*/
|
||||
List<String> getUserPortraitList(Map<Long,String> userPortraitMap,String userPortraitStr);
|
||||
|
||||
/**
|
||||
* 修改标签信息
|
||||
* @param dto 新标签信息
|
||||
|
||||
@@ -3,6 +3,7 @@ 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.CommonConstants;
|
||||
import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
@@ -36,6 +37,7 @@ import javax.annotation.Resource;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -91,7 +93,8 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
throw new ServiceException(ErrorCodeEnum.PARTNER_BASE_INFO_NOT_EXIST);
|
||||
}
|
||||
hyPartnerBaseInfo.setId(addTagsRequest.getPartnerBaseInfoId());
|
||||
hyPartnerBaseInfo.setUserPortrait(CollectionUtils.isNotEmpty(addTagsRequest.getTags())? JSONObject.toJSONString(addTagsRequest.getTags()):"");
|
||||
hyPartnerBaseInfo.setUserPortrait(CollectionUtils.isNotEmpty(addTagsRequest.getTags())?
|
||||
addTagsRequest.getTags().stream().map(Object::toString).collect(Collectors.joining(CommonConstants.COMMA, CommonConstants.COMMA, CommonConstants.COMMA)):"");
|
||||
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(hyPartnerBaseInfo);
|
||||
HyPartnerLineInfoDO line = hyPartnerLineInfoDAO.getByPartnerId(hyPartnerBaseInfo.getPartnerId());
|
||||
//添加日志
|
||||
|
||||
@@ -15,14 +15,13 @@ import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.HyPartnerLabelMapper;
|
||||
import com.cool.store.mapper.HyPartnerUserChannelMapper;
|
||||
import com.cool.store.request.BaseUserInfoRequest;
|
||||
import com.cool.store.request.IndustryCognitionInfoRequest;
|
||||
import com.cool.store.request.PartnerIntentInfoRequest;
|
||||
import com.cool.store.request.PartnerWantShopInfoRequest;
|
||||
import com.cool.store.service.HyPartnerIntentInfoService;
|
||||
import com.cool.store.service.HyPartnerLineInfoService;
|
||||
import com.cool.store.service.HyPhoneLocationService;
|
||||
import com.cool.store.service.LogService;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
@@ -73,12 +72,16 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
HyPartnerTaskInfoLogDAO hyPartnerTaskInfoLogDAO;
|
||||
@Autowired
|
||||
private LogService logService;
|
||||
|
||||
@Resource
|
||||
HyPartnerUserChannelMapper hyPartnerUserChannelMapper;
|
||||
@Resource
|
||||
LabelService labelService;
|
||||
@Autowired
|
||||
private NoticeService noticeService;
|
||||
|
||||
@Override
|
||||
public PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber) {
|
||||
public PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber,String keyword, Integer callStatus,
|
||||
List<String> userPortraitIdList, Long lastFollowStartTime, Long lastFollowEndTime, String userChannelIdList) {
|
||||
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO();
|
||||
String workflowStatus = "";
|
||||
if (CommonConstants.PENDING.equals(type)) {
|
||||
@@ -87,22 +90,35 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
if (CommonConstants.FOLLOW.equals(type)) {
|
||||
workflowStatus = WorkflowStatusEnum.INTENT_0.getCode();
|
||||
}
|
||||
String lastFollowStartTimeStr = null;
|
||||
String lastFollowEndTimeStr = null;
|
||||
if (lastFollowStartTime!=null||lastFollowEndTime!=null){
|
||||
lastFollowStartTimeStr = DateUtil.format(new Date(lastFollowStartTime), CoolDateUtils.DATE_FORMAT_SEC);
|
||||
lastFollowEndTimeStr = DateUtil.format(new Date(lastFollowEndTime), CoolDateUtils.DATE_FORMAT_SEC);
|
||||
}
|
||||
PageHelper.startPage(pageNumber,pageSize);
|
||||
PageInfo partnerIntentApplyInfo = new PageInfo(hyPartnerIntentInfoDAO.selectPartnerIntentApplyInfoList(userId, WorkflowStageEnum.INTENT.getCode(), workflowStatus));
|
||||
PageInfo partnerIntentApplyInfo = new PageInfo(hyPartnerIntentInfoDAO.selectPartnerIntentApplyInfoList(userId, WorkflowStageEnum.INTENT.getCode(), workflowStatus,keyword
|
||||
,callStatus,userPortraitIdList,lastFollowStartTimeStr,lastFollowEndTimeStr,userChannelIdList));
|
||||
if (partnerIntentApplyInfo==null){
|
||||
return new PageInfo<>();
|
||||
}
|
||||
List<PartnerIntentApplyInfoDTO> list = partnerIntentApplyInfo.getList();
|
||||
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<Integer> userChannelIds = list.stream().filter(x -> x.getUserChannelId() != null).map(PartnerIntentApplyInfoDTO::getUserChannelId).collect(Collectors.toList());
|
||||
List<HyPartnerUserChannelDO> userChannelList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(userChannelIds)){
|
||||
userChannelList = hyPartnerUserChannelMapper.getUserChannelByIds(userChannelIds);
|
||||
}
|
||||
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(PartnerIntentApplyInfoDTO::getUserPortrait).collect(Collectors.toList());
|
||||
Map<Long, String> userChannelMap = userChannelList.stream().collect(Collectors.toMap(HyPartnerUserChannelDO::getChannelId, HyPartnerUserChannelDO::getChannelName));
|
||||
List<Long> wantShopAreaList = list.stream().filter(x->StringUtils.isNotEmpty(x.getWantShopArea())).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);
|
||||
List<PartnerIntentApplyInfoVO> resultList = PartnerIntentApplyInfoVO.convertList(list, wantShopAreaNameMap, workflowStatus,userChannelMap,labelService.getUserPortraitMap(userPortraitList));
|
||||
partnerIntentApplyInfo.setList(resultList);
|
||||
return partnerIntentApplyInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean updatePartnerIntentInfo(LoginUserInfo userInfo, BaseUserInfoRequest baseUserInfoRequest) {
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.message.RemindInterviewMsgDTO;
|
||||
import com.cool.store.dto.message.SendCardMessageDTO;
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.MessageTypeEnum;
|
||||
@@ -16,11 +17,13 @@ import com.cool.store.http.ISVHttpRequest;
|
||||
import com.cool.store.mapper.HyPartnerInterviewMapper;
|
||||
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
|
||||
import com.cool.store.mapper.HyPartnerLineInfoMapper;
|
||||
import com.cool.store.mapper.HyPartnerUserChannelMapper;
|
||||
import com.cool.store.request.CloseFollowRequest;
|
||||
import com.cool.store.request.GetInterviewListReq;
|
||||
import com.cool.store.service.HyPartnerInterviewPlanService;
|
||||
import com.cool.store.service.HyPartnerLineInfoService;
|
||||
import com.cool.store.service.InterviewService;
|
||||
import com.cool.store.service.LabelService;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.vo.InterviewDetailInfoVO;
|
||||
import com.cool.store.vo.PartnerInterviewInfoVO;
|
||||
@@ -78,6 +81,10 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
|
||||
|
||||
@Autowired
|
||||
private InterviewService interviewService;
|
||||
@Resource
|
||||
LabelService labelService;
|
||||
@Resource
|
||||
HyPartnerUserChannelMapper hyPartnerUserChannelMapper;
|
||||
|
||||
|
||||
@Value("${feishu.notice.link.url:null}")
|
||||
@@ -129,6 +136,9 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
|
||||
List<PartnerInterviewInfoVO> result = new ArrayList<>();
|
||||
List<String> partnerIds = list.stream().map(PartnerInterviewInfoDTO::getPartnerId).collect(Collectors.toList());
|
||||
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIds);
|
||||
List<Integer> userChannelIds = hyPartnerUserInfoDOS.stream().filter(x -> x.getUserChannelId() != null).map(HyPartnerUserInfoDO::getUserChannelId).collect(Collectors.toList());
|
||||
List<HyPartnerUserChannelDO> userChannelList = hyPartnerUserChannelMapper.getUserChannelByIds(userChannelIds);
|
||||
Map<Long, String> channelMap = userChannelList.stream().collect(Collectors.toMap(HyPartnerUserChannelDO::getChannelId, HyPartnerUserChannelDO::getChannelName));
|
||||
List<String> interviewerUserIds = list.stream().filter(x-> StringUtils.isNotEmpty(x.getInterviewer())).map(PartnerInterviewInfoDTO::getInterviewer).collect(Collectors.toList());
|
||||
List<EnterpriseUserDO> userInfoByUserIds = enterpriseUserDAO.getUserInfoByUserIds(interviewerUserIds);
|
||||
Map<String, EnterpriseUserDO> interviewerUserMap = userInfoByUserIds.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, data -> data));
|
||||
@@ -136,8 +146,10 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
|
||||
List<Long> lineIds = list.stream().map(PartnerInterviewInfoDTO::getPartnerLineId).collect(Collectors.toList());
|
||||
List<HyPartnerLineInfoDO> hyPartnerLineInfoDOS= hyPartnerLineInfoDAO.getHyPartnerLineInfoListByIds(lineIds);
|
||||
Map<Long, HyPartnerLineInfoDO> hyPartnerLineInfoDOMap = hyPartnerLineInfoDOS.stream().collect(Collectors.toMap(HyPartnerLineInfoDO::getId, data -> data));
|
||||
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(PartnerInterviewInfoDTO::getUserPortrait).collect(Collectors.toList());
|
||||
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
|
||||
list.stream().forEach(x->{
|
||||
PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x);
|
||||
PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x,userPortraitMap,userNameMap.get(x.getPartnerId()),channelMap);
|
||||
partnerInterviewInfoVO.setPartnerName(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getUsername());
|
||||
partnerInterviewInfoVO.setPartnerPhone(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getMobile());
|
||||
partnerInterviewInfoVO.setInterviewerName(interviewerUserMap.getOrDefault(x.getInterviewer(),new EnterpriseUserDO()).getName());
|
||||
@@ -170,12 +182,17 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
|
||||
List<String> partnerIds = list.stream().map(PartnerInterviewInfoDTO::getPartnerId).collect(Collectors.toList());
|
||||
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIds);
|
||||
Map<String, HyPartnerUserInfoDO> userNameMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, Data->Data));
|
||||
List<Integer> userChannelIds = hyPartnerUserInfoDOS.stream().filter(x -> x.getUserChannelId() != null).map(HyPartnerUserInfoDO::getUserChannelId).collect(Collectors.toList());
|
||||
List<HyPartnerUserChannelDO> userChannelList = hyPartnerUserChannelMapper.getUserChannelByIds(userChannelIds);
|
||||
Map<Long, String> channelMap = userChannelList.stream().collect(Collectors.toMap(HyPartnerUserChannelDO::getChannelId, HyPartnerUserChannelDO::getChannelName));
|
||||
List<Long> lineIds = list.stream().map(PartnerInterviewInfoDTO::getPartnerLineId).collect(Collectors.toList());
|
||||
List<HyPartnerLineInfoDO> hyPartnerLineInfoDOS= hyPartnerLineInfoDAO.getHyPartnerLineInfoListByIds(lineIds);
|
||||
Map<Long, HyPartnerLineInfoDO> hyPartnerLineInfoDOMap = hyPartnerLineInfoDOS.stream().collect(Collectors.toMap(HyPartnerLineInfoDO::getId, data -> data));
|
||||
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(PartnerInterviewInfoDTO::getUserPortrait).collect(Collectors.toList());
|
||||
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
|
||||
List<PartnerInterviewInfoVO> result = new ArrayList<>();
|
||||
list.stream().forEach(x->{
|
||||
PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x);
|
||||
PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x,userPortraitMap,userNameMap.get(x.getPartnerId()),channelMap);
|
||||
partnerInterviewInfoVO.setPartnerName(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getUsername());
|
||||
partnerInterviewInfoVO.setPartnerPhone(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getMobile());
|
||||
partnerInterviewInfoVO.setLineStatus(hyPartnerLineInfoDOMap.getOrDefault(x.getPartnerLineId(),new HyPartnerLineInfoDO()).getLineStatus());
|
||||
@@ -310,7 +327,7 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
|
||||
* @param partnerInterviewInfoDTO
|
||||
* @return
|
||||
*/
|
||||
private PartnerInterviewInfoVO convertPartnerInterviewInfoDTOToVo(PartnerInterviewInfoDTO partnerInterviewInfoDTO){
|
||||
private PartnerInterviewInfoVO convertPartnerInterviewInfoDTOToVo(PartnerInterviewInfoDTO partnerInterviewInfoDTO,Map<Long, String> userPortraitMap, HyPartnerUserInfoDO hyPartnerUserInfoDO,Map<Long, String> channelMap){
|
||||
PartnerInterviewInfoVO partnerInterviewInfoVO = new PartnerInterviewInfoVO();
|
||||
partnerInterviewInfoVO.setInterviewId(partnerInterviewInfoDTO.getInterviewId());
|
||||
partnerInterviewInfoVO.setInterviewPlanId(partnerInterviewInfoDTO.getId());
|
||||
@@ -325,6 +342,17 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
|
||||
partnerInterviewInfoVO.setAuthCode(partnerInterviewInfoDTO.getIntentionContractNo());
|
||||
partnerInterviewInfoVO.setEndTime(DateUtil.format(partnerInterviewInfoDTO.getEndTime(),CoolDateUtils.DATE_FORMAT_SEC_2));
|
||||
partnerInterviewInfoVO.setApproveTime(DateUtil.format(partnerInterviewInfoDTO.getApproveTime(),CoolDateUtils.DATE_FORMAT_SEC_2));
|
||||
partnerInterviewInfoVO.setLastFollowTime(DateUtil.format(partnerInterviewInfoDTO.getLastFollowTime(),CoolDateUtils.DATE_FORMAT_SEC_2));
|
||||
Integer callStatus = null;
|
||||
if(partnerInterviewInfoDTO.getCallStatus()!=null){
|
||||
callStatus = partnerInterviewInfoDTO.getCallStatus()==1?partnerInterviewInfoDTO.getCallStatus():0;
|
||||
}
|
||||
partnerInterviewInfoVO.setCallStatus(callStatus);
|
||||
if (hyPartnerUserInfoDO!=null){
|
||||
partnerInterviewInfoVO.setUserChannelName(channelMap.get(hyPartnerUserInfoDO.getUserChannelId()));
|
||||
}
|
||||
List<String> userPortrait = labelService.getUserPortraitList(userPortraitMap, partnerInterviewInfoDTO.getUserPortrait());
|
||||
partnerInterviewInfoVO.setUserPortraitList(userPortrait);
|
||||
return partnerInterviewInfoVO;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.HyPartnerUserChannelMapper;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
@@ -24,6 +25,7 @@ import com.cool.store.vo.*;
|
||||
import com.cool.store.vo.interview.InterviewVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -77,9 +79,13 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
HyPartnerTaskInfoLogDAO hyPartnerTaskInfoLogDAO;
|
||||
@Resource
|
||||
HyPhoneLocationService hyPhoneLocationService;
|
||||
@Resource
|
||||
HyPartnerUserChannelMapper hyPartnerUserChannelMapper;
|
||||
|
||||
@Autowired
|
||||
private NoticeService noticeService;
|
||||
@Resource
|
||||
LabelService labelService;
|
||||
|
||||
@Autowired
|
||||
private SmsService smsService;
|
||||
@@ -103,6 +109,15 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
PartnerLineInfoAndBaseInfoVO partnerLineInfoAndBaseInfoVO = convertPartnerLineInfoAndBaseInfoDTOToVo(partnerLineInfoAndBaseInfoDTO);
|
||||
|
||||
String userPortrait = partnerLineInfoAndBaseInfoDTO.getUserPortrait();
|
||||
if (StringUtils.isNotEmpty(userPortrait)){
|
||||
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(Arrays.asList(userPortrait));
|
||||
List<String> userPortraitList = userPortraitMap.values().stream()
|
||||
.collect(Collectors.toList());
|
||||
partnerLineInfoAndBaseInfoVO.setUserPortrait(userPortraitList);
|
||||
}
|
||||
|
||||
List<String> userIds = new ArrayList<>();
|
||||
if (StringUtils.isNotEmpty(partnerLineInfoAndBaseInfoDTO.getPassUserId())){
|
||||
userIds.add(partnerLineInfoAndBaseInfoDTO.getPassUserId());
|
||||
@@ -186,6 +201,24 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean batchTransferInvestmentManager(LoginUserInfo user, BatchTransferInvestmentManagerRequest request) throws ApiException {
|
||||
if (CollectionUtils.isEmpty(request.getLineIds())||StringUtils.isEmpty(request.getUserId())){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
for (Long lineId:request.getLineIds()) {
|
||||
TransferInvestmentManagerRequest transferInvestmentManagerRequest = new TransferInvestmentManagerRequest();
|
||||
transferInvestmentManagerRequest.setUserId(request.getUserId());
|
||||
transferInvestmentManagerRequest.setLineId(lineId);
|
||||
try {
|
||||
this.transferInvestmentManager(user,transferInvestmentManagerRequest);
|
||||
} catch (ApiException e) {
|
||||
log.info("transferInvestmentManager_success Transfer_interview_management_failed,lineId:{}",lineId);
|
||||
}
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean allocationInvestmentManager(LoginUserInfo user, List<Long> lineIdList) {
|
||||
if (user==null|| CollectionUtils.isEmpty(lineIdList)){
|
||||
@@ -472,6 +505,13 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
|
||||
List<Long> wantShopAreaList = list.stream().map(PublicSeaLineDTO::getWantShopArea).filter(Objects::nonNull).map(Long::parseLong).distinct().collect(Collectors.toList());
|
||||
Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList);
|
||||
|
||||
List<Integer> userChannelIds = list.stream().filter(x -> x.getUserChannelId() != null).map(PublicSeaLineDTO::getUserChannelId).collect(Collectors.toList());
|
||||
List<HyPartnerUserChannelDO> userChannelList = hyPartnerUserChannelMapper.getUserChannelByIds(userChannelIds);
|
||||
Map<Long, String> channelMap = userChannelList.stream().collect(Collectors.toMap(HyPartnerUserChannelDO::getChannelId, HyPartnerUserChannelDO::getChannelName));
|
||||
|
||||
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(PublicSeaLineDTO::getUserPortrait).collect(Collectors.toList());
|
||||
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
|
||||
List<PublicSeaLineListVo> result = new ArrayList<>();
|
||||
list.forEach(x->{
|
||||
PublicSeaLineListVo publicSeaLineListVo = new PublicSeaLineListVo();
|
||||
@@ -496,6 +536,9 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
String closeTime = DateUtil.format(hy.getCloseTime(), CoolDateUtils.DATE_FORMAT_SEC_2);
|
||||
publicSeaLineListVo.setLastCloseDate(closeTime);
|
||||
publicSeaLineListVo.setLastInvestmentManager(nameMobileMap.get(hy.getInvestmentManager()));
|
||||
List<String> userPortrait = labelService.getUserPortraitList(userPortraitMap, x.getUserPortrait());
|
||||
publicSeaLineListVo.setUserPortraitList(userPortrait);
|
||||
publicSeaLineListVo.setUserChannelName(channelMap.get(x.getUserChannelId()));
|
||||
result.add(publicSeaLineListVo);
|
||||
});
|
||||
publicSeaLineList.setList(result);
|
||||
@@ -506,8 +549,12 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageInfo<PrivateSeaLineListVo> privateSeaLineList(String userId, PrivateSeaLineListRequest request) {
|
||||
UserPositionAndUserScopeDTO userIdsByScope = enterpriseUserService.getUserIdsByScope(userId);
|
||||
public PageInfo<PrivateSeaLineListVo> privateSeaLineList(String userId, PrivateSeaLineListRequest request,Boolean allPrivateSeaFlag) {
|
||||
//allPrivateSeaFlag 为true的时候 查询全量私海
|
||||
UserPositionAndUserScopeDTO userIdsByScope = new UserPositionAndUserScopeDTO();
|
||||
if (!allPrivateSeaFlag){
|
||||
userIdsByScope = enterpriseUserService.getUserIdsByScope(userId);
|
||||
}
|
||||
String intentAreaName = getIntentAreaName(request.getIntentArea());
|
||||
PageHelper.startPage(request.getPageNum(),request.getPageSize());
|
||||
PageInfo privateLineList = new PageInfo(hyPartnerLineInfoDAO.getPrivateSeaLineList(request.getKeyword(), request.getKeywordType(), request.getWorkflowStage(),
|
||||
@@ -530,7 +577,15 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
}
|
||||
List<Long> wantShopAreaList = list.stream().filter(x->StringUtils.isNotEmpty(x.getWantShopArea())).map(PrivateSeaLineDTO::getWantShopArea).map(Long::parseLong).distinct().collect(Collectors.toList());
|
||||
Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList);
|
||||
List<PrivateSeaLineListVo> result = PrivateSeaLineListVo.convertList(list, devManagerMap, wantShopAreaNameMap,hyPartnerInterviewPlanDOMap);
|
||||
|
||||
List<Integer> userChannelIds = list.stream().filter(x -> x.getUserChannelId() != null).map(PrivateSeaLineDTO::getUserChannelId).collect(Collectors.toList());
|
||||
List<HyPartnerUserChannelDO> userChannelList = hyPartnerUserChannelMapper.getUserChannelByIds(userChannelIds);
|
||||
Map<Long, String> channelMap = userChannelList.stream().collect(Collectors.toMap(HyPartnerUserChannelDO::getChannelId, HyPartnerUserChannelDO::getChannelName));
|
||||
|
||||
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(PrivateSeaLineDTO::getUserPortrait).collect(Collectors.toList());
|
||||
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
|
||||
|
||||
List<PrivateSeaLineListVo> result = PrivateSeaLineListVo.convertList(list, devManagerMap, wantShopAreaNameMap,hyPartnerInterviewPlanDOMap,channelMap,userPortraitMap);
|
||||
privateLineList.setList(result);
|
||||
return privateLineList;
|
||||
}
|
||||
@@ -806,9 +861,6 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
partnerLineInfoAndBaseInfoVO.setId(partnerLineInfoAndBaseInfoDTO.getId());
|
||||
partnerLineInfoAndBaseInfoVO.setPartnerUserId(partnerLineInfoAndBaseInfoDTO.getPartnerId());
|
||||
partnerLineInfoAndBaseInfoVO.setInvestmentManager(partnerLineInfoAndBaseInfoDTO.getInvestmentManager());
|
||||
if (StringUtils.isNotEmpty(partnerLineInfoAndBaseInfoDTO.getUserPortrait())){
|
||||
partnerLineInfoAndBaseInfoVO.setUserPortrait(JSONObject.parseArray(partnerLineInfoAndBaseInfoDTO.getUserPortrait(),String.class));
|
||||
}
|
||||
partnerLineInfoAndBaseInfoVO.setPartnerBaseInfoId(partnerLineInfoAndBaseInfoDTO.getPartnerBaseInfoId());
|
||||
partnerLineInfoAndBaseInfoVO.setWorkflowStage(partnerLineInfoAndBaseInfoDTO.getWorkflowStage());
|
||||
partnerLineInfoAndBaseInfoVO.setWorkflowStatus(partnerLineInfoAndBaseInfoDTO.getWorkflowStatus());
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dto.partner.UserChannelDTO;
|
||||
import com.cool.store.entity.HyPartnerUserChannelDO;
|
||||
import com.cool.store.mapper.HyPartnerUserChannelMapper;
|
||||
import com.cool.store.service.HyPartnerUserChannelService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/8/10 11:14
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class HyPartnerUserChannelServiceImpl implements HyPartnerUserChannelService {
|
||||
|
||||
@Resource
|
||||
HyPartnerUserChannelMapper hyPartnerUserChannelMapper;
|
||||
|
||||
@Override
|
||||
public List<UserChannelDTO> queryAllUserChannelList() {
|
||||
List<HyPartnerUserChannelDO> allUserChannel = hyPartnerUserChannelMapper.getAllUserChannel();
|
||||
List<UserChannelDTO> result = new ArrayList<>();
|
||||
allUserChannel.forEach(x->{
|
||||
UserChannelDTO userChannelDTO = new UserChannelDTO();
|
||||
userChannelDTO.setUserChannelId(x.getChannelId());
|
||||
userChannelDTO.setUserChannelName(x.getChannelName());
|
||||
result.add(userChannelDTO);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -11,17 +11,22 @@ import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.mapper.HyPartnerLabelMapper;
|
||||
import com.cool.store.service.LabelService;
|
||||
import com.cool.store.vo.LabelListVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Fun Li 2023/8/10 14:24
|
||||
* @version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LabelServiceImpl implements LabelService {
|
||||
|
||||
@Autowired
|
||||
@@ -100,4 +105,47 @@ public class LabelServiceImpl implements LabelService {
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long,String> getUserPortraitMap(List<String> userPortraitStrList){
|
||||
Set<Long> userPortraitIdList = new HashSet<>();
|
||||
for (String userPortrait:userPortraitStrList) {
|
||||
String[] parts = userPortrait.split(",");
|
||||
for (String part : parts) {
|
||||
String trimmedPart = part.trim();
|
||||
if (!trimmedPart.isEmpty()) {
|
||||
try {
|
||||
Long value = Long.parseLong(trimmedPart);
|
||||
userPortraitIdList.add(value);
|
||||
} catch (NumberFormatException e) {
|
||||
log.info("Invalid format: {}" , trimmedPart);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
List<HyPartnerLabelDO> labelListByIds = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(userPortraitIdList)){
|
||||
labelListByIds = labelMapper.getLabelListByIds(new ArrayList<>(userPortraitIdList));
|
||||
}
|
||||
return labelListByIds.stream().collect(Collectors.toMap(HyPartnerLabelDO::getId,HyPartnerLabelDO::getLabelName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getUserPortraitList(Map<Long, String> userPortraitMap, String userPortraitStr) {
|
||||
List<String> userPortraitList= new ArrayList<>();
|
||||
if(StringUtils.isNotEmpty(userPortraitStr)){
|
||||
String[] parts = userPortraitStr.split(",");
|
||||
for (String part : parts) {
|
||||
String trimmedPart = part.trim();
|
||||
if (!trimmedPart.isEmpty()) {
|
||||
try {
|
||||
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
|
||||
} catch (NumberFormatException e) {
|
||||
log.info("Invalid format: {}" , trimmedPart);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return userPortraitList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,10 +107,17 @@ public class DeskController {
|
||||
@ApiImplicitParam(name = "pageSize", value = "10", required = false),
|
||||
})
|
||||
public ResponseResult<PageInfo<PartnerIntentApplyInfoVO>> queryIntentApplyList(@RequestParam(value = "type",required = false)String type,
|
||||
@RequestParam(value = "keyword",required = false)String keyword,
|
||||
@RequestParam(value = "callStatus",required = false)Integer callStatus,
|
||||
@RequestParam(value = "userPortraitIdList",required = false)List<String> userPortraitIdList,
|
||||
@RequestParam(value = "lastFollowStartTime",required = false)Long lastFollowStartTime,
|
||||
@RequestParam(value = "lastFollowEndTime",required = false)Long lastFollowEndTime,
|
||||
@RequestParam(value = "userChannelIdList",required = false)String userChannelIdList,
|
||||
@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
|
||||
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
return ResponseResult.success(hyPartnerIntentInfoService.getPartnerIntentApplyList(userId,type,pageSize,pageNumber));
|
||||
return ResponseResult.success(hyPartnerIntentInfoService.getPartnerIntentApplyList(userId,type,pageSize,pageNumber,keyword,callStatus,userPortraitIdList,
|
||||
lastFollowStartTime,lastFollowEndTime,userChannelIdList));
|
||||
}
|
||||
|
||||
|
||||
@@ -205,6 +212,12 @@ public class DeskController {
|
||||
return ResponseResult.success(hyPartnerLineInfoService.transferInvestmentManager(CurrentUserHolder.getUser(),request ));
|
||||
}
|
||||
|
||||
@PostMapping(path = "/batchTransferInvestmentManager")
|
||||
@ApiOperation("批量转让招商经理")
|
||||
public ResponseResult<Boolean> batchTransferInvestmentManager(@RequestBody BatchTransferInvestmentManagerRequest request) throws ApiException {
|
||||
return ResponseResult.success(hyPartnerLineInfoService.batchTransferInvestmentManager(CurrentUserHolder.getUser(),request ));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path = "/queryPublicSeqLineList")
|
||||
@ApiOperation("公海列表")
|
||||
@@ -216,7 +229,14 @@ public class DeskController {
|
||||
@PostMapping(path = "/queryPrivateSeaLineList")
|
||||
@ApiOperation("私海列表")
|
||||
public ResponseResult<PageInfo<PrivateSeaLineListVo>> queryPrivateSeqLineList(@RequestBody PrivateSeaLineListRequest privateSeaLineListRequest){
|
||||
return ResponseResult.success(hyPartnerLineInfoService.privateSeaLineList(CurrentUserHolder.getUserId(),privateSeaLineListRequest));
|
||||
return ResponseResult.success(hyPartnerLineInfoService.privateSeaLineList(CurrentUserHolder.getUserId(),privateSeaLineListRequest,Boolean.FALSE));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path = "/queryAllPrivateSeqLineList")
|
||||
@ApiOperation("全量私海")
|
||||
public ResponseResult<PageInfo<PrivateSeaLineListVo>> queryAllPrivateSeqLineList(@RequestBody PrivateSeaLineListRequest privateSeaLineListRequest){
|
||||
return ResponseResult.success(hyPartnerLineInfoService.privateSeaLineList(CurrentUserHolder.getUserId(),privateSeaLineListRequest,Boolean.TRUE));
|
||||
}
|
||||
|
||||
@PostMapping(path = "/queryBlackList")
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.cool.store.controller;
|
||||
|
||||
import com.cool.store.dto.partner.UserChannelDTO;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.HyPartnerUserChannelService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/8/10 11:17
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "线索来源")
|
||||
@Slf4j
|
||||
public class UserChannelController {
|
||||
|
||||
@Resource
|
||||
HyPartnerUserChannelService hyPartnerUserChannelService;
|
||||
|
||||
@GetMapping(path = "/queryAllUserChannelList")
|
||||
@ApiOperation("线索来源列表")
|
||||
public ResponseResult<List<UserChannelDTO>> queryAllUserChannelList(){
|
||||
return ResponseResult.success(hyPartnerUserChannelService.queryAllUserChannelList());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user