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

@@ -7,8 +7,10 @@ import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.request.LineListRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
@@ -82,4 +84,8 @@ public class LineInfoDAO {
List<LineInfoDO> lineInfo = lineInfoMapper.listByInvestmentManager(investmentManagerUserId,subStageStatus);
return lineInfo;
}
public List<LineInfoDO> lineList(LineListRequest lineListRequest, String userId, List<Long> wantShopAreaIds) {
List<LineInfoDO> lineInfo = lineInfoMapper.lineList(lineListRequest,userId,wantShopAreaIds);
return lineInfo;
}
}

View File

@@ -2,6 +2,7 @@ package com.cool.store.mapper;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.request.LineListRequest;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
@@ -19,5 +20,14 @@ public interface LineInfoMapper extends Mapper<LineInfoDO> {
*/
List<LineInfoDO> listByInvestmentManager(@Param("investmentManagerUserId") String investmentManagerUserId, @Param("code") Integer code);
/**
* 我的线索列表
* @param lineListRequest
* @return
*/
List<LineInfoDO> lineList(@Param("request") LineListRequest lineListRequest,
@Param("userId") String userId,
@Param("wantShopAreaIds") List<Long> wantShopAreaIds);
void insertOrUpdate(@Param("param") LineInfoDO lineInfoParam);
}

View File

@@ -16,13 +16,13 @@
<result column="select_site_num" jdbcType="INTEGER" property="selectSiteNum" />
<result column="prepare_shop_num" jdbcType="INTEGER" property="prepareShopNum" />
<result column="open_shop_num" jdbcType="INTEGER" property="openShopNum" />
<result column="line_source" jdbcType="TINYINT" property="lineSource" />
<result column="line_source" jdbcType="BIGINT" property="lineSource" />
<result column="investment_manager" jdbcType="VARCHAR" property="investmentManager" />
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager" />
<result column="first_interviewer" jdbcType="VARCHAR" property="firstInterviewer" />
<result column="second_interviewer" jdbcType="VARCHAR" property="secondInterviewer" />
<result column="user_portrait" jdbcType="VARCHAR" property="userPortrait" />
<result column="is_join" jdbcType="BIT" property="isJoin" />
<result column="join_status" jdbcType="BIT" property="joinStatus" />
<result column="line_status" jdbcType="TINYINT" property="lineStatus" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
@@ -93,8 +93,8 @@
<if test="param.userPortrait != null and param.userPortrait != ''">
user_portrait,
</if>
<if test="param.isJoin != null">
is_join,
<if test="param.joinStatus != null">
join_status,
</if>
<if test="param.lineStatus != null">
line_status,
@@ -250,4 +250,33 @@
</select>
<select id="lineList" resultMap="BaseResultMap">
select * from xfsg_line_info
where deleted = 0
<if test="userId != null and userId != ''">
and investment_manager = #{userId}
</if>
<if test="request.userName != null and request.username!=''">
and username = #{request.userName}
</if>
<if test="request.mobile != null and request.mobile!=''">
and mobile = #{request.mobile}
</if>
<if test="request.wantShopAreaId != null">
and want_shop_area_id = #{request.wantShopAreaId}
</if>
<if test="request.lineSource != null">
and line_source #{request.lineSource}
</if>
<if test="request.createTimeStart!=null and request.createTimeEnd!=null">
and create_time between #{request.createTimeStart} and #{request.createTimeEnd}
</if>
<if test="wantShopAreaIds !=null and wantShopAreaIds.size>0">
<foreach collection="wantShopAreaIds" item="wantShopAreaId" open="and want_shop_area_id in (" close=")" separator=",">
#{wantShopAreaId}
</foreach>
</if>
</select>
</mapper>

View File

@@ -123,8 +123,8 @@ public class LineInfoDO {
/**
* 是否是加盟商0.否 1.是
*/
@Column(name = "is_join")
private Boolean isJoin;
@Column(name = "0-线索 1-蓄水池 2-加盟商")
private Boolean joinStatus;
/**
* 0.公海 1.私海 2黑名单

View File

@@ -0,0 +1,32 @@
package com.cool.store.request;
import com.cool.store.common.PageBasicInfo;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2024/3/27 16:32
* @Version 1.0
*/
@Data
public class LineListRequest extends PageBasicInfo {
@ApiModelProperty("线索姓名")
private String userName;
@ApiModelProperty("线索手机号")
private String mobile;
@ApiModelProperty("线索子阶段")
private Integer workflowSubStage;
@ApiModelProperty("线索创建时间_开始")
private String createTimeStart;
@ApiModelProperty("线索创建时间_结束")
private String createTimeEnd;
@ApiModelProperty("意向区域ID")
private Integer wantShopAreaId;
@ApiModelProperty("线索来源")
private Integer lineSource;
}

View File

@@ -31,6 +31,8 @@ public class BaseInfoVO {
@ApiModelProperty("线索标签")
private List<LabelBaseInfoVO> userPortraitList;
private Integer workflowSubStage;
@ApiModelProperty("子阶段状态")
private Integer workflowSubStageStatus;
@@ -44,6 +46,7 @@ public class BaseInfoVO {
this.partnerId = baseInfoVO.getPartnerId();
this.username = baseInfoVO.getUsername();
this.mobile = baseInfoVO.getMobile();
this.workflowSubStage = baseInfoVO.getWorkflowSubStage();
this.wantShopAreaName = baseInfoVO.getWantShopAreaName();
this.userPortraitList = baseInfoVO.getUserPortraitList();
this.workflowSubStageStatus = baseInfoVO.getWorkflowSubStageStatus();

View File

@@ -149,9 +149,9 @@ public class LineInfoVO {
/**
* 是否是加盟商0.否 1.是
*/
@Column(name = "is_join")
@ApiModelProperty("是否是加盟商0.否 1.是")
private Boolean isJoin;
@Column(name = "join_status")
@ApiModelProperty("0-线索 1-蓄水池 2-加盟商")
private Boolean joinStatus;
/**
* 0.公海 1.私海 2黑名单

View File

@@ -0,0 +1,36 @@
package com.cool.store.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2024/3/27 16:13
* @Version 1.0
*/
@Data
public class LineListVO extends BaseInfoVO{
@ApiModelProperty("招商经理名称")
private String investmentManagerUserName;
@ApiModelProperty("招商经理名称")
private String lineSourceName;
@ApiModelProperty("招商经理名称")
private String createTime;
@ApiModelProperty("招商经理名称")
private String updateTime;
@ApiModelProperty("招商经理名称")
private String updateUserName;
public LineListVO(){}
public LineListVO(BaseInfoVO baseInfoVO) {
super(baseInfoVO);
}
}

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;
}
}

View File

@@ -0,0 +1,66 @@
package com.cool.store.controller.webb;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.request.LineListRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.LineService;
import com.cool.store.vo.LineInfoVO;
import com.cool.store.vo.LineListVO;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @Author suzhuhong
* @Date 2024/3/27 15:57
* @Version 1.0
*/
@RestController
@RequestMapping("/pc/line")
@Api(tags = "PC线索信息")
@Slf4j
public class LineInfoController {
@Resource
LineService lineService;
@ApiOperation("查询线索详情")
@GetMapping("/getLineDetail")
@ApiImplicitParams({
@ApiImplicitParam(name = "lineId", value = "线索id", required = true)
})
public ResponseResult<LineInfoVO> getLineInfo(@RequestParam("lineId")Long lineId) {
return ResponseResult.success(lineService.getLineInfo(lineId));
}
@ApiOperation("我的线索")
@PostMapping("/getMyLineList")
public ResponseResult<PageInfo<LineListVO>> getLineList(@RequestBody LineListRequest lineListRequest) {
LoginUserInfo user = CurrentUserHolder.getUser();
user.setUserId("055740241221153440");
return ResponseResult.success(lineService.getLineList(lineListRequest,user,Boolean.FALSE));
}
@ApiOperation("团队线索")
@PostMapping("/getTeamLineList")
public ResponseResult<PageInfo<LineListVO>> getTeamLineList(@RequestBody LineListRequest lineListRequest) {
LoginUserInfo user = CurrentUserHolder.getUser();
user.setUserId("055740241221153440");
return ResponseResult.success(lineService.getLineList(lineListRequest,user,Boolean.TRUE));
}
}