临期线索
This commit is contained in:
@@ -7,6 +7,7 @@ import com.cool.store.vo.InterviewScheduleInfoVO;
|
||||
import com.cool.store.vo.StageCountVO;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -22,7 +23,7 @@ public interface DeskService {
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
InterviewPlanVO getInterviewPlan(String userId);
|
||||
HashMap<String, InterviewPlanVO> getInterviewPlan(String userId);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.HyPartnerInterviewPlanDAO;
|
||||
import com.cool.store.dao.HyPartnerLineInfoDAO;
|
||||
import com.cool.store.dto.calendar.UserCalendarsEventDTO;
|
||||
import com.cool.store.dto.partner.AdvanceLineDTO;
|
||||
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ApiException;
|
||||
@@ -24,9 +25,8 @@ import org.apache.http.client.utils.DateUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -48,18 +48,35 @@ public class DeskServiceImpl implements DeskService {
|
||||
private ISVHttpRequest isvHttpRequest;
|
||||
|
||||
@Override
|
||||
public InterviewPlanVO getInterviewPlan(String userId) {
|
||||
InterviewPlanVO interviewPlanVO = new InterviewPlanVO();
|
||||
public HashMap<String, InterviewPlanVO> getInterviewPlan(String userId) {
|
||||
|
||||
String currentDate = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_DAY);
|
||||
Integer currentDateInterviewCount = hyPartnerInterviewPlanDAO.getCurrentDateInterviewCount(userId, currentDate);
|
||||
interviewPlanVO.setHasInterview(currentDateInterviewCount>0);
|
||||
String endDate = DateUtil.format(CoolDateUtils.getDateFormatDay(new Date(), 6), CoolDateUtils.DATE_FORMAT_DAY);
|
||||
List<AdvanceLineDTO> currentDateInterviewList = hyPartnerInterviewPlanDAO.getCurrentDateInterviewCount(userId, currentDate,endDate);
|
||||
Map<String, Integer> dateIntegerMap = currentDateInterviewList.stream().collect(Collectors.toMap(AdvanceLineDTO::getDate, AdvanceLineDTO::getCount));
|
||||
//临期数量
|
||||
Integer adventLineCount = hyPartnerLineInfoDAO.getAdventLineCount(userId, currentDate);
|
||||
interviewPlanVO.setHasAdventLine(adventLineCount>0);
|
||||
return interviewPlanVO;
|
||||
List<AdvanceLineDTO> adventLineList = hyPartnerLineInfoDAO.getAdventLineCount(userId, currentDate,endDate);
|
||||
Map<String, Integer> adventLinerMap = adventLineList.stream().collect(Collectors.toMap(AdvanceLineDTO::getDate, AdvanceLineDTO::getCount));
|
||||
|
||||
HashMap<String, InterviewPlanVO> resultMap = new HashMap<>();
|
||||
String tempDate = currentDate;
|
||||
int i = 0;
|
||||
while (true){
|
||||
tempDate = DateUtil.format(CoolDateUtils.getDateFormatDay(new Date(), i++), CoolDateUtils.DATE_FORMAT_DAY);
|
||||
Integer currentDateInterviewCount = dateIntegerMap.getOrDefault(tempDate, 0);
|
||||
Integer adventLineCount = adventLinerMap.getOrDefault(tempDate,0);
|
||||
InterviewPlanVO interviewPlanVO = new InterviewPlanVO();
|
||||
interviewPlanVO.setHasInterview(currentDateInterviewCount>0);
|
||||
interviewPlanVO.setHasAdventLine(adventLineCount>0);
|
||||
resultMap.put(tempDate,interviewPlanVO);
|
||||
if (tempDate.equals(endDate)){
|
||||
break;
|
||||
}
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public InterviewScheduleInfoVO interviewSchedule(String userId,String selectedData) {
|
||||
if (StringUtils.isEmpty(userId)||selectedData==null){
|
||||
|
||||
Reference in New Issue
Block a user