فهرست منبع

Merge branch 'feature/1020-tencent-im' into saas

liujc 1 سال پیش
والد
کامیت
32c7c0b54a
1فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 9 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImGroupServiceImpl.java

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

@@ -989,9 +989,12 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
                 importGroup.setNotification(imGroup.getMemo());
                 importGroup.setFaceUrl(imGroup.getImg());
                 if (StringUtils.isEmpty(imGroup.getImg())) {
-                    importGroup.setFaceUrl(imGroup.getGroupType().getAvatar());
+                    importGroup.setFaceUrl(Optional.ofNullable(imGroup.getGroupType()).orElse(ImGroup.GroupTypeEnum.NORMAL).getAvatar());
                 }
                 importGroup.setApplyJoinOption("FreeAccess");
+                if (imGroup.getCreateTime() == null) {
+                    imGroup.setCreateTime(DateTime.now().plusYears(-1).toDate());
+                }
                 importGroup.setCreateTime(imGroup.getCreateTime().getTime() / 1000);
                 if (admin != null) {
                     register(admin.getUserId().toString(), getClientType(admin.getRoleType()),"");
@@ -1015,6 +1018,9 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
                             MessageWrapper.ImportGroupMemberData data = new MessageWrapper.ImportGroupMemberData();
                             data.setMemberAccount(getImUserId(next.getUserId().toString(),
                                     getClientType(next.getRoleType())));
+                            if (next.getCreateTime() == null){
+                                next.setCreateTime(DateTime.now().plusMonths(-6).toDate());
+                            }
                             if (next.getCreateTime().getTime() / 1000 <= importGroup.getCreateTime()) {
                                 data.setJoinTime(date.getTime() / 1000);
                             } else {
@@ -1028,7 +1034,7 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
                 imGroupDao.updateImportStatusSuccess(imGroup.getId());
             } catch (Exception e) {
                 log.error(String.format("群迁移失败,失败群组:%s", JSON.toJSONString(imGroup)));
-                log.error(String.format("群迁移失败:%s", e.getMessage()));
+                log.error("群迁移失败:", e);
             }
             log.info("群迁移成功:{}", imGroup.getId());
         }
@@ -1056,6 +1062,7 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
 //            imGroupCoreService.register(userId,clientType, username, sysUserService.getImAvatar(user));
             imGroupCoreService.register(userId,clientType, username, avatar);
         } catch (Exception e) {
+            log.error("register user error,userId:{}", userId);
             log.error("register user error", e);
         }
     }