浏览代码

NC定时代码更新

fyz 7 月之前
父节点
当前提交
3cb2479dc4
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      mjava-lanyun/src/main/java/com/malk/lanyun/service/impl/NCServiceImpl.java

+ 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;
 
     // 获取当前日期
-    LocalDate lastMonth = LocalDate.now().minusMonths(1);
+//    LocalDate lastMonth = LocalDate.now().minusMonths(1);
+    //本月
+    LocalDate lastMonth = LocalDate.now();
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
     @Override
     public void getNcInfo() {
@@ -369,9 +371,10 @@ public class NCServiceImpl implements NCService {
         } finally {
             // 关闭资源
             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) {
                 e.printStackTrace();
             }