|
@@ -2,6 +2,7 @@ package com.fdkankan.scene.Interceptor;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.fdkankan.common.constant.CommonStatus;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.constant.ServerCode;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
@@ -64,12 +65,27 @@ public class CheckCooperationPermitAspect {
|
|
|
throw new BusinessException(ErrorCode.PARAM_REQUIRED);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//判断是不是场景原用户,如果是,跳出
|
|
|
ScenePlus scenePlus= scenePlusService.getScenePlusByNum(num);
|
|
|
if(Objects.isNull(scenePlus)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
}
|
|
|
+
|
|
|
+ //判断是否相机登录,是否场景的相机id和相机登录的相机id是否相等,如果都满足,则放行,否则判定为用户登录
|
|
|
+ if(Objects.nonNull(user.getCameraLogin())
|
|
|
+ && CommonStatus.YES.code().byteValue() == user.getCameraLogin().intValue()){
|
|
|
+ if(scenePlus.getCameraId().equals(user.getCameraId())){
|
|
|
+ return;
|
|
|
+ }else{
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5014);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //走到这里代表是用户账号密码登录,如果查到的场景的userid是空,证明相机解绑了,需要返回无权操作
|
|
|
+ if(Objects.isNull(scenePlus.getUserId())){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5014);
|
|
|
+ }
|
|
|
+
|
|
|
if(scenePlus.getUserId().equals(user.getId())){
|
|
|
return;
|
|
|
}
|