|
@@ -1,16 +1,13 @@
|
|
package com.ym.mec.biz.service.impl;
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Arrays;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Objects;
|
|
|
|
-import java.util.Set;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
+import com.ym.mec.biz.dal.dao.*;
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
|
+import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
|
|
|
|
+import com.ym.mec.biz.service.SysConfigService;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -19,27 +16,6 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
-import com.ym.mec.biz.dal.dao.ClassGroupDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupQuitDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.StudentDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.StudentExtracurricularExercisesSituationDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.StudentManageDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.SubjectChangeDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.TeacherDao;
|
|
|
|
-import com.ym.mec.biz.dal.dao.VipGroupDao;
|
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupQuit;
|
|
|
|
-import com.ym.mec.biz.dal.entity.Student;
|
|
|
|
-import com.ym.mec.biz.dal.entity.StudentRegistration;
|
|
|
|
-import com.ym.mec.biz.dal.entity.SubjectChange;
|
|
|
|
-import com.ym.mec.biz.dal.entity.SysUserCashAccount;
|
|
|
|
-import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
import com.ym.mec.biz.dal.page.MusicGroupStudentQueryInfo;
|
|
import com.ym.mec.biz.dal.page.MusicGroupStudentQueryInfo;
|
|
import com.ym.mec.biz.dal.page.StudentManageAttendanceQueryInfo;
|
|
import com.ym.mec.biz.dal.page.StudentManageAttendanceQueryInfo;
|
|
@@ -102,6 +78,10 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
private MusicGroupQuitDao musicGroupQuitDao;
|
|
private MusicGroupQuitDao musicGroupQuitDao;
|
|
@Autowired
|
|
@Autowired
|
|
private SubjectChangeDao subjectChangeDao;
|
|
private SubjectChangeDao subjectChangeDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PageInfo<StudentManageListDto> findStudentsByOrganId(StudentManageQueryInfo queryInfo) {
|
|
public PageInfo<StudentManageListDto> findStudentsByOrganId(StudentManageQueryInfo queryInfo) {
|
|
@@ -214,6 +194,62 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ public PageInfo<StudentVipDouble11Dto> queryDouble11Students(StudentManageQueryInfo queryInfo) {
|
|
|
|
+ PageInfo<StudentVipDouble11Dto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
|
+
|
|
|
|
+ Teacher teacher = teacherDao.get(queryInfo.getTeacherId());
|
|
|
|
+ if (Objects.isNull(teacher)) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ List<Integer> organIds = new ArrayList<>();
|
|
|
|
+ if (Objects.nonNull(teacher.getTeacherOrganId())) {
|
|
|
|
+ organIds.add(teacher.getTeacherOrganId());
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank(teacher.getFlowOrganRange())) {
|
|
|
|
+ List<Integer> flowOrganRangeIds = Arrays.stream(teacher.getFlowOrganRange().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
|
|
|
|
+ organIds.addAll(flowOrganRangeIds);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (CollectionUtils.isEmpty(organIds)) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ params.put("organIds", organIds);
|
|
|
|
+
|
|
|
|
+ List<StudentVipDouble11Dto> dataList = new ArrayList<>();
|
|
|
|
+ int count = studentPaymentOrderDao.countDouble11Students(params);
|
|
|
|
+ if (count > 0) {
|
|
|
|
+ pageInfo.setTotal(count);
|
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
|
+ dataList = studentPaymentOrderDao.queryDouble11Students(params);
|
|
|
|
+ SysConfig vipSpecialActivityConfig = sysConfigService.findByParamName(SysConfigService.VIP_SPECIAL_ACTIVITY_IDS);
|
|
|
|
+ Map<Integer, StudentVipDouble11Dto> studentCourseTimeMap = new HashMap<>();
|
|
|
|
+ if(Objects.nonNull(vipSpecialActivityConfig)&&StringUtils.isNotBlank(vipSpecialActivityConfig.getParanValue())){
|
|
|
|
+ Set<Integer> studentIds = dataList.stream().map(StudentVipDouble11Dto::getUserId).collect(Collectors.toSet());
|
|
|
|
+ Set<Integer> specialActivityIds = Arrays.stream(vipSpecialActivityConfig.getParanValue().split(",")).map(Integer::valueOf).collect(Collectors.toSet());
|
|
|
|
+ List<StudentVipDouble11Dto> studentCourseTimeList = courseScheduleStudentPaymentDao.countStudentDouble11CourseTime(new ArrayList<>(studentIds), new ArrayList<>(specialActivityIds));
|
|
|
|
+ studentCourseTimeMap = studentCourseTimeList.stream().collect(Collectors.toMap(StudentVipDouble11Dto::getUserId, s -> s));
|
|
|
|
+ }
|
|
|
|
+ for (StudentVipDouble11Dto studentVipDouble11Dto : dataList) {
|
|
|
|
+ StudentVipDouble11Dto studentCourseTime = studentCourseTimeMap.get(studentVipDouble11Dto.getUserId());
|
|
|
|
+ studentVipDouble11Dto.setCourseOneToOneTime(studentVipDouble11Dto.getPaymentOneToOneTime()*20-(Objects.isNull(studentCourseTime)?0:studentCourseTime.getCourseOneToOneTime()));
|
|
|
|
+ if(studentVipDouble11Dto.getCourseOneToOneTime()<0){
|
|
|
|
+ studentVipDouble11Dto.setCourseOneToOneTime(0);
|
|
|
|
+ }
|
|
|
|
+ studentVipDouble11Dto.setCourseOneToTwoTime(studentVipDouble11Dto.getPaymentOneToTwoTime()*20-(Objects.isNull(studentCourseTime)?0:studentCourseTime.getCourseOneToTwoTime()));
|
|
|
|
+ if(studentVipDouble11Dto.getCourseOneToTwoTime()<0){
|
|
|
|
+ studentVipDouble11Dto.setCourseOneToTwoTime(0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
|
+
|
|
|
|
+ return pageInfo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
public StudentManageListDto findStudentManageBaseInfo(Integer userId) {
|
|
public StudentManageListDto findStudentManageBaseInfo(Integer userId) {
|
|
return studentManageDao.findStudentBaseInfoByUserID(userId);
|
|
return studentManageDao.findStudentBaseInfoByUserID(userId);
|
|
}
|
|
}
|