Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 5 years ago
parent
commit
b77ecd2c54

+ 3 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1533,11 +1533,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             if(schedule.getGroupType() == MUSIC){
                 Set<Long> collect = truantStudent.stream().map(e -> e.getStudentId()).collect(Collectors.toSet());
                 Map<Integer,String> paymentStatusMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.queryUserCoursePaymentStatus(collect,schedule.getMusicGroupId()));
-                if(paymentStatusMap.size() > 0){
-                    truantStudent.forEach(studentAttendanceViewDto -> {
-                        studentAttendanceViewDto.setPaymentStatus(paymentStatusMap.get(studentAttendanceViewDto.getStudentId().intValue()));
-                    });
-                }
+                truantStudent.forEach(studentAttendanceViewDto -> {
+                    studentAttendanceViewDto.setPaymentStatus(paymentStatusMap.get(studentAttendanceViewDto.getStudentId().intValue()));
+                });
             }
             List<StudentAttendanceViewDto> tempIds = truantStudent.stream()
                     .filter(studentAttendanceViewDto -> studentAttendanceViewDto.getGroupType().equals("MUSIC"))

+ 3 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java

@@ -604,11 +604,9 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
             if(schedule.getGroupType() == GroupType.MUSIC){
                 Set<Integer> collect = dataList.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
                 Map<Integer,String> paymentStatusMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.queryUserCoursePaymentStatus(collect,schedule.getMusicGroupId()));
-                if(paymentStatusMap.size() > 0){
-                    dataList.forEach(e -> {
-                        e.setPaymentStatus(paymentStatusMap.get(e.getUserId()));
-                    });
-                }
+                dataList.forEach(e -> {
+                    e.setPaymentStatus(paymentStatusMap.get(e.getUserId()));
+                });
             }
         }
         if (count == 0) {

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

@@ -487,6 +487,7 @@
         SELECT mg.id_ 'key',CASE WHEN MIN(mgpcd.payment_status_) IS NULL THEN 'NON_PAYMENT' ELSE MIN(mgpcd.payment_status_) END 'value'
         FROM music_group mg
         LEFT JOIN music_group_payment_calender mgpc ON mgpc.music_group_id_ = mg.id_
+        AND mgpc.status_ IN ('NO','OPEN','OVER')
         AND DATE_FORMAT(NOW(),'%Y-%m-%d') >= DATE_FORMAT(mgpc.payment_valid_start_date_,'%Y-%m-%d')
         LEFT JOIN music_group_payment_calender_detail mgpcd ON mgpc.id_ = mgpcd.music_group_payment_calender_id_ AND mgpcd.user_id_ = #{userId}
         WHERE FIND_IN_SET(mg.id_,#{musicGroupId})
@@ -496,7 +497,9 @@
         SELECT mgpcd.user_id_ 'key',
         CASE WHEN MIN(mgpcd.payment_status_) IS NULL THEN 'NON_PAYMENT' ELSE MIN(mgpcd.payment_status_) END 'value'
         FROM music_group mg
-        LEFT JOIN music_group_payment_calender mgpc ON mgpc.music_group_id_ = mg.id_ AND DATE_FORMAT(NOW(),'%Y-%m-%d') >= DATE_FORMAT(mgpc.payment_valid_start_date_,'%Y-%m-%d')
+        LEFT JOIN music_group_payment_calender mgpc ON mgpc.music_group_id_ = mg.id_
+        AND mgpc.status_ IN ('NO','OPEN','OVER')
+        AND DATE_FORMAT(NOW(),'%Y-%m-%d') >= DATE_FORMAT(mgpc.payment_valid_start_date_,'%Y-%m-%d')
         LEFT JOIN music_group_payment_calender_detail mgpcd ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
         WHERE mg.id_ = #{musicGroupId} AND mgpcd.user_id_ IN
         <foreach collection="studentId" item="item" separator="," open="(" close=")">