Browse Source

fix: 修改bug

liaoyitao 5 months ago
parent
commit
f78a222bdd

+ 1 - 1
src/main/java/com/lqkj/link/module/zone/repository/ZoneInfoRepository.java

@@ -124,7 +124,7 @@ public interface ZoneInfoRepository extends JpaRepository<ZoneInfo, Integer> {
124
                      @Param("userCode") String userCode);
124
                      @Param("userCode") String userCode);
125
 
125
 
126
     @Query(nativeQuery = true,
126
     @Query(nativeQuery = true,
127
-        value = "select auth_status = 1 or auth_status = 2 from zone_info where zone_id = :zoneId"
127
+        value = "select auth_status != 1 from zone_info where zone_id = :zoneId"
128
     )
128
     )
129
     Boolean canBeDeleteWithAuthStatus(@Param("zoneId") Integer zoneId);
129
     Boolean canBeDeleteWithAuthStatus(@Param("zoneId") Integer zoneId);
130
 
130
 

+ 1 - 1
src/main/java/com/lqkj/link/module/zone/service/ResourceService.java

@@ -57,7 +57,7 @@ public class ResourceService {
57
         category = categoryRepository.save(category);
57
         category = categoryRepository.save(category);
58
         String filePath = category.getCompressFilePath();
58
         String filePath = category.getCompressFilePath();
59
         if (uploadCompress) {
59
         if (uploadCompress) {
60
-            infoRepository.deleteWithCategory(category.getCategoryId());
60
+//            infoRepository.deleteWithCategory(category.getCategoryId());
61
 //            Unzipper.unzip("." + filePath, "./upload/resource/" + category.getCategoryId() + "/", false);
61
 //            Unzipper.unzip("." + filePath, "./upload/resource/" + category.getCategoryId() + "/", false);
62
             Unzipper.unZipFiles(new File("." + filePath), "./upload/resource/" + category.getCategoryId() + "/");
62
             Unzipper.unZipFiles(new File("." + filePath), "./upload/resource/" + category.getCategoryId() + "/");
63
 
63
 

+ 2 - 2
src/main/java/com/lqkj/link/module/zone/service/ZoneInfoService.java

@@ -280,8 +280,8 @@ public class ZoneInfoService {
280
         if (!zoneInfoRepository.isAuthor(zoneId, userCode)) {
280
         if (!zoneInfoRepository.isAuthor(zoneId, userCode)) {
281
             return "您不是该作品的作者!";
281
             return "您不是该作品的作者!";
282
         }
282
         }
283
-        if (zoneInfoRepository.canBeDeleteWithAuthStatus(zoneId)) {
284
-            return "不能删除正在审核或已发布的作品!";
283
+        if (!zoneInfoRepository.canBeDeleteWithAuthStatus(zoneId)) {
284
+            return "不能删除正在审核的作品!";
285
         }
285
         }
286
         zoneInfoRepository.deleteById(zoneId);
286
         zoneInfoRepository.deleteById(zoneId);
287
         return null;
287
         return null;