|
@@ -132,27 +132,19 @@ public class DirServiceImpl extends IBaseServiceImpl<DirEntity, Long> implements
|
|
|
// 检查该目录下的场景是否被使用
|
|
|
private boolean checkPanoUse(String dirs){
|
|
|
log.info("检查的目录集合id: {}", dirs);
|
|
|
- boolean isUser = false;
|
|
|
// 查询目录下的场景码
|
|
|
List<String> sceneCodes = fodderService.getSceneCodeByParentIds(dirs);
|
|
|
+ if (sceneCodes.size()==0){
|
|
|
+ log.info("没有场景需要检查: {}", sceneCodes.size());
|
|
|
+ return false;
|
|
|
+ }
|
|
|
// 查找该用户的作品
|
|
|
- List<WorkEntity> works = workService.getUserWork();
|
|
|
+ boolean works = workService.getUserWorkCountBySceneCodes(sceneCodes);
|
|
|
// 匹配场景码
|
|
|
- for (WorkEntity work : works) {
|
|
|
- if (StrUtil.isNotBlank(work.getSceneCodes())){
|
|
|
- continue;
|
|
|
- }
|
|
|
- for (String sceneCode : sceneCodes) {
|
|
|
- if (work.getSceneCodes().contains(sceneCode)){
|
|
|
- log.error("此场景:{} 被该作品:{} 引用", sceneCode, work.getId());
|
|
|
- isUser = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+// log.error("此场景:{} 被该作品:{} 引用", works);
|
|
|
|
|
|
- }
|
|
|
- log.info("检查结果: {}", isUser);
|
|
|
- return isUser;
|
|
|
+ log.info("引用检查结果: {}", works);
|
|
|
+ return works;
|
|
|
|
|
|
}
|
|
|
|