From 10c5247722995e571b3fd4dbffb178964a9bd6ee Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期三, 05 十一月 2025 10:51:54 +0800
Subject: [PATCH] 台账添加错误问题修改
---
smart-man-boot/src/main/java/com/qianwen/smartman/common/utils/LocalDateTimeUtils.java | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/common/utils/LocalDateTimeUtils.java b/smart-man-boot/src/main/java/com/qianwen/smartman/common/utils/LocalDateTimeUtils.java
index b23a044..1bc5410 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/common/utils/LocalDateTimeUtils.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/common/utils/LocalDateTimeUtils.java
@@ -79,12 +79,23 @@
return time.withHour(23).withMinute(59).withSecond(59).withNano(999999999);
}
+ /**
+ * 璁$畻涓�骞寸殑澶╂暟
+ * @param year 骞翠唤
+ * @return year鎸囧畾鐨勫勾浠芥�诲ぉ鏁�
+ */
public static Integer getDayOfYear(Integer year) {
- return Integer.valueOf(LocalDate.of(year.intValue(), 1, 1).isLeapYear() ? 366 : 365);
+ return Integer.valueOf(LocalDate.of(year, 1, 1).isLeapYear() ? 366 : 365);
}
+ /**
+ * 璁$畻2涓棩鏈熷ぉ鏁扮殑宸� endDate-startDate
+ * @param startDate
+ * @param endDate
+ * @return
+ */
public static Integer getDifference(LocalDate startDate, LocalDate endDate) {
- Long l = Long.valueOf(endDate.toEpochDay() - startDate.toEpochDay());
+ Long l = Long.valueOf(endDate.toEpochDay() - startDate.toEpochDay());//l.intValue()
Integer difference = Integer.valueOf(Integer.parseInt(l.toString()));
return difference;
}
--
Gitblit v1.9.3