Explorar o código

Merge branch 'feature/0721-tenant'

yuanliang hai 1 ano
pai
achega
4bf0101b90

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

@@ -184,11 +184,12 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
         if (code == null) {
             throw new BizException("激活码不存在");
         }
-        if (Boolean.TRUE.equals(code.getActivationStatus()) || EActivationCode.SEND.equals(code.getSendStatus())) {
+        SysUser sysUser = sysUserMapper.selectById(studentId);
+        if (Boolean.TRUE.equals(code.getActivationStatus()) || (EActivationCode.SEND.equals(code.getSendStatus()) &&
+                !sysUser.getPhone().equals(code.getActivationPhone()))) {
             throw new BizException("激活码已经被使用");
         }
 
-        SysUser sysUser = sysUserMapper.selectById(studentId);
         // 通过状态和ID同时判断更新是否存在竞争
         boolean update = this.lambdaUpdate()
                 .set(TenantActivationCode::getActivationStatus, true)

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

@@ -237,12 +237,13 @@ public class TenantUnbindRecordServiceImpl extends ServiceImpl<TenantUnbindRecor
         }
 
         // 添加历史记录
-        TenantUnbindHistory history = JSON.parseObject(JSON.toJSONString(unbindRecord), TenantUnbindHistory.class);
+        TenantUnbindRecord newRecord = tenantUnbindRecordService.getById(audio.getId());
+        TenantUnbindHistory history = JSON.parseObject(JSON.toJSONString(newRecord), TenantUnbindHistory.class);
         history.setId(null);
         tenantUnbindHistoryService.save(history);
 
         // 老师端发送消息
-        CompletableFuture.runAsync(() -> sendTeacherUnBindMessage(audio, unbindRecord));
+        CompletableFuture.runAsync(() -> sendTeacherUnBindMessage(audio, newRecord));
     }
 
     @Transactional(rollbackFor = Exception.class)

BIN=BIN
cooleshow-user/user-student/.DS_Store