Parcourir la source

Merge branch 'online'

yonge il y a 3 ans
Parent
commit
2d50e1826c

+ 1 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/MessageTypeEnum.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.EnumValue;
 import com.yonge.toolset.base.enums.BaseEnum;
 
 public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
+	CUSTOME_MESSAGE_PUSH("自定义系统消息推送"),
     SMS_VERIFY_CODE_LOGIN("验证码登录"),
     SMS_VERIFY_CODE_LOGOFF("用户注销"),
     SMS_VERIFY_CODE_REGISTER("验证码注册"),

+ 14 - 5
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherServiceImpl.java

@@ -45,6 +45,7 @@ import com.yonge.cooleshow.biz.dal.entity.TeacherTotal;
 import com.yonge.cooleshow.biz.dal.entity.UserAccount;
 import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
+import com.yonge.cooleshow.biz.dal.enums.MessageTypeEnum;
 import com.yonge.cooleshow.biz.dal.enums.TeacherTagEnum;
 import com.yonge.cooleshow.biz.dal.enums.TeacherTypeEnum;
 import com.yonge.cooleshow.biz.dal.service.StudentService;
@@ -498,10 +499,12 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
     	if(styleVideo == null){
     		styleVideo = new ArrayList<TeacherStyleVideo>();
     	}
+        //修改老师信息
+        
+        List<TeacherStyleVideo> teacherStyleVideoList = teacherStyleVideoService.list(Wrappers.<TeacherStyleVideo>lambdaQuery()
+                .eq(TeacherStyleVideo::getUserId, userId));
 
-        Map<Long, TeacherStyleVideo> oldMap = teacherStyleVideoService.list(Wrappers.<TeacherStyleVideo>lambdaQuery()
-                        .eq(TeacherStyleVideo::getUserId, userId))
-                .stream().collect(Collectors.toMap(TeacherStyleVideo::getId, o -> o));
+        Map<Long, TeacherStyleVideo> oldMap = teacherStyleVideoList.stream().collect(Collectors.toMap(TeacherStyleVideo::getId, o -> o));
 
         List<TeacherStyleVideo> createList = styleVideo.stream().filter(o -> o.getId() == null)
                 .collect(Collectors.toList());
@@ -514,6 +517,12 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
 
         List<Long> oldIds = styleVideo.stream().filter(o -> o.getId() != null)
                 .map(TeacherStyleVideo::getId).collect(Collectors.toList());
+        
+        for(TeacherStyleVideo tv : teacherStyleVideoList){
+        	if(tv.getAuthStatus() == AuthStatusEnum.DOING){
+        		oldIds.add(tv.getId());
+        	}
+        }
         //删除旧视频
         teacherStyleVideoService.removeByUserIdAndOldIds(userId, oldIds);
         //保存新视频
@@ -540,8 +549,8 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
             Map<Long, String> receivers = new HashMap<>();
             receivers.put(userId, user.getPhone());
 
-            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, "系统消息", message, receivers, null,
-                    0, null, ClientEnum.TEACHER.getCode());
+			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.CUSTOME_MESSAGE_PUSH, receivers, null, 0,
+					null, ClientEnum.TEACHER.getCode(), message);
 
         } catch (Exception e) {
             log.error("[老师风采修改]发送消息失败--> {}", e.fillInStackTrace());