Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
1f903468
Commit
1f903468
authored
Jan 07, 2026
by
huyuchen
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.7.18' into MVP1.7.18
parents
394cc4cc
a5203e59
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
DateUtil.java
...om/yifu/cloud/plus/v1/yifu/common/core/util/DateUtil.java
+20
-7
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/DateUtil.java
View file @
1f903468
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
util
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
util
;
import
com.alibaba.excel.converters.date.DateDateConverter
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.sms.MonthObject
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.sms.MonthObject
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -1984,6 +1983,20 @@ public class DateUtil {
...
@@ -1984,6 +1983,20 @@ public class DateUtil {
return
false
;
return
false
;
}
}
/**
* @Author fxj
* @Description 判断 日期 date 是否在 registDate 之后,在返回true,否则返回false
* @Date 15:10 2025/12/12
* @Param
* @return
**/
public
static
boolean
isBefore
(
Date
date
,
Date
registDate
)
{
if
(
date
.
getTime
()
<
registDate
.
getTime
())
{
return
true
;
}
return
false
;
}
/**
/**
* 日期月份类型枚举
* 日期月份类型枚举
*/
*/
...
@@ -2014,7 +2027,7 @@ public class DateUtil {
...
@@ -2014,7 +2027,7 @@ public class DateUtil {
}
}
// 获取当前月份的第一天
// 获取当前月份的第一天
Date
currentMonthFirstDay
=
DateUtil
.
setDayByDate
(
new
Date
(
),
1
);
Date
currentMonthFirstDay
=
DateUtil
.
setDayByDate
(
DateUtil
.
formatDateByPatten
(
new
Date
(),
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
),
1
);
// 获取下个月的第一天
// 获取下个月的第一天
Date
nextMonthFirstDay
=
DateUtil
.
addMonthByDate
(
currentMonthFirstDay
,
1
);
Date
nextMonthFirstDay
=
DateUtil
.
addMonthByDate
(
currentMonthFirstDay
,
1
);
...
@@ -2023,11 +2036,11 @@ public class DateUtil {
...
@@ -2023,11 +2036,11 @@ public class DateUtil {
Date
nextNextMonthFirstDay
=
DateUtil
.
addMonthByDate
(
currentMonthFirstDay
,
2
);
Date
nextNextMonthFirstDay
=
DateUtil
.
addMonthByDate
(
currentMonthFirstDay
,
2
);
// 判断目标日期是否早于下个月第一天
// 判断目标日期是否早于下个月第一天
if
(
!
DateUtil
.
isAfter
(
targetDate
,
nextMonthFirstDay
))
{
if
(
DateUtil
.
isBefore
(
targetDate
,
nextMonthFirstDay
))
{
return
MonthType
.
CURRENT_OR_BEFORE
;
return
MonthType
.
CURRENT_OR_BEFORE
;
}
}
// 判断目标日期是否早于下下个月第一天
// 判断目标日期是否早于下下个月第一天
else
if
(
!
DateUtil
.
isAfter
(
targetDate
,
nextNextMonthFirstDay
))
{
else
if
(
DateUtil
.
isBefore
(
targetDate
,
nextNextMonthFirstDay
))
{
return
MonthType
.
NEXT_MONTH
;
return
MonthType
.
NEXT_MONTH
;
}
}
// 其他情况为次次月及之后
// 其他情况为次次月及之后
...
@@ -2037,7 +2050,7 @@ public class DateUtil {
...
@@ -2037,7 +2050,7 @@ public class DateUtil {
}
}
/**
/**
* 判断给定日期是否为当月及之前月份
* 判断给定日期是否为当月及之前月份
比较日期不带时分秒
*
*
* @param targetDate 目标日期
* @param targetDate 目标日期
* @return true: 当月及之前月份, false: 之后月份
* @return true: 当月及之前月份, false: 之后月份
...
@@ -2047,7 +2060,7 @@ public class DateUtil {
...
@@ -2047,7 +2060,7 @@ public class DateUtil {
}
}
/**
/**
* 判断给定日期是否为次月
* 判断给定日期是否为次月
比较日期不带时分秒
*
*
* @param targetDate 目标日期
* @param targetDate 目标日期
* @return true: 次月, false: 其他月份
* @return true: 次月, false: 其他月份
...
@@ -2057,7 +2070,7 @@ public class DateUtil {
...
@@ -2057,7 +2070,7 @@ public class DateUtil {
}
}
/**
/**
* 判断给定日期是否为次次月及之后月份
* 判断给定日期是否为次次月及之后月份
比较日期不带时分秒
*
*
* @param targetDate 目标日期
* @param targetDate 目标日期
* @return true: 次次月及之后月份, false: 之前月份
* @return true: 次次月及之后月份, false: 之前月份
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment