PC 线索信息 我的线索 团队线索

This commit is contained in:
苏竹红
2024-03-27 18:07:28 +08:00
parent 6318cca496
commit e4b8891c0b
13 changed files with 286 additions and 15 deletions

View File

@@ -1,9 +1,15 @@
package com.cool.store.service;
import com.cool.store.entity.HyPartnerLabelDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.vo.BaseInfoVO;
import com.cool.store.vo.desk.IntendPendingVO;
import com.cool.store.vo.desk.InterviewPendingVO;
import com.github.pagehelper.PageInfo;
import java.util.List;
import java.util.Map;
/**
* @Author suzhuhong
* @Date 2024/3/26 15:15
@@ -30,5 +36,20 @@ public interface DeskService {
*/
PageInfo<InterviewPendingVO> interviewPendingList(Integer pageNum, Integer pageSize,String userId);
/**
* convertToBaseInfoVO
* @param lineInfoDO
* @param userPortraitMap
* @param wantShopAreaMap
* @return
*/
BaseInfoVO convertToBaseInfoVO(LineInfoDO lineInfoDO, Map<Long, HyPartnerLabelDO> userPortraitMap, Map<Long,String> wantShopAreaMap);
/**
* getUserPortraitMap
* @param lineInfoDOList
* @return
*/
Map<Long, HyPartnerLabelDO> getUserPortraitMap(List<LineInfoDO> lineInfoDOList);
}

View File

@@ -1,6 +1,10 @@
package com.cool.store.service;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.request.LineListRequest;
import com.cool.store.vo.LineInfoVO;
import com.cool.store.vo.LineListVO;
import com.github.pagehelper.PageInfo;
/**
* @Author suzhuhong
@@ -18,6 +22,13 @@ public interface LineService {
LineInfoVO getLineInfo(Long lineId);
/**
* 我的线索 团队线索
* @param lineListRequest
* @param loginUserInfo
* @return
*/
PageInfo<LineListVO> getLineList(LineListRequest lineListRequest, LoginUserInfo loginUserInfo,Boolean teamFlag);
}

View File

@@ -51,8 +51,7 @@ public class DeskServiceImpl implements DeskService {
PageInfo page = new PageInfo(lineInfoDOS);
Map<Long, HyPartnerLabelDO> userPortraitMap = this.getUserPortraitMap(lineInfoDOS);
List<Long> wantShopAreaIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOList = hyOpenAreaInfoDAO.selectByIds(wantShopAreaIds);
Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDOList.stream().collect(Collectors.toMap(HyOpenAreaInfoDO::getId, HyOpenAreaInfoDO::getAreaName, (k1, k2) -> k1));
Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIds);
List<IntendPendingVO> list = new ArrayList<>();
lineInfoDOS.forEach(x->{
BaseInfoVO baseInfoVO = convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
@@ -72,8 +71,7 @@ public class DeskServiceImpl implements DeskService {
PageInfo page = new PageInfo(lineInfoDOS);
Map<Long, HyPartnerLabelDO> userPortraitMap = this.getUserPortraitMap(lineInfoDOS);
List<Long> wantShopAreaIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOList = hyOpenAreaInfoDAO.selectByIds(wantShopAreaIds);
Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDOList.stream().collect(Collectors.toMap(HyOpenAreaInfoDO::getId, HyOpenAreaInfoDO::getAreaName, (k1, k2) -> k1));
Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIds);
List<Long> lineIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getId() != null).map(LineInfoDO::getId).collect(Collectors.toList());
List<LineInterviewDO> interviewByLindIds = lineInterviewDAO.getInterviewByLindIds(lineIds, InterviewTypeEnum.MEET);
Map<Long, LineInterviewDO> interviewDOMap = interviewByLindIds.stream().collect(Collectors.toMap(LineInterviewDO::getLineId, x -> x, (k1, k2) -> k1));
@@ -100,7 +98,8 @@ public class DeskServiceImpl implements DeskService {
* @param wantShopAreaMap
* @return
*/
private BaseInfoVO convertToBaseInfoVO(LineInfoDO lineInfoDO, Map<Long, HyPartnerLabelDO> userPortraitMap, Map<Long,String> wantShopAreaMap){
@Override
public BaseInfoVO convertToBaseInfoVO(LineInfoDO lineInfoDO, Map<Long, HyPartnerLabelDO> userPortraitMap, Map<Long,String> wantShopAreaMap){
BaseInfoVO baseInfoVO = new BaseInfoVO();
BeanUtil.copyProperties(lineInfoDO, baseInfoVO);
baseInfoVO.setLineId(lineInfoDO.getId());
@@ -128,7 +127,8 @@ public class DeskServiceImpl implements DeskService {
* @param lineInfoDOList
* @return
*/
private Map<Long, HyPartnerLabelDO> getUserPortraitMap(List<LineInfoDO> lineInfoDOList){
@Override
public Map<Long, HyPartnerLabelDO> getUserPortraitMap(List<LineInfoDO> lineInfoDOList){
List<Long> libelIds = new ArrayList<>();
lineInfoDOList.stream().forEach(x->{
if (StringUtil.isNotEmpty(x.getUserPortrait())){

View File

@@ -1,15 +1,33 @@
package com.cool.store.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.HyOpenAreaInfoDAO;
import com.cool.store.dao.HyPartnerUserChannelDAO;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.entity.HyOpenAreaInfoDO;
import com.cool.store.entity.HyPartnerLabelDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.LineListRequest;
import com.cool.store.service.DeskService;
import com.cool.store.service.LineService;
import com.cool.store.utils.poi.DateUtils;
import com.cool.store.vo.BaseInfoVO;
import com.cool.store.vo.LineInfoVO;
import com.cool.store.vo.LineListVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
@@ -21,6 +39,14 @@ public class LineServiceImpl implements LineService {
@Resource
LineInfoDAO lineInfoDAO;
@Resource
HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
@Resource
DeskService deskService;
@Resource
HyPartnerUserChannelDAO hyPartnerUserChannelDAO;
@Resource
EnterpriseUserDAO enterpriseUserDAO;
@Override
public LineInfoVO getLineInfo(Long lineId) {
@@ -33,4 +59,35 @@ public class LineServiceImpl implements LineService {
BeanUtil.copyProperties(lineInfo,result);
return result;
}
@Override
public PageInfo<LineListVO> getLineList(LineListRequest lineListRequest, LoginUserInfo loginUserInfo,Boolean teamFlag) {
//确定意向区域
PageHelper.startPage(lineListRequest.getPageNum(), lineListRequest.getPageSize());
List<LineInfoDO> lineInfoDOS = lineInfoDAO.lineList(lineListRequest, loginUserInfo.getUserId(), null);
PageInfo page = new PageInfo(lineInfoDOS);
Map<Long, HyPartnerLabelDO> userPortraitMap = deskService.getUserPortraitMap(lineInfoDOS);
List<Long> wantShopAreaIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIds);
List<Integer> lineSourceIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getLineSource() != null).map(LineInfoDO::getLineSource).collect(Collectors.toList());
Map<Integer, String> channelMapByIds = hyPartnerUserChannelDAO.getChannelMapByIds(lineSourceIds);
List<String> userIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getInvestmentManager() != null).map(LineInfoDO::getInvestmentManager).collect(Collectors.toList());
userIds.addAll(lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getCreateUserId() != null).map(LineInfoDO::getCreateUserId).collect(Collectors.toList()));
userIds.addAll(lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getUpdateUserId() != null).map(LineInfoDO::getUpdateUserId).collect(Collectors.toList()));
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(userIds);
List<LineListVO> result = new ArrayList<>();
lineInfoDOS.forEach(x->{
BaseInfoVO baseInfoVO = deskService.convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
LineListVO lineListVO = new LineListVO(baseInfoVO);
lineListVO.setCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, x.getCreateTime()));
lineListVO.setUpdateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, x.getUpdateTime()));
lineListVO.setLineSourceName(channelMapByIds.get(x.getLineSource()));
lineListVO.setInvestmentManagerUserName(userNameMap.get(x.getInvestmentManager()));
lineListVO.setUpdateUserName(userNameMap.get(x.getUpdateUserId()));
result.add(lineListVO);
});
page.setList(result);
return page;
}
}