فهرست منبع

Merge branch 'feature/0721-tenant' into online-0926

liujc 1 سال پیش
والد
کامیت
aeedfa4c82

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

@@ -460,10 +460,10 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
 
         // 机构老师与学生互加好友关系
         if (Optional.ofNullable(teacher.getTenantId()).orElse(-1L) > 0) {
-            // 自动与机构老师成为好友
+            // 自动与机构学生成为好友
             Set<Long> collect = studentService.lambdaQuery()
                     .eq(Student::getTenantId, teacher.getTenantId()).list().stream()
-                    .map(Student::getUserId).filter(next->!next.equals(teacher.getUserId())).collect(Collectors.toSet());
+                    .map(Student::getUserId).collect(Collectors.toSet());
 
             imUserFriendService.saveUserFriend(teacher.getUserId(), collect);
         }
@@ -476,7 +476,7 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
             queryWrapper.lambda().in(com.yonge.cooleshow.biz.dal.entity.SysUser::getPhone,phones);
             List<com.yonge.cooleshow.biz.dal.entity.SysUser> sysUsers = sysUserMapper.selectList(queryWrapper);
             Set<Long> userIds = sysUsers.stream().map(com.yonge.cooleshow.biz.dal.entity.SysUser::getId).collect(Collectors.toSet());
-            if (userIds.isEmpty()) {
+            if (!userIds.isEmpty()) {
                 imUserFriendService.saveUserTeacherFriend(teacher.getUserId(), userIds);
             }
         }
@@ -1075,10 +1075,10 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
 
         // 机构老师与学生互加好友关系
         if (Optional.ofNullable(updateTenant.getTenantId()).orElse(-1L) > 0) {
-            // 自动与机构老师成为好友
+            // 自动与机构学生成为好友
             Set<Long> collect = studentService.lambdaQuery()
                     .eq(Student::getTenantId, updateTenant.getTenantId()).list().stream()
-                    .map(Student::getUserId).filter(next -> !next.equals(teacher.getUserId()))
+                    .map(Student::getUserId)
                     .collect(Collectors.toSet());
 
             if (!collect.isEmpty()) {

+ 2 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantAccountRecordServiceImpl.java

@@ -122,8 +122,8 @@ public class TenantAccountRecordServiceImpl extends ServiceImpl<TenantAccountRec
             return;
         }
         // 过滤出结算成功的
-        List<String> successIds = collect.stream().filter(o -> PostStatusEnum.RECORDED.getCode().equals(o.getSettlement())).map(TenantAccountRecordImport::getId).collect(Collectors.toList());
-        List<String> waitIds = collect.stream().filter(o -> PostStatusEnum.WAIT.getCode().equals(o.getSettlement())).map(TenantAccountRecordImport::getId).collect(Collectors.toList());
+        List<String> successIds = collect.stream().filter(o -> PostStatusEnum.RECORDED.equals(o.getPostStatus())).map(TenantAccountRecordImport::getId).collect(Collectors.toList());
+        List<String> waitIds = collect.stream().filter(o -> PostStatusEnum.WAIT.equals(o.getPostStatus())).map(TenantAccountRecordImport::getId).collect(Collectors.toList());
 
         if (CollectionUtils.isNotEmpty(successIds)) {
             List<TenantAccountRecord> list = this.lambdaQuery()