lyhzzz 8 mēneši atpakaļ
vecāks
revīzija
dd5b3d1d5b

+ 2 - 2
src/main/java/com/fdkankan/fusion/controller/CaseLiveController.java

@@ -18,14 +18,14 @@ import org.springframework.web.bind.annotation.*;
  */
 @RestController
 @RequestMapping("/caseLive")
-public class CaseLiveController {
+public class CaseLiveController extends BaseController{
 
     @Autowired
     ICaseLiveService caseLiveService;
 
     @PostMapping("/getTakeLookRoom")
     public ResultData getTakeLookRoom(@RequestBody CaseLive caseLive){
-        return ResultData.ok(caseLiveService.getByCaseId(caseLive.getCaseId()));
+        return ResultData.ok(caseLiveService.getByCaseId(caseLive.getCaseId(),getUserName()));
     }
 }
 

+ 3 - 0
src/main/java/com/fdkankan/fusion/entity/CaseLive.java

@@ -37,6 +37,9 @@ public class CaseLive implements Serializable {
     @TableField("tm_user_id")
     private String tmUserId;
 
+    @TableField("user_name")
+    private String userName;
+
     @TableField("take_room_id")
     private String takeRoomId;
 

+ 7 - 6
src/main/java/com/fdkankan/fusion/httpClient/FdService.java

@@ -52,12 +52,13 @@ public class FdService {
         return vo.getFdToken();
     }
     public String getFdToken(){
-        String jsObj = redisUtil.get(String.format(RedisKeyUtil.fusionLoginToken, StpUtil.getTokenValue()));
-        FdkkLoginVo vo = JSONObject.parseObject(jsObj, FdkkLoginVo.class);
-        if(vo == null){
-            throw new BusinessException(ResultCode.USER_NOT_LOGIN);
-        }
-        return vo.getFdToken();
+//        String jsObj = redisUtil.get(String.format(RedisKeyUtil.fusionLoginToken, StpUtil.getTokenValue()));
+//        FdkkLoginVo vo = JSONObject.parseObject(jsObj, FdkkLoginVo.class);
+//        if(vo == null){
+//            throw new BusinessException(ResultCode.USER_NOT_LOGIN);
+//        }
+//        return vo.getFdToken();
+        return StpUtil.getTokenValue();
     }
 
     public String getFdTokenByUserName(String userName) {

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/ICaseLiveService.java

@@ -13,5 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ICaseLiveService extends IService<CaseLive> {
 
-    Object getByCaseId(Integer caseId);
+    Object getByCaseId(Integer caseId,String userName);
 }

+ 3 - 3
src/main/java/com/fdkankan/fusion/service/impl/CaseLiveServiceImpl.java

@@ -49,7 +49,7 @@ public class CaseLiveServiceImpl extends ServiceImpl<ICaseLiveMapper, CaseLive>
 
 
     @Override
-    public Object getByCaseId(Integer caseId) {
+    public Object getByCaseId(Integer caseId,String userName) {
 
         CaseEntity caseEntity = caseService.getById(caseId);
         if(caseEntity == null ){
@@ -57,7 +57,7 @@ public class CaseLiveServiceImpl extends ServiceImpl<ICaseLiveMapper, CaseLive>
         }
         LambdaQueryWrapper<CaseLive> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(CaseLive::getCaseId,caseId);
-        wrapper.eq(CaseLive::getTmUserId, StpUtil.getLoginId());
+        wrapper.eq(CaseLive::getUserName,userName);
         CaseLive caseLive = this.getOne(wrapper);
         List<CaseNumEntity> caseNumEntities = caseNumService.getByCaseId(caseId);
         if(caseNumEntities == null || caseNumEntities.size() <=0 ){
@@ -67,7 +67,7 @@ public class CaseLiveServiceImpl extends ServiceImpl<ICaseLiveMapper, CaseLive>
         if(caseLive == null){
             caseLive = new CaseLive();
             caseLive.setCaseId(caseId);
-            caseLive.setTmUserId((String)StpUtil.getLoginId() );
+            caseLive.setUserName(userName);
         }
         Boolean flag = this.getCheckCreateRoom(caseLive.getNumList(),numList);
         if(!flag){