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

# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
This commit is contained in:
pserimal
2023-06-13 18:55:38 +08:00
73 changed files with 2832 additions and 119 deletions

View File

@@ -0,0 +1,49 @@
package com.cool.store.Service;
import com.cool.store.vo.InterviewPlanVO;
import com.cool.store.vo.InterviewScheduleInfoVO;
import com.cool.store.vo.StageCountVO;
import java.util.Date;
/**
* @Author suzhuhong
* @Date 2023/6/8 14:45
* @Version 1.0
*/
public interface DeskService {
/**
* 是否有临期线索与面试
* @param userId
* @return
*/
InterviewPlanVO getInterviewPlan(String userId);
/**
* 面试日程
* @param userId
* @param selectedData
* @return
*/
InterviewScheduleInfoVO interviewSchedule(String userId,Date selectedData);
/**
* 招商经理 各阶段 待处理 待跟进数量
* @param userId
* @param type
* @return
*/
StageCountVO getStageCountByType(String userId,String type);
}

View File

@@ -0,0 +1,31 @@
package com.cool.store.Service;
import com.cool.store.vo.PartnerIntentApplyInfoVO;
import com.github.pagehelper.PageInfo;
/**
* @Author suzhuhong
* @Date 2023/6/9 14:54
* @Version 1.0
*/
public interface HyPartnerIntentInfoService {
/**
* 招商经理 意向申请阶段 待处理 待跟进列表
* @param userId
* @param type
* @param pageSize
* @param pageNumber
* @return
*/
PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber);
/**
* 根据线索查询加盟商意向申请信息
* @param lineId
* @return
*/
PartnerIntentApplyInfoVO getPartnerIntentApplyInfo(Long lineId);
}

View File

@@ -0,0 +1,45 @@
package com.cool.store.Service;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
import com.cool.store.vo.InterviewDetailInfoVO;
import com.cool.store.vo.PartnerInterviewInfoVO;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/6/8 19:32
* @Version 1.0
*/
public interface HyPartnerInterviewPlanService {
/**
* 招商经理今日面试列表
* @param userId
* @return
*/
List<InterviewDetailInfoVO> getInterviewPlanList(String userId);
/**
* getPartnerInterviewInfoList
* @param userId
* @param pageSize
* @param pageNumber
* @return
*/
PageInfo<PartnerInterviewInfoVO> getPartnerInterviewInfoList(String userId,Integer pageSize,Integer pageNumber);
/**
* getQualifiedInterviewList
* @param userId
* @param type
* @param pageSize
* @param pageNumber
* @return
*/
PageInfo<PartnerInterviewInfoVO> getQualifiedInterviewList(String userId,String type,Integer pageSize,Integer pageNumber);
}

View File

@@ -0,0 +1,94 @@
package com.cool.store.Service;
import com.cool.store.request.LineRequest;
import com.cool.store.vo.BlackListVO;
import com.cool.store.vo.PartnerLineInfoAndBaseInfoVO;
import com.cool.store.vo.PartnerLineInfoVO;
import com.cool.store.vo.StageCountVO;
import com.github.pagehelper.PageInfo;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/6/9 10:30
* @Version 1.0
*/
public interface HyPartnerLineInfoService {
/**
* 查询招商经理 待处理
* @param userId
* @return
*/
StageCountVO selectStagePendingCount(String userId);
/**
* 查询招商经理 待跟进
* @param userId
* @return
*/
StageCountVO selectStageFollowCount(String userId);
/**
* 查询加盟商线索详情之一 线索信息与基本信息
* @param lineId
* @return
*/
PartnerLineInfoAndBaseInfoVO selectPartnerLineInfoAndBaseInfo(Long lineId);
/**
* 最近30天结束的线索
* @param userId
* @param pageSize
* @param pageNumber
* @return
*/
PageInfo<PartnerLineInfoVO> lastMonthCloseLine(String userId,Integer pageSize,Integer pageNumber);
/**
* 转让招商经理
* @param userId
* @param lineId
* @return
*/
Boolean transferInvestmentManager(String userId,Long lineId);
/**
* 分配招商经理
* @param userId
* @param lineIdList
* @return
*/
Boolean allocationInvestmentManager(String userId, List<Long> lineIdList);
/**
* 黑名单列表
* @param LineRequest LineRequest
* @return
*/
PageInfo<BlackListVO> getBlackList(LineRequest LineRequest);
/**
* 加入或者移除 黑名单
* @param lineId
* @param status
* @param joinReason
* @return
*/
Boolean joinBlackList( Long lineId, Integer status, String joinReason);
/**
* 移除黑名单
* @param lineId
* @param status
* @param removeReason
* @return
*/
Boolean removeBlackList( Long lineId, Integer status, String removeReason);
}

View File

@@ -0,0 +1,92 @@
package com.cool.store.Service.impl;
import cn.hutool.core.date.DateUtil;
import com.cool.store.Service.DeskService;
import com.cool.store.Service.HyPartnerInterviewPlanService;
import com.cool.store.Service.HyPartnerLineInfoService;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.HyPartnerInterviewPlanDAO;
import com.cool.store.dao.HyPartnerLineInfoDAO;
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.vo.InterviewDetailInfoVO;
import com.cool.store.vo.InterviewPlanVO;
import com.cool.store.vo.InterviewScheduleInfoVO;
import com.cool.store.vo.StageCountVO;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.utils.DateUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/6/8 14:45
* @Version 1.0
*/
@Service
public class DeskServiceImpl implements DeskService {
@Resource
HyPartnerInterviewPlanDAO hyPartnerInterviewPlanDAO;
@Resource
HyPartnerLineInfoDAO hyPartnerLineInfoDAO;
@Resource
HyPartnerInterviewPlanService hyPartnerInterviewPlanService;
@Resource
HyPartnerLineInfoService hyPartnerLineInfoService;
@Override
public InterviewPlanVO getInterviewPlan(String userId) {
InterviewPlanVO interviewPlanVO = new InterviewPlanVO();
String currentDate = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_DAY);
Integer currentDateInterviewCount = hyPartnerInterviewPlanDAO.getCurrentDateInterviewCount(userId, currentDate);
interviewPlanVO.setHasInterview(currentDateInterviewCount>0);
//临期数量
Integer adventLineCount = hyPartnerLineInfoDAO.getAdventLineCount(userId, currentDate);
interviewPlanVO.setHasAdventLine(adventLineCount>0);
return interviewPlanVO;
}
@Override
public InterviewScheduleInfoVO interviewSchedule(String userId,Date selectedData) {
if (StringUtils.isEmpty(userId)||selectedData==null){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
InterviewScheduleInfoVO interviewScheduleInfoVO = new InterviewScheduleInfoVO();
//查询面试数量
String currentDate = DateUtil.format(selectedData, CoolDateUtils.DATE_FORMAT_DAY);
String startTime = DateUtil.format(selectedData, CoolDateUtils.DATE_FORMAT_SEC);
String endTime = DateUtil.format(CoolDateUtils.getDateBefore(selectedData, 7), CoolDateUtils.DATE_FORMAT_SEC);
SpecialDateRangeInterviewCountDTO interviewCount = hyPartnerInterviewPlanDAO.getInterviewCount(userId, currentDate, startTime, endTime);
interviewScheduleInfoVO.setCurrentDayInterviewCount(interviewCount.getCurrentDayInterviewCount());
interviewScheduleInfoVO.setLastSevenDayInterviewCount(interviewCount.getLastSevenDayInterviewCount());
//查询面试列表
//当天时间 与入参无关
List<InterviewDetailInfoVO> interviewPlanList = hyPartnerInterviewPlanService.getInterviewPlanList(userId);
interviewScheduleInfoVO.setInterviewDetailInfoVOS(interviewPlanList);
return interviewScheduleInfoVO;
}
@Override
public StageCountVO getStageCountByType(String userId, String type) {
if (CommonConstants.PENDING.equals(type)){
return hyPartnerLineInfoService.selectStagePendingCount(userId);
}
if (CommonConstants.FOLLOW.equals(type)){
return hyPartnerLineInfoService.selectStageFollowCount(userId);
}
return null;
}
}

View File

@@ -0,0 +1,104 @@
package com.cool.store.Service.impl;
import com.cool.store.Service.HyPartnerIntentInfoService;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.HyPartnerIntentInfoDAO;
import com.cool.store.dao.HyPartnerLineInfoDAO;
import com.cool.store.dao.HyPartnerUserInfoDAO;
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
import com.cool.store.entity.HyPartnerIntentInfoDO;
import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.entity.HyPartnerUserInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.WorkflowStageEnum;
import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.vo.PartnerIntentApplyInfoVO;
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
* @Date 2023/6/9 15:00
* @Version 1.0
*/
@Service
public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoService {
@Resource
HyPartnerIntentInfoDAO hyPartnerIntentInfoDAO;
@Resource
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
@Resource
HyPartnerLineInfoDAO hyPartnerLineInfoDAO;
@Override
public PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber) {
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO();
String workflowStatus = "";
if (CommonConstants.PENDING.equals(type)) {
workflowStatus = WorkflowStatusEnum.RESERVATION_0.getCode();
}
if (CommonConstants.FOLLOW.equals(type)) {
workflowStatus = WorkflowStatusEnum.INTERVIEW_4.getCode();
}
PageHelper.startPage(pageNumber,pageSize);
PageInfo partnerIntentApplyInfo = hyPartnerIntentInfoDAO.selectPartnerIntentApplyInfoList(userId, WorkflowStageEnum.INTENT.getCode(), workflowStatus);
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<PartnerIntentApplyInfoVO> result = new ArrayList<>();
list.stream().forEach(x->{
PartnerIntentApplyInfoVO pat = partnerIntentApplyInfoDTOToVo(x);
HyPartnerUserInfoDO infoDOMapOrDefault = infoDOMap.getOrDefault(x.getPartnerId(), new HyPartnerUserInfoDO());
pat.setPartnerUserName(infoDOMapOrDefault.getUsername());
pat.setPartnerUserPhone(infoDOMapOrDefault.getMobile());
result.add(pat);
});
partnerIntentApplyInfo.setList(result);
return partnerIntentApplyInfo;
}
@Override
public PartnerIntentApplyInfoVO getPartnerIntentApplyInfo(Long lineId) {
PartnerIntentApplyInfoDTO partnerIntentApplyInfoDTO= hyPartnerIntentInfoDAO.selectByLineId(lineId);
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = partnerIntentApplyInfoDTOToVo(partnerIntentApplyInfoDTO);
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerIntentApplyInfoDTO.getPartnerId());
partnerIntentApplyInfoVO.setPartnerUserName(hyPartnerUserInfoDO.getUsername());
partnerIntentApplyInfoVO.setPartnerUserPhone(hyPartnerUserInfoDO.getMobile());
//todo su 手机号归属地 意向申请区域名称
return partnerIntentApplyInfoVO;
}
/**
* partnerIntentApplyInfoDTOToVo
* @param partnerIntentApplyInfoDTO
* @return
*/
private PartnerIntentApplyInfoVO partnerIntentApplyInfoDTOToVo(PartnerIntentApplyInfoDTO partnerIntentApplyInfoDTO){
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO();
partnerIntentApplyInfoVO.setId(partnerIntentApplyInfoDTO.getId());
partnerIntentApplyInfoVO.setPartnerId(partnerIntentApplyInfoDTO.getPartnerId());
partnerIntentApplyInfoVO.setPartnerLineId(partnerIntentApplyInfoDTO.getPartnerLineId());
partnerIntentApplyInfoVO.setPartnerSubmitTime(partnerIntentApplyInfoDTO.getPartnerSubmitTime());
partnerIntentApplyInfoVO.setAcceptAdjustType(partnerIntentApplyInfoDTO.getAcceptAdjustType());
partnerIntentApplyInfoVO.setLiveArea(partnerIntentApplyInfoDTO.getLiveArea());
partnerIntentApplyInfoVO.setWantShopArea(partnerIntentApplyInfoDTO.getWantShopArea());
partnerIntentApplyInfoVO.setDeadline(partnerIntentApplyInfoDTO.getDeadline());
return partnerIntentApplyInfoVO;
}
}

View File

@@ -0,0 +1,141 @@
package com.cool.store.Service.impl;
import cn.hutool.core.date.DateUtil;
import com.cool.store.Service.HyPartnerInterviewPlanService;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.HyPartnerInterviewPlanDAO;
import com.cool.store.dao.HyPartnerUserInfoDAO;
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
import com.cool.store.entity.HyPartnerUserInfoDO;
import com.cool.store.enums.WorkflowStageEnum;
import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.vo.InterviewDetailInfoVO;
import com.cool.store.vo.PartnerInterviewInfoVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
* @Date 2023/6/8 19:32
* @Version 1.0
*/
@Service
public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlanService {
@Resource
HyPartnerInterviewPlanDAO hyPartnerInterviewPlanDAO;
@Resource
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
@Override
public List<InterviewDetailInfoVO> getInterviewPlanList(String userId) {
String currentTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_DAY);
List<HyPartnerInterviewPlanDO> interviewPlanList = hyPartnerInterviewPlanDAO.getInterviewPlanList(userId, currentTime);
if (CollectionUtils.isEmpty(interviewPlanList)){
return Lists.newArrayList();
}
List<String> partnerIdList = interviewPlanList.stream().map(HyPartnerInterviewPlanDO::getPartnerId).collect(Collectors.toList());
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIdList);
Map<String, HyPartnerUserInfoDO> hyPartnerUserInfoDOMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, data -> data));
List<InterviewDetailInfoVO> result = new ArrayList<>();
interviewPlanList.stream().forEach(x->{
InterviewDetailInfoVO interviewDetailInfoVO = convertDoToInterviewDetailInfoVO(x);
HyPartnerUserInfoDO userInfoDO = hyPartnerUserInfoDOMap.getOrDefault(x.getPartnerId(), new HyPartnerUserInfoDO());
interviewDetailInfoVO.setUserId(userInfoDO.getPartnerId());
interviewDetailInfoVO.setUserName(userInfoDO.getUsername());
interviewDetailInfoVO.setUserPhone(userInfoDO.getMobile());
result.add(interviewDetailInfoVO);
});
return result;
}
@Override
public PageInfo<PartnerInterviewInfoVO> getPartnerInterviewInfoList(String userId ,Integer pageSize,Integer pageNumber) {
PageHelper.startPage(pageNumber,pageSize);
//查询预约面试列表
PageInfo partnerInterviewInfoList = hyPartnerInterviewPlanDAO.getPartnerInterviewInfoList(userId, WorkflowStageEnum.RESERVATION.getCode(), WorkflowStatusEnum.RESERVATION_0.getCode());
List<PartnerInterviewInfoDTO> list = partnerInterviewInfoList.getList();
if (CollectionUtils.isEmpty(list)){
return partnerInterviewInfoList;
}
List<PartnerInterviewInfoVO> result = new ArrayList<>();
list.stream().forEach(x->{
PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x);
result.add(partnerInterviewInfoVO);
});
partnerInterviewInfoList.setList(result);
return partnerInterviewInfoList;
}
@Override
public PageInfo<PartnerInterviewInfoVO> getQualifiedInterviewList(String userId, String type, Integer pageSize, Integer pageNumber) {
String workflowStatus = "";
if (CommonConstants.PENDING.equals(type)) {
workflowStatus = WorkflowStatusEnum.INTERVIEW_3.getCode();
}
if (CommonConstants.FOLLOW.equals(type)) {
workflowStatus = WorkflowStatusEnum.INTERVIEW_4.getCode();
}
PageHelper.startPage(pageNumber,pageSize);
//查询预约面试列表
PageInfo partnerInterviewInfoList = hyPartnerInterviewPlanDAO.getPartnerInterviewInfoList(userId, WorkflowStageEnum.INTERVIEW.getCode(),workflowStatus);
List<PartnerInterviewInfoDTO> list = partnerInterviewInfoList.getList();
if (CollectionUtils.isEmpty(list)){
return partnerInterviewInfoList;
}
List<PartnerInterviewInfoVO> result = new ArrayList<>();
list.stream().forEach(x->{
PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x);
result.add(partnerInterviewInfoVO);
});
partnerInterviewInfoList.setList(result);
return partnerInterviewInfoList;
}
/**
* convertDoToInterviewDetailInfoVO
* @param hyPartnerInterviewPlanDO
* @return
*/
private InterviewDetailInfoVO convertDoToInterviewDetailInfoVO(HyPartnerInterviewPlanDO hyPartnerInterviewPlanDO){
InterviewDetailInfoVO interviewDetailInfoVO = new InterviewDetailInfoVO();
if (hyPartnerInterviewPlanDO==null){
return interviewDetailInfoVO;
}
interviewDetailInfoVO.setLineId(hyPartnerInterviewPlanDO.getPartnerLineId());
interviewDetailInfoVO.setStartTime(hyPartnerInterviewPlanDO.getStartTime());
return interviewDetailInfoVO;
}
/**
* PartnerInterviewInfoDTOToVo
* @param partnerInterviewInfoDTO
* @return
*/
private PartnerInterviewInfoVO convertPartnerInterviewInfoDTOToVo(PartnerInterviewInfoDTO partnerInterviewInfoDTO){
PartnerInterviewInfoVO partnerInterviewInfoVO = new PartnerInterviewInfoVO();
partnerInterviewInfoVO.setInterviewId(partnerInterviewInfoDTO.getInterviewId());
partnerInterviewInfoVO.setPartnerId(partnerInterviewInfoDTO.getPartnerId());
partnerInterviewInfoVO.setInterviewerId(partnerInterviewInfoDTO.getInterviewer());
partnerInterviewInfoVO.setProcessInfo(partnerInterviewInfoDTO.getProcessInfo());
partnerInterviewInfoVO.setCreateTime(DateUtil.format(partnerInterviewInfoDTO.getCreateTime(),CoolDateUtils.DATE_FORMAT_SEC));
partnerInterviewInfoVO.setRoomId(partnerInterviewInfoDTO.getRoomId());
partnerInterviewInfoVO.setStartTime(DateUtil.format(partnerInterviewInfoDTO.getStartTime(),CoolDateUtils.DATE_FORMAT_SEC));
partnerInterviewInfoVO.setStatus(partnerInterviewInfoDTO.getStatus());
partnerInterviewInfoVO.setEndTime(DateUtil.format(partnerInterviewInfoDTO.getEndTime(),CoolDateUtils.DATE_FORMAT_SEC));
return partnerInterviewInfoVO;
}
}

View File

@@ -0,0 +1,243 @@
package com.cool.store.Service.impl;
import cn.hutool.core.date.DateUtil;
import com.cool.store.Service.HyPartnerLineInfoService;
import com.cool.store.dao.HyPartnerLineInfoDAO;
import com.cool.store.dao.HyPartnerUserInfoDAO;
import com.cool.store.dto.partner.PartnerBlackListDTO;
import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
import com.cool.store.dto.partner.StageCountDTO;
import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.entity.HyPartnerUserInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.LineStatusEnum;
import com.cool.store.enums.WorkflowStageEnum;
import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.LineRequest;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.StringUtil;
import com.cool.store.vo.BlackListVO;
import com.cool.store.vo.PartnerLineInfoAndBaseInfoVO;
import com.cool.store.vo.PartnerLineInfoVO;
import com.cool.store.vo.StageCountVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
* @Date 2023/6/9 10:30
* @Version 1.0
*/
@Service
public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
@Resource
HyPartnerLineInfoDAO hyPartnerLineInfoDAO;
@Resource
HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
@Override
public StageCountVO selectStagePendingCount(String userId) {
StageCountDTO stageCountDTO = hyPartnerLineInfoDAO.selectStagePendingCount(userId);
return stageCountDTOToVo(stageCountDTO);
}
@Override
public StageCountVO selectStageFollowCount(String userId) {
StageCountDTO stageCountDTO = hyPartnerLineInfoDAO.selectStageFollowCount(userId);
return stageCountDTOToVo(stageCountDTO);
}
@Override
public PartnerLineInfoAndBaseInfoVO selectPartnerLineInfoAndBaseInfo(Long lineId) {
PartnerLineInfoAndBaseInfoDTO partnerLineInfoAndBaseInfoDTO = hyPartnerLineInfoDAO.selectPartnerLineInfoAndBaseInfo(lineId);
if (partnerLineInfoAndBaseInfoDTO==null){
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
PartnerLineInfoAndBaseInfoVO partnerLineInfoAndBaseInfoVO = convertPartnerLineInfoAndBaseInfoDTOToVo(partnerLineInfoAndBaseInfoDTO);
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerLineInfoAndBaseInfoVO.getPartnerUserId());
if (hyPartnerUserInfoDO!=null){
partnerLineInfoAndBaseInfoVO.setPartnerUserName(hyPartnerUserInfoDO.getUsername());
partnerLineInfoAndBaseInfoVO.setPartnerUserPhone(hyPartnerUserInfoDO.getMobile());
}
//todo su 1、招商经理名称 手机号归属地 2、加盟商手机号归属地
return partnerLineInfoAndBaseInfoVO;
}
@Override
public PageInfo<PartnerLineInfoVO> lastMonthCloseLine(String userId, Integer pageSize, Integer pageNumber) {
PageHelper.startPage(pageNumber,pageSize);
String lastMonthTodayDate = DateUtil.format(CoolDateUtils.getDateBefore(new Date(),-30), CoolDateUtils.DATE_FORMAT_SEC);
PageInfo hyPartnerLineInfoDOPageInfo = hyPartnerLineInfoDAO.lastMonthCloseLine(userId, lastMonthTodayDate);
List<HyPartnerLineInfoDO> list = hyPartnerLineInfoDOPageInfo.getList();
List<PartnerLineInfoVO> result = new ArrayList<>();
list.stream().forEach(x->{
PartnerLineInfoVO partnerLineInfoVO = new PartnerLineInfoVO();
BeanUtils.copyProperties(x,partnerLineInfoVO);
result.add(partnerLineInfoVO);
});
hyPartnerLineInfoDOPageInfo.setList(result);
return hyPartnerLineInfoDOPageInfo;
}
@Override
public Boolean transferInvestmentManager(String userId, Long lineId) {
if (StringUtil.isBlank(userId)||lineId==null){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
hyPartnerLineInfoDAO.updateInvestmentManager(userId, Arrays.asList(lineId));
return Boolean.TRUE;
}
@Override
public Boolean allocationInvestmentManager(String userId, List<Long> lineIdList) {
if (StringUtil.isBlank(userId)|| CollectionUtils.isEmpty(lineIdList)){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
//加盟上线索集合
List<HyPartnerLineInfoDO> partnerLineInfoList= hyPartnerLineInfoDAO.getLineListByLineIds(lineIdList);
//过滤出已结束的线索 这块线索需要重新生成新的线索
List<HyPartnerLineInfoDO> closeLineList = partnerLineInfoList.stream().filter(x -> x.getCloseTime() != null).collect(Collectors.toList());
List<Long> closeLineIdList = closeLineList.stream().map(HyPartnerLineInfoDO::getId).collect(Collectors.toList());
//已结束的线索 需要重新生成一条新的线索
List<HyPartnerLineInfoDO> list = new ArrayList<>();
closeLineList.stream().forEach(x->{
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
hyPartnerLineInfoDO.setPartnerId(x.getPartnerId());
hyPartnerLineInfoDO.setInvestmentManager(userId);
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
hyPartnerLineInfoDO.setLineStatus(1);
list.add(hyPartnerLineInfoDO);
});
hyPartnerLineInfoDAO.batchInsert(list);
//将老的线索置为删除状态
hyPartnerLineInfoDAO.batchDeleted(closeLineIdList);
//没有结束的线索直接分配招商经理
List<HyPartnerLineInfoDO> otherLineList = partnerLineInfoList.stream().filter(x -> x.getCloseTime() == null).collect(Collectors.toList());
List<Long> otherLineIdList = otherLineList.stream().map(HyPartnerLineInfoDO::getId).collect(Collectors.toList());
hyPartnerLineInfoDAO.updateInvestmentManager(userId, otherLineIdList);
return null;
}
@Override
public PageInfo<BlackListVO> getBlackList(LineRequest LineRequest) {
PageHelper.startPage(LineRequest.getPageNum(),LineRequest.getPageSize());
PageInfo blackListDTOPageInfo = hyPartnerLineInfoDAO.getBlackList(LineRequest.getKeyWord(), LineRequest.getIntentArea(), LineRequest.getAcceptAdjustType());
List<PartnerBlackListDTO> list = blackListDTOPageInfo.getList();
List<BlackListVO> result = new ArrayList<>();
list.stream().forEach(x->{
BlackListVO blackListVO = convertPartnerBlackListDTOToVo(x);
//todo su 员工名称手机号 手机号归属地
result.add(blackListVO);
});
blackListDTOPageInfo.setList(result);
return blackListDTOPageInfo;
}
@Override
public Boolean joinBlackList(Long lineId, Integer status, String joinReason) {
if (lineId==null){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
//加入黑名单 阶段回到第一步待提交状态
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
hyPartnerLineInfoDO.setId(lineId);
hyPartnerLineInfoDO.setLineStatus(status);
hyPartnerLineInfoDO.setJoinBlackReason(joinReason);
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
return Boolean.TRUE;
}
@Override
public Boolean removeBlackList(Long lineId, Integer status, String removeReason) {
//移除黑名单 黑名单线索置为删除状态 新增一条线索
if (lineId==null){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
hyPartnerLineInfoDO.setId(lineId);
hyPartnerLineInfoDO.setLineStatus(status);
hyPartnerLineInfoDO.setRemoveBlackReason(removeReason);
hyPartnerLineInfoDO.setDeleted(Boolean.TRUE);
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
HyPartnerLineInfoDO newHyPartnerLineInfoDO = new HyPartnerLineInfoDO();
hyPartnerLineInfoDO.setPartnerId(hyPartnerLineInfoDO.getPartnerId());
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
hyPartnerLineInfoDO.setLineStatus(0);
hyPartnerLineInfoDAO.batchInsert(Arrays.asList(newHyPartnerLineInfoDO));
return Boolean.TRUE;
}
/**
* convertPartnerBlackListDTOToVo
* @param partnerBlackListDTO
* @return
*/
public BlackListVO convertPartnerBlackListDTOToVo(PartnerBlackListDTO partnerBlackListDTO){
BlackListVO blackListVO = new BlackListVO();
blackListVO.setId(partnerBlackListDTO.getLineId());
blackListVO.setPartnerUserId(partnerBlackListDTO.getPartnerId());
blackListVO.setPartnerUserName(partnerBlackListDTO.getPartnerUserName());
blackListVO.setPartnerUserPhone(partnerBlackListDTO.getMobile());
blackListVO.setCreateTime(partnerBlackListDTO.getCreateTime());
blackListVO.setCloseTime(partnerBlackListDTO.getCloseTime());
blackListVO.setJoinBlackReason(partnerBlackListDTO.getJoinBlackReason());
blackListVO.setCloseUserId(partnerBlackListDTO.getCloseUserId());
return blackListVO;
}
/**
* convertPartnerLineInfoAndBaseInfoDTOToVo
* @param partnerLineInfoAndBaseInfoDTO
* @return
*/
private PartnerLineInfoAndBaseInfoVO convertPartnerLineInfoAndBaseInfoDTOToVo(PartnerLineInfoAndBaseInfoDTO partnerLineInfoAndBaseInfoDTO){
PartnerLineInfoAndBaseInfoVO partnerLineInfoAndBaseInfoVO = new PartnerLineInfoAndBaseInfoVO();
partnerLineInfoAndBaseInfoVO.setId(partnerLineInfoAndBaseInfoDTO.getId());
partnerLineInfoAndBaseInfoVO.setPartnerUserId(partnerLineInfoAndBaseInfoDTO.getPartnerId());
partnerLineInfoAndBaseInfoVO.setInvestmentManager(partnerLineInfoAndBaseInfoDTO.getInvestmentManager());
partnerLineInfoAndBaseInfoVO.setUserPortrait(partnerLineInfoAndBaseInfoDTO.getUserPortrait());
partnerLineInfoAndBaseInfoVO.setWorkflowStage(partnerLineInfoAndBaseInfoDTO.getWorkflowStage());
partnerLineInfoAndBaseInfoVO.setWorkflowStatus(partnerLineInfoAndBaseInfoDTO.getWorkflowStatus());
return partnerLineInfoAndBaseInfoVO;
}
/**
* stageCountDTOToVo
* @param stageCountDTO
* @return
*/
private StageCountVO stageCountDTOToVo(StageCountDTO stageCountDTO){
StageCountVO stageCountVO = new StageCountVO();
stageCountVO.setQualifiedInterviewCount(stageCountDTO.getQualifiedInterviewCount());
stageCountVO.setIntentApplyApproveCount(stageCountDTO.getIntentApplyApproveCount());
stageCountVO.setReservationInterviewCount(stageCountDTO.getReservationInterviewCount());
return stageCountVO;
}
}

View File

@@ -1,5 +1,10 @@
package com.cool.store.controller;
import com.cool.store.Service.DeskService;
import com.cool.store.Service.HyPartnerIntentInfoService;
import com.cool.store.Service.HyPartnerInterviewPlanService;
import com.cool.store.Service.HyPartnerLineInfoService;
import com.cool.store.enums.LineStatusEnum;
import com.cool.store.request.*;
import com.cool.store.response.ResponseResult;
import com.cool.store.vo.*;
@@ -10,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@@ -22,12 +28,22 @@ import java.util.List;
@Slf4j
public class DeskController {
@Resource
DeskService deskService;
@Resource
HyPartnerIntentInfoService hyPartnerIntentInfoService;
@Resource
HyPartnerInterviewPlanService hyPartnerInterviewPlanService;
@Resource
HyPartnerLineInfoService hyPartnerLineInfoService;
@GetMapping(path = "/interviewSchedule")
@ApiOperation("面试日程信息 面试信息有限 不做分页")
public ResponseResult<InterviewScheduleInfoVO> interviewSchedule(@RequestParam(value = "selectedData",required = false) Date selectedData){
public ResponseResult<InterviewScheduleInfoVO> interviewSchedule(@RequestParam(value = "userId",required = false) String userId,
@RequestParam(value = "selectedData",required = false) Date selectedData){
return ResponseResult.success();
return ResponseResult.success(deskService.interviewSchedule(userId,selectedData));
}
@@ -36,9 +52,18 @@ public class DeskController {
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "类型 待处理-Pending 待跟进-follow", required = false),
})
public ResponseResult<StageCountVO> queryStageCount(@RequestParam(value = "type",required = false)Integer type){
public ResponseResult<StageCountVO> queryStageCount(@RequestParam(value = "type",required = false)String type){
String userId = "";
return ResponseResult.success(deskService.getStageCountByType(userId,type));
}
return ResponseResult.success();
@GetMapping(path = "/queryInterviewPlan")
@ApiOperation("是否有面试与临期线索")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "招商经理ID", required = false),
})
public ResponseResult<InterviewPlanVO> queryInterviewPlanVO(@RequestParam(value = "userId",required = false)String userId){
return ResponseResult.success(deskService.getInterviewPlan(userId));
}
@@ -46,32 +71,46 @@ public class DeskController {
@ApiOperation("招商经理视角===意向申请审核列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "类型 待处理-Pending 待跟进-follow", required = false),
@ApiImplicitParam(name = "pageNumber", value = "1", required = false),
@ApiImplicitParam(name = "pageSize", value = "10", required = false),
})
public ResponseResult<PageInfo<PartnerIntentApplyInfoVO>> queryIntentApplyList(@RequestParam(value = "type",required = false)Integer type){
return ResponseResult.success();
public ResponseResult<PageInfo<PartnerIntentApplyInfoVO>> queryIntentApplyList(@RequestParam(value = "type",required = false)String type,
@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
String userId = "";
return ResponseResult.success(hyPartnerIntentInfoService.getPartnerIntentApplyList(userId,type,pageSize,pageNumber));
}
@PostMapping(path = "/querySubscribeInterviewTimeList")
@ApiOperation("招商经理视角===预约面试时间/合格资格面试 列表")
@ApiOperation("招商经理视角===预约面试时间 列表")
public ResponseResult<PageInfo<PartnerInterviewInfoVO>> querySubscribeInterviewTimeList(@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
String userId = "";
return ResponseResult.success(hyPartnerInterviewPlanService.getPartnerInterviewInfoList(userId,pageSize,pageNumber));
}
@PostMapping(path = "/queryQualifiedInterviewList")
@ApiOperation("招商经理视角===合格资格面试 列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "类型 待处理-Pending 待跟进-follow", required = false),
})
public ResponseResult<PageInfo<PartnerInterviewInfoVO>> querySubscribeInterviewTimeList(@RequestParam(value = "type",required = false)Integer type){
return ResponseResult.success();
public ResponseResult<PageInfo<PartnerInterviewInfoVO>> queryQualifiedInterviewList(@RequestParam(value = "type",required = false)String type,
@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
String userId = "";
return ResponseResult.success(hyPartnerInterviewPlanService.getQualifiedInterviewList(userId,type,pageSize,pageNumber));
}
@GetMapping(path = "/getPartnerLineDetail")
@ApiOperation("查询加盟商线索详情 线索信息与基本信息")
@GetMapping(path = "/getPartnerLineInfoAndBaseInfo")
@ApiOperation("查询加盟商线索详情之一 线索信息与基本信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
})
public ResponseResult<PartnerLineDetailVO> getPartnerLineDetail(@RequestParam(value = "lineId",required = false)Long lineId){
return ResponseResult.success();
public ResponseResult<PartnerLineInfoAndBaseInfoVO> getPartnerLineInfoAndBaseInfo(@RequestParam(value = "lineId",required = false)Long lineId){
return ResponseResult.success(hyPartnerLineInfoService.selectPartnerLineInfoAndBaseInfo(lineId));
}
@@ -81,9 +120,7 @@ public class DeskController {
@ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
})
public ResponseResult<PartnerIntentApplyInfoVO> getPartnerIntentInfo(@RequestParam(value = "lineId",required = false)Long lineId){
return ResponseResult.success();
return ResponseResult.success(hyPartnerIntentInfoService.getPartnerIntentApplyInfo(lineId));
}
@@ -120,16 +157,23 @@ public class DeskController {
public ResponseResult<PageInfo<PartnerLineInfoVO>> lastMonthCloseLine(@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
return ResponseResult.success();
String userId = "";
return ResponseResult.success(hyPartnerLineInfoService.lastMonthCloseLine(userId,pageSize,pageNumber));
}
@PostMapping(path = "/allocationInvestmentManager")
@ApiOperation("分配招商经理/转让招商经理")
public ResponseResult<Boolean> allocationInvestmentManager(@RequestBody AllocationInvestmentManagerRequest allocationInvestmentManagerRequest){
@ApiOperation("分配招商经理/批量分配招商经理")
public ResponseResult<Boolean> allocationInvestmentManager(@RequestBody AllocationInvestmentManagerRequest request){
return ResponseResult.success();
return ResponseResult.success(hyPartnerLineInfoService.allocationInvestmentManager(request.getUserId(),request.getLineIdList()));
}
@PostMapping(path = "/transferInvestmentManager")
@ApiOperation("转让招商经理")
public ResponseResult<Boolean> transferInvestmentManager(@RequestBody TransferInvestmentManagerRequest request){
return ResponseResult.success(hyPartnerLineInfoService.transferInvestmentManager(request.getUserId(),request.getLineId()));
}
@@ -157,7 +201,7 @@ public class DeskController {
@ApiOperation("黑名单列表")
public ResponseResult<PageInfo<BlackListVO>> queryBlackList(@RequestBody LineRequest LineRequest){
return ResponseResult.success();
return ResponseResult.success(hyPartnerLineInfoService.getBlackList(LineRequest));
}
@@ -165,16 +209,14 @@ public class DeskController {
@ApiOperation("移出黑名单")
public ResponseResult<Boolean> removeBlackList(@RequestBody LineBlackListRequest lineBlackListRequest){
return ResponseResult.success();
return ResponseResult.success(hyPartnerLineInfoService.removeBlackList(lineBlackListRequest.getLineId(), LineStatusEnum.PUBLIC_SEAS.getCode(),lineBlackListRequest.getCause()));
}
@PostMapping(path = "/joinBlackList")
@ApiOperation("加入黑名单")
public ResponseResult<Boolean> joinBlackList(@RequestBody LineBlackListRequest lineBlackListRequest){
return ResponseResult.success();
return ResponseResult.success(hyPartnerLineInfoService.joinBlackList(lineBlackListRequest.getLineId(),LineStatusEnum.BLACKLIST.getCode(),lineBlackListRequest.getCause()));
}
@@ -201,15 +243,17 @@ public class DeskController {
return ResponseResult.success();
}
@GetMapping(path = "/queryPartnerIntentApplyInfo")
@ApiOperation("查看意向审核信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
})
public ResponseResult<PartnerSummaryInfoVO> queryPartnerIntentApplyInfo(@RequestParam(value = "lineId",required = false)Long lineId){
return ResponseResult.success();
}
// TODO: 2023/6/13 添加根据线索查询店员接口列表接口
// @GetMapping(path = "/queryPartnerIntentApplyInfo")
// @ApiOperation("查看意向审核信息")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "lineId", value = "线索ID", required = false),
// })
// public ResponseResult<PartnerSummaryInfoVO> queryPartnerIntentApplyInfo(@RequestParam(value = "lineId",required = false)Long lineId){
//
// return ResponseResult.success();
// }
@@ -250,14 +294,12 @@ public class DeskController {
return ResponseResult.success();
}
@GetMapping(path = "/getZoneList")
@ApiOperation("战区列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "意向区域-intent 开发区域=dev", required = false),
})
public ResponseResult<List<OpenAreaVO>> getZoneList(@RequestParam(value = "type",required = false)String type,
public ResponseResult<PageInfo<ZoneVO>> getZoneList(@RequestParam(value = "type",required = false)String type,
@RequestParam(value = "pageNumber",required = false,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize){
return ResponseResult.success();
@@ -269,7 +311,7 @@ public class DeskController {
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "意向区域-intent 开发区域=dev", required = false),
})
public ResponseResult<List<OpenAreaVO>> deletedZoneList(@RequestParam(value = "id",required = false)Long id){
public ResponseResult<Boolean> deletedZoneList(@RequestParam(value = "id",required = false)Long id){
return ResponseResult.success();
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.controller;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.RegionService;
import com.cool.store.vo.region.RegionBaseInfoVO;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: RegionController
* @Description:
* @date 2023-06-12 15:53
*/
@RestController
@RequestMapping({"/v1/region" })
@Slf4j
@Api(tags = "组织架构")
public class RegionController {
@Resource
private RegionService regionService;
@GetMapping("/getRegionList")
public ResponseResult<List<RegionBaseInfoVO>> getRegionBaseInfoList(){
List<RegionBaseInfoVO> resultList = new ArrayList<>(Arrays.asList(regionService.getRegionBaseInfoList()));
return ResponseResult.success(resultList);
}
}