|
@@ -58,6 +58,8 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* TODO
|
|
@@ -94,7 +96,7 @@ public class SceneServiceImpl extends ServiceImpl<ISceneMapper, Scene> implement
|
|
|
private IScenePlusService scenePlusService;
|
|
|
@Autowired
|
|
|
private IScenePlusExtService scenePlusExtService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private FYunFileServiceInterface fYunFileService;
|
|
|
@Autowired
|
|
|
private IVideoSceneProgressService videoSceneProgressService;
|
|
@@ -213,21 +215,15 @@ public class SceneServiceImpl extends ServiceImpl<ISceneMapper, Scene> implement
|
|
|
}
|
|
|
|
|
|
User user = userService.findByUserName(username);
|
|
|
+ SceneCooperation sceneCooperation = null;
|
|
|
if("18750226207".equals(username)){
|
|
|
log.info("18750226207该账号默认超级管理员,可以操作所有场景");
|
|
|
}
|
|
|
else if(user == null || sceneProEntity.getUserId() == null || user.getId().longValue() != sceneProEntity.getUserId().longValue()){
|
|
|
log.info("user:" + user.getId() + ",scene:" + sceneProEntity.getUserId());
|
|
|
|
|
|
- List<SceneCooperation> list =
|
|
|
- sceneCooperationService.list(
|
|
|
- new LambdaQueryWrapper<SceneCooperation>()
|
|
|
- .eq(SceneCooperation::getSceneNum, num));
|
|
|
- if(list != null && list.size() > 0){
|
|
|
- if(list.get(0).getUserId().longValue() != user.getId().longValue()){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5014);
|
|
|
- }
|
|
|
- }else {
|
|
|
+ sceneCooperation = sceneCooperationService.getByNumAndUserId(num, user.getId());
|
|
|
+ if(Objects.isNull(sceneCooperation)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5014);
|
|
|
}
|
|
|
}
|
|
@@ -245,20 +241,10 @@ public class SceneServiceImpl extends ServiceImpl<ISceneMapper, Scene> implement
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //权限控制完后判断若是协作账号,获取协作权限
|
|
|
- SceneCooperation sceneCooperation = sceneCooperationService.getByNum(num);
|
|
|
- //若数据为空表示可操作全部资源
|
|
|
- if(sceneCooperation == null || sceneCooperation.getUserId().longValue() != ssoUser.getId().longValue()){
|
|
|
- return result;
|
|
|
+ if(Objects.nonNull(sceneCooperation)){
|
|
|
+ jsonObject.put("include", sceneResourceService.findByCooperationId(sceneCooperation.getId()));
|
|
|
}
|
|
|
|
|
|
- if(sceneProEntity.getUserId()!= null && sceneCooperation.getUserId()!= null &&
|
|
|
- sceneProEntity.getUserId().equals(sceneCooperation.getUserId())){
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- jsonObject.put("include", sceneResourceService.findByCooperationId(sceneCooperation.getId()));
|
|
|
-
|
|
|
return result;
|
|
|
}
|
|
|
|