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

This commit is contained in:
guohb
2024-03-27 16:03:13 +08:00
28 changed files with 887 additions and 8 deletions

View File

@@ -0,0 +1,37 @@
package com.cool.store.enums;
/**
* @author zhangchenbiao
* @FileName: SmsCodeTypeEnum
* @Description: 短信验证码类型
* @date 2021-07-20 9:47
*/
public enum SmsCodeTypeEnum {
LOGIN("SMS_220325070","验证码登录", 10 * 60),
;
private String templateCode;
private String message;
private int cacheSeconds;
SmsCodeTypeEnum(String templateCode, String message, int cacheSeconds) {
this.templateCode = templateCode;
this.message = message;
this.cacheSeconds = cacheSeconds;
}
public String getTemplateCode() {
return templateCode;
}
public String getMessage() {
return message;
}
public int getCacheSeconds() {
return cacheSeconds;
}
}

View File

@@ -10,11 +10,12 @@ public enum WorkflowSubStageStatusEnum {
//意向申请
INTENT_0(0,"待提交"),
INTENT_5(5,"待审核"),
INTENT_7(7,"未通过"),
//邀约面谈
INVITING_INTERVIEWS_10(10,"待预约"),
INVITING_INTERVIEWS_15(15,"待面谈"),
INVITING_INTERVIEWS_20(20,"面谈未通过"),
INVITING_INTERVIEWS_20(20,"待审核"),
//一审面试
FIRST_INTERVIEWS_25(25,"待预约"),
@@ -31,6 +32,7 @@ public enum WorkflowSubStageStatusEnum {
//签署意向协议
SIGN_INTENT_AGREEMENT_60(60,"待补充"),
SIGN_INTENT_AGREEMENT_63(63,"待审核"),
SIGN_INTENT_AGREEMENT_65(65,"不通过"),
SIGN_INTENT_AGREEMENT_70(70,"待提交"),
SIGN_INTENT_AGREEMENT_75(75,"待OA审核"),

View File

@@ -0,0 +1,33 @@
package com.cool.store.dao;
import com.cool.store.entity.HyPartnerLabelDO;
import com.cool.store.mapper.HyPartnerLabelMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2024/3/26 16:39
* @Version 1.0
*/
@Repository
public class HyPartnerLabelDAO {
@Resource
HyPartnerLabelMapper hyPartnerLabelMapper;
public List<HyPartnerLabelDO> listByIds(List<Long> ids ){
if (CollectionUtils.isEmpty(ids)){
return null;
}
return hyPartnerLabelMapper.getLabelListByIds(ids);
}
}

View File

@@ -0,0 +1,49 @@
package com.cool.store.dao;
import com.cool.store.entity.LineFollowLogDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.mapper.LineFollowLogMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: LineFollowLogDAO
* @Description:跟进日志
* @date 2024-03-27 14:33
*/
@Slf4j
@Repository
public class LineFollowLogDAO {
@Resource
private LineFollowLogMapper lineFollowLogMapper;
public Page<LineFollowLogDO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize){
PageHelper.startPage(pageNum, pageSize);
return lineFollowLogMapper.getFollowLogPage(lineId);
}
/**
* 新增跟进线索
* @param lineInfo
* @param operateUserId
* @param operateUsername
* @param message
* @return
*/
public Long addFollowLog(LineInfoDO lineInfo, String operateUserId, String operateUsername, String message){
if(Objects.isNull(lineInfo)){
return null;
}
LineFollowLogDO followLog = new LineFollowLogDO(lineInfo.getPartnerId(), lineInfo.getId(), operateUserId, operateUsername, lineInfo.getWorkflowStage(), lineInfo.getWorkflowSubStage(), lineInfo.getWorkflowSubStageStatus(), message);
lineFollowLogMapper.insertSelective(followLog);
return followLog.getId();
}
}

View File

@@ -8,9 +8,11 @@ import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.LineInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
@@ -72,4 +74,12 @@ public class LineInfoDAO {
}
return null;
}
public List<LineInfoDO> listByInvestmentManager(String investmentManagerUserId,Integer subStageStatus) {
if (StringUtils.isBlank(investmentManagerUserId)){
return null;
}
List<LineInfoDO> lineInfo = lineInfoMapper.listByInvestmentManager(investmentManagerUserId,subStageStatus);
return lineInfo;
}
}

View File

@@ -8,9 +8,11 @@ import com.cool.store.request.LineInterviewPageRequest;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
@@ -32,6 +34,13 @@ public class LineInterviewDAO {
return lineInterviewMapper.getInterviewInfo(lineId, interviewType.getCode());
}
public List<LineInterviewDO> getInterviewByLindIds(List<Long> lineIds, InterviewTypeEnum interviewType){
if(CollectionUtils.isEmpty(lineIds) || Objects.isNull(interviewType)){
return null;
}
return lineInterviewMapper.getInterviewByLindIds(lineIds, interviewType.getCode());
}
public Integer updateInterviewInfo(LineInterviewDO interview){
return lineInterviewMapper.updateByPrimaryKeySelective(interview);
}

View File

@@ -0,0 +1,16 @@
package com.cool.store.mapper;
import com.cool.store.entity.LineFollowLogDO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
public interface LineFollowLogMapper extends Mapper<LineFollowLogDO> {
/**
*
* @param lineId
* @return
*/
Page<LineFollowLogDO> getFollowLogPage(@Param("lineId")Long lineId);
}

View File

@@ -1,13 +1,23 @@
package com.cool.store.mapper;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface LineInfoMapper extends Mapper<LineInfoDO> {
LineInfoDO getByPartnerId(@Param("partnerId") String partnerId);
LineInfoDO getByLineId(@Param("lineId") Long lineId);
/**
* 查询招商经理待处理数据
* @param investmentManagerUserId
* @return
*/
List<LineInfoDO> listByInvestmentManager(@Param("investmentManagerUserId") String investmentManagerUserId, @Param("code") Integer code);
void insertOrUpdate(@Param("param") LineInfoDO lineInfoParam);
}

View File

@@ -7,6 +7,8 @@ import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface LineInterviewMapper extends Mapper<LineInterviewDO> {
/**
@@ -17,6 +19,14 @@ public interface LineInterviewMapper extends Mapper<LineInterviewDO> {
*/
LineInterviewDO getInterviewInfo(@Param("lineId") Long lineId, @Param("interviewType") Integer interviewType);
/**
* getInterviewByLindIds
* @param lineIds
* @param interviewType
* @return
*/
List<LineInterviewDO> getInterviewByLindIds(@Param("lineIds") List<Long> lineIds, @Param("interviewType") Integer interviewType);
/**
* 获取面试分页
* @param request

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.LineFollowLogMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.LineFollowLogDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
<result column="line_id" jdbcType="BIGINT" property="lineId" />
<result column="operate_user_id" jdbcType="VARCHAR" property="operateUserId" />
<result column="operate_username" jdbcType="VARCHAR" property="operateUsername" />
<result column="workflow_stage" jdbcType="TINYINT" property="workflowStage" />
<result column="workflow_sub_stage" jdbcType="TINYINT" property="workflowSubStage" />
<result column="workflow_sub_stage_status" jdbcType="TINYINT" property="workflowSubStageStatus" />
<result column="message" jdbcType="VARCHAR" property="message" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="deleted" jdbcType="BIT" property="deleted" />
</resultMap>
<select id="getFollowLogPage" resultMap="BaseResultMap">
select
id, partner_id, line_id, operate_user_id, operate_username, workflow_stage, workflow_sub_stage, workflow_sub_stage_status, message, create_time
from
xfsg_line_follow_log
where
line_id = #{lineId} and deleted = '0' order by create_time desc
</select>
</mapper>

View File

@@ -237,4 +237,17 @@
select * from xfsg_line_info where id = #{lineId} and deleted = 0
</select>
<select id="listByInvestmentManager" resultMap="BaseResultMap">
select * from xfsg_line_info
where deleted = 0
and workflow_sub_stage_status = 5
<if test="investmentManagerUserId != null and investmentManagerUserId != ''">
and investment_manager = #{investmentManagerUserId}
</if>
<if test="code != null">
and workflow_sub_stage_status = #{code}
</if>
</select>
</mapper>

View File

@@ -30,6 +30,15 @@
select * from xfsg_line_interview where line_id = #{lineId} and interview_type = #{interviewType} and deleted = '0'
</select>
<select id="getInterviewByLindIds" resultMap="BaseResultMap">
select * from xfsg_line_interview where interview_type = #{interviewType} and deleted = '0'
<if test="lineIds != null">
<foreach collection="lineIds" item="item" separator="," open="and line_id in (" close=")">
#{item}
</foreach>
</if>
</select>
<select id="getInterviewerPage" resultType="com.cool.store.dto.interview.LineInterviewPageDTO">
select
a.id as interviewId,

View File

@@ -3,6 +3,6 @@ jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcoll
jdbc.user= coolstore
jdbc.password = CSCErYcXniNYm7bT
table.name = xfsg_line_interview
table.object.class = LineInterviewDO
table.mapper = LineInterviewMapper
table.name = xfsg_line_follow_log
table.object.class = LineFollowLogDO
table.mapper = LineFollowLogMapper

View File

@@ -0,0 +1,93 @@
package com.cool.store.entity;
import lombok.Data;
import java.util.Date;
import javax.persistence.*;
@Data
@Table(name = "xfsg_line_follow_log")
public class LineFollowLogDO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* hy_partner_user_info.partner_id
*/
@Column(name = "partner_id")
private String partnerId;
/**
* hy_partner_line_info.id
*/
@Column(name = "line_id")
private Long lineId;
/**
* 操作人id
*/
@Column(name = "operate_user_id")
private String operateUserId;
/**
* 操作人姓名
*/
@Column(name = "operate_username")
private String operateUsername;
/**
* 流程阶段:1意向加盟;2新店进展;
*/
@Column(name = "workflow_stage")
private Integer workflowStage;
/**
* 流程子阶段
*/
@Column(name = "workflow_sub_stage")
private Integer workflowSubStage;
/**
* 流程子阶段状态
*/
@Column(name = "workflow_sub_stage_status")
private Integer workflowSubStageStatus;
/**
* 备注
*/
private String message;
/**
* 创建时间
*/
@Column(name = "create_time")
private Date createTime;
/**
* 更新时间
*/
@Column(name = "update_time")
private Date updateTime;
/**
* 删除标识
*/
private Boolean deleted;
public LineFollowLogDO() {
}
public LineFollowLogDO(String partnerId, Long lineId, String operateUserId, String operateUsername, Integer workflowStage, Integer workflowSubStage, Integer workflowSubStageStatus, String message) {
this.partnerId = partnerId;
this.lineId = lineId;
this.operateUserId = operateUserId;
this.operateUsername = operateUsername;
this.workflowStage = workflowStage;
this.workflowSubStage = workflowSubStage;
this.workflowSubStageStatus = workflowSubStageStatus;
this.message = message;
this.createTime= new Date();
}
}

View File

@@ -0,0 +1,21 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: LineFollowLogRequest
* @Description:
* @date 2024-03-27 14:59
*/
@Data
public class LineFollowLogRequest {
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("日志")
private String message;
}

View File

@@ -0,0 +1,55 @@
package com.cool.store.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2024/3/26 15:18
* @Version 1.0
*/
@Data
public class BaseInfoVO {
@ApiModelProperty("线索ID")
private Long lineId;
@ApiModelProperty("partnerId")
private Integer partnerId;
@ApiModelProperty("线索名称")
private String username;
@ApiModelProperty("手机号")
private String mobile;
@ApiModelProperty("意向加盟区域")
private String wantShopAreaName;
@ApiModelProperty("线索标签")
private List<LabelBaseInfoVO> userPortraitList;
@ApiModelProperty("子阶段状态")
private Integer workflowSubStageStatus;
public BaseInfoVO(){}
/**
* 写一个构造方法 参数是BaseInfoVO
* @param baseInfoVO
*/
public BaseInfoVO(BaseInfoVO baseInfoVO) {
this.lineId = baseInfoVO.getLineId();
this.partnerId = baseInfoVO.getPartnerId();
this.username = baseInfoVO.getUsername();
this.mobile = baseInfoVO.getMobile();
this.wantShopAreaName = baseInfoVO.getWantShopAreaName();
this.userPortraitList = baseInfoVO.getUserPortraitList();
this.workflowSubStageStatus = baseInfoVO.getWorkflowSubStageStatus();
}
}

View File

@@ -0,0 +1,22 @@
package com.cool.store.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2024/3/26 15:24
* @Version 1.0
*/
@Data
public class LabelBaseInfoVO {
@ApiModelProperty("标签ID")
private Long labelId;
@ApiModelProperty("标签名称")
private String labelName;
}

View File

@@ -0,0 +1,25 @@
package com.cool.store.vo.desk;
import com.cool.store.vo.BaseInfoVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @Author suzhuhong
* @Date 2024/3/26 15:33
* @Version 1.0
*/
@Data
public class IntendPendingVO extends BaseInfoVO {
@ApiModelProperty("提交时间")
private Date joinTime;
public IntendPendingVO(){}
public IntendPendingVO(BaseInfoVO baseInfoVO) {
super(baseInfoVO);
}
}

View File

@@ -0,0 +1,28 @@
package com.cool.store.vo.desk;
import com.cool.store.vo.BaseInfoVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2024/3/27 11:36
* @Version 1.0
*/
@Data
public class InterviewPendingVO extends BaseInfoVO {
@ApiModelProperty("面谈开始时间 2024年04月23日 16:00")
private String startTime;
@ApiModelProperty("面谈结束时间 10:00")
private String endTime;
public InterviewPendingVO(){};
public InterviewPendingVO(BaseInfoVO baseInfoVO) {
super(baseInfoVO);
}
}

View File

@@ -0,0 +1,42 @@
package com.cool.store.vo.log;
import com.cool.store.entity.LineFollowLogDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: LineFollowLogVO
* @Description:跟进日志
* @date 2024-03-27 14:50
*/
@Data
public class LineFollowLogVO {
@ApiModelProperty("日志")
private String message;
@ApiModelProperty("创建时间")
private Date createTime;
public LineFollowLogVO(String message, Date createTime) {
this.message = message;
this.createTime = createTime;
}
public static List<LineFollowLogVO> convertList(List<LineFollowLogDO> list){
if (CollectionUtils.isEmpty(list)) {
return null;
}
List<LineFollowLogVO> resultList = new ArrayList<>();
for (LineFollowLogDO followLog : list) {
resultList.add(new LineFollowLogVO(followLog.getMessage(), followLog.getCreateTime()));
}
return resultList;
}
}

View File

@@ -0,0 +1,34 @@
package com.cool.store.service;
import com.cool.store.vo.desk.IntendPendingVO;
import com.cool.store.vo.desk.InterviewPendingVO;
import com.github.pagehelper.PageInfo;
/**
* @Author suzhuhong
* @Date 2024/3/26 15:15
* @Version 1.0
*/
public interface DeskService {
/**
* 加盟申请待处理
* @param pageNum
* @param pageSize
* @param userId
* @return
*/
PageInfo<IntendPendingVO> intendPendingList(Integer pageNum, Integer pageSize,String userId);
/**
* 面试待处理
* @param pageNum
* @param pageSize
* @param userId
* @return
*/
PageInfo<InterviewPendingVO> interviewPendingList(Integer pageNum, Integer pageSize,String userId);
}

View File

@@ -0,0 +1,32 @@
package com.cool.store.service;
import com.cool.store.request.LineFollowLogRequest;
import com.cool.store.vo.log.LineFollowLogVO;
import com.github.pagehelper.PageInfo;
/**
* @author zhangchenbiao
* @FileName: LineFollowService
* @Description:线索跟进
* @date 2024-03-27 14:49
*/
public interface LineFollowService {
/**
* 分页获取跟进日志
* @param lineId
* @param pageNum
* @param pageSize
* @return
*/
PageInfo<LineFollowLogVO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize);
/**
* 新增跟进日志
* @param followLog
* @param operateUserId
* @param operateUsername
* @return
*/
Long addFollowLog(LineFollowLogRequest followLog, String operateUserId, String operateUsername);
}

View File

@@ -1,15 +1,23 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.http.MethodType;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dto.message.SendMessageDTO;
import com.cool.store.enums.MessageEnum;
import com.cool.store.enums.RocketMqTagEnum;
import com.cool.store.enums.UserRoleEnum;
import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.enums.*;
import com.cool.store.exception.ServiceException;
import com.cool.store.mq.producer.SimpleMessageService;
import com.cool.store.response.ResponseResult;
import com.cool.store.utils.UUIDUtils;
import com.cool.store.utils.poi.constant.Constants;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -31,6 +39,7 @@ import java.util.stream.Collectors;
* @Description:
* @date 2024-03-20 17:09
*/
@Slf4j
@Service
public class CommonService {
@@ -95,4 +104,5 @@ public class CommonService {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,143 @@
package com.cool.store.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.cool.store.dao.HyOpenAreaInfoDAO;
import com.cool.store.dao.HyPartnerLabelDAO;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.dao.LineInterviewDAO;
import com.cool.store.entity.HyOpenAreaInfoDO;
import com.cool.store.entity.HyPartnerLabelDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.LineInterviewDO;
import com.cool.store.enums.InterviewTypeEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.mapper.LineInterviewMapper;
import com.cool.store.service.DeskService;
import com.cool.store.utils.StringUtil;
import com.cool.store.utils.poi.DateUtils;
import com.cool.store.vo.BaseInfoVO;
import com.cool.store.vo.LabelBaseInfoVO;
import com.cool.store.vo.desk.IntendPendingVO;
import com.cool.store.vo.desk.InterviewPendingVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
* @Date 2024/3/26 15:15
* @Version 1.0
*/
@Service
public class DeskServiceImpl implements DeskService {
@Resource
LineInfoDAO lineInfoDAO;
@Resource
HyPartnerLabelDAO hyPartnerLabelDAO;
@Resource
HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
@Resource
LineInterviewDAO lineInterviewDAO;
@Override
public PageInfo<IntendPendingVO> intendPendingList(Integer pageNum, Integer pageSize,String userId) {
PageHelper.startPage(pageNum, pageSize);
List<LineInfoDO> lineInfoDOS = lineInfoDAO.listByInvestmentManager(userId, WorkflowSubStageStatusEnum.INTENT_5.getCode());
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));
List<IntendPendingVO> list = new ArrayList<>();
lineInfoDOS.forEach(x->{
BaseInfoVO baseInfoVO = convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
IntendPendingVO intendPendingVO = new IntendPendingVO(baseInfoVO);
intendPendingVO.setJoinTime(new Date());
list.add(intendPendingVO);
});
page.setList(list);
return page ;
}
@Override
public PageInfo<InterviewPendingVO> interviewPendingList(Integer pageNum, Integer pageSize, String userId) {
PageHelper.startPage(pageNum, pageSize);
List<LineInfoDO> lineInfoDOS = lineInfoDAO.listByInvestmentManager(userId,WorkflowSubStageStatusEnum.INTENT_5.getCode());
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));
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));
List<InterviewPendingVO> list = new ArrayList<>();
lineInfoDOS.forEach(x->{
BaseInfoVO baseInfoVO = convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
InterviewPendingVO interviewPendingVO = new InterviewPendingVO(baseInfoVO);
LineInterviewDO lineInterviewDO = interviewDOMap.get(x.getId());
if (lineInterviewDO != null){
interviewPendingVO.setStartTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START,lineInterviewDO.getStartTime()));
interviewPendingVO.setEndTime(DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_END,lineInterviewDO.getEndTime()));
}
list.add(interviewPendingVO);
});
page.setList(list);
return page;
}
/**
* convertToBaseInfoVO
* @param lineInfoDO
* @param userPortraitMap
* @param wantShopAreaMap
* @return
*/
private BaseInfoVO convertToBaseInfoVO(LineInfoDO lineInfoDO, Map<Long, HyPartnerLabelDO> userPortraitMap, Map<Long,String> wantShopAreaMap){
BaseInfoVO baseInfoVO = new BaseInfoVO();
BeanUtil.copyProperties(lineInfoDO, baseInfoVO);
baseInfoVO.setLineId(lineInfoDO.getId());
String userPortrait = lineInfoDO.getUserPortrait();
List<LabelBaseInfoVO> labelBaseInfoList = new ArrayList<>();
if (StringUtil.isNotEmpty(userPortrait)){
Arrays.asList(userPortrait.split(",")).subList(1, userPortrait.split(",").length).forEach(x->{
LabelBaseInfoVO labelBaseInfoVO = new LabelBaseInfoVO();
HyPartnerLabelDO hyPartnerLabelDO = userPortraitMap.get(Long.valueOf(x));
if (hyPartnerLabelDO != null){
labelBaseInfoVO.setLabelId(userPortraitMap.getOrDefault(Long.valueOf(x), new HyPartnerLabelDO()).getId());
labelBaseInfoVO.setLabelName(userPortraitMap.getOrDefault(Long.valueOf(x),new HyPartnerLabelDO()).getLabelName());
labelBaseInfoList.add(labelBaseInfoVO);
}
});
}
baseInfoVO.setUserPortraitList(labelBaseInfoList);
baseInfoVO.setWantShopAreaName(wantShopAreaMap.get(lineInfoDO.getWantShopAreaId()));
return baseInfoVO;
}
/**
* 用户画像MAP
* @param lineInfoDOList
* @return
*/
private Map<Long, HyPartnerLabelDO> getUserPortraitMap(List<LineInfoDO> lineInfoDOList){
List<Long> libelIds = new ArrayList<>();
lineInfoDOList.stream().forEach(x->{
if (StringUtil.isNotEmpty(x.getUserPortrait())){
List<String> list = Arrays.asList(x.getUserPortrait().split(",")).subList(1, x.getUserPortrait().split(",").length);
libelIds.addAll(list.stream().map(Long::valueOf).collect(Collectors.toList()));
}
});
List<HyPartnerLabelDO> hyPartnerLabelDOS = hyPartnerLabelDAO.listByIds(libelIds);
return hyPartnerLabelDOS.stream().collect(Collectors.toMap(HyPartnerLabelDO::getId, x -> x));
}
}

View File

@@ -0,0 +1,51 @@
package com.cool.store.service.impl;
import com.cool.store.dao.LineFollowLogDAO;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.entity.LineFollowLogDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.LineFollowLogRequest;
import com.cool.store.service.LineFollowService;
import com.cool.store.vo.log.LineFollowLogVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: LineFollowServiceImpl
* @Description:
* @date 2024-03-27 14:49
*/
@Service
public class LineFollowServiceImpl implements LineFollowService {
@Resource
private LineFollowLogDAO lineFollowLogDAO;
@Resource
private LineInfoDAO lineInfoDAO;
@Override
public PageInfo<LineFollowLogVO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize) {
Page<LineFollowLogDO> followLogPage = lineFollowLogDAO.getFollowLogPage(lineId, pageNum, pageSize);
PageInfo resultPage = new PageInfo(followLogPage);
List<LineFollowLogVO> resultList = LineFollowLogVO.convertList(followLogPage);
resultPage.setList(resultList);
return resultPage;
}
@Override
public Long addFollowLog(LineFollowLogRequest followLog, String operateUserId, String operateUsername) {
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(followLog.getLineId());
if(Objects.isNull(lineInfo)){
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
return lineFollowLogDAO.addFollowLog(lineInfo, operateUserId, operateUsername, followLog.getMessage());
}
}

View File

@@ -29,6 +29,10 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
public static String SPECIAL_DATE_START = "yyyy年MM月dd日 HH:mm";
public static String SPECIAL_DATE_END = "HH:mm";
private static String[] parsePatterns = {
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",

View File

@@ -0,0 +1,51 @@
package com.cool.store.controller.webb;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.DeskService;
import com.cool.store.vo.desk.IntendPendingVO;
import com.cool.store.vo.desk.InterviewPendingVO;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @Author suzhuhong
* @Date 2024/3/26 17:49
* @Version 1.0
*/
@Api(tags = "工作台接口")
@RestController
@RequestMapping("pc/desk")
public class DeskController {
@Resource
DeskService deskService;
@ApiOperation("待处理-加盟申请")
@GetMapping("/intendPendingList")
public ResponseResult<PageInfo<IntendPendingVO>> intendPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
// LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.intendPendingList(pageNumber,pageSize,"055740241221153440"));
}
@ApiOperation("待处理-邀约面谈")
@GetMapping("/interviewPendingList")
public ResponseResult<PageInfo<InterviewPendingVO>> interviewPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
// LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.interviewPendingList(pageNumber,pageSize,"055740241221153440"));
}
}

View File

@@ -0,0 +1,43 @@
package com.cool.store.controller.webb;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.request.LineFollowLogRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.LineFollowService;
import com.cool.store.vo.log.LineFollowLogVO;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @author zhangchenbiao
* @FileName: LineFollowController
* @Description:
* @date 2024-03-27 15:02
*/
@Api(tags = "跟进日志")
@RestController
@RequestMapping({"pc/follow"})
public class LineFollowController {
@Resource
private LineFollowService lineFollowService;
@ApiOperation("跟进日志分页")
@GetMapping("/page")
public ResponseResult<PageInfo<LineFollowLogVO>> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize){
return ResponseResult.success(lineFollowService.getFollowLogPage(lineId, pageNum, pageSize));
}
@ApiOperation("新增跟进日志")
@PostMapping("/log/add")
public ResponseResult<Long> addFollowLog(@RequestBody LineFollowLogRequest request){
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(lineFollowService.addFollowLog(request, user.getUserId(), user.getName()));
}
}