From dcd1aab9b5bec2556161c16bd1bc4fe71fef476d Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期一, 08 六月 2026 17:17:47 +0800
Subject: [PATCH] 关于社保补缴的计算,如果社保保险设置有多条数据,根据创建时间来判断,当月即以后得参考标准用对应的配置,并且需要统计当年从1月到现在缴纳的所有社保金额,和最新的社保比列得出的金额进行比较,计算需要补缴的金额,只有社会保险设置新增一条数据的当月会计算,其余月份对应的都是0
---
src/main/java/com/ruoyi/common/utils/OrderUtils.java | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/ruoyi/common/utils/OrderUtils.java b/src/main/java/com/ruoyi/common/utils/OrderUtils.java
index a110ec9..6f47375 100644
--- a/src/main/java/com/ruoyi/common/utils/OrderUtils.java
+++ b/src/main/java/com/ruoyi/common/utils/OrderUtils.java
@@ -61,8 +61,11 @@
* @param <T> 瀹炰綋绫诲瀷
* @return 璁㈠崟缂栧彿
*/
- public static <T> String countTodayByCreateTime(BaseMapper<T> mapper,String preFix,String code) {
- LocalDate today = LocalDate.now();
+ public static <T> String countTodayByCreateTime(BaseMapper<T> mapper,String preFix,String code, LocalDateTime createTime) {
+ if (createTime == null) {
+ createTime = LocalDateTime.now();
+ }
+ LocalDate today = createTime.toLocalDate();
LocalDateTime todayStart = today.atStartOfDay();
LocalDateTime tomorrowStart = today.plusDays(1).atStartOfDay();
String dateStr = today.format(DateTimeFormatter.BASIC_ISO_DATE);
@@ -109,13 +112,17 @@
* @param <T> 瀹炰綋绫绘硾鍨�
* @return 褰撳ぉ璁板綍鏁伴噺
*/
- public static <T> String countAfterServiceTodayByCreateTime(BaseMapper<T> mapper,String preFix) {
+ public static <T> String countAfterServiceTodayByCreateTime(BaseMapper<T> mapper,String preFix, LocalDateTime createTime) {
+ if (createTime == null) {
+ createTime = LocalDateTime.now();
+ }
+ LocalDate localDate = createTime.toLocalDate();
LocalDateTime todayStart = LocalDateTime.of(
- LocalDateTime.now().toLocalDate(),
+ localDate,
LocalTime.MIN
);
LocalDateTime todayEnd = LocalDateTime.of(
- LocalDateTime.now().toLocalDate(),
+ localDate,
LocalTime.MAX
);
@@ -127,6 +134,6 @@
.lt("create_time", endDate);
Long aLong = mapper.selectCount(queryWrapper);
- return preFix + LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE).replaceAll("-", "") + String.format("%03d", (aLong + 1));
+ return preFix + localDate.format(DateTimeFormatter.ISO_LOCAL_DATE).replaceAll("-", "") + String.format("%03d", (aLong + 1));
}
}
--
Gitblit v1.9.3