临期线索

This commit is contained in:
苏竹红
2023-07-05 16:40:16 +08:00
parent 1b88c11fd0
commit be70a0531c
10 changed files with 69 additions and 27 deletions

View File

@@ -1,5 +1,6 @@
package com.cool.store.dao;
import com.cool.store.dto.partner.AdvanceLineDTO;
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
@@ -36,11 +37,11 @@ public class HyPartnerInterviewPlanDAO {
* @param currentDate
* @return
*/
public Integer getCurrentDateInterviewCount(String userId,String currentDate){
public List<AdvanceLineDTO> getCurrentDateInterviewCount(String userId, String currentDate, String endDate){
if (StringUtils.isEmpty(userId)){
return 0;
return new ArrayList<>();
}
return hyPartnerInterviewPlanMapper.getCurrentDateInterviewCount(userId,currentDate);
return hyPartnerInterviewPlanMapper.getCurrentDateInterviewCount(userId,currentDate,endDate);
}
/**

View File

@@ -64,11 +64,11 @@ public class HyPartnerLineInfoDAO {
}
public Integer getAdventLineCount( String userId, String currentDate){
public List<AdvanceLineDTO> getAdventLineCount( String userId, String currentDate,String endDate){
if (StringUtils.isEmpty(userId)){
return 0;
return new ArrayList<>();
}
return hyPartnerLineInfoMapper.getAdventLineCount(userId,currentDate);
return hyPartnerLineInfoMapper.getAdventLineCount(userId,currentDate,endDate);
}
public StageCountDTO selectStagePendingCount(String userId){

View File

@@ -1,6 +1,7 @@
package com.cool.store.mapper;
import com.cool.store.dto.message.RemindInterviewMsgDTO;
import com.cool.store.dto.partner.AdvanceLineDTO;
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
@@ -39,7 +40,7 @@ public interface HyPartnerInterviewPlanMapper {
* @param currentDate
* @return
*/
Integer getCurrentDateInterviewCount(@Param("userId") String userId, @Param("currentDate") String currentDate);
List<AdvanceLineDTO> getCurrentDateInterviewCount(@Param("userId") String userId, @Param("currentDate") String currentDate, String endDate);
/**
* todo 当天面试数据需要修改

View File

@@ -61,7 +61,7 @@ public interface HyPartnerLineInfoMapper {
* @param currentDate
* @return
*/
Integer getAdventLineCount(@Param("userId") String userId, @Param("currentDate") String currentDate);
List<AdvanceLineDTO> getAdventLineCount(@Param("userId") String userId, @Param("currentDate") String currentDate, @Param("endDate") String endDate);
/**
* 招商经理 对应各阶段待处理数据

View File

@@ -255,17 +255,18 @@
where id = #{id}
</update>
<select id="getCurrentDateInterviewCount" resultType="java.lang.Integer">
select count(1) from hy_partner_interview_plan
<select id="getCurrentDateInterviewCount" resultType="com.cool.store.dto.partner.AdvanceLineDTO">
select interview_date as date,count(1) as count from hy_partner_interview_plan
<where>
<if test="userId!=null and userId!=''">
and interviewer = #{userId}
</if>
<if test="currentDate!=null and currentDate!=''">
and interview_date = #{currentDate}
and interview_date BETWEEN #{currentDate} and #{endDate}
</if>
</where>
</select>
group by interview_date
</select>
<select id="getInterviewCount" resultType="com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO">

View File

@@ -278,17 +278,18 @@
where id = #{record.id}
</update>
<select id="getAdventLineCount" resultType="java.lang.Integer">
select count(1) from hy_partner_line_info
<select id="getAdventLineCount" resultType="com.cool.store.dto.partner.AdvanceLineDTO">
select DATE(deadline) as date ,count(1) as count from hy_partner_line_info
<where>
<if test="userId!=null and userId!=''">
and investment_manager = #{userId}
</if>
<if test="currentDate!=null and currentDate!=''">
and DATE(deadline) = #{currentDate}
and DATE(deadline) BETWEEN #{currentDate} and #{endDate}
</if>
and (workflow_stage = 2 and workflow_status = 0)
</where>
group by DATE(deadline)
</select>
<select id="selectStagePendingCount" resultType="com.cool.store.dto.partner.StageCountDTO">

View File

@@ -0,0 +1,19 @@
package com.cool.store.dto.partner;
import lombok.Data;
import java.util.Date;
/**
* @Author suzhuhong
* @Date 2023/7/5 15:52
* @Version 1.0
*/
@Data
public class AdvanceLineDTO {
private String date;
private Integer count;
}

View File

@@ -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);
/**

View File

@@ -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){

View File

@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
@@ -92,7 +93,7 @@ public class DeskController {
@GetMapping(path = "/queryInterviewPlan")
@ApiOperation("是否有面试与临期线索")
public ResponseResult<InterviewPlanVO> queryInterviewPlanVO(){
public ResponseResult<HashMap<String, InterviewPlanVO>> queryInterviewPlanVO(){
String userId = CurrentUserHolder.getUserId();
return ResponseResult.success(deskService.getInterviewPlan(userId));
}