浏览代码

群聊新增类型编辑

zouxuan 3 年之前
父节点
当前提交
86e03cfbc2

+ 47 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ImGroup.java

@@ -1,8 +1,8 @@
 package com.ym.mec.biz.dal.entity;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
 import com.ym.mec.common.entity.BaseEntity;
+import com.ym.mec.common.enums.BaseEnum;
+import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
  * 对应数据库表(im_group):
@@ -31,7 +31,51 @@ public class ImGroup extends BaseEntity {
 
 	/** 乐团群 MUSIC,班级群 CLASS,训练营 TRAINING */
 	private String type;
-	
+
+	public enum GroupTypeEnum implements BaseEnum<String,GroupTypeEnum> {
+		NORMAL("NORMAL", "普通班级"), MIX("MIX", "合奏班级"), HIGH("HIGH", "提高班"),
+		VIP("VIP", "vip课"), DEMO("DEMO", "试听课"), PRACTICE("PRACTICE", "网管课"),
+		SNAP("SNAP","临时班级"), COMM("COMM", "对外课程"), HIGH_ONLINE("HIGH_ONLINE", "网络基础训练课"),
+		MUSIC_NETWORK("MUSIC_NETWORK","乐团网管课"),PARENT_MEETING("PARENT_MEETING","家长会"),TRAINING("TRAINING","训练营");
+
+		private String code;
+
+		private String msg;
+
+		GroupTypeEnum(String code, String msg) {
+			this.code = code;
+			this.msg = msg;
+		}
+
+		public void setCode(String code) {
+			this.code = code;
+		}
+
+		public String getMsg() {
+			return msg;
+		}
+
+		public void setMsg(String msg) {
+			this.msg = msg;
+		}
+
+		@Override
+		public String getCode() {
+			return this.code;
+		}
+	}
+
+	//群类型
+	private GroupTypeEnum groupType;
+
+	public GroupTypeEnum getGroupType() {
+		return groupType;
+	}
+
+	public void setGroupType(GroupTypeEnum groupType) {
+		this.groupType = groupType;
+	}
+
 	/**  */
 	private java.util.Date createTime;
 	

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/ImGroupQueryInfo.java

@@ -16,6 +16,16 @@ public class ImGroupQueryInfo extends QueryInfo {
 
     private String targetIds;
 
+    private String groupType;
+
+    public String getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(String groupType) {
+        this.groupType = groupType;
+    }
+
     public String getTargetIds() {
         return targetIds;
     }

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/ImGroupService.java

@@ -20,10 +20,10 @@ public interface ImGroupService extends BaseService<String, ImGroup> {
 	 * @param type 群类型
 	 * @return
 	 */
-	ImGroup create(String id, Integer userId, String name, String introduce, String memo, String tags, String img, String type);
+	ImGroup create(String id, Integer userId, String name, String introduce, String memo, String tags, String img, String type, ImGroup.GroupTypeEnum groupType);
 
 	//创建非课程类型的业务群组
-	String createGroup(List<String> userIdList,String groupName,String groupType);
+	String createGroup(List<String> userIdList,String groupName,String type, ImGroup.GroupTypeEnum groupType);
 
 	/**
 	 * 解散群组
@@ -70,4 +70,6 @@ public interface ImGroupService extends BaseService<String, ImGroup> {
 	 * @return
 	 */
 	void updateNickName1(Integer userId, String nickName);
+
+	void updateImGroup(ImGroup imGroup);
 }

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

@@ -299,7 +299,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     userRoleMap.put(teacherId, "指导老师");
                 }
             }
-            imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), musicGroup.getName(), musicGroup.getName(), musicGroup.getName(), null, "MUSIC");
+            imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), musicGroup.getName(),
+                    musicGroup.getName(), musicGroup.getName(), null, "MUSIC", ImGroup.GroupTypeEnum.valueOf(classGroup.getType().getCode()));
             imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
         }
         return true;
@@ -3745,7 +3746,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             }
         }
 
-        imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), musicGroup.getName(), musicGroup.getName(), musicGroup.getName(), null, "MUSIC");
+        imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(),
+                musicGroup.getName(), musicGroup.getName(), musicGroup.getName(), null, "MUSIC",
+                ImGroup.GroupTypeEnum.valueOf(classGroup.getType().getCode()));
         imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
         imUserFriendService.refreshClassImUserFriend(classGroup.getId());
         return true;

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

@@ -257,7 +257,8 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
         courseScheduleTeacherSalaryDao.batchInsert(courseScheduleTeacherSalaries);
         teacherAttendanceDao.batchInsert(teacherAttendances);
         //创建群聊
-        imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), courseGroup.getName(), courseGroup.getName(), courseGroup.getName(), null, "COMM");
+        imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(),
+                courseGroup.getName(), courseGroup.getName(), courseGroup.getName(), null, "COMM", ImGroup.GroupTypeEnum.COMM);
         Map<Integer,String> userRoleMap = new HashMap(1);
         userRoleMap.put(courseGroup.getTeacherId(),"指导老师");
         imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
@@ -754,7 +755,8 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
         userRoleMap.put(coursesGroup.getTeacherId(), "");
         userRoleMap.put(order.getUserId(), "");
         
-        imGroupService.create(classGroup.getId().toString(), coursesGroup.getTeacherId(), classGroup.getName(), classGroup.getName(), classGroup.getName(), classGroup.getName(), null, "COMM");
+        imGroupService.create(classGroup.getId().toString(), coursesGroup.getTeacherId(), classGroup.getName(),
+                classGroup.getName(), classGroup.getName(), classGroup.getName(), null, "COMM", ImGroup.GroupTypeEnum.COMM);
         imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
         imUserFriendService.refreshClassImUserFriend(classGroup.getId());
         return BaseController.succeed();

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

@@ -100,7 +100,8 @@ public class ImGroupMemberServiceImpl extends BaseServiceImpl<Long, ImGroupMembe
 			}
 			tags = vipGroup.getName();
 		}
-		ImGroup imGroup = imGroupService.create(imGroupId, null, classGroup.getName(), tags, tags, tags, null, classGroup.getGroupType().getCode());
+		ImGroup imGroup = imGroupService.create(imGroupId, null, classGroup.getName(), tags,
+				tags, tags, null, classGroup.getGroupType().getCode(), ImGroup.GroupTypeEnum.valueOf(classGroup.getType().getCode()));
 		if(userId != null){
 			join(imGroupId,userId,roleType,isAdmin);
 		}

+ 13 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImGroupServiceImpl.java

@@ -59,7 +59,7 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public ImGroup create(String id, Integer userId, String name, String introduce, String memo, String tags, String img, String type) {
+	public ImGroup create(String id, Integer userId, String name, String introduce, String memo, String tags, String img, String type, ImGroup.GroupTypeEnum groupType) {
 		ImGroup imGroup = imGroupDao.get(id);
 		if (imGroup != null) {
 			return imGroup;
@@ -83,6 +83,7 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
 		imGroup.setTags(tags);
 		imGroup.setImg(img);
 		imGroup.setType(type);
+		imGroup.setGroupType(groupType);
 		imGroup.setUpdateTime(date);
 		imGroupDao.insert(imGroup);
 
@@ -103,10 +104,10 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public String createGroup(List<String> userIdList,String groupName,String groupType){
+	public String createGroup(List<String> userIdList,String groupName,String type, ImGroup.GroupTypeEnum groupType){
 		Optional.ofNullable(userIdList).filter(CollectionUtils::isNotEmpty).orElseThrow(() -> new BizException("群成员不能为空"));
 		Optional.ofNullable(groupName).filter(StringUtils::isNotBlank).orElseThrow(() -> new BizException("群名称不能为空"));
-		Optional.ofNullable(groupType).filter(StringUtils::isNotBlank).orElseThrow(() -> new BizException("群类型不能为空"));
+		Optional.ofNullable(type).filter(StringUtils::isNotBlank).orElseThrow(() -> new BizException("群类型不能为空"));
 		Date date = new Date();
 		ImGroup imGroup = new ImGroup();
 		String groupId = UUID.randomUUID().toString();
@@ -115,7 +116,8 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
 		imGroup.setIntroduce(groupName);
 		imGroup.setMemberNum(userIdList.size());
 		imGroup.setName(groupName);
-		imGroup.setType(groupType);
+		imGroup.setType(type);
+		imGroup.setGroupType(groupType);
 		imGroup.setUpdateTime(date);
 		imGroupDao.insert(imGroup);
 		List<ImGroupMember> groupMemberList = imGroupMemberDao.queryMembers(groupId, userIdList, TenantContextHolder.getTenantId());
@@ -186,4 +188,11 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
 		//同步融云基本信息
 		imFeignService.update(new ImUserModel(sysUser.getId().toString(),nickName,sysUser.getAvatar()));
 	}
+
+    @Override
+	@Transactional(rollbackFor = Exception.class)
+    public void updateImGroup(ImGroup imGroup) {
+		imGroupDao.update(imGroup);
+		imFeignService.groupUpdate(new GroupModel(imGroup.getId(),null,imGroup.getName()));
+    }
 }

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

@@ -1879,7 +1879,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupDao.update(musicGroup);
 
         // 创建群
-        imGroupService.create(musicGroupId, null, "乐团预报名", null, musicGroup.getName(), musicGroup.getName(), null, GroupType.MUSIC.getCode());
+        imGroupService.create(musicGroupId, null, "乐团预报名", null,
+                musicGroup.getName(), musicGroup.getName(), null, GroupType.MUSIC.getCode(), ImGroup.GroupTypeEnum.PARENT_MEETING);
 
         Map<Integer, String> userRoleMap = new HashMap<Integer, String>();
 

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

@@ -291,7 +291,8 @@ public class OnlineMusicGroupServiceImpl implements OnlineMusicGroupService {
         userRoleMap.put(onlineMusicGroupCourseInfo.getTeacherId(), "指导老师");
         
         // 创建群组
-        imGroupService.create(classGroup.getId().toString(), musicGroup.getEducationalTeacherId(), classGroup.getName(), classGroup.getName(), classGroup.getName(), classGroup.getName(), null, "MUSIC");
+        imGroupService.create(classGroup.getId().toString(), musicGroup.getEducationalTeacherId(), classGroup.getName(),
+                classGroup.getName(), classGroup.getName(), classGroup.getName(), null, "MUSIC", ImGroup.GroupTypeEnum.valueOf(classGroup.getType().getCode()));
         imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
 
         List<String> courseTimes = courses.stream().map(c -> DateUtil.dateToString(c.getStartClassTime(), "yyyy-MM-dd HH:mm")).collect(Collectors.toList());

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

@@ -441,7 +441,7 @@ public class TempLittleArtistTrainingCampServiceImpl extends ServiceImpl<TempLit
             //如果人数小于最大人数 则直接分组
             if (maxUserNum.intValue() >= applyNum.intValue()) {
                 //分组
-                String groupId = imGroupService.createGroup(userStrList, camp.getName() + "-1群", groupType);
+                String groupId = imGroupService.createGroup(userStrList, camp.getName() + "-1群", groupType, ImGroup.GroupTypeEnum.TRAINING);
                 imGroupIds.add(groupId);
                 //修改关系表
                 updateGroup.accept(groupId, userStrList);
@@ -455,7 +455,7 @@ public class TempLittleArtistTrainingCampServiceImpl extends ServiceImpl<TempLit
                 //群号
                 AtomicInteger i = new AtomicInteger(1);
                 partition.forEach(list -> {
-                    String groupId = imGroupService.createGroup(list, camp.getName() + "-" + i.get() + "群", groupType);
+                    String groupId = imGroupService.createGroup(list, camp.getName() + "-" + i.get() + "群", groupType, ImGroup.GroupTypeEnum.TRAINING);
                     updateGroup.accept(groupId, list);
                     //修改关系表
                     imGroupIds.add(groupId);

+ 12 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -1099,7 +1099,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 //		courseScheduleService.checkNewCourseSchedules(courseSchedules, false,false);
 
         try {
-            imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(), vipGroupApplyBaseInfoDto.getName(), null, null, GroupType.VIP.getCode());
+            imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(),
+                    vipGroupApplyBaseInfoDto.getName(), null, null, GroupType.VIP.getCode(), ImGroup.GroupTypeEnum.VIP);
             imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
             imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(), classGroup.getGroupType());
             //发送推送
@@ -1503,7 +1504,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         }
 //		courseScheduleService.checkNewCourseSchedules(courseSchedules, false,false);
         try {
-            imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(), applyBaseInfo.getName(), null, null, GroupType.VIP.getCode());
+            imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(),
+                    applyBaseInfo.getName(), null, null, GroupType.VIP.getCode(), ImGroup.GroupTypeEnum.VIP);
             imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
             imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(), classGroup.getGroupType());
 //			SysUser sysUser = teacherDao.getUser(applyBaseInfo.getUserId());
@@ -2549,7 +2551,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 //		courseScheduleService.checkNewCourseSchedules(courseSchedules, false,false);
 
         try {
-            imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(), vipGroup.getName(), null, null, GroupType.VIP.getCode());
+            imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(),
+                    vipGroup.getName(), null, null, GroupType.VIP.getCode(), ImGroup.GroupTypeEnum.VIP);
             imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
             imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(), classGroup.getGroupType());
             //发送推送短信
@@ -2855,7 +2858,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
                     courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
 
-                    imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(), vipGroup.getName(), null, null, GroupType.VIP.getCode());
+                    imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(),
+                            vipGroup.getName(), null, null, GroupType.VIP.getCode(), ImGroup.GroupTypeEnum.VIP);
                     imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
                     imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(), classGroup.getGroupType());
                 }
@@ -4365,7 +4369,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             classGroupDao.update(classGroup);
 
             try {
-                imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(), vipGroup.getName(), null, null, GroupType.VIP.getCode());
+                imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(),
+                        classGroup.getName(), vipGroup.getName(), null, null, GroupType.VIP.getCode(), ImGroup.GroupTypeEnum.VIP);
                 imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
                 imUserFriendService.refreshClassImUserFriend(classGroup.getId());
             } catch (Exception e) {
@@ -4493,7 +4498,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         studentDao.updateStudentServiceTag(null, studentIds, YesOrNoEnum.YES.getCode());
 
         try {
-            imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(), vipGroup.getName(), null, null, GroupType.VIP.getCode());
+            imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(),
+                    vipGroup.getName(), null, null, GroupType.VIP.getCode(), ImGroup.GroupTypeEnum.VIP);
             imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
 
             imUserFriendService.refreshGroupImUserFriend(vipGroup.getId().toString(), GroupType.VIP);

+ 9 - 2
mec-biz/src/main/resources/config/mybatis/ImGroupMapper.xml

@@ -15,6 +15,7 @@
 		<result column="tags_" property="tags" />
 		<result column="img_" property="img" />
 		<result column="type_" property="type" />
+		<result column="group_type_" property="groupType" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
         <result column="tenant_id_" property="tenantId"/>
@@ -52,13 +53,16 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ImGroup" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO im_group (id_,name_,introduce_,member_num_,memo_,tags_,img_,type_,create_time_,update_time_,tenant_id_)
-		VALUES(#{id},#{name},#{introduce},#{memberNum},#{memo},#{tags},#{img},#{type},#{createTime},#{updateTime},#{tenantId})
+		INSERT INTO im_group (id_,name_,introduce_,member_num_,memo_,tags_,img_,type_,create_time_,update_time_,tenant_id_,group_type_)
+		VALUES(#{id},#{name},#{introduce},#{memberNum},#{memo},#{tags},#{img},#{type},#{createTime},#{updateTime},#{tenantId},#{groupType})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.ImGroup">
 		UPDATE im_group <set>
+		<if test="group_type_ != null">
+			group_type_ = #{groupType},
+		</if>
 		<if test="memberNum != null">
 		member_num_ = #{memberNum},
 		</if>
@@ -119,6 +123,9 @@
 		<if test="targetIds != null and targetIds != ''">
 			AND FIND_IN_SET(ig.id_,#{targetIds})
 		</if>
+		<if test="groupType != null">
+			AND ig.group_type_ = #{groupType}
+		</if>
 	</sql>
 	
 	<!-- 分页查询 -->

+ 9 - 0
mec-client-api/src/main/java/com/ym/mec/im/ImFeignService.java

@@ -43,6 +43,15 @@ public interface ImFeignService {
     Object groupCreate(@RequestBody GroupModel groupModel);
 
     /**
+     * 修改群组
+     *
+     * @param groupModel
+     * @return
+     */
+    @PostMapping(value = "group/update")
+    Object groupUpdate(@RequestBody GroupModel groupModel);
+
+    /**
      * 批量创建群组
      *
      * @param groupModels

+ 4 - 0
mec-client-api/src/main/java/com/ym/mec/im/fallback/ImFeignServiceFallback.java

@@ -24,6 +24,10 @@ public class ImFeignServiceFallback implements ImFeignService {
     public Object groupCreate(GroupModel groupModel) {
         return null;
     }
+    @Override
+    public Object groupUpdate(GroupModel groupModel) {
+        return null;
+    }
 
     @Override
     public void groupBatchCreate(List<GroupModel> groupModels) {

+ 3 - 2
mec-web/src/main/java/com/ym/mec/web/controller/ImGroupController.java

@@ -70,9 +70,10 @@ public class ImGroupController extends BaseController {
 
 	@ApiOperation("修改群信息")
 	@PostMapping(value = "/updateImGroup")
-	public HttpResponseResult<Integer> updateImGroup(@RequestBody ImGroup imGroup) {
+	public HttpResponseResult updateImGroup(@RequestBody ImGroup imGroup) {
 		imGroup.setUpdateTime(new Date());
-		return succeed(imGroupService.update(imGroup));
+		imGroupService.updateImGroup(imGroup);
+		return succeed();
 	}
 
 	@ApiOperation("修改群成员信息")

+ 9 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ImSendGroupMessageController.java

@@ -15,6 +15,7 @@ import com.ym.mec.common.page.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -36,6 +37,7 @@ public class ImSendGroupMessageController extends BaseController {
 
     @ApiOperation("获取群消息列表")
     @PostMapping(value = "/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('imSendGroupMessage/queryPage')")
     public HttpResponseResult<PageInfo<ImSendGroupMessage>> queryPage(ImSendGroupMessageQueryInfo queryInfo) throws Exception {
         SysUser sysUser = Optional.ofNullable(sysUserFeignService.queryUserInfo()).
                 orElseThrow(() -> new Exception("请登录"));
@@ -45,6 +47,7 @@ public class ImSendGroupMessageController extends BaseController {
 
     @ApiOperation("发送群聊消息")
     @PostMapping(value = "/send")
+    @PreAuthorize("@pcs.hasPermissions('imSendGroupMessage/send')")
     public HttpResponseResult send(@RequestBody ImSendGroupMessage imSendGroupMessage) throws Exception {
         imSendGroupMessageService.sendGroupMessage(imSendGroupMessage);
         return succeed();
@@ -52,6 +55,7 @@ public class ImSendGroupMessageController extends BaseController {
 
     @ApiOperation("修改未发送的群消息")
     @PostMapping(value = "/update")
+    @PreAuthorize("@pcs.hasPermissions('imSendGroupMessage/update')")
     public HttpResponseResult update(@RequestBody ImSendGroupMessage imSendGroupMessage) throws Exception {
         imSendGroupMessageService.updateGroupMessage(imSendGroupMessage);
         return succeed();
@@ -59,12 +63,14 @@ public class ImSendGroupMessageController extends BaseController {
 
     @ApiOperation("删除未发送的群消息")
     @PostMapping(value = "/delete")
+    @PreAuthorize("@pcs.hasPermissions('imSendGroupMessage/delete')")
     public HttpResponseResult delete(Long id) throws Exception {
         imSendGroupMessageService.deleteGroupMessage(id);
         return succeed();
     }
     @ApiOperation("删除未发送消息的群列表")
     @PostMapping(value = "/deleteGroupList")
+    @PreAuthorize("@pcs.hasPermissions('imSendGroupMessage/deleteGroupList')")
     public HttpResponseResult deleteGroupList(Long imSendGroupMessageId,String groupIds) throws Exception {
         Optional.ofNullable(groupIds).orElseThrow(() -> new BizException("群组id不能为空"));
         Optional.ofNullable(imSendGroupMessageId).orElseThrow(() -> new BizException("群消息id不能为空"));
@@ -73,6 +79,7 @@ public class ImSendGroupMessageController extends BaseController {
     }
     @ApiOperation("添加未发送消息的群列表")
     @PostMapping(value = "/addGroupList")
+    @PreAuthorize("@pcs.hasPermissions('imSendGroupMessage/addGroupList')")
     public HttpResponseResult addGroupList(Long imSendGroupMessageId,String groupIds) throws Exception {
         Optional.ofNullable(groupIds).orElseThrow(() -> new BizException("群组id不能为空"));
         Optional.ofNullable(imSendGroupMessageId).orElseThrow(() -> new BizException("群消息id不能为空"));
@@ -82,6 +89,7 @@ public class ImSendGroupMessageController extends BaseController {
 
     @ApiOperation("查询群列表(没有在消息列表的)")
     @PostMapping(value = "/queryGroupPage")
+    @PreAuthorize("@pcs.hasPermissions('imSendGroupMessage/queryGroupPage')")
     public HttpResponseResult<PageInfo<ImGroup>> queryGroupPage(ImGroupQueryInfo imGroupQueryInfo) throws Exception {
         SysUser sysUser = Optional.ofNullable(sysUserFeignService.queryUserInfo()).
                 orElseThrow(() -> new Exception("请登录"));
@@ -96,6 +104,7 @@ public class ImSendGroupMessageController extends BaseController {
 
     @ApiOperation("查询群列表(在消息列表的)")
     @PostMapping(value = "/queryGroupPage1")
+    @PreAuthorize("@pcs.hasPermissions('imSendGroupMessage/queryGroupPage1')")
     public HttpResponseResult<PageInfo<ImGroup>> queryGroupPage1(ImGroupQueryInfo imGroupQueryInfo) throws Exception {
         SysUser sysUser = Optional.ofNullable(sysUserFeignService.queryUserInfo()).
                 orElseThrow(() -> new Exception("请登录"));

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

@@ -130,7 +130,8 @@ public class VipGroupManageController extends BaseController {
                 }
             }
 
-            imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(), vipGroup.getName(), null, null, GroupType.VIP.getCode());
+            imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(),
+                    classGroup.getName(), vipGroup.getName(), null, null, GroupType.VIP.getCode(), ImGroup.GroupTypeEnum.VIP);
             imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
             imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(),classGroup.getGroupType());
         }