From 16332a341801f80d27830d2ea4e683b4ab21167c Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期一, 21 四月 2025 18:28:00 +0800
Subject: [PATCH] 工单业务

---
 server/src/main/java/com/doumee/core/utils/DateUtil.java |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/server/src/main/java/com/doumee/core/utils/DateUtil.java b/server/src/main/java/com/doumee/core/utils/DateUtil.java
index 637e297..d906a52 100644
--- a/server/src/main/java/com/doumee/core/utils/DateUtil.java
+++ b/server/src/main/java/com/doumee/core/utils/DateUtil.java
@@ -577,15 +577,16 @@
      * @return String
      * @throws Exception
      */
-    public static String getNowYear() throws Exception {
+    public static String getNowYear() {
         String nowYear = "";
         try {
             String strTemp = getNowLongTime();
             nowYear = strTemp.substring(0, 4);
             return nowYear;
         } catch (Exception e) {
-            throw e;
+          e.printStackTrace();
         }
+        return nowYear;
     }
 
     /**
@@ -594,15 +595,16 @@
      * @return String
      * @throws Exception
      */
-    public static String getNowMonth() throws Exception {
+    public static Integer getNowMonth()   {
         String nowMonth = "";
         try {
             String strTemp = getNowLongTime();
             nowMonth = strTemp.substring(4, 6);
-            return nowMonth;
+            return Integer.valueOf(nowMonth);
         } catch (Exception e) {
-            throw e;
+            e.printStackTrace();
         }
+        return null;
     }
 
     /**
@@ -611,15 +613,16 @@
      * @return String
      * @throws Exception
      */
-    public static String getNowDay() throws Exception {
+    public static String getNowDay()  {
         String nowDay = "";
         try {
             String strTemp = getNowLongTime();
             nowDay = strTemp.substring(6, 8);
             return nowDay;
         } catch (Exception e) {
-            throw e;
+            e.printStackTrace();
         }
+        return  nowDay;
     }
 
     /**
@@ -2928,8 +2931,9 @@
 //            System.out.println(DateUtil.afterMinutesDate(-5));
 
 
-            System.out.println(getPlusTime2(DateUtil.addMonthToDate(new Date(),-1)));
-//            System.out.println(DateUtil.getBeforMonthStr(new Date(),12));
+//            List<String> s = DateUtil.getDayByMonth();
+//            System.out.println(getPlusTime2(DateUtil.addMonthToDate(new Date(),-1)));
+            System.out.println(DateUtil.getNowMonth());
 
 //            List<Date> list =getThisMonthDateList();
 //            for(Date d :list){
@@ -3236,6 +3240,14 @@
         return cal.getTime();
     }
 
+    public static Date afterHoursDate(Date date,Integer hours){
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        cal.add(Calendar.HOUR,hours);
+        return cal.getTime();
+    }
+
+
     /**
      * LocalDateTime to date
      * @param now

--
Gitblit v1.9.3