|
@@ -7,7 +7,9 @@ import com.fdkankan.common.constant.SceneStatus;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
+import com.fdkankan.scene.entity.SceneCooperation;
|
|
|
import com.fdkankan.scene.entity.ScenePlus;
|
|
|
+import com.fdkankan.scene.service.ISceneCooperationService;
|
|
|
import com.fdkankan.scene.service.IScenePlusService;
|
|
|
import com.fdkankan.web.user.SSOLoginHelper;
|
|
|
import com.fdkankan.web.user.SSOUser;
|
|
@@ -38,6 +40,8 @@ public class CheckPermitAspect {
|
|
|
private RedisUtil redisUtil;
|
|
|
@Autowired
|
|
|
private IScenePlusService scenePlusService;
|
|
|
+ @Autowired
|
|
|
+ private ISceneCooperationService sceneCooperationService;
|
|
|
|
|
|
|
|
|
@Pointcut("@annotation(com.fdkankan.scene.annotation.CheckPermit)")
|
|
@@ -94,11 +98,16 @@ public class CheckPermitAspect {
|
|
|
}
|
|
|
|
|
|
//如果不是用户自己的场景,判断是否有协作权限
|
|
|
- String userId = redisUtil.hget(RedisKey.SCENE_COOPERATION_NUM_USERID, num);
|
|
|
- if(StrUtil.isEmpty(userId)){
|
|
|
+ Long userId = null;
|
|
|
+ SceneCooperation sceneCooperation = sceneCooperationService.getByNum(num);
|
|
|
+ if(Objects.nonNull(sceneCooperation)){
|
|
|
+ userId = sceneCooperation.getUserId();
|
|
|
+ }
|
|
|
+
|
|
|
+ if(Objects.isNull(userId)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5014);
|
|
|
}
|
|
|
- if(!userId.equals(String.valueOf(user.getId()))){
|
|
|
+ if(!userId.equals(user.getId())){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5014);
|
|
|
}
|
|
|
}
|