huangtf hai 1 ano
pai
achega
5d168bbf12

+ 1 - 1
blade-common/src/main/java/org/springblade/common/utils/ForestNodeMergerEx.java

@@ -145,7 +145,7 @@ public class ForestNodeMergerEx {
 
         if (dstTree.getFromId() == null) {
             bRootMatch = false;
-        } else if (!dstTree.getFromId().equals(srcTree.getId()) && dstTree.getParentId() != 0) {
+        } else if (srcTree.getId() != null && !dstTree.getFromId().equals(srcTree.getId()) && dstTree.getParentId()!= null && dstTree.getParentId() != 0) {
             bRootMatch = false;
         }
 

+ 9 - 4
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchiveAutoPdfServiceImpl.java

@@ -713,13 +713,18 @@ public class ArchiveAutoPdfServiceImpl implements IArchiveAutoPdfService {
         }
 
         // 将日期赋值给startDate和endDate
-        if (!minDate.isEmpty() && !minDate.equals("null") && minDate.matches(".*\\d.*")) {
+        if (!minDate.isEmpty() && !minDate.equals("null") ) {
             LocalDateTime localDateTime = FormulaUtil.parseStringToLocalDateTime(minDate, "yyyyMMdd");
-            archive.setStartDate(localDateTime);
+            if (localDateTime != null) {
+                archive.setStartDate(localDateTime);
+            }
+
         }
-        if (!maxDate.isEmpty() && !maxDate.equals("null") && maxDate.matches(".*\\d.*")) {
+        if (!maxDate.isEmpty() && !maxDate.equals("null") ) {
             LocalDateTime localDateTime = FormulaUtil.parseStringToLocalDateTime(maxDate, "yyyyMMdd");
-            archive.setEndDate(localDateTime);
+            if (localDateTime != null) {
+                archive.setStartDate(localDateTime);
+            }
         }
 
         Map<String, Object> archivesAutoMap = new ObjectMapper().convertValue(archive, Map.class);

+ 13 - 1
blade-service/blade-archive/src/main/java/org/springblade/archive/utils/FormulaUtil.java

@@ -55,6 +55,11 @@ public class FormulaUtil {
      * @return
      */
     public static LocalDateTime parseStringToLocalDateTime(String strDate, String pattern) {
+
+        if (!strDate.matches(".*\\d.*")) {
+            return null;
+        }
+
         if (StringUtils.isNotEmpty(strDate)) {
             strDate =  strDate.replace(".", "");
             strDate = strDate.replace("-","");
@@ -62,8 +67,15 @@ public class FormulaUtil {
             strDate = strDate.replace("月","");
             strDate = strDate.replace("日","");
         }
+
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
-        LocalDate date = LocalDate.parse(strDate, formatter);
+        LocalDate date = null;
+        try {
+            date = LocalDate.parse(strDate, formatter);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
         return LocalDateTime.of(date, LocalTime.MIN);
     }
 

+ 3 - 3
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ArchiveFileMapper.xml

@@ -360,7 +360,7 @@
           and (is_archive = 0 OR is_archive IS NULL)
           and (is_auto_file is null or is_auto_file != 1)
           and is_deleted = 0
-        order by sort
+        order by sort,create_time
     </select>
 
     <select id="getListByNodeIDName" resultMap="archiveFileResultMap">
@@ -370,7 +370,7 @@
           and (is_archive = 0 OR is_archive IS NULL)
           and (is_auto_file is null or is_auto_file != 1)
           and is_deleted = 0
-        order by sort
+        order by sort,create_time
     </select>
 
     <select id="getArchiveFileByArchiveID" resultMap="archiveFileResultMap">
@@ -378,7 +378,7 @@
         from u_archive_file
         where archive_id = #{archiveId}
           and is_deleted = 0
-        order by sort
+        order by sort,create_time
     </select>