Browse Source

Merge remote-tracking branch 'origin/feature/0529-live' into feature/0529-live

shangke 2 years ago
parent
commit
28ac18a5fd

+ 50 - 80
.idea/httpRequests/http-requests-log.http

@@ -1,3 +1,53 @@
+GET http://127.0.0.1:9002/classGroup/findTeacherClassStudents?classGroupId=191
+Authorization: bearer 7957b8d7-63d0-43e1-9c06-8a36b2cc85a4
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-05T193543.200.json
+
+###
+
+GET http://127.0.0.1:9002/classGroup/findTeacherClassStudents?classGroupId=197
+Authorization: bearer 7957b8d7-63d0-43e1-9c06-8a36b2cc85a4
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-05T193534.200.json
+
+###
+
+GET http://127.0.0.1:9002/classGroup/findTeacherClassStudents?courseScheduleId=1819
+Authorization: bearer 7957b8d7-63d0-43e1-9c06-8a36b2cc85a4
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-05T193400.200.json
+
+###
+
+GET http://127.0.0.1:9002/classGroup/findTeacherClassStudents?courseScheduleId=1270
+Authorization: bearer 7957b8d7-63d0-43e1-9c06-8a36b2cc85a4
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-05T193335.200.json
+
+###
+
+GET http://127.0.0.1:9002/classGroup/findTeacherClassStudents
+Authorization: bearer 7957b8d7-63d0-43e1-9c06-8a36b2cc85a4
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-05T193308.200.json
+
+###
+
 POST http://127.0.0.1:8005/studentManage/userPage
 Authorization: bearer b897da27-5a37-47df-8e76-54d80a61a55d
 Content-Type: application/json
@@ -763,83 +813,3 @@ Accept-Encoding: br,deflate,gzip,x-gzip
 
 ###
 
-POST http://127.0.0.1:8005/classGroup/teachingPointCourse
-Authorization: bearer 81d0c352-fcc8-4812-87f5-0f7a68d10451
-Content-Type: application/json
-coopId: 7
-Content-Length: 68
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{"startTime":"2023-05-22","endTime":"2023-05-28","page":1,"rows":20}
-
-<> 2023-06-01T155031.200.json
-
-###
-
-POST http://127.0.0.1:8005/classGroup/teachingPointCourse
-Authorization: bearer 81d0c352-fcc8-4812-87f5-0f7a68d10451
-Content-Type: application/json
-coopId: 7
-Content-Length: 68
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{"startTime":"2023-05-22","endTime":"2023-05-28","page":1,"rows":20}
-
-<> 2023-06-01T154820.200.json
-
-###
-
-POST http://127.0.0.1:8005/classGroup/teachingPointCourse
-Authorization: bearer 387ba749-39ac-4a02-a183-00cf8ac29f10
-Content-Type: application/json
-coopId: 7
-Content-Length: 68
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{"startTime":"2023-05-22","endTime":"2023-05-28","page":1,"rows":20}
-
-<> 2023-06-01T154745.200.json
-
-###
-
-POST http://127.0.0.1:8005/imGroup/updateImGroup
-Authorization: bearer 81d0c352-fcc8-4812-87f5-0f7a68d10451
-Content-Type: application/json
-tenantId: 1
-Content-Length: 54
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-	"name": "考虑图",
-	"id": "1660958104046542850"
-}
-
-<> 2023-06-01T145140.200.json
-
-###
-
-POST http://127.0.0.1:8005/imGroup/updateImGroup
-Authorization: bearer 81d0c352-fcc8-4812-87f5-0f7a68d10451
-Content-Type: application/json
-Content-Length: 54
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-	"name": "考虑图",
-	"id": "1660958104046542850"
-}
-
-<> 2023-06-01T145016.200.json
-
-###
-

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherClassStudentDto.java

@@ -22,6 +22,29 @@ public class TeacherClassStudentDto {
     @ApiModelProperty(value = "连续旷课次数")
     private Integer continuousAbsenteeismTimes;
 
+    @ApiModelProperty(value = "声部")
+    private String subjectName;
+
+
+    @ApiModelProperty(value = "会员状态")
+    private Boolean vipFlag;
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public Boolean getVipFlag() {
+        return vipFlag;
+    }
+
+    public void setVipFlag(Boolean vipFlag) {
+        this.vipFlag = vipFlag;
+    }
+
     public String getPhone() {
         return phone;
     }

+ 22 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1863,12 +1863,33 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
-        List dataList = null;
+        List<TeacherClassStudentDto> dataList = null;
         int count = classGroupStudentMapperDao.findClassStudentNum(params);
         if (count > 0) {
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             dataList = classGroupStudentMapperDao.findClassStudent(params);
+
+            // 学生ID集合
+            Set<Long> studentIds = dataList.stream().map(o -> o.getUserId()).filter(Objects::nonNull).collect(Collectors.toSet());
+
+            // 会员信息
+            Map<Integer, Student> studentMap = studentService.getMapByIds(studentIds.stream().map(Long::intValue).collect(Collectors.toList()));
+
+            // 声部
+            Map<Integer, StudentSubjectDto> studentSubjectDtoMap = subjectService.getSubjectByStudentId(new HashSet<>(studentIds));
+
+            for (TeacherClassStudentDto teacherClassStudentDto : dataList) {
+                Student student = studentMap.get(teacherClassStudentDto.getUserId().intValue());
+                if (student != null) {
+                    teacherClassStudentDto.setVipFlag(student.getMemberRankSettingId() != null);
+                }
+                StudentSubjectDto studentSubjectDto = studentSubjectDtoMap.get(teacherClassStudentDto.getUserId().intValue());
+                if (studentSubjectDto != null) {
+                    teacherClassStudentDto.setSubjectName(studentSubjectDto.getSubjectName());
+                }
+            }
+
         }
         if (count == 0) {
             dataList = new ArrayList<>();

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -2154,7 +2154,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		VipGroup vipGroup=null;
 		VipGroupActivity vipGroupActivity = null;
 
-		if(groupType == VIP) {
+		if(groupType == VIP || groupType == LIVE) {
 			vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
 			if(Objects.isNull(vipGroup)){
 				throw new BizException("课程组信息不存在");
@@ -2334,7 +2334,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 }
             }
         }
-		if(groupType == VIP){
+		if(groupType == VIP || groupType == LIVE){
 			CourseSchedule courseSchedule = courseSchedules.stream().max(Comparator.comparing(CourseSchedule::getEndClassTime)).get();
 //
 //			BigDecimal teacherSalary=BigDecimal.ZERO;

+ 6 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherLeaveRecordServiceImpl.java

@@ -93,15 +93,13 @@ public class TeacherLeaveRecordServiceImpl extends BaseServiceImpl<Long, Teacher
 				List<CourseSchedule> list = new ArrayList<CourseSchedule>();
 
 				for (CoursesScheduleHistory his : coursesScheduleHistoryList) {
-					if (his.getBefore().getType() != CourseScheduleType.VIP && his.getBefore().getType() != CourseScheduleType.LIVE) {
-						continue;
-					}
-					if(!teacherLeaveRecord.getEndTime().before(his.getAfter().getStartClassTime())
-							&&!teacherLeaveRecord.getStartTime().after(his.getAfter().getEndClassTime())){
-						throw new BizException("课程时间与老师请假时间存在冲突");
+					if (his.getBefore().getType() == CourseScheduleType.VIP) {
+						if(!teacherLeaveRecord.getEndTime().before(his.getAfter().getStartClassTime())
+								&&!teacherLeaveRecord.getStartTime().after(his.getAfter().getEndClassTime())){
+							throw new BizException("课程时间与老师请假时间存在冲突");
+						}
+						list.add(his.getAfter());
 					}
-
-					list.add(his.getAfter());
 				}
 			}
 		}

+ 5 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -2335,6 +2335,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         if (!vipGroupCategory.getMusicTheory()) {
             gofts = gofts.divide(new BigDecimal(vipGroupCategory.getStudentNum()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(normalStudentNum)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
             ofts = ofts.divide(new BigDecimal(vipGroupCategory.getStudentNum()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(normalStudentNum)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+        } else if("LIVE".equals(vipGroup.getGroupType())){
+            gofts = gofts.multiply(new BigDecimal(normalStudentNum)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+            ofts = ofts.multiply(new BigDecimal(normalStudentNum)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
         }
         results.put("offlineTeacherSalary", ofts);
         results.put("giveOfflineTeacherSalary", gofts);
@@ -4514,7 +4517,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
                 //关闭课程组
                 vipGroupDao.batchUpdate(noStudentGroup);
             }
-            Date now = new Date();
             if(!CollectionUtils.isEmpty(hasStudentGroup)){
                 //排课
                 for (VipGroup vipGroup : hasStudentGroup) {
@@ -4522,7 +4524,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
                     vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
                     Integer tenantId = vipGroup.getTenantId();
                     for (String s : vipGroup.getStudentIdList().split(",")) {
-                        Integer userId = Integer.parseInt(s);
                         classGroup.setDelFlag(0);
                         VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroup.getVipGroupCategoryId(),
                                 vipGroup.getOrganId(), vipGroup.getGroupType());
@@ -4607,15 +4608,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
                         imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(),
                                 vipGroup.getName(), null, null, vipGroup.getGroupType(), ImGroup.GroupTypeEnum.valueOf(vipGroup.getGroupType()));
                         imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
-                        imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(), classGroup.getGroupType());
-                        //更新所属分部列表
-                        List<Integer> organIds = classGroupDao.findStudentOrganIdsByClassGroup(classGroup.getId().longValue());
-                        organIds.add(vipGroup.getOrganId());
-                        HashSet<Integer> hashSet = new HashSet<>(organIds);
-                        String organIdsString = StringUtils.join(hashSet, ",");
-                        vipGroup.setOrganIdList(organIdsString);
-                        vipGroupDao.update(vipGroup);
                     }
+                    imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(), classGroup.getGroupType());
+                    vipGroupDao.update(vipGroup);
                 }
             }
         }