فهرست منبع

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 سال پیش
والد
کامیت
a83464f1ef

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -1309,7 +1309,8 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      */
     List<Map<Integer, Long>> countStudentVipCoursesWithDate(@Param("studentIds") List<Integer> studentIds,
                                                                @Param("startTime") Date startTime,
-                                                               @Param("endTime") Date endTime);
+                                                               @Param("endTime") Date endTime,
+                                                            @Param("groupType") GroupType groupType);
 
     /**
      * @describe 统计学生在未来的vip课数量

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentExercisesSituationDto.java

@@ -16,6 +16,16 @@ public class StudentExercisesSituationDto extends StudentExtracurricularExercise
 
     private Integer existVipCourse;
 
+    private Integer existPracticeCourse;
+
+    public Integer getExistPracticeCourse() {
+        return existPracticeCourse;
+    }
+
+    public void setExistPracticeCourse(Integer existPracticeCourse) {
+        this.existPracticeCourse = existPracticeCourse;
+    }
+
     public Integer getExistVipCourse() {
         return existVipCourse;
     }

+ 8 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
 import com.ym.mec.biz.dal.dto.StudentServiceDetailDto;
 import com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation;
+import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.page.StudentExercisesSituationQueryInfo;
 import com.ym.mec.biz.dal.page.StudentServiceDetailQueryInfo;
 import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
@@ -51,15 +52,15 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 			dataList = studentExtracurricularExercisesSituationDao.findExercisesSituations(params);
 			if(Objects.isNull(queryInfo.getExistVipCourse())){
 				List<Integer> studentIds = dataList.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
-				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday());
+				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday(), GroupType.VIP);
+				List<Map<Integer, Long>> studentPracticeCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday(), GroupType.PRACTICE);
 				Map<Integer, Long> studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
+				Map<Integer, Long> studentPracticeCourseMap = MapUtil.convertIntegerMap(studentPracticeCoursesMaps);
 				for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
 					Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getStudentId());
-					if(Objects.isNull(vipCourses)||vipCourses<=0){
-						exercisesSituationDto.setExistVipCourse(0);
-					}else{
-						exercisesSituationDto.setExistVipCourse(1);
-					}
+					Long practiceCourses=studentPracticeCourseMap.get(exercisesSituationDto.getStudentId());
+					exercisesSituationDto.setExistVipCourse(Objects.isNull(vipCourses)?0:vipCourses.intValue());
+					exercisesSituationDto.setExistPracticeCourse(Objects.isNull(practiceCourses)?0:practiceCourses.intValue());
 				}
 			}
 		}
@@ -84,7 +85,7 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 			dataList = studentExtracurricularExercisesSituationDao.findExercisesSituations(params);
 			if(Objects.isNull(queryInfo.getExistVipCourse())){
 				List<Integer> studentIds = dataList.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
-				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday());
+				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday(),GroupType.VIP);
 				Map<Integer, Long> studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
 				for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
 					Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getStudentId());

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -3004,7 +3004,7 @@
             <foreach collection="studentIds" item="studentId" separator="," open="(" close=")">
                 #{studentId}
             </foreach>
-            AND cssp.group_type_ = 'VIP'
+            AND cssp.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             AND cs.class_date_ BETWEEN #{startTime} AND #{endTime}
         GROUP BY
         cssp.user_id_