|
@@ -814,10 +814,17 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
}
|
|
}
|
|
List<CloudTeacherActiveTargetDto> targetDtoList = JSONArray.parseArray(cloudTeacherActiveTarget, CloudTeacherActiveTargetDto.class);
|
|
List<CloudTeacherActiveTargetDto> targetDtoList = JSONArray.parseArray(cloudTeacherActiveTarget, CloudTeacherActiveTargetDto.class);
|
|
Map<Integer, List<CloudTeacherActiveTargetDto>> targetMap = targetDtoList.stream().collect(Collectors.groupingBy(e -> e.getOrganId()));
|
|
Map<Integer, List<CloudTeacherActiveTargetDto>> targetMap = targetDtoList.stream().collect(Collectors.groupingBy(e -> e.getOrganId()));
|
|
-
|
|
|
|
|
|
+ //获取各分部总人数
|
|
|
|
+ List<Map<String, Long>> maps = indexBaseMonthDataDao.countTotalStudentNum();
|
|
|
|
+ Map<String, Long> organStudentNumMap = new HashMap<>(20);
|
|
|
|
+ if(maps != null && maps.size() > 0){
|
|
|
|
+ organStudentNumMap = MapUtil.convertIntegerMap(maps);
|
|
|
|
+ }
|
|
params.put("organIdList",organIdList);
|
|
params.put("organIdList",organIdList);
|
|
List<CloudTeacherActiveTargetDto> resultList = indexBaseMonthDataDao.countCloudTeacherActive(params);
|
|
List<CloudTeacherActiveTargetDto> resultList = indexBaseMonthDataDao.countCloudTeacherActive(params);
|
|
for (CloudTeacherActiveTargetDto dto : resultList) {
|
|
for (CloudTeacherActiveTargetDto dto : resultList) {
|
|
|
|
+ Long aLong = organStudentNumMap.get(dto.getOrganId().toString());
|
|
|
|
+ dto.setTotalNum(aLong==null?0:aLong.intValue());
|
|
List<CloudTeacherActiveTargetDto> targetDtos = targetMap.get(dto.getOrganId());
|
|
List<CloudTeacherActiveTargetDto> targetDtos = targetMap.get(dto.getOrganId());
|
|
if(targetDtos != null && targetDtos.size() > 0){
|
|
if(targetDtos != null && targetDtos.size() > 0){
|
|
CloudTeacherActiveTargetDto target = targetDtos.get(0);
|
|
CloudTeacherActiveTargetDto target = targetDtos.get(0);
|
|
@@ -825,7 +832,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
dto.setTargetAmount(target.getTargetAmount());
|
|
dto.setTargetAmount(target.getTargetAmount());
|
|
}
|
|
}
|
|
if(dto.getBuyAmount().doubleValue() > 0d && dto.getBuyNum() > 0){
|
|
if(dto.getBuyAmount().doubleValue() > 0d && dto.getBuyNum() > 0){
|
|
- BigDecimal avgBuyAmount = dto.getBuyAmount().divide(new BigDecimal(dto.getBuyNum()), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
|
|
|
+ BigDecimal avgBuyAmount = dto.getBuyAmount().divide(new BigDecimal(dto.getBuyNum()), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
|
|
dto.setAvgBuyAmount(avgBuyAmount);
|
|
dto.setAvgBuyAmount(avgBuyAmount);
|
|
}
|
|
}
|
|
if(dto.getTotalNum() > 0 && dto.getBuyNum() > 0){
|
|
if(dto.getTotalNum() > 0 && dto.getBuyNum() > 0){
|
|
@@ -852,7 +859,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
resultMap.put("buyScale",0);
|
|
resultMap.put("buyScale",0);
|
|
resultMap.put("targetFinishScale",0);
|
|
resultMap.put("targetFinishScale",0);
|
|
if(buyAmount.doubleValue() > 0d && buyNum > 0){
|
|
if(buyAmount.doubleValue() > 0d && buyNum > 0){
|
|
- BigDecimal avgBuyAmount = buyAmount.divide(new BigDecimal(buyNum), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
|
|
|
+ BigDecimal avgBuyAmount = buyAmount.divide(new BigDecimal(buyNum), CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
|
|
resultMap.put("avgBuyAmount",avgBuyAmount);
|
|
resultMap.put("avgBuyAmount",avgBuyAmount);
|
|
}
|
|
}
|
|
if(totalNum > 0 && buyNum > 0){
|
|
if(totalNum > 0 && buyNum > 0){
|