Pārlūkot izejas kodu

双十一活动调整

zouxuan 1 gadu atpakaļ
vecāks
revīzija
874ec62d12

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/LiveGroupWrapper.java

@@ -80,6 +80,9 @@ public class LiveGroupWrapper {
         @ApiModelProperty("学生状态")
         private int studentStatus = 0;
 
+        @ApiModelProperty("学生班级状态")
+        private String classStatus;
+
 
     }
 

+ 18 - 19
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -4737,7 +4737,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(), classGroup.getGroupType());
         }
         imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(),
-                vipGroup.getName(), null, "https://gyt.ks3-cn-beijing.ksyuncs.com/icon_live_class_group_avatar.png",
+                vipGroup.getName(), null, "",
                 vipGroup.getGroupType(), ImGroup.GroupTypeEnum.valueOf(vipGroup.getGroupType()));
         classGroup.setTotalClassTimes(courseSchedules.size());
         classGroupDao.update(classGroup);
@@ -5041,33 +5041,32 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         if (CollectionUtils.isEmpty(studentMapperList)) {
             return livedStudentList;
         }
-        Map<Integer, ClassGroupStudentMapper> studentMapperMap = studentMapperList.stream().collect(Collectors.toMap(ClassGroupStudentMapper::getUserId, o->o ,(k1,k2)->k2));
-
-//        List<StudentApplyRefunds> applyRefunds = studentApplyRefundsDao.findByGroupAndType(query.getLiveGroupId().toString(), GroupType.LIVE.getCode());
-//        Map<Integer, List<StudentApplyRefunds>> studentApplyRefundsMap = applyRefunds.stream()
-//                .collect(Collectors.groupingBy(StudentApplyRefunds::getUserId));
+        List<StudentApplyRefunds> applyRefunds = studentApplyRefundsDao.findByGroupAndType(query.getLiveGroupId().toString(), GroupType.LIVE.getCode());
+        Map<Integer, List<StudentApplyRefunds>> studentApplyRefundsMap = applyRefunds.stream()
+                .collect(Collectors.groupingBy(StudentApplyRefunds::getUserId));
         records.forEach(data -> {
-            ClassGroupStudentMapper classGroupStudentMapper = studentMapperMap.get(data.getStudentId());
-            if (Objects.isNull(classGroupStudentMapper)) {
+            if (StringUtils.isEmpty(data.getClassStatus())) {
                 data.setStudentStatus(0);
                 return;
             }
-            if (classGroupStudentMapper.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)) {
+            if (StringUtils.equals(data.getClassStatus(),ClassGroupStudentStatusEnum.QUIT.getCode())) {
                 data.setStudentStatus(1);
                 return;
-            } else if (classGroupStudentMapper.getStatus().equals(ClassGroupStudentStatusEnum.QUIT_SCHOOL)) {
+            } else if (StringUtils.equals(data.getClassStatus(),ClassGroupStudentStatusEnum.QUIT_SCHOOL.getCode())) {
                 data.setStudentStatus(3);
                 return;
-            }
-
-            /*List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsMap.get(data.getStudentId());
-            if (!CollectionUtils.isEmpty(studentApplyRefunds)) {
-                StudentApplyRefunds studentApplyRefund = studentApplyRefunds.get(0);
-                if (data.getStudentStatus() == 0 && studentApplyRefund.getStatus().equals(StudentApplyRefundsStatus.ING)) {
-                    data.setStudentStatus(2);
-                    return;
+            } else if (StringUtils.equals(data.getClassStatus(),ClassGroupStudentStatusEnum.NORMAL.getCode())) {
+                data.setStudentStatus(0);
+                List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsMap.get(data.getStudentId());
+                if (!CollectionUtils.isEmpty(studentApplyRefunds)) {
+                    StudentApplyRefunds studentApplyRefund = studentApplyRefunds.get(0);
+                    if (data.getStudentStatus() == 0 && studentApplyRefund.getStatus().equals(StudentApplyRefundsStatus.ING)) {
+                        data.setStudentStatus(2);
+                        return;
+                    }
                 }
-            }*/
+                return;
+            }
             data.setStudentStatus(0);
         });
 

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

@@ -6,8 +6,10 @@
     select
     t.user_id_ as studentId,
     t.create_time_ as createTime,
-    t.order_no_ as orderNo
+    t.order_no_ as orderNo,
+    cgsm.status_ as classStatus
     from student_payment_order t
+    left join class_group_student_mapper cgsm ON cgsm.music_group_id_ = t.music_group_id_ and cgsm.class_group_id_ = t.class_group_id_ and cgsm.user_id_ = t.user_id_
     left join sys_user su on su.id_ = t.user_id_
     <where>
         <if test="param.liveGroupId != null">