浏览代码

增加静态文件路径

xiewenjie 3 年之前
父节点
当前提交
1f21d5e91d
共有 1 个文件被更改,包括 13 次插入6 次删除
  1. 13 6
      sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/testController.java

+ 13 - 6
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/testController.java

@@ -1,6 +1,8 @@
 package com.fdkk.sxz.webApi.controller;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
 import com.fdkk.sxz.base.BaseController;
 import com.fdkk.sxz.base.Result;
 import com.fdkk.sxz.entity.RenovationPartsDetailEntity;
@@ -61,17 +63,22 @@ public class testController extends BaseController {
     public Result cleanMviewPath() {
         List<RenovationPartsDetailEntity> list = renovationPartsDetailService.list();
         for (RenovationPartsDetailEntity renovationPartsDetailEntity : list) {
-            if (!uploadToOssUtil.existFileToOSS(renovationPartsDetailEntity.getMviewPath(), "4d-tjw")) {
-                renovationPartsDetailEntity.setMviewPath(null);
-                renovationPartsDetailService.updateById(renovationPartsDetailEntity);
+            if (ObjectUtil.isNotNull(renovationPartsDetailEntity.getMviewPath()) && StrUtil.isNotBlank(renovationPartsDetailEntity.getMviewPath())) {
+                if (!uploadToOssUtil.existFileToOSS(renovationPartsDetailEntity.getMviewPath(), "4d-tjw")) {
+                    renovationPartsDetailEntity.setMviewPath(null);
+                    renovationPartsDetailService.updateById(renovationPartsDetailEntity);
+                }
             }
         }
         List<CustomComponentEntity> list1 = customComponentService.list();
         for (CustomComponentEntity customComponentEntity : list1) {
-            if (!uploadToOssUtil.existFileToOSS(customComponentEntity.getMviewPath(), "4d-tjw")) {
-                customComponentEntity.setMviewPath(null);
-                customComponentService.updateById(customComponentEntity);
+            if (ObjectUtil.isNotNull(customComponentEntity.getMviewPath()) && StrUtil.isNotBlank(customComponentEntity.getMviewPath())) {
+                if (!uploadToOssUtil.existFileToOSS(customComponentEntity.getMviewPath(), "4d-tjw")) {
+                    customComponentEntity.setMviewPath(null);
+                    customComponentService.updateById(customComponentEntity);
+                }
             }
+
         }
         return success();
     }