Browse Source

NC定时代码更新

fyz 7 months ago
parent
commit
3cb2479dc4

+ 7 - 4
mjava-lanyun/src/main/java/com/malk/lanyun/service/impl/NCServiceImpl.java

@@ -38,7 +38,9 @@ public class NCServiceImpl implements NCService {
     private YDService ydService;
     private YDService ydService;
 
 
     // 获取当前日期
     // 获取当前日期
-    LocalDate lastMonth = LocalDate.now().minusMonths(1);
+//    LocalDate lastMonth = LocalDate.now().minusMonths(1);
+    //本月
+    LocalDate lastMonth = LocalDate.now();
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
     @Override
     @Override
     public void getNcInfo() {
     public void getNcInfo() {
@@ -369,9 +371,10 @@ public class NCServiceImpl implements NCService {
         } finally {
         } finally {
             // 关闭资源
             // 关闭资源
             try {
             try {
-                if (resultSet != null) resultSet.close();
-                if (statement != null) statement.close();
-                if (connection != null) connection.close();
+                assert resultSet != null;
+                resultSet.close();
+                statement.close();
+                connection.close();
             } catch (Exception e) {
             } catch (Exception e) {
                 e.printStackTrace();
                 e.printStackTrace();
             }
             }