浏览代码

Merge branch 'feature/0721-tenant'

yuanliang 1 年之前
父节点
当前提交
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) {
         if (code == null) {
             throw new BizException("激活码不存在");
             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("激活码已经被使用");
             throw new BizException("激活码已经被使用");
         }
         }
 
 
-        SysUser sysUser = sysUserMapper.selectById(studentId);
         // 通过状态和ID同时判断更新是否存在竞争
         // 通过状态和ID同时判断更新是否存在竞争
         boolean update = this.lambdaUpdate()
         boolean update = this.lambdaUpdate()
                 .set(TenantActivationCode::getActivationStatus, true)
                 .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);
         history.setId(null);
         tenantUnbindHistoryService.save(history);
         tenantUnbindHistoryService.save(history);
 
 
         // 老师端发送消息
         // 老师端发送消息
-        CompletableFuture.runAsync(() -> sendTeacherUnBindMessage(audio, unbindRecord));
+        CompletableFuture.runAsync(() -> sendTeacherUnBindMessage(audio, newRecord));
     }
     }
 
 
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)

二进制
cooleshow-user/user-student/.DS_Store