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

This commit is contained in:
俞扬
2023-07-05 19:13:49 +08:00
11 changed files with 72 additions and 30 deletions

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

@@ -222,9 +222,6 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
oldBaseInfo.getSex(), oldBaseInfo.getBirthdate(), oldBaseInfo.getNation(), oldBaseInfo.getLiveAddress(), oldBaseInfo.getStatus());
newBaseInfo.setStatus(oldBaseInfo.getStatus());
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(newBaseInfo);
// 老的身份证信息置空
fillBaseInfoIdCard(oldBaseInfo, null, null, null, null, null, null, null, null, null);
oldBaseInfo.setStatus(Integer.valueOf(WorkflowStatusEnum.INTENT_0.getCode()));
//修改名称
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(newPartnerId);
HyPartnerIntentInfoDO oldIntentInfo = hyPartnerIntentInfoDAO.getByPartnerIdAndLineId(oldLineInfo.getPartnerId(), oldLineInfo.getId());
@@ -235,6 +232,9 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
hyPartnerUserInfoDO.setAcceptAdjustType(oldIntentInfo.getAcceptAdjustType());
hyPartnerUserInfoDAO.updateByPrimaryKeySelective(hyPartnerUserInfoDO);
}
// 老的身份证信息置空
fillBaseInfoIdCard(oldBaseInfo, null, null, null, null, null, null, null, null, null);
oldBaseInfo.setStatus(Integer.valueOf(WorkflowStatusEnum.INTENT_0.getCode()));
hyPartnerBaseInfoDAO.updateByPrimaryKey(oldBaseInfo);
hyPartnerIntentInfoDAO.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());
hyPartnerClerkDAO.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());