|
@@ -347,6 +347,12 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
}
|
|
}
|
|
|
|
|
|
private void publicBoxModel(String num, SceneEditInfo sceneEditInfo){
|
|
private void publicBoxModel(String num, SceneEditInfo sceneEditInfo){
|
|
|
|
+
|
|
|
|
+ List<String> boxModelKeys = uploadToOssUtil.listKeys(String.format(UploadFilePath.USER_EDIT_PATH, num) + "boxModels/");
|
|
|
|
+ if(CollUtil.isEmpty(boxModelKeys)){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
String boxModels = sceneEditInfo.getBoxModels();
|
|
String boxModels = sceneEditInfo.getBoxModels();
|
|
if(StrUtil.isEmpty(boxModels)){
|
|
if(StrUtil.isEmpty(boxModels)){
|
|
return;
|
|
return;
|
|
@@ -355,20 +361,28 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
if(CollUtil.isEmpty(jsonArray)){
|
|
if(CollUtil.isEmpty(jsonArray)){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- jsonArray.stream().forEach(o->{
|
|
|
|
- JSONObject item = (JSONObject)o;
|
|
|
|
|
|
+ Set<String> sidSet = jsonArray.stream().map(o -> {
|
|
|
|
+ JSONObject item = (JSONObject) o;
|
|
String sid = item.getString("sid");
|
|
String sid = item.getString("sid");
|
|
- if(StrUtil.isNotEmpty(sid)){
|
|
|
|
- String ossKey = String.format(UploadFilePath.USER_EDIT_PATH, num) + sid + ".glb";
|
|
|
|
|
|
+ return sid;
|
|
|
|
+ }).collect(Collectors.toSet());
|
|
|
|
+
|
|
|
|
+ boxModelKeys.stream().forEach(key -> {
|
|
|
|
+ if(!sidSet.contains(key.substring(key.lastIndexOf("/") + 1, key.lastIndexOf(".")))){
|
|
try {
|
|
try {
|
|
- uploadToOssUtil.delete(ossKey);
|
|
|
|
|
|
+ uploadToOssUtil.delete(key);
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
- log.warn("删除oss文件出错, key:{}", ossKey);
|
|
|
|
|
|
+ e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+ String key = "aaa/bbb/123.glb";
|
|
|
|
+ System.out.println(key.substring(key.lastIndexOf("/"), key.lastIndexOf(".")));
|
|
|
|
+ }
|
|
|
|
+
|
|
private void publicSurveillance(String num, Integer surveillances) throws IOException {
|
|
private void publicSurveillance(String num, Integer surveillances) throws IOException {
|
|
String surveillanceJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "surveillance.json";
|
|
String surveillanceJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "surveillance.json";
|
|
if(surveillances == CommonStatus.NO.code().intValue()){
|
|
if(surveillances == CommonStatus.NO.code().intValue()){
|