Selaa lähdekoodia

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

zouxuan 2 vuotta sitten
vanhempi
commit
70eef323bd

+ 95 - 111
.idea/httpRequests/http-requests-log.http

@@ -1,3 +1,98 @@
+GET http://127.0.0.1:9001/studentVipGroup/joinLiveRoomByShare?courseScheduleId=2179
+Authorization: bearer 093517b0-c9a4-407b-b558-0d71bf157b16
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-12T095605.200.json
+
+###
+
+GET http://127.0.0.1:9001/studentVipGroup/joinLiveRoomByShare?courseScheduleId=2179
+Authorization: bearer 093517b0-c9a4-407b-b558-0d71bf157b16
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-12T095427.200.json
+
+###
+
+GET http://127.0.0.1:9001/studentVipGroup/joinLiveRoomByShare?courseScheduleId=2179
+Authorization: bearer 093517b0-c9a4-407b-b558-0d71bf157b16
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-12T095323.200.json
+
+###
+
+GET http://127.0.0.1:9001/studentVipGroup/joinLiveRoomByShare?courseScheduleId=2179
+Authorization: bearer 093517b0-c9a4-407b-b558-0d71bf157b16
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-12T095238.200.json
+
+###
+
+GET http://127.0.0.1:9001/studentVipGroup/joinLiveRoomByShare?courseScheduleId=2179
+Authorization: bearer 093517b0-c9a4-407b-b558-0d71bf157b16
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-12T095217.200.json
+
+###
+
+GET http://127.0.0.1:9001/studentVipGroup/joinLiveRoomByShare?courseScheduleId=2179
+Authorization: bearer 093517b0-c9a4-407b-b558-0d71bf157b16
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-12T095045.200.json
+
+###
+
+GET http://127.0.0.1:9001/studentVipGroup/joinLiveRoomByShare?courseScheduleId=2179
+Authorization: bearer 093517b0-c9a4-407b-b558-0d71bf157b16
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-12T094907.200.json
+
+###
+
+GET http://127.0.0.1:9001/studentVipGroup/joinLiveRoomByShare?courseScheduleId=2179
+Authorization: bearer 81d0c352-fcc8-4812-87f5-0f7a68d10451
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-06-12T094734.200.json
+
+###
+
+POST http://localhost:8005/imSendGroupMessage/send
+Content-Type: application/json
+tenantId: 1
+Authorization: bearer 9b756b90-f27a-4ca9-99b1-da854c72eb3f
+Content-Length: 99
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{"postType":"0","messageContent":"3の3","messageType":"TXT","targetIds":"232","isIncludeSender":0}
+
+<> 2023-06-09T174838.200.json
+
+###
+
 GET http://127.0.0.1:8005/task/closeLiveCourseRoom
 Connection: Keep-Alive
 User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
@@ -638,114 +733,3 @@ Accept-Encoding: br,deflate,gzip,x-gzip
 
 ###
 
-GET http://127.0.0.1:9002/teacherCourseSchedule/liveCourseScheduleTime?courseScheduleId=1678
-Authorization: bearer 2cd308e9-0b8b-4b08-b3cd-f34dc50a8dfd
-Proxy-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-06-07T152014.200.json
-
-###
-
-GET http://127.0.0.1:8005/teacher/findTeacherByTenantId
-Authorization: bearer 7e4145d6-111d-429b-893a-4546df0f58ed
-tenantId: 1
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-06-06T170540.200.json
-
-###
-
-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
-coopId: 25
-Content-Length: 137
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-//  "keyword": "一",
-//    "musicGroupId": 23050516201200001,
-  //  "subjectId": 2,
-  //  "vipFlag": true,
-//  "studentId": 2248340
-
-}
-
-<> 2023-06-02T201036.200.json
-
-###
-
-POST http://127.0.0.1:8005/studentManage/userDetail
-Authorization: bearer 81d0c352-fcc8-4812-87f5-0f7a68d10451
-Content-Type: application/json
-coopId: 25
-Content-Length: 63
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-  "studentId": 2248340,
-  "musicGroupId": 23042419330600001
-}
-
-<> 2023-06-02T201028.200.json
-
-###
-

+ 1 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/CourseShareService.java

@@ -8,11 +8,9 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 import org.springframework.web.multipart.MultipartFile;
 
-import java.util.List;
-
 public interface CourseShareService extends BaseService<Integer, CourseShare> {
 
-    List<CourseShare> saveCourseShare(CourseShareDto courseShareDto);
+    Boolean saveCourseShare(CourseShareDto courseShareDto);
 
     PageInfo<StudentManageListDto> queryCourseSharedStudent(CourseShareQueryInfo shareQueryInfo);
 

+ 100 - 47
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseShareServiceImpl.java

@@ -5,17 +5,19 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
 import com.ym.mec.biz.dal.dao.CourseShareDao;
+import com.ym.mec.biz.dal.dao.ImLiveRoomPurviewDao;
 import com.ym.mec.biz.dal.dao.OrganizationDao;
-import com.ym.mec.biz.dal.dao.StudentDao;
 import com.ym.mec.biz.dal.dao.StudentManageDao;
 import com.ym.mec.biz.dal.dao.SubjectDao;
 import com.ym.mec.biz.dal.dto.CourseShareDto;
 import com.ym.mec.biz.dal.dto.StudentManageListDto;
+import com.ym.mec.biz.dal.dto.SysUserDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
 import com.ym.mec.biz.dal.entity.CourseShare;
 import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.dal.entity.Student;
+import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.enums.JoinCourseType;
 import com.ym.mec.biz.dal.page.CourseShareQueryInfo;
 import com.ym.mec.biz.service.CourseShareService;
@@ -28,6 +30,7 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.excel.POIUtil;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -58,7 +61,7 @@ public class CourseShareServiceImpl extends BaseServiceImpl<Integer, CourseShare
     /**
      * 导入数据错误信息最大长度
      */
-    private static final int IMPORT_ERR_MSG_MAX_LEN = 1000;
+    private static final int IMPORT_ERR_MSG_MAX_LEN = 50;
 
     private static final String TENANT_ID = "tenantId";
 
@@ -69,9 +72,6 @@ public class CourseShareServiceImpl extends BaseServiceImpl<Integer, CourseShare
     private StudentManageDao studentManageDao;
 
     @Autowired
-    private StudentDao studentDao;
-
-    @Autowired
     private SysUserService userService;
 
     @Autowired
@@ -83,6 +83,12 @@ public class CourseShareServiceImpl extends BaseServiceImpl<Integer, CourseShare
     @Autowired
     private OrganizationDao organizationDao;
 
+    @Autowired
+    private ImLiveRoomPurviewDao imLiveRoomPurviewDao;
+
+    @Autowired
+    private SubjectDao subjectDao;
+
     private static final List<String> STUDENT_TEMPLATE_FIELDS = Arrays.asList("分部", "学生姓名", "手机号");
 
     @Override
@@ -92,38 +98,53 @@ public class CourseShareServiceImpl extends BaseServiceImpl<Integer, CourseShare
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public List<CourseShare> saveCourseShare(CourseShareDto courseShareDto) {
+    public Boolean saveCourseShare(CourseShareDto courseShareDto) {
         CourseSchedule courseSchedule = getCourseScheduleById(courseShareDto.getCourseId());
-        Integer userId = userService.getUserId();
-        if (CollectionUtils.isEmpty(courseShareDto.getUserIds())) {
-            // 不分享,清理数据并返回
-            courseShareDao.deleteByCourseId(courseShareDto.getCourseId());
-            return new ArrayList<>();
+
+        HashMap<String, Object> params = new HashMap<>();
+        MapUtil.populateMap(params, courseShareDto);
+        List<Integer> userIds = courseShareDto.getUserIds();
+        if (params.keySet().isEmpty() && CollectionUtils.isEmpty(userIds)) {
+            throw new BizException("未选择参数");
+        }
+        List<SysUserDto> studentList = imLiveRoomPurviewDao.selectRoomPurviewStudent(params);
+        List<Integer> userIdList = studentList.stream()
+                .map(SysUserDto::getUserId).map(Long::intValue).distinct().collect(Collectors.toList());
+        if (CollectionUtils.isNotEmpty(userIds)) {
+            userIds.forEach(next -> {
+                if (!userIdList.contains(next)) {
+                    userIdList.add(next);
+                }
+            });
+        }
+        // 处理已经分享过的数据
+        List<CourseShare> existShares = courseShareDao.selectByCourseId(courseShareDto.getCourseId());
+        if (CollectionUtils.isNotEmpty(existShares)) {
+            List<Integer> sharedHistoryRecords = existShares.stream()
+                    .map(CourseShare::getUserId)
+                    .collect(Collectors.toList());
+            // 已经存在的数据不需要重复录入
+            userIdList.removeIf(sharedHistoryRecords::contains);
+        }
+        if (CollectionUtils.isEmpty(userIdList)) {
+            // 没有新加入的数据
+            return true;
         }
 
-        List<Student> students = studentDao.findByStudentIds(courseShareDto.getUserIds());
-        List<CourseShare> courseShares = students.stream().map(next -> {
+        Integer userId = userService.getUserId();
+        List<CourseShare> courseShares = userIdList.stream().map(next -> {
             CourseShare courseShare = new CourseShare();
             courseShare.setCourseId(courseShareDto.getCourseId());
             courseShare.setTenantId(courseSchedule.getTenantId());
-            courseShare.setUserId(next.getUserId());
+            courseShare.setUserId(next);
             courseShare.setCreateTime(new Date());
             courseShare.setCreateBy(userId);
             return courseShare;
         }).collect(Collectors.toList());
 
-        // 处理已经分享过的数据
-        List<CourseShare> existShares = courseShareDao.selectByCourseId(courseShareDto.getCourseId());
-        if (CollectionUtils.isNotEmpty(existShares)) {
-            // 私有分享,删除历史数据
-            List<Integer> sharedHistoryRecords = existShares.stream()
-                    .map(CourseShare::getId)
-                    .collect(Collectors.toList());
-            courseShareDao.deleteByIds(sharedHistoryRecords);
-        }
         // 数据入库
         batchInsert(courseShares);
-        return courseShareDao.selectByCourseId(courseShareDto.getCourseId());
+        return true;
     }
 
     @Override
@@ -146,12 +167,28 @@ public class CourseShareServiceImpl extends BaseServiceImpl<Integer, CourseShare
         param.put(TENANT_ID, courseSchedule.getTenantId());
         MapUtil.populateMap(param, shareQueryInfo);
         param.put("userIds", courseShareRecords.stream().map(CourseShare::getUserId).toArray());
-        int count = studentManageDao.countStudentAttendances(param);
+        int count = studentManageDao.countStudentByOrganId(param);
         pageInfo.setTotal(count);
-        if (count > 0) {
-            param.put("offset", pageInfo.getOffset());
-            pageInfo.setRows(studentManageDao.findStudentsByOrganId(param));
+        if (count == 0) {
+            pageInfo.setRows(new ArrayList<>());
+            return pageInfo;
+        }
+        param.put("offset", pageInfo.getOffset());
+        List<StudentManageListDto> studentManageListDtos = studentManageDao.findStudentsByOrganId(param);
+        List<Subject> subjects = subjectDao.findAll(new HashMap<>());
+        Map<Integer, String> subjectIdNameMap = subjects.stream()
+                .collect(Collectors.toMap(Subject::getId, Subject::getName));
+        for (StudentManageListDto next : studentManageListDtos) {
+            String subjectIdList = next.getSubjectIdList();
+            if (StringUtils.isEmpty(subjectIdList)) {
+                continue;
+            }
+            List<String> subjectNames = Arrays.stream(subjectIdList.split(","))
+                    .map(id -> subjectIdNameMap.getOrDefault(Integer.valueOf(id), "")).distinct()
+                    .collect(Collectors.toList());
+            next.setSubjectName(String.join(",", subjectNames));
         }
+        pageInfo.setRows(studentManageListDtos);
         return pageInfo;
     }
 
@@ -202,32 +239,32 @@ public class CourseShareServiceImpl extends BaseServiceImpl<Integer, CourseShare
             throw new BizException("文件格式错误,无法获取[student]页签数据");
         }
         if (!students.get(0).keySet().containsAll(STUDENT_TEMPLATE_FIELDS)) {
-            throw new BizException("页签必须包含[分部/学生姓名/手机号]");
+            throw new BizException("首行标题必须包含[分部/学生姓名/手机号]字段");
         }
         List<Organization> allOrgans = organizationDao.findAllOrgans(courseSchedule.getTenantId());
         Set<String> orgNames = allOrgans.stream().map(Organization::getName).collect(Collectors.toSet());
-        StringBuilder sb = new StringBuilder();
         List<Student> studentList = new ArrayList<>();
         Set<String> phoneNos = new HashSet<>();
+        HashMap<Integer, String> rowIndexMsg = new LinkedHashMap<>();
         for (int index = 0; index < students.size(); index++) {
             Map<String, Object> row = students.get(index);
-            Student student = checkExcelData(sb, orgNames, phoneNos, index, row);
+            Student student = checkExcelData(rowIndexMsg, orgNames, phoneNos, index, row);
             if (student == null) {
                 // 空行过滤
                 continue;
             }
             // 避免导入数据存在大量错误数据,出现长时间等待
-            if (sb.length() > IMPORT_ERR_MSG_MAX_LEN) {
+            if (rowIndexMsg.keySet().size() > IMPORT_ERR_MSG_MAX_LEN) {
                 break;
             }
             studentList.add(student);
         }
-        if (sb.length() > 0) {
-            throw new BizException(sb.toString());
+        if (!rowIndexMsg.keySet().isEmpty()) {
+            List<String> msgList = new ArrayList<>(rowIndexMsg.values());
+            throw new BizException(String.join("\n", msgList));
         }
 
         // 判断导入的学生数据是否在库中匹配到,过滤非法的学生数据
-        SysUser sysUser = userService.getUser();
         Map<Integer, String> orgIdNameMap = allOrgans.stream()
                 .collect(Collectors.toMap(Organization::getId, Organization::getName));
 
@@ -258,33 +295,45 @@ public class CourseShareServiceImpl extends BaseServiceImpl<Integer, CourseShare
                     next.setUserId(legalStudentMap.get(key).getUserId());
                     return false;
                 }
+                rowIndexMsg.put(next.getUserId(), String.format("错误的学生姓名:%s,手机号:%s", next.getUsername(),
+                        next.getPhone()));
                 return true;
             });
         }
+
+        if (!rowIndexMsg.keySet().isEmpty()) {
+            List<String> msgList = new ArrayList<>(rowIndexMsg.values());
+            throw new BizException(String.join("\n", msgList));
+        }
         List<Student> legalStudents = studentGroupByOrg.values().stream()
                 .flatMap(Collection::stream).collect(Collectors.toList());
-        if (CollectionUtils.isEmpty(legalStudents)) {
-            throw new BizException("未解析到合法的学生");
-        }
 
         // 处理导入数据中存在已经分享的数据再次入库
         List<CourseShare> existShares = courseShareDao.selectByCourseId(courseId);
         if (CollectionUtils.isNotEmpty(existShares)) {
             Set<String> existShareKeys = existShares.stream()
                     .map(next -> (next.getCourseId() + "_" + next.getUserId())).collect(Collectors.toSet());
-            legalStudents.removeIf(next -> existShareKeys.contains(courseId + "_" + next.getUserId()));
+            legalStudents.removeIf(next -> {
+                if (existShareKeys.contains(courseId + "_" + next.getUserId())) {
+                    rowIndexMsg.put(next.getUserId(), "数据重复");
+                    return true;
+                }
+                return false;
+            });
         }
+        SysUser sysUser = userService.getUser();
+        Integer tenantId = TenantIdThreadLocal.get();
         List<CourseShare> courseShares = legalStudents.stream().map(next -> {
             CourseShare courseShare = new CourseShare();
             courseShare.setUserId(next.getUserId());
-            courseShare.setTenantId(TenantIdThreadLocal.get());
+            courseShare.setTenantId(tenantId);
             courseShare.setCourseId(courseId);
             courseShare.setCreateTime(new Date());
             courseShare.setCreateBy(sysUser.getId());
             return courseShare;
         }).collect(Collectors.toList());
         batchInsert(courseShares);
-        return String.format("成功导入%s条数据", courseShares.size());
+        return String.format("成功导入数据%s条%n重复数据%s条", courseShares.size(), rowIndexMsg.keySet().size());
     }
 
     @Override
@@ -293,15 +342,18 @@ public class CourseShareServiceImpl extends BaseServiceImpl<Integer, CourseShare
         return true;
     }
 
-    private Student checkExcelData(StringBuilder sb, Set<String> orgNames, Set<String> phoneNos, int i, Map<String,
-            Object> row) {
+    private Student checkExcelData(HashMap<Integer, String> rowIndexMsg, Set<String> orgNames, Set<String> phoneNos,
+                                   int rowIndex, Map<String, Object> row) {
         Student student = new Student();
+        // 临时用作记录导入数据的行号
+        int currentRowIndex = rowIndex + 2;
+        student.setUserId(currentRowIndex);
         if (row.size() == 0) {
             return null;
         }
         Object orgName = row.get(STUDENT_TEMPLATE_FIELDS.get(0));
         if (Objects.isNull(orgName) || !orgNames.contains(orgName.toString().trim())) {
-            sb.append(String.format("第%s行分部数据格式错误或者所属分部不存在%n", (i + 2)));
+            rowIndexMsg.put(currentRowIndex, String.format("第%s行分部数据格式错误或者所属分部不存在%n", currentRowIndex));
         } else {
             student.setOrganName(orgName.toString().trim());
         }
@@ -309,19 +361,19 @@ public class CourseShareServiceImpl extends BaseServiceImpl<Integer, CourseShare
         if (Objects.nonNull(studentName)) {
             student.setUsername(studentName.toString().trim());
         } else {
-            sb.append(String.format("第%s行学生姓名数据格式错误%n", (i + 2)));
+            rowIndexMsg.put(currentRowIndex, String.format("第%s行学生姓名数据格式错误%n", currentRowIndex));
         }
         Object phoneNo = row.get(STUDENT_TEMPLATE_FIELDS.get(2));
         if (Objects.nonNull(phoneNo)) {
             String phone = phoneNo.toString().trim();
             if (phoneNos.contains(phone)) {
-                sb.append(String.format("第%s行手机号重复%n", (i + 2)));
+                rowIndexMsg.put(currentRowIndex, String.format("第%s行手机号重复%n", currentRowIndex));
                 return null;
             }
             student.setPhone(phone);
             phoneNos.add(phone);
         } else {
-            sb.append(String.format("第%s行手机号数据格式错误%n", (i + 2)));
+            rowIndexMsg.put(currentRowIndex, String.format("第%s行手机号数据格式错误%n", currentRowIndex));
         }
         return student;
     }
@@ -341,6 +393,7 @@ public class CourseShareServiceImpl extends BaseServiceImpl<Integer, CourseShare
         }
         return courseSchedule;
     }
+
     /**
      * 根据用户id和课程id查询是否已经私有分享当前课程
      *

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

@@ -384,7 +384,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         classGroup.setName(vipGroupApplyBaseInfoDto.getName());
         classGroup.setTotalClassTimes(totalClassTimes);
         classGroup.setType(ClassGroupTypeEnum.valueOf(groupType));
-        classGroup.setDelFlag(1);
         classGroup.setGroupType(GroupType.valueOf(groupType));
         classGroup.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
 
@@ -5189,15 +5188,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             throw new BizException("课程不存在");
         }
 
-        // 课程是否开始
-        if(CourseStatusEnum.NOT_START.equals(courseSchedule.getStatus())) {
-            throw new BizException("课程未开始");
-        }
-
-        // 是否结束
-        if (CourseStatusEnum.OVER.equals(courseSchedule.getStatus())) {
-            throw new BizException("课程已结束");
-        }
 
         // 分享类型  是否能进入
         if (ShareModeEnum.NO_SHARE.equals(courseSchedule.getShareMode())) {
@@ -5211,6 +5201,17 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             }
         }
 
+
+        // 课程是否开始
+        if(CourseStatusEnum.NOT_START.equals(courseSchedule.getStatus())) {
+            throw new BizException("课程未开始");
+        }
+
+        // 是否结束
+        if (CourseStatusEnum.OVER.equals(courseSchedule.getStatus())) {
+            throw new BizException("课程已结束");
+        }
+
         return LiveGroupWrapper.LiveCourseInfo.builder()
                 .studentId(studentId)
                 .canJoinShareRoom(true)

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

@@ -154,9 +154,10 @@
         s.membership_end_time_,CASE WHEN sut.user_id_ IS NULL THEN 0 ELSE 1 END is_signed_contract_,
         s.cooperation_organ_id_,s.activity_course_detail_,s.experience_membership_end_time_,
         DATEDIFF(s.experience_membership_end_time_,NOW()) experience_membership_day_,DATEDIFF(s.membership_end_time_,NOW()) membership_day_,
-        smcr.user_id_ record_user_id_,s.course_teacher_
+        smcr.user_id_ record_user_id_,s.course_teacher_,org.name_ as organ_name_
 		FROM `student` s LEFT JOIN `sys_user` su ON s.`user_id_` = su.`id_`
 		LEFT JOIN sys_user_tsign sut ON sut.user_id_ = s.user_id_
+        LEFT JOIN organization org ON su.organ_id_ = org.id_
         LEFT JOIN (SELECT DISTINCT user_id_ FROM sys_music_compare_record) smcr ON smcr.user_id_ = s.user_id_
         <if test="hasMember != null">
             <if test="hasMember == 2">

+ 2 - 1
mec-web/src/main/java/com/ym/mec/web/controller/CourseShareController.java

@@ -41,7 +41,8 @@ public class CourseShareController extends BaseController {
     @PostMapping("/saveCourseShare")
     @PreAuthorize("@pcs.hasPermissions('courseShare/saveCourseShare')")
     public HttpResponseResult<List<CourseShare>> saveCourseShare(@Validated @RequestBody CourseShareDto courseShareDto) {
-        return succeed(courseShareService.saveCourseShare(courseShareDto));
+        courseShareService.saveCourseShare(courseShareDto);
+        return succeed();
     }
 
     @ApiOperation(value = "查询已经分享过的学生")