Browse Source

Merge branch 'zx_saas_0906' of http://git.dayaedu.com/yonge/mec into test

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/StudentWrapper.java
zouxuan 6 months ago
parent
commit
a4d558808c
22 changed files with 708 additions and 98 deletions
  1. 28 0
      mec-application/src/main/java/com/ym/mec/student/controller/ImGroupNoticeController.java
  2. 28 0
      mec-application/src/main/java/com/ym/mec/teacher/controller/ImGroupNoticeController.java
  3. 12 16
      mec-application/src/main/java/com/ym/mec/web/controller/ClassGroupStudentController.java
  4. 8 6
      mec-application/src/main/java/com/ym/mec/web/controller/education/ImGroupNoticeController.java
  5. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java
  6. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentStudentCourseDetailDao.java
  7. 6 33
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ImGroupNoticeDto.java
  8. 23 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ImGroupNotice.java
  9. 34 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/im/CK.java
  10. 107 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/im/EClientType.java
  11. 137 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/ImGroupNoticeWrapper.java
  12. 53 8
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/StudentWrapper.java
  13. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupStudentMapperService.java
  14. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ImGroupNoticeService.java
  15. 46 21
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java
  16. 150 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImGroupNoticeServiceImpl.java
  17. 16 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml
  18. 11 6
      mec-biz/src/main/resources/config/mybatis/ImGroupNoticeMapper.xml
  19. 29 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentStudentCourseDetailMapper.xml
  20. 2 2
      mec-im/src/main/java/com/ym/controller/GroupController.java
  21. 1 1
      mec-im/src/main/java/com/ym/controller/PrivateController.java
  22. 1 1
      pom.xml

+ 28 - 0
mec-application/src/main/java/com/ym/mec/student/controller/ImGroupNoticeController.java

@@ -0,0 +1,28 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.biz.dal.dto.ImGroupNoticeDto;
+import com.ym.mec.biz.service.ImGroupNoticeService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+@RequestMapping("${app-config.url.student:}/imGroupNotice")
+@Api(tags = "即时通讯群公告")
+@RestController
+public class ImGroupNoticeController extends BaseController {
+
+    @Resource
+    private ImGroupNoticeService imGroupNoticeService;
+
+    @ApiOperation(value = "获取群公告")
+    @RequestMapping("/getNotice")
+    public HttpResponseResult<ImGroupNoticeDto> getNotice(Long id) {
+        return succeed(imGroupNoticeService.getNotice(id));
+    }
+
+}

+ 28 - 0
mec-application/src/main/java/com/ym/mec/teacher/controller/ImGroupNoticeController.java

@@ -0,0 +1,28 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.biz.dal.dto.ImGroupNoticeDto;
+import com.ym.mec.biz.service.ImGroupNoticeService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+@RequestMapping("${app-config.url.teacher:}/imGroupNotice")
+@Api(tags = "即时通讯群公告")
+@RestController
+public class ImGroupNoticeController extends BaseController {
+
+    @Resource
+    private ImGroupNoticeService imGroupNoticeService;
+
+    @ApiOperation(value = "获取群公告")
+    @RequestMapping("/getNotice")
+    public HttpResponseResult<ImGroupNoticeDto> getNotice(Long id) {
+        return succeed(imGroupNoticeService.getNotice(id));
+    }
+
+}

+ 12 - 16
mec-application/src/main/java/com/ym/mec/web/controller/ClassGroupStudentController.java

@@ -1,7 +1,9 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.wrapper.StudentWrapper;
 import com.ym.mec.biz.service.ClassGroupStudentMapperService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -10,18 +12,12 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @RequestMapping("${app-config.url.web:}/classGroupStudent")
@@ -29,7 +25,7 @@ import java.util.stream.Collectors;
 @RestController
 public class ClassGroupStudentController extends BaseController {
 
-    @Autowired
+    @Resource
     private ClassGroupStudentMapperService classGroupStudentMapperService;
 
 
@@ -38,7 +34,7 @@ public class ClassGroupStudentController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('classGroupStudent/del')")
     @ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "int"),
             @ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
-    public HttpResponseResult del(Integer userId, Integer classGroupId) throws Exception {
+    public HttpResponseResult<Boolean> del(Integer userId, Integer classGroupId) throws Exception {
         return succeed(classGroupStudentMapperService.delClassGroupStudent(userId, classGroupId,false));
     }
 
@@ -46,8 +42,8 @@ public class ClassGroupStudentController extends BaseController {
     @PostMapping("/findAllStudent")
     @PreAuthorize("@pcs.hasPermissions('classGroupStudent/findAllStudent')")
     @ApiImplicitParams({@ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
-    public HttpResponseResult findAllStudent(Integer classGroupId) throws Exception {
-        return succeed(classGroupStudentMapperService.findClassStudentList(classGroupId, ClassGroupStudentStatusEnum.NORMAL));
+    public HttpResponseResult<List<StudentWrapper.ClassStudentDto>> findAllStudent(@RequestBody StudentWrapper.ClassStudentQuery query) throws Exception {
+        return succeed(classGroupStudentMapperService.findAllStudent(query));
     }
 
     @ApiOperation(value = "调整班级(小班课)")
@@ -58,7 +54,7 @@ public class ClassGroupStudentController extends BaseController {
             @ApiImplicitParam(name = "oldClassGroupId", value = "原班级id", required = true, dataType = "int"),
             @ApiImplicitParam(name = "classGroupId", value = "新班级id", required = true, dataType = "int")
     })
-    public HttpResponseResult adjustClassGroup(Integer userId, Integer oldClassGroupId, Integer classGroupId) throws Exception {
+    public HttpResponseResult<Boolean> adjustClassGroup(Integer userId, Integer oldClassGroupId, Integer classGroupId) throws Exception {
         return succeed(classGroupStudentMapperService.adjustClassGroup(userId, oldClassGroupId, classGroupId));
     }
 
@@ -70,7 +66,7 @@ public class ClassGroupStudentController extends BaseController {
             @ApiImplicitParam(name = "classGroupId", value = "小课班班级id", required = true, dataType = "int"),
             @ApiImplicitParam(name = "userIdsStr", value = "学生UserId,逗号分隔", required = true, dataType = "String")
     })
-    public HttpResponseResult addStudents(Integer classGroupId, String userIdsStr) throws Exception {
+    public HttpResponseResult<Boolean> addStudents(Integer classGroupId, String userIdsStr) throws Exception {
         return succeed(classGroupStudentMapperService.addStudents(classGroupId, userIdsStr, GroupType.MUSIC));
     }
 
@@ -89,7 +85,7 @@ public class ClassGroupStudentController extends BaseController {
     @ApiOperation(value = "修改班级学员")
     @PostMapping("/updateClassGroupStudents")
     @PreAuthorize("@pcs.hasPermissions('classGroupStudent/updateClassGroupStudents')")
-    public HttpResponseResult updateClassGroupStudents(Long classGroupId, String studentIds){
+    public HttpResponseResult<Object> updateClassGroupStudents(Long classGroupId, String studentIds){
         if(Objects.isNull(classGroupId)){
             return failed("请指定班级");
         }

+ 8 - 6
mec-application/src/main/java/com/ym/mec/web/controller/education/ImGroupNoticeController.java

@@ -34,11 +34,7 @@ public class ImGroupNoticeController extends BaseController {
     @RequestMapping("/add")
     public HttpResponseResult<Long> add(ImGroupNotice imGroupNotice ) {
         imGroupNotice.setOperatorId(sysUserService.getUserId().longValue());
-        if(imGroupNotice.isIsTop()){
-            //置顶取消
-            imGroupNoticeService.getDao().updateTop(imGroupNotice.getImGroupId(),false);
-        }
-        return succeed(imGroupNoticeService.insert(imGroupNotice));
+        return succeed(imGroupNoticeService.add(imGroupNotice));
     }
 
     @ApiOperation(value = "修改")
@@ -56,6 +52,12 @@ public class ImGroupNoticeController extends BaseController {
         return succeed(imGroupNoticeService.queryLatestNotice(groupId));
     }
 
+    @ApiOperation(value = "获取群公告")
+    @RequestMapping("/getNotice")
+    public HttpResponseResult<ImGroupNoticeDto> getNotice(Long id) {
+        return succeed(imGroupNoticeService.getNotice(id));
+    }
+
     @ApiOperation(value = "获取群公告列表")
     @RequestMapping("/queryNoticePage")
     public HttpResponseResult<PageInfo<ImGroupNoticeDto>> queryPage(ImGroupNoticeQueryInfo queryInfo) {
@@ -65,7 +67,7 @@ public class ImGroupNoticeController extends BaseController {
     @ApiOperation(value = "删除")
     @RequestMapping("/del")
     public HttpResponseResult<Object> del(Long id) {
-        imGroupNoticeService.delete(id);
+        imGroupNoticeService.del(id);
         return succeed();
     }
 }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -6,6 +6,7 @@ import java.util.Map;
 import java.util.Set;
 
 import com.ym.mec.biz.dal.wrapper.LiveGroupWrapper;
+import com.ym.mec.biz.dal.wrapper.StudentWrapper;
 import org.apache.ibatis.annotations.Param;
 
 import com.ym.mec.biz.dal.dto.BaseMapDto;
@@ -230,6 +231,8 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
      */
     List<StudentRegistration> findClassStudentList(@Param("classGroupId") Integer classGroupId, @Param("status") ClassGroupStudentStatusEnum status);
 
+    List<StudentWrapper.ClassStudentDto> findAllStudent(@Param("query") StudentWrapper.ClassStudentQuery query);
+
     /**
      * 查询学生是否已报小班课
      *

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentStudentCourseDetailDao.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.dal.dao;
 import com.ym.mec.biz.dal.dto.StudentSubTotalCourseTimesDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
+import com.ym.mec.biz.dal.wrapper.StudentWrapper;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 
@@ -102,4 +103,8 @@ public interface MusicGroupPaymentStudentCourseDetailDao extends BaseDAO<Long, M
     void delByIds(@Param("courseDetailIds") List<Long> courseDetailIds);
 
     List<MusicGroupPaymentStudentCourseDetail> findByUserIdAndMusicGroupId(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
+
+    List<StudentWrapper.ClassStudentDto> findStudentCourseDetail(@Param("musicGroupId") String musicGroupId,
+                                                                 @Param("studentIds") List<Integer> studentIds,
+                                                                 @Param("query") StudentWrapper.ClassStudentQuery query);
 }

+ 6 - 33
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ImGroupNoticeDto.java

@@ -1,52 +1,25 @@
 package com.ym.mec.biz.dal.dto;
 
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.ImGroupNotice;
 import io.swagger.annotations.ApiModelProperty;
 
-import java.util.Objects;
-
 public class ImGroupNoticeDto extends ImGroupNotice {
 
-	private SysUser user = new SysUser();
-
-	// 拓展字段
-	@ApiModelProperty(value = "群编号;")
-	private String groupId;
-
-	@ApiModelProperty(value = "是否置顶")
-	private Boolean topFlag;
-
-	@ApiModelProperty(value = "是否发送给新人")
-	private Boolean sentToNewMemberFlag;
+	@ApiModelProperty(value = "头像")
+	private String avatar;
 
 	@ApiModelProperty("用户名称")
 	private String username;
 
-	public SysUser getUser() {
-		return user;
-	}
-
-	public void setUser(SysUser user) {
-		this.user = user;
-	}
-
-	public String getGroupId() {
-		return getImGroupId();
-	}
-
-	public Boolean getTopFlag() {
-		return isIsTop();
+	public String getAvatar() {
+		return avatar;
 	}
 
-	public Boolean getSentToNewMemberFlag() {
-		return isIsSentToNewMember();
+	public void setAvatar(String avatar) {
+		this.avatar = avatar;
 	}
 
 	public String getUsername() {
-		if (Objects.nonNull(getUser())) {
-			return getUser().getRealName();
-		}
 		return username;
 	}
 

+ 23 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ImGroupNotice.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import com.ym.mec.common.entity.BaseEntity;
@@ -38,7 +39,28 @@ public class ImGroupNotice extends BaseEntity {
 	
 	/** 操作人 */
 	private Long operatorId;
-	
+
+	// IM消息ID
+	private String messageSeqId;
+
+	private String clientType;
+
+	public String getClientType() {
+		return clientType;
+	}
+
+	public void setClientType(String clientType) {
+		this.clientType = clientType;
+	}
+
+	public String getMessageSeqId() {
+		return messageSeqId;
+	}
+
+	public void setMessageSeqId(String messageSeqId) {
+		this.messageSeqId = messageSeqId;
+	}
+
 	public void setId(Long id){
 		this.id = id;
 	}

+ 34 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/im/CK.java

@@ -0,0 +1,34 @@
+package com.ym.mec.biz.dal.enums.im;
+
+/**
+ * 常用定义
+ * Created by Eric.Shang on 2022/11/4.
+ */
+public interface CK {
+
+    // 手机号
+    String EXP_MOBILE_NUMBER = "^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-8]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\\d{8}$";
+    // 邮箱
+    String EXP_EMAIL = "^(\\w+([-.][A-Za-z0-9]+)*){3,18}@\\w+([-.][A-Za-z0-9]+)*\\.\\w+([-.][A-Za-z0-9]+)*$\n";
+    // 正型
+    String EXP_INT = "^\\d+$";
+    String EXP_JSON_A = "^\\[.?|.+\\]$";
+    String EXP_JSON_O = "^\\{.?|.+\\}$";
+
+    // 参数配置
+    String PARAM_SMS_MAX_TIMES = "sms_max_times";
+    // 参数配置
+    String PARAM_SMS_RECENT_MINUTES = "sms_recent_minutes";
+    // 密码前缀
+    String PASSWORD_PREFIX = "yyszkt";
+
+    // 时间格式化
+    String FORMAT_YYYY_MM_DD = "yyyyMMdd";
+
+    // IM用户ID格式
+    String IM_USER_ID_FORMAT = "{0}_{1}";
+    String IM_USER_LONG_ID_FORMAT = "{0}_{1}_{2}";
+    // 用户ID分隔符
+    String IM_USER_ID_SPLIT = "_";
+
+}

+ 107 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/im/EClientType.java

@@ -0,0 +1,107 @@
+package com.ym.mec.biz.dal.enums.im;
+
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import com.google.common.collect.Lists;
+import com.microsvc.toolkit.common.enums.ConverterEnum;
+import lombok.Getter;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.List;
+
+/**
+ * 客户端类型
+ * Created by Eric.Shang on 2022/11/4.
+ */
+@Getter
+public enum EClientType implements ConverterEnum<String> {
+
+    BACKEND(1, "后端", "cooleshow-backend", "", "backend_login_locked"),
+    SCHOOL(2, "教务端", "cooleshow-school", "school_device_num", "school_login_locked"),
+    TEACHER(3, "老师端", "cooleshow-teacher", "teacher_device_num", "teacher_login_locked"),
+    STUDENT(4, "学生端", "cooleshow-student", "student_device_num", "student_login_locked"),
+    ;
+
+    private final int value;
+    private final String name;
+    private final String clientId;
+    private final String deviceParam;
+    private final String lockedParam;
+
+    @EnumValue
+    private final String code;
+
+    EClientType(int value, String name, String clientId, String param, String lockParam) {
+        this.value = value;
+        this.name = name;
+        this.clientId = clientId;
+        this.deviceParam = param;
+        this.lockedParam = lockParam;
+
+        this.code = this.name();
+    }
+
+    /**
+     * 客户端类型
+     * @param clientId 授权client_id
+     * @return EClientType
+     */
+    public static EClientType clientType(String clientId) {
+
+        if (StringUtils.isNoneBlank(clientId)) {
+
+            for (EClientType item : EClientType.values()) {
+
+                if (Lists.newArrayList(item.getClientId().split(",")).contains(clientId)) {
+
+                    return item;
+                }
+            }
+        }
+
+        return BACKEND;
+    }
+
+    public static EClientType clientName(String name) {
+
+        if (StringUtils.isNoneBlank(name)) {
+
+            for (EClientType item : EClientType.values()) {
+
+                if (Lists.newArrayList(item.name()).contains(name)) {
+
+                    return item;
+                }
+            }
+        }
+
+        return BACKEND;
+    }
+
+
+    /**
+     * 客户端对象比较
+     * @param code 客户端类型
+     * @return boolean
+     */
+    public boolean match(String code) {
+        return getCode().equals(code.toUpperCase());
+    }
+
+    /**
+     * jwtToken失效时间
+     * @param clientType 客户端类型
+     * @return boolean
+     */
+    public static boolean jwtTokenExpire(String clientType) {
+
+        List<EClientType> clientTypes = Lists.newArrayList(BACKEND, TEACHER);
+        for (EClientType item : clientTypes) {
+
+            // 需要设置token失效时间
+            if (item.getCode().equals(clientType)) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

+ 137 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/ImGroupNoticeWrapper.java

@@ -0,0 +1,137 @@
+package com.ym.mec.biz.dal.wrapper;
+
+import com.alibaba.fastjson.JSON;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.ym.mec.biz.dal.enums.im.EClientType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Optional;
+
+/**
+ * 群公告
+ * 2022-11-26 10:55:18
+ */
+@ApiModel(value = "ImGroupNoticeWrapper对象", description = "群公告查询对象")
+public class ImGroupNoticeWrapper {
+
+    @Data
+	@Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" ImGroupNoticeQuery-群公告")
+    public static class ImGroupNoticeQuery implements QueryInfo {
+
+    	@ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        @ApiModelProperty("关键字匹配")
+		private String keyword;
+
+        @ApiModelProperty("群组ID")
+        private String groupId;
+
+        @ApiModelProperty("删除标记")
+        private Boolean delFlag;
+
+        public static ImGroupNoticeQuery from(String json) {
+            return JSON.parseObject(json, ImGroupNoticeQuery.class);
+        }
+
+        public Boolean getDelFlag() {
+            return Optional.ofNullable(delFlag).orElse(false);
+        }
+
+        public String getKeyword() {
+            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
+        }
+    }
+
+    @Data
+	@Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+	@ApiModel(" ImGroupNotice-群公告")
+    public static class ImGroupNotice {
+
+
+		@ApiModelProperty("主键")
+		private Long id;
+
+		@ApiModelProperty("群组ID")
+		private String groupId;
+
+		@ApiModelProperty("标题")
+		private String title;
+
+		@ApiModelProperty("内容")
+		private String content;
+
+		@ApiModelProperty("是否置顶")
+		private Boolean topFlag;
+
+		@ApiModelProperty("是否发送给新人")
+		private Boolean sentToNewMemberFlag;
+
+		@ApiModelProperty("操作人")
+		private Long operatorId;
+
+        @ApiModelProperty("操作用户身份")
+        private EClientType clientType;
+
+		@ApiModelProperty("是否删除1是0否;")
+		private Boolean delFlag;
+
+        @ApiModelProperty("IM消息ID")
+        private String messageSeqId;
+
+		@ApiModelProperty("修改时间")
+		private Date updateTime;
+
+		@ApiModelProperty("创建时间")
+		private Date createTime;
+
+        public static ImGroupNotice from(String json) {
+            return JSON.parseObject(json, ImGroupNotice.class);
+        }
+
+	}
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" 自定义群公告")
+    public static class CustomGroupNotice implements Serializable {
+
+        @ApiModelProperty("业务ID")
+        private String businessID;
+
+        @ApiModelProperty("群公告ID")
+        private String msgId;
+
+        @ApiModelProperty("群公告标题")
+        private String msgTitle;
+
+        @ApiModelProperty("群公告内容")
+        private String msgContent;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public String getBusinessID() {
+            return Optional.ofNullable(businessID).orElse("TC_GROUP_NOTICE");
+        }
+    }
+}

+ 53 - 8
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/StudentWrapper.java

@@ -2,16 +2,15 @@ package com.ym.mec.biz.dal.wrapper;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
-import com.ym.mec.biz.dal.enums.EInGroupStatus;
-import com.ym.mec.biz.dal.enums.ELessonTrainingType;
-import com.ym.mec.biz.dal.enums.StandardEnum;
-import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
+import com.ym.mec.biz.dal.entity.CooperationOrgan;
+import com.ym.mec.biz.dal.enums.*;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -227,12 +226,35 @@ public class StudentWrapper {
 
         @ApiModelProperty(value = "合作机构ID")
         private Integer cooperationOrganId;
+    }
+
+    @Data
+    @ApiModel("班级在读学员列表")
+    public static class ClassStudentQuery {
+
+        @ApiModelProperty(value = "班级编号", required = false)
+        private Integer classGroupId;
+
+        @ApiModelProperty(value = "模糊匹配", required = false)
+        private String search;
+
+        @ApiModelProperty(value = "声部", required = false)
+        private Integer subjectId;
+
+        @ApiModelProperty(value = "有剩余时长的课程类型,(classroom,comprehensive,high,high_online,mix,single,training_mix,training_single,no_course)", required = false)
+        private String courseType;
+
+        @ApiModelProperty(value = "排序字段", required = false)
+        private String sortField;
+
+        @ApiModelProperty(value = "排序方式,ASC,DESC", required = false)
+        private String sortType;
 
     }
 
     @Data
-    @ApiModel("UpdateStudent-学生修改")
-    public static class ClassGroupStudent {
+    @ApiModel("班级在读学员列表")
+    public static class ClassStudentDto {
 
         @ApiModelProperty(value = "学生编号", required = false)
         private Integer userId;
@@ -249,8 +271,31 @@ public class StudentWrapper {
         @ApiModelProperty(value = "家长电话", required = false)
         private String parentsPhone;
 
-        @ApiModelProperty(value = "声部课时长", required = false)
-        private Integer singleDuration;
+        @ApiModelProperty(value = "乐团编号", required = false)
+        private String musicGroupId;
+
+        @ApiModelProperty(value = "声部课剩余时长", required = false)
+        private Integer single;
+
+        @ApiModelProperty(value = "合奏课剩余时长", required = false)
+        private Integer mix;
+
+        @ApiModelProperty(value = "课堂课剩余时长", required = false)
+        private Integer classroom;
+
+        @ApiModelProperty(value = "综合课剩余时长", required = false)
+        private Integer comprehensive;
+
+        @ApiModelProperty(value = "基础技能课剩余时长", required = false)
+        private Integer high;
+
+        @ApiModelProperty(value = "线上基础技能课剩余时长", required = false)
+        private Integer highOnline;
+
+        @ApiModelProperty(value = "集训声部课剩余时长", required = false)
+        private Integer trainingSingle;
 
+        @ApiModelProperty(value = "集训合奏课剩余时长", required = false)
+        private Integer trainingMix;
     }
 }

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupStudentMapperService.java

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.wrapper.StudentWrapper;
 import com.ym.mec.common.service.BaseService;
 
 import java.io.IOException;
@@ -42,7 +43,7 @@ public interface ClassGroupStudentMapperService extends BaseService<Long, ClassG
      * @param status
      * @return
      */
-    List<StudentRegistration> findClassStudentList(Integer classGroupId, ClassGroupStudentStatusEnum status);
+    List<StudentWrapper.ClassStudentDto> findAllStudent(StudentWrapper.ClassStudentQuery query);
 
     /**
      * 调整班级

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ImGroupNoticeService.java

@@ -21,4 +21,10 @@ public interface ImGroupNoticeService extends BaseService<Long, ImGroupNotice> {
 	void modify(ImGroupNotice imGroupNotice);
 
 	ImGroupNoticeDao getDao();
+
+    Long add(ImGroupNotice imGroupNotice);
+
+	void del(Long id);
+
+	ImGroupNoticeDto getNotice(Long id);
 }

+ 46 - 21
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -3,8 +3,10 @@ package com.ym.mec.biz.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.ClassGroupStudentInfoDto;
+import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.dal.wrapper.StudentWrapper;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
@@ -15,7 +17,9 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
 
+import javax.annotation.Resource;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.util.*;
@@ -24,42 +28,42 @@ import java.util.stream.Collectors;
 @Service
 public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, ClassGroupStudentMapper> implements ClassGroupStudentMapperService {
 
-    @Autowired
+    @Resource
     private ClassGroupStudentMapperDao classGroupStudentMapperDao;
-    @Autowired
+    @Resource
     private CourseScheduleService courseScheduleService;
-    @Autowired
+    @Resource
     private StudentRegistrationService studentRegistrationService;
-    @Autowired
+    @Resource
     private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
-    @Autowired
+    @Resource
     private ClassGroupService classGroupService;
-    @Autowired
+    @Resource
     private ClassGroupRelationService classGroupRelationService;
-    @Autowired
+    @Resource
     private ImGroupMemberService imGroupMemberService;
-    @Autowired
+    @Resource
     private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
-    @Autowired
+    @Resource
     private ClassGroupTeacherMapperService classGroupTeacherMapperService;
-    @Autowired
+    @Resource
     private CourseScheduleTeacherSalaryService courseScheduleTeacherSalaryService;
-    @Autowired
+    @Resource
     private TeacherDefaultMusicGroupSalaryService teacherDefaultMusicGroupSalaryService;
-    @Autowired
+    @Resource
     private StudentDao studentDao;
-    @Autowired
+    @Resource
     private CourseScheduleDao courseScheduleDao;
-    @Autowired
+    @Resource
     private ClassGroupDao classGroupDao;
-    @Autowired
+    @Resource
     private MusicGroupDao musicGroupDao;
-
-    @Autowired
+    @Resource
     private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
-
-    @Autowired
+    @Resource
     private ImUserFriendService imUserFriendService;
+    @Resource
+    private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
 
     private static String holidayUrl = "http://tool.bitefu.net/jiari/?d=";
 
@@ -197,8 +201,29 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
     }
 
     @Override
-    public List<StudentRegistration> findClassStudentList(Integer classGroupId, ClassGroupStudentStatusEnum status) {
-        return classGroupStudentMapperDao.findClassStudentList(classGroupId, status);
+    public List<StudentWrapper.ClassStudentDto> findAllStudent(StudentWrapper.ClassStudentQuery query) {
+        List<StudentWrapper.ClassStudentDto> studentDtos = classGroupStudentMapperDao.findAllStudent(query);
+        if(CollectionUtils.isEmpty(studentDtos)){
+            return studentDtos;
+        }
+        //获取乐团学员剩余排课时长
+        String musicGroupId = studentDtos.get(0).getMusicGroupId();
+        List<Integer> studentIds = studentDtos.stream().map(StudentWrapper.ClassStudentDto::getUserId).collect(Collectors.toList());
+        List<StudentWrapper.ClassStudentDto> studentCourseDetails =
+                musicGroupPaymentStudentCourseDetailDao.findStudentCourseDetail(musicGroupId, studentIds,query);
+        if (CollectionUtils.isEmpty(studentCourseDetails)){
+            return new ArrayList<>();
+        }
+        Map<Integer,StudentWrapper.ClassStudentDto> studentDtoMap = studentDtos.stream()
+                .collect(Collectors.toMap(StudentWrapper.ClassStudentDto::getUserId, s -> s, (s1, s2) -> s1));
+        for (StudentWrapper.ClassStudentDto studentCourseDetail : studentCourseDetails) {
+            StudentWrapper.ClassStudentDto classStudentDto = studentDtoMap.get(studentCourseDetail.getUserId());
+            studentCourseDetail.setName(classStudentDto.getName());
+            studentCourseDetail.setGender(classStudentDto.getGender());
+            studentCourseDetail.setSubjectName(classStudentDto.getSubjectName());
+            studentCourseDetail.setParentsPhone(classStudentDto.getParentsPhone());
+        }
+        return studentCourseDetails;
     }
 
     @Override

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

@@ -1,29 +1,46 @@
 package com.ym.mec.biz.service.impl;
 
+import com.alibaba.fastjson.JSON;
+import com.google.common.collect.Lists;
+import com.microsvc.toolkit.middleware.im.ImPluginContext;
+import com.microsvc.toolkit.middleware.im.message.ETencentMessage;
+import com.microsvc.toolkit.middleware.im.message.MessageWrapper;
+import com.microsvc.toolkit.middleware.im.message.TencentRequest;
+import com.microsvc.toolkit.middleware.im.properties.ImConfigProperties;
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.ImGroupNoticeDao;
 import com.ym.mec.biz.dal.dto.ImGroupNoticeDto;
 import com.ym.mec.biz.dal.entity.ImGroupNotice;
 import com.ym.mec.biz.dal.page.ImGroupNoticeQueryInfo;
+import com.ym.mec.biz.dal.wrapper.ImGroupNoticeWrapper;
 import com.ym.mec.biz.service.ImGroupNoticeService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
-import org.springframework.beans.factory.annotation.Autowired;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 @Service
+@Slf4j
 public class ImGroupNoticeServiceImpl extends BaseServiceImpl<Long, ImGroupNotice>  implements ImGroupNoticeService {
 	
-	@Autowired
+	@Resource
 	private ImGroupNoticeDao imGroupNoticeDao;
+	@Resource
+	private ImPluginContext imPluginContext;
+	@Resource
+	private SysUserService sysUserService;
 
 	@Override
 	public BaseDAO<Long, ImGroupNotice> getDAO() {
@@ -66,6 +83,18 @@ public class ImGroupNoticeServiceImpl extends BaseServiceImpl<Long, ImGroupNotic
 			imGroupNoticeDao.updateTop(imGroupNotice.getImGroupId(),false);
 		}
 		imGroupNoticeDao.update(imGroupNotice);
+		// 撤销群公告消息
+		ImGroupNotice notice = imGroupNoticeDao.get(imGroupNotice.getId());
+		revokeImGroupNoticeMessage(notice);
+
+		// 发送群公告消息
+		String messageSeqId = sendGroupCustomNoticeMessage(convertToImGroupNotice(notice));
+
+		// 更新群公告消息ID
+		if (StringUtils.isNotBlank(messageSeqId)) {
+			notice.setMessageSeqId(messageSeqId);
+			imGroupNoticeDao.update(notice);
+		}
 	}
 
 	@Override
@@ -73,4 +102,123 @@ public class ImGroupNoticeServiceImpl extends BaseServiceImpl<Long, ImGroupNotic
 		return imGroupNoticeDao;
 	}
 
+    @Override
+	@Transactional(rollbackFor = Exception.class)
+    public Long add(ImGroupNotice imGroupNotice) {
+		if(imGroupNotice.isIsTop()){
+			//置顶取消
+			imGroupNoticeDao.updateTop(imGroupNotice.getImGroupId(),false);
+		}
+		imGroupNoticeDao.insert(imGroupNotice);
+		// 发送群公告消息
+		String messageSeqId = sendGroupCustomNoticeMessage(convertToImGroupNotice(imGroupNotice));
+		// 更新群公告消息ID
+		if (StringUtils.isNotBlank(messageSeqId)) {
+			imGroupNotice.setMessageSeqId(messageSeqId);
+			imGroupNoticeDao.update(imGroupNotice);
+		}
+		return imGroupNotice.getId();
+    }
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void del(Long id) {
+		ImGroupNotice notice = imGroupNoticeDao.get(id);
+		if (notice == null) {
+			throw new BizException("该群公告已被删除");
+		}
+		imGroupNoticeDao.delete(id);
+		// 撤销群公告消息
+		revokeImGroupNoticeMessage(notice);
+	}
+
+	@Override
+	public ImGroupNoticeDto getNotice(Long id) {
+		ImGroupNotice notice = imGroupNoticeDao.get(id);
+		if (notice == null) {
+			throw new BizException("该群公告已被删除");
+		}
+		ImGroupNoticeDto noticeDto = JSON.parseObject(JSON.toJSONString(notice), ImGroupNoticeDto.class);
+		SysUser sysUser = sysUserService.queryUserById(noticeDto.getOperatorId().intValue());
+		noticeDto.setUsername(sysUser.getRealName());
+		noticeDto.setAvatar(sysUser.getAvatar());
+		return noticeDto;
+	}
+
+	public ImGroupNoticeWrapper.ImGroupNotice convertToImGroupNotice(ImGroupNotice imGroupNotice) {
+		ImGroupNoticeWrapper.ImGroupNotice notice = ImGroupNoticeWrapper.ImGroupNotice.builder()
+				.id(imGroupNotice.getId())
+				.groupId(imGroupNotice.getImGroupId())
+				.title(imGroupNotice.getTitle())
+				.content(imGroupNotice.getContent())
+				.topFlag(imGroupNotice.isIsTop())
+				.sentToNewMemberFlag(true)
+				.operatorId(imGroupNotice.getOperatorId())
+				.delFlag(imGroupNotice.isDelFlag())
+				.build();
+		return notice;
+	}
+
+
+	/**
+	 * 发送群公告消息
+	 *
+	 * @param notice   ImGroupNoticeWrapper.ImGroupNotice
+	 * @return 消息ID
+	 */
+	private String sendGroupCustomNoticeMessage(ImGroupNoticeWrapper.ImGroupNotice notice) {
+		String messageSeqId;
+		// 发送群公告消息
+		ImGroupNoticeWrapper.CustomGroupNotice customGroupNotice = ImGroupNoticeWrapper.CustomGroupNotice.builder()
+				.businessID("TC_GROUP_NOTICE")
+				.msgId(String.valueOf(notice.getId()))
+				.msgTitle(notice.getTitle())
+				.msgContent(notice.getContent())
+				.build();
+
+		TencentRequest.MessageBody messageBody = TencentRequest.MessageBody.builder()
+				.msgType(ETencentMessage.TIMCustomElem.name())
+				.msgContent(TencentRequest.CustomMessageBody.builder()
+						.data(customGroupNotice.jsonString())
+						.desc("群公告")
+						.build())
+				.build();
+
+		try {
+			// 发送群公告消息
+			messageSeqId = imPluginContext.getPluginService().sendGroupMessage(MessageWrapper.GroupMessage.builder()
+					.senderId(notice.getOperatorId().toString())
+					.groupId(notice.getGroupId())
+					.tencentMessage(messageBody)
+					.build());
+		} catch (Exception e) {
+			log.error("群公告消息发送失败, messageId={}, groupId={}, title={}, ", notice.getId(), notice.getGroupId(),
+					notice.getTitle(), e);
+			throw com.microsvc.toolkit.common.webportal.exception.BizException.from("群公告消息发送失败");
+		}
+		return messageSeqId;
+	}
+
+
+	/**
+	 * 撤销群公告消息
+	 * @param imGroupNotice ImGroupNotice
+	 */
+	private void revokeImGroupNoticeMessage(ImGroupNotice imGroupNotice) {
+		try {
+			if (StringUtils.isNotBlank(imGroupNotice.getMessageSeqId())) {
+				imPluginContext.getPluginService().recallGroupMessage(MessageWrapper.RecallGroupMessage.builder()
+						.groupId(imGroupNotice.getImGroupId())
+						.reason("群公告消息撤销")
+						.messageSeqs(Lists.newArrayList(
+								TencentRequest.GroupMessageSeq.builder().messageSeq(Integer.parseInt(imGroupNotice.getMessageSeqId())).build()
+						))
+						.build());
+			}
+		} catch (Exception e) {
+			log.error("撤销群公告消息失败, messageId={}, groupId={}, title={}, ", imGroupNotice.getId(), imGroupNotice.getImGroupId(),
+					imGroupNotice.getTitle(), e);
+		}
+	}
+
 }

+ 16 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml

@@ -305,6 +305,22 @@
         AND cgsm.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
     </select>
 
+    <select id="findAllStudent" resultType="com.ym.mec.biz.dal.wrapper.StudentWrapper$ClassStudentDto">
+        SELECT sr.user_id_ userId,sr.name_ name,sr.parents_phone_ parentsPhone,
+        s.name_ subject_name_,su.gender_ gender,sr.music_group_id_ musicGroupId
+        FROM class_group_student_mapper cgsm
+        LEFT JOIN student_registration sr ON (sr.user_id_ = cgsm.user_id_ AND sr.music_group_id_ = cgsm.music_group_id_)
+        LEFT JOIN sys_user su on sr.user_id_ = su.id_
+        LEFT JOIN subject s ON sr.actual_subject_id_ = s.id_
+        WHERE cgsm.class_group_id_ = #{query.classGroupId} AND sr.music_group_status_ != 'QUIT' AND cgsm.status_ = 'NORMAL'
+        <if test="query.subjectId != null">
+            AND sr.actual_subject_id_ = #{query.subjectId}
+        </if>
+        <if test="query.search != null and query.search != ''">
+            AND (sr.name_ LIKE CONCAT('%',#{query.search},'%') OR sr.parents_phone_ LIKE CONCAT('%',#{query.search},'%'))
+        </if>
+    </select>
+
     <select id="findHighClassGroupHasUser" resultMap="ClassGroupStudentMapper">
         SELECT cgsm.* FROM class_group_student_mapper cgsm
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_

+ 11 - 6
mec-biz/src/main/resources/config/mybatis/ImGroupNoticeMapper.xml

@@ -18,12 +18,12 @@
 		<result column="del_flag_" property="delFlag" />
 		<result column="operator_id_" property="operatorId" />
         <result column="tenant_id_" property="tenantId"/>
+        <result column="message_seq_id_" property="messageSeqId"/>
 	</resultMap>
 	
 	<resultMap type="com.ym.mec.biz.dal.dto.ImGroupNoticeDto" id="ImGroupNoticeDto" extends="ImGroupNotice">
-		<result column="real_name_" property="user.realName"/>
-		<result column="username_" property="user.username"/>
-        <result column="avatar_" property="user.avatar"/>
+		<result column="username_" property="username"/>
+        <result column="avatar_" property="avatar"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -38,8 +38,10 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ImGroupNotice" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO im_group_notice (im_group_id_,title_,content_,is_top_,is_sent_to_new_member_,create_time_,update_time_,del_flag_,operator_id_,tenant_id_)
-		VALUES(#{imGroupId},#{title},#{content},#{isTop},#{isSentToNewMember},NOW(),NOW(),#{delFlag},#{operatorId},#{tenantId})
+		INSERT INTO im_group_notice (im_group_id_,title_,content_,is_top_,is_sent_to_new_member_,
+		                             create_time_,update_time_,del_flag_,operator_id_,tenant_id_,message_seq_id_)
+		VALUES(#{imGroupId},#{title},#{content},#{isTop},#{isSentToNewMember},
+		       NOW(),NOW(),#{delFlag},#{operatorId},#{tenantId},#{messageSeqId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -48,6 +50,9 @@
 		<if test="delFlag != null">
 		del_flag_ = #{delFlag},
 		</if>
+		<if test="messageSeqId != null">
+			message_seq_id_ = #{messageSeqId},
+		</if>
 		<if test="operatorId != null">
 		operator_id_ = #{operatorId},
 		</if>
@@ -80,7 +85,7 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryForPage" resultMap="ImGroupNoticeDto" parameterType="map">
-		SELECT ign.*,if(u.real_name_ is null or u.real_name_ = '',u.username_,u.real_name_) as real_name_, u.username_, u.avatar_
+		SELECT ign.*,if(u.real_name_ is null or u.real_name_ = '',u.username_,u.real_name_) as username_, u.avatar_
 		FROM im_group_notice ign left join sys_user u on ign.operator_id_ = u.id_
 		<where>
             ign.del_flag_ = 0 and ign.tenant_id_ = #{tenantId}

+ 29 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentStudentCourseDetailMapper.xml

@@ -362,6 +362,35 @@
             #{studentId}
         </foreach>)c
     </select>
+    <select id="findStudentCourseDetail"
+            resultType="com.ym.mec.biz.dal.wrapper.StudentWrapper$ClassStudentDto">
+        select
+         mgpscd.user_id_ userId,
+         SUM(CASE WHEN mgpscd.course_type_ = 'CLASSROOM' THEN mgpscd.sub_course_minutes_ ELSE 0 END) AS 'classroom'
+        ,SUM(CASE WHEN mgpscd.course_type_ = 'COMPREHENSIVE' THEN mgpscd.sub_course_minutes_ ELSE 0 END) AS 'comprehensive'
+        ,SUM(CASE WHEN mgpscd.course_type_ = 'HIGH' THEN mgpscd.sub_course_minutes_ ELSE 0 END) AS 'high'
+        ,SUM(CASE WHEN mgpscd.course_type_ = 'HIGH_ONLINE' THEN mgpscd.sub_course_minutes_ ELSE 0 END) AS 'highOnline'
+        ,SUM(CASE WHEN mgpscd.course_type_ = 'MIX' THEN mgpscd.sub_course_minutes_ ELSE 0 END) AS 'mix'
+        ,SUM(CASE WHEN mgpscd.course_type_ = 'SINGLE' THEN mgpscd.sub_course_minutes_ ELSE 0 END) AS 'single'
+        ,SUM(CASE WHEN mgpscd.course_type_ = 'TRAINING_MIX' THEN mgpscd.sub_course_minutes_ ELSE 0 END) AS 'trainingMix'
+        ,SUM(CASE WHEN mgpscd.course_type_ = 'TRAINING_SINGLE' THEN mgpscd.sub_course_minutes_ ELSE 0 END) AS 'trainingSingle'
+        from music_group_payment_student_course_detail mgpscd
+        where mgpscd.music_group_id_ = #{musicGroupId}
+        and mgpscd.user_id_ IN
+        <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+            #{studentId}
+        </foreach>
+        <if test="query.courseType != null and query.courseType == 'no_course'">
+            and mgpscd.sub_course_minutes_ = 0
+        </if>
+        group by user_id_
+        <if test="query.courseType != null and query.courseType != '' and query.courseType != 'no_course'">
+            HAVING ${query.courseType} > 0
+        </if>
+        <if test="query.sortField != null">
+            order by ${query.sortField} ${query.sortType}
+        </if>
+    </select>
 
     <update id="clearRemainCourseMinutesByMusicGroupId">
     	update music_group_payment_student_course_detail set sub_course_minutes_ = 0 WHERE sub_course_minutes_ > 0 and music_group_id_ = #{musicGroupId}

+ 2 - 2
mec-im/src/main/java/com/ym/controller/GroupController.java

@@ -143,7 +143,7 @@ public class GroupController{
                 for (String groupId : integers) {
                     MessageWrapper.GroupMessage groupMessage = JSON.parseObject(JSON.toJSONString(build.groupId(groupId)),
                         MessageWrapper.GroupMessage.class);
-                    Boolean ret = imPluginContext.getPluginService().sendGroupMessage(groupMessage);
+                    String ret = imPluginContext.getPluginService().sendGroupMessage(groupMessage);
                     log.info("batchSendPrivateMessage GROUP tencentCloud senderId={}, ret={}, message={}", build.getSenderId(), ret, JSON.toJSONString(groupMessage));
 
                 }
@@ -152,7 +152,7 @@ public class GroupController{
                 MessageWrapper.GroupMessage groupMessage = JSON.parseObject(build.targetIds(integers).toString(),
                     MessageWrapper.GroupMessage.class);
                 // 融云消息
-                Boolean ret = imPluginContext.getPluginService().sendGroupMessage(groupMessage);
+                String ret = imPluginContext.getPluginService().sendGroupMessage(groupMessage);
                 log.info("batchSendPrivateMessage GROUP rongCloud senderId={}, ret={}", build.getSenderId(), ret);
             }
 

+ 1 - 1
mec-im/src/main/java/com/ym/controller/PrivateController.java

@@ -117,7 +117,7 @@ public class PrivateController {
                 }
             }
         }
-        Boolean ret = imPluginContext.getPluginService().sendPrivateMessage(build);
+        String ret = imPluginContext.getPluginService().sendPrivateMessage(build);
         log.info("privateMessage send ret:{}, service={}, content={}", ret, imPluginContext.defaultService(), JSON.toJSONString(build));
 
         return true;

+ 1 - 1
pom.xml

@@ -25,7 +25,7 @@
 		<docker.host>http://127.0.0.1:2375</docker.host>
 		<docker.registry.repository>127.0.0.1:5000</docker.registry.repository>
 		<docker.maven.plugin.version>1.2.2</docker.maven.plugin.version>
-		<com.microsvc.toolkit.version>1.0.8</com.microsvc.toolkit.version>
+		<com.microsvc.toolkit.version>1.0.8-RC1</com.microsvc.toolkit.version>
 		<cbs.version>1.0.15</cbs.version>
 	</properties>