待处理 意向加盟+邀约面试

This commit is contained in:
苏竹红
2024-03-27 15:54:45 +08:00
parent 7be6eeae78
commit e3dee054c2
17 changed files with 460 additions and 2 deletions

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,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

@@ -32,7 +32,7 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
LineInfoMapper lineInfoMapper;
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public boolean submit(JoinIntentionRequest request) {
if (Objects.isNull(request)){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);

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",