liaoyitao 5 mesi fa
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 124
                      @Param("userCode") String userCode);
125 125
 
126 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 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 57
         category = categoryRepository.save(category);
58 58
         String filePath = category.getCompressFilePath();
59 59
         if (uploadCompress) {
60
-            infoRepository.deleteWithCategory(category.getCategoryId());
60
+//            infoRepository.deleteWithCategory(category.getCategoryId());
61 61
 //            Unzipper.unzip("." + filePath, "./upload/resource/" + category.getCategoryId() + "/", false);
62 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 280
         if (!zoneInfoRepository.isAuthor(zoneId, userCode)) {
281 281
             return "您不是该作品的作者!";
282 282
         }
283
-        if (zoneInfoRepository.canBeDeleteWithAuthStatus(zoneId)) {
284
-            return "不能删除正在审核或已发布的作品!";
283
+        if (!zoneInfoRepository.canBeDeleteWithAuthStatus(zoneId)) {
284
+            return "不能删除正在审核的作品!";
285 285
         }
286 286
         zoneInfoRepository.deleteById(zoneId);
287 287
         return null;