Kaynağa Gözat

Merge branch 'release-多人协作' into test

dengsixing 4 ay önce
ebeveyn
işleme
52d6b42d77

+ 1 - 8
src/main/java/com/fdkankan/scene/aop/CheckCurrenUserAspect.java

@@ -88,15 +88,8 @@ public class CheckCurrenUserAspect {
 			}
 		}
 		else if((user != null && entity != null) && entity.getUserId() != null && (user.getId().longValue() != entity.getUserId().longValue())){
-			SceneCooperation sceneCooperation = sceneCooperationService.getByNum(sceneNum);
+			SceneCooperation sceneCooperation = sceneCooperationService.getByNumAndUserId(sceneNum, user.getId());
 			if(Objects.nonNull(sceneCooperation)){
-				if(sceneCooperation.getUserId().longValue() != user.getId().longValue()){
-					log.info(getCheckUserMthodDescription(joinPoint));
-					log.info("不是当前用户的方法:"
-							+ (joinPoint.getTarget().getClass().getName() + "." + joinPoint.getSignature().getName() + "()"));
-					throw new BusinessException(ErrorCode.FAILURE_CODE_5014);
-				}
-			}else {
 				log.info(getCheckUserMthodDescription(joinPoint));
 				log.info("不是当前用户的方法:"
 						+ (joinPoint.getTarget().getClass().getName() + "." + joinPoint.getSignature().getName() + "()"));

+ 1 - 6
src/main/java/com/fdkankan/scene/controller/SceneController.java

@@ -314,15 +314,10 @@ public class SceneController extends BaseController {
         }
 
         if(user.getId().longValue() != scene.getUserId().longValue()) {
-            SceneCooperation sceneCooperationEntity = sceneCooperationService.getByNum(sceneNum);
+            SceneCooperation sceneCooperationEntity = sceneCooperationService.getByNumAndUserId(sceneNum, user.getId());
             if(sceneCooperationEntity == null){
                 throw new BusinessException(ErrorCode.FAILURE_CODE_5014);
             }
-
-            if(sceneCooperationEntity.getUserId().longValue() != user.getId().longValue()){
-                throw new BusinessException(ErrorCode.FAILURE_CODE_5014);
-            }
-
         }
 
         if(!SecurityUtil.MD5(password).equals(user.getPassword()))

+ 1 - 6
src/main/java/com/fdkankan/scene/service/impl/SceneServiceImpl.java

@@ -263,12 +263,7 @@ public class SceneServiceImpl extends ServiceImpl<ISceneMapper, Scene> implement
             return ResultData.ok();
         }
 
-        SceneCooperation sceneCooperation = sceneCooperationService.getByNum(cooperation.getSceneNum());
-        //若数据为空表示可操作全部资源
-        if(sceneCooperation == null || sceneCooperation.getUserId().longValue() != ssoUser.getId().longValue()){
-            return ResultData.ok();
-        }
-
+        SceneCooperation sceneCooperation = sceneCooperationService.getByNumAndUserId(cooperation.getSceneNum(), ssoUser.getId());
         ScenePro scenePro = sceneProService.findBySceneNum(cooperation.getSceneNum());
         if(scenePro != null && scenePro.getUserId() == sceneCooperation.getUserId().longValue()){
             return ResultData.ok();