|
|
|
@ -218,4 +218,47 @@ public class HomepageServiceImpl implements HomepageService {
|
|
|
|
|
}
|
|
|
|
|
return mapChannelType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Object distributorsEnterClue(HomePageQo homePageQo) {
|
|
|
|
|
homePageQo.setDistributorId(SecurityUtils.getCurrentUserId());
|
|
|
|
|
//分发员进线
|
|
|
|
|
List<HomePageDTO> enterList = customMapper.distributorsEnterClueByTime(homePageQo);
|
|
|
|
|
Map<String, Integer> enterMap = enterList.stream()
|
|
|
|
|
.collect(Collectors.toMap(HomePageDTO::getCreateTime, HomePageDTO::getNum));
|
|
|
|
|
//分发员分发数
|
|
|
|
|
List<HomePageDTO> assignedList = clueMapper.distributorsAssignedClueByTime(homePageQo);
|
|
|
|
|
Map<String, Integer> assignedMap = assignedList.stream()
|
|
|
|
|
.collect(Collectors.toMap(HomePageDTO::getCreateTime, HomePageDTO::getNum));
|
|
|
|
|
|
|
|
|
|
Map<String, Map<String, Integer>> map = new LinkedHashMap<>(8);
|
|
|
|
|
long betweenDay = DateUtil.between(DateUtil.parseDate(homePageQo.getCreateStartTime()), DateUtil.parseDate(homePageQo.getCreateEndTime()), DateUnit.DAY);
|
|
|
|
|
for (int i = 0; i <= betweenDay; i++) {
|
|
|
|
|
Map<String, Integer> mapNum = new LinkedHashMap<>(16);
|
|
|
|
|
String time = DateUtil.format(DateUtil.offsetDay(DateUtil.parseDate(homePageQo.getCreateStartTime()), i), "yyyy-MM-dd");
|
|
|
|
|
mapNum.put("enter", enterMap.getOrDefault(time, 0));
|
|
|
|
|
mapNum.put("assigned", assignedMap.getOrDefault(time, 0));
|
|
|
|
|
map.put(time, mapNum);
|
|
|
|
|
}
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Object salesmanEnterClue(HomePageQo homePageQo) {
|
|
|
|
|
homePageQo.setAssignedId(SecurityUtils.getCurrentUserId());
|
|
|
|
|
//业务员进线数
|
|
|
|
|
List<HomePageDTO> assignedList = clueMapper.distributorsAssignedClueByTime(homePageQo);
|
|
|
|
|
Map<String, Integer> assignedMap = assignedList.stream()
|
|
|
|
|
.collect(Collectors.toMap(HomePageDTO::getCreateTime, HomePageDTO::getNum));
|
|
|
|
|
|
|
|
|
|
Map<String, Integer> map = new LinkedHashMap<>(8);
|
|
|
|
|
long betweenDay = DateUtil.between(DateUtil.parseDate(homePageQo.getCreateStartTime()), DateUtil.parseDate(homePageQo.getCreateEndTime()), DateUnit.DAY);
|
|
|
|
|
//返回日期值 如{"2023-12-6":100}
|
|
|
|
|
for (int i = 0; i <= betweenDay; i++) {
|
|
|
|
|
String time = DateUtil.format(DateUtil.offsetDay(DateUtil.parseDate(homePageQo.getCreateStartTime()), i), "yyyy-MM-dd");
|
|
|
|
|
map.put(time, assignedMap.getOrDefault(time, 0));
|
|
|
|
|
}
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|