B端 部分接口
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.cool.store.Service;
|
||||
|
||||
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);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
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.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.WorkflowStageEnum;
|
||||
import com.cool.store.enums.WorkflowStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
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.request.*;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.vo.*;
|
||||
@@ -10,6 +14,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 +27,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 +51,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 +70,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 +119,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 +156,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()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user