|
@@ -1,5 +1,6 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
@@ -792,9 +793,16 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
//清除标记
|
|
|
studentDao.cleanCountFlag();
|
|
|
//打标记
|
|
|
+ List<Integer> studentIds = new ArrayList<>();
|
|
|
//获取在会员团的学员
|
|
|
- List<Integer> studentIds = studentRegistrationDao.queryHasMemberGroupStudent();
|
|
|
+ studentIds.addAll(studentRegistrationDao.queryHasMemberGroupStudent());
|
|
|
+ //获取购买过云教练(非活动)的学员
|
|
|
+ studentIds.addAll(cloudTeacherOrderDao.getStudentIds());
|
|
|
studentDao.remarkCountFlag(studentIds);
|
|
|
+ //更新目标学员、目标金额
|
|
|
+ SysConfig config = sysConfigDao.findByParamName("cloud_teacher_active_target");
|
|
|
+ config.setParanValue(JSON.toJSONString(studentRegistrationDao.queryOrganTarget()));
|
|
|
+ sysConfigDao.update(config);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -808,10 +816,17 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
}
|
|
|
List<CloudTeacherActiveTargetDto> targetDtoList = JSONArray.parseArray(cloudTeacherActiveTarget, CloudTeacherActiveTargetDto.class);
|
|
|
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);
|
|
|
List<CloudTeacherActiveTargetDto> resultList = indexBaseMonthDataDao.countCloudTeacherActive(params);
|
|
|
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());
|
|
|
if(targetDtos != null && targetDtos.size() > 0){
|
|
|
CloudTeacherActiveTargetDto target = targetDtos.get(0);
|
|
@@ -819,7 +834,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
dto.setTargetAmount(target.getTargetAmount());
|
|
|
}
|
|
|
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);
|
|
|
}
|
|
|
if(dto.getTotalNum() > 0 && dto.getBuyNum() > 0){
|
|
@@ -846,7 +861,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
resultMap.put("buyScale",0);
|
|
|
resultMap.put("targetFinishScale",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);
|
|
|
}
|
|
|
if(totalNum > 0 && buyNum > 0){
|