|
@@ -116,7 +116,7 @@ public class DirServiceImpl extends IBaseServiceImpl<DirEntity, Long> implements
|
|
|
// 查询子节点
|
|
|
String dirs = getChildIdById(id);
|
|
|
log.info("删除类型{},dir-ids:{}",type,dirs);
|
|
|
- BaseRuntimeException.isTrue(checkPanoUse(dirs), ErrorEnum.FAILURE_CODE_3101.code(), ErrorEnum.FAILURE_CODE_3101.message());
|
|
|
+ BaseRuntimeException.isTrue(checkPanoUse(dirs,type), ErrorEnum.FAILURE_CODE_3101.code(), ErrorEnum.FAILURE_CODE_3101.message());
|
|
|
this.deleteByIds(dirs);
|
|
|
fodderService.removeByDirIds(dirs);
|
|
|
return Result.success();
|
|
@@ -143,19 +143,27 @@ public class DirServiceImpl extends IBaseServiceImpl<DirEntity, Long> implements
|
|
|
}
|
|
|
|
|
|
// 检查该目录下的场景是否被使用
|
|
|
- private boolean checkPanoUse(String dirs){
|
|
|
+ private boolean checkPanoUse(String dirs,String type){
|
|
|
log.info("检查的目录集合id: {}", dirs);
|
|
|
- // 查询目录下的场景码
|
|
|
- List<String> sceneCodes = fodderService.getSceneCodeByParentIds(dirs);
|
|
|
- if (sceneCodes.size()==0){
|
|
|
- log.info("没有场景需要检查: {}", sceneCodes.size());
|
|
|
- return false;
|
|
|
- }
|
|
|
- // 查找该用户的作品
|
|
|
- boolean works = workService.getUserWorkCountBySceneCodes(sceneCodes);
|
|
|
- if (!works){
|
|
|
- works=workHotsFodderService.getCountByDirId(dirs);
|
|
|
+ boolean works=false;
|
|
|
+ if ("pano".equals(type)){
|
|
|
+ // 查询目录下的场景码
|
|
|
+ List<String> sceneCodes = fodderService.getSceneCodeByParentIds(dirs);
|
|
|
+ if (sceneCodes.size()==0){
|
|
|
+ log.info("没有场景需要检查: {}", sceneCodes.size());
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // 查找该用户的作品
|
|
|
+ works = workService.getUserWorkCountBySceneCodes(sceneCodes);
|
|
|
+ if (!works){
|
|
|
+ works=workHotsFodderService.getCountByDirId(dirs);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ works=workHotsFodderService.getCountByDirId(dirs);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 匹配场景码
|
|
|
// log.error("此场景:{} 被该作品:{} 引用", works);
|
|
|
|