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
fb3da26e
Commit
fb3da26e
authored
Dec 19, 2025
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
社保公积金自动化定时任务+社保公积金起缴日期+户截止日配置-fxj
parent
06030182
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
123 additions
and
22 deletions
+123
-22
DateUtil.java
...om/yifu/cloud/plus/v1/yifu/common/core/util/DateUtil.java
+97
-0
EmployeeRegistrationServiceImpl.java
.../v1/csp/service/impl/EmployeeRegistrationServiceImpl.java
+9
-6
TDispatchInfoPreServiceImpl.java
...yifu/social/service/impl/TDispatchInfoPreServiceImpl.java
+6
-6
THouseHoldLimitServiceImpl.java
.../yifu/social/service/impl/THouseHoldLimitServiceImpl.java
+10
-9
THouseHoldLimitMapper.xml
...l-biz/src/main/resources/mapper/THouseHoldLimitMapper.xml
+1
-1
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/DateUtil.java
View file @
fb3da26e
...
...
@@ -1983,4 +1983,101 @@ public class DateUtil {
}
return
false
;
}
/**
* 日期月份类型枚举
*/
public
enum
MonthType
{
/**
* 当月及之前月份
*/
CURRENT_OR_BEFORE
,
/**
* 次月
*/
NEXT_MONTH
,
/**
* 次次月及之后月份
*/
NEXT_NEXT_MONTH_OR_AFTER
}
/**
* 判断给定日期相对于当前日期的月份类型
*
* @param targetDate 目标日期
* @return 月份类型枚举值
*/
public
static
MonthType
checkMonthType
(
Date
targetDate
)
{
if
(
targetDate
==
null
)
{
throw
new
IllegalArgumentException
(
"目标日期不能为空"
);
}
// 获取当前月份的第一天
Date
currentMonthFirstDay
=
DateUtil
.
setDayByDate
(
new
Date
(),
1
);
// 获取下个月的第一天
Date
nextMonthFirstDay
=
DateUtil
.
addMonthByDate
(
currentMonthFirstDay
,
1
);
// 获取下下个月的第一天
Date
nextNextMonthFirstDay
=
DateUtil
.
addMonthByDate
(
currentMonthFirstDay
,
2
);
// 判断目标日期是否早于下个月第一天
if
(!
DateUtil
.
isAfter
(
targetDate
,
nextMonthFirstDay
))
{
return
MonthType
.
CURRENT_OR_BEFORE
;
}
// 判断目标日期是否早于下下个月第一天
else
if
(!
DateUtil
.
isAfter
(
targetDate
,
nextNextMonthFirstDay
))
{
return
MonthType
.
NEXT_MONTH
;
}
// 其他情况为次次月及之后
else
{
return
MonthType
.
NEXT_NEXT_MONTH_OR_AFTER
;
}
}
/**
* 判断给定日期是否为当月及之前月份
*
* @param targetDate 目标日期
* @return true: 当月及之前月份, false: 之后月份
*/
public
static
boolean
isCurrentOrBeforeMonth
(
Date
targetDate
)
{
return
checkMonthType
(
targetDate
)
==
MonthType
.
CURRENT_OR_BEFORE
;
}
/**
* 判断给定日期是否为次月
*
* @param targetDate 目标日期
* @return true: 次月, false: 其他月份
*/
public
static
boolean
isNextMonth
(
Date
targetDate
)
{
return
checkMonthType
(
targetDate
)
==
MonthType
.
NEXT_MONTH
;
}
/**
* 判断给定日期是否为次次月及之后月份
*
* @param targetDate 目标日期
* @return true: 次次月及之后月份, false: 之前月份
*/
public
static
boolean
isNextNextMonthOrAfter
(
Date
targetDate
)
{
return
checkMonthType
(
targetDate
)
==
MonthType
.
NEXT_NEXT_MONTH_OR_AFTER
;
}
/**
* @Author fxj
* @Description 日期格式化后返回
* @Date 17:47 2025/12/19
* @Param
* @return
**/
public
static
Date
formatDateByPatten
(
Date
date
,
String
patten
)
{
if
(
Common
.
isEmpty
(
patten
))
{
patten
=
DATETIME_YYYYMM
;
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
patten
);
return
stringToDate
(
sdf
.
format
(
date
));
}
}
yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/impl/EmployeeRegistrationServiceImpl.java
View file @
fb3da26e
...
...
@@ -825,6 +825,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
else
{
innerVo
=
resultR
.
getData
();
}
if
(
null
==
innerVo
){
throw
new
RuntimeException
(
"请及时配置户("
+
houseName
+
")截止日配置信息"
);
}
boolean
canBeHandle
=
innerVo
.
getCanBeHandle
();
LocalTime
currentTime
=
LocalTime
.
now
();
LocalTime
thresholdTime
=
LocalTime
.
of
(
15
,
20
);
...
...
@@ -835,11 +838,11 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
String
confirmTimeFormat
=
" 09:00"
;
//获取次月1号日期
Date
nextMonthFirstDay
=
DateUtil
.
addMonthByDate
(
DateUtil
.
getDateByDayNum
(
0
),
1
);
Date
nextMonthFirstDay
=
DateUtil
.
addMonthByDate
(
DateUtil
.
formatDateByPatten
(
new
Date
(),
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
),
1
);
nextMonthFirstDay
=
DateUtil
.
setDayByDate
(
nextMonthFirstDay
,
1
);
//获取起缴月份1号
Date
startDateFirstDay
=
DateUtil
.
addDayByDate
(
startDate
,
0
);
Date
startDateFirstDay
=
DateUtil
.
addDayByDate
(
DateUtil
.
formatDateByPatten
(
startDate
,
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
)
,
0
);
startDateFirstDay
=
DateUtil
.
setDayByDate
(
startDateFirstDay
,
1
);
//获取起缴月-1日期
...
...
@@ -848,7 +851,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
//获取次日
Date
tomorrow
=
DateUtil
.
getDateByDayNum
(
1
);
//1.起缴月份为当月及之前的月份
if
(
!
DateUtil
.
isAfter
(
startDate
,
DateUtil
.
getDateByDayNum
(
0
)
)){
if
(
DateUtil
.
isCurrentOrBeforeMonth
(
startDate
)){
if
(
canBeHandle
){
//发起时间不看工作日
if
(
isBeforeThreshold
)
{
...
...
@@ -871,10 +874,10 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
}
//2.起缴月份为次月
else
if
(
preVo2
.
getSocialStartDate
().
getTime
()
==
DateUtil
.
addMonthByDate
(
DateUtil
.
getDateByDayNum
(
0
),
1
).
getTime
(
)){
else
if
(
DateUtil
.
isNextMonth
(
startDate
)){
//当月办次月生效
if
(
CommonConstants
.
ONE_STRING
.
equals
(
innerVo
.
getAddHandleRule
())){
if
(
canBeHandle
&&
isBeforeThreshold
){
if
(
canBeHandle
){
Date
today
=
new
Date
();
preVo2
.
setExpectedCollectionTime
(
DateUtil
.
parseDate
(
DateUtil
.
dateToString
(
today
,
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
)
+
collectionTimeFormat
,
DateUtil
.
DATETIME_PATTERN_MINUTE
));
...
...
@@ -895,7 +898,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
}
//3.起缴月份为次月之后的月份
else
if
(
preVo2
.
getSocialStartDate
().
getTime
()
>
DateUtil
.
addMonthByDate
(
DateUtil
.
getDateByDayNum
(
0
),
1
).
getTime
(
)){
else
if
(
DateUtil
.
isNextNextMonthOrAfter
(
startDate
)){
//当月办次月生效
if
(
CommonConstants
.
ONE_STRING
.
equals
(
innerVo
.
getAddHandleRule
())){
preVo2
.
setExpectedCollectionTime
(
DateUtil
.
parseDate
(
DateUtil
.
dateToString
(
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TDispatchInfoPreServiceImpl.java
View file @
fb3da26e
...
...
@@ -1023,11 +1023,11 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
String
confirmTimeFormat
=
" 09:00"
;
//获取次月1号日期
Date
nextMonthFirstDay
=
DateUtil
.
addMonthByDate
(
DateUtil
.
getDateByDayNum
(
0
),
1
);
Date
nextMonthFirstDay
=
DateUtil
.
addMonthByDate
(
DateUtil
.
formatDateByPatten
(
new
Date
(),
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
),
1
);
nextMonthFirstDay
=
DateUtil
.
setDayByDate
(
nextMonthFirstDay
,
1
);
//获取起缴月份1号
Date
startDateFirstDay
=
DateUtil
.
addDayByDate
(
startDate
,
0
);
Date
startDateFirstDay
=
DateUtil
.
addDayByDate
(
DateUtil
.
formatDateByPatten
(
startDate
,
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
)
,
0
);
startDateFirstDay
=
DateUtil
.
setDayByDate
(
startDateFirstDay
,
1
);
//获取起缴月-1日期
...
...
@@ -1036,7 +1036,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
//获取次日
Date
tomorrow
=
DateUtil
.
getDateByDayNum
(
1
);
//1.起缴月份为当月及之前的月份
if
(
!
DateUtil
.
isAfter
(
startDate
,
DateUtil
.
getDateByDayNum
(
0
)
)){
if
(
DateUtil
.
isCurrentOrBeforeMonth
(
startDate
)){
if
(
canBeHandle
){
//发起时间不看工作日
if
(
isBeforeThreshold
)
{
...
...
@@ -1059,10 +1059,10 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
}
}
//2.起缴月份为次月
else
if
(
preVo2
.
getSocialStartDate
().
getTime
()
==
DateUtil
.
addMonthByDate
(
DateUtil
.
getDateByDayNum
(
0
),
1
).
getTime
(
)){
else
if
(
DateUtil
.
isNextMonth
(
startDate
)){
//当月办次月生效
if
(
CommonConstants
.
ONE_STRING
.
equals
(
innerVo
.
getAddHandleRule
())){
if
(
canBeHandle
&&
isBeforeThreshold
){
if
(
canBeHandle
){
Date
today
=
new
Date
();
preVo2
.
setExpectedCollectionTime
(
DateUtil
.
parseDate
(
DateUtil
.
dateToString
(
today
,
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
)
+
collectionTimeFormat
,
DateUtil
.
DATETIME_PATTERN_MINUTE
));
...
...
@@ -1083,7 +1083,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
}
}
//3.起缴月份为次月之后的月份
else
if
(
preVo2
.
getSocialStartDate
().
getTime
()
>
DateUtil
.
addMonthByDate
(
DateUtil
.
getDateByDayNum
(
0
),
1
).
getTime
(
)){
else
if
(
DateUtil
.
isNextNextMonthOrAfter
(
startDate
)){
//当月办次月生效
if
(
CommonConstants
.
ONE_STRING
.
equals
(
innerVo
.
getAddHandleRule
())){
preVo2
.
setExpectedCollectionTime
(
DateUtil
.
parseDate
(
DateUtil
.
dateToString
(
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/THouseHoldLimitServiceImpl.java
View file @
fb3da26e
...
...
@@ -214,6 +214,7 @@ public class THouseHoldLimitServiceImpl extends ServiceImpl<THouseHoldLimitMappe
data
.
setRowIndex
(
rowIndex
+
1
);
ErrorMessage
errorMessage
=
util1
.
checkEntity
(
data
,
data
.
getRowIndex
());
if
(
Common
.
isNotNull
(
errorMessage
))
{
errorMessage
.
setData
(
data
);
errorMessageList
.
add
(
errorMessage
);
}
else
{
cachedDataList
.
add
(
data
);
...
...
@@ -319,8 +320,8 @@ public class THouseHoldLimitServiceImpl extends ServiceImpl<THouseHoldLimitMappe
errorMessageList
.
add
(
errorMsg
);
continue
;
}
if
(
Integer
.
parseInt
(
excel
.
getDeadLineDay
())
>
31
||
Integer
.
parseInt
(
excel
.
getDeadLineDay
())
<
1
){
errorMsg
=
new
ErrorMessage
(
excel
.
getRowIndex
(),
"派增截止(日)只能是1-31的数字"
,
excel
);
if
(
Integer
.
parseInt
(
excel
.
getDeadLineDay
())
>
31
||
Integer
.
parseInt
(
excel
.
getDeadLineDay
())
<
1
0
){
errorMsg
=
new
ErrorMessage
(
excel
.
getRowIndex
(),
"派增截止(日)只能是1
0
-31的数字"
,
excel
);
errorMessageList
.
add
(
errorMsg
);
continue
;
}
...
...
@@ -439,7 +440,7 @@ public class THouseHoldLimitServiceImpl extends ServiceImpl<THouseHoldLimitMappe
try
{
TEmployeeInsuranceWorkDayVo
vo
=
new
TEmployeeInsuranceWorkDayVo
();
// 设置RegistDate为当前月份对应的截止日期deadLineDay
Date
registDate
=
DateUtil
.
setDayByDate
(
new
Date
(
),
Integer
.
parseInt
(
deadLineDay
));
Date
registDate
=
DateUtil
.
setDayByDate
(
DateUtil
.
getDateByDayNum
(
0
),
Integer
.
parseInt
(
deadLineDay
));
if
(
null
==
registDate
)
{
return
R
.
failed
(
"未找到截止日期对应的可用工作日"
);
}
...
...
@@ -476,11 +477,11 @@ public class THouseHoldLimitServiceImpl extends ServiceImpl<THouseHoldLimitMappe
boolean
isBeforeThreshold
=
currentTime
.
isBefore
(
thresholdTime
)
||
currentTime
.
equals
(
thresholdTime
);
//获取次月1号日期
Date
nextMonthFirstDay
=
DateUtil
.
addMonthByDate
(
DateUtil
.
getDateByDayNum
(
0
),
1
);
Date
nextMonthFirstDay
=
DateUtil
.
addMonthByDate
(
DateUtil
.
formatDateByPatten
(
new
Date
(),
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
),
1
);
nextMonthFirstDay
=
DateUtil
.
setDayByDate
(
nextMonthFirstDay
,
1
);
//获取起缴月份1号
Date
startDateFirstDay
=
DateUtil
.
addDayByDate
(
startDate
,
0
);
Date
startDateFirstDay
=
DateUtil
.
addDayByDate
(
DateUtil
.
formatDateByPatten
(
startDate
,
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
)
,
0
);
startDateFirstDay
=
DateUtil
.
setDayByDate
(
startDateFirstDay
,
1
);
//获取起缴月-1日期
...
...
@@ -489,7 +490,7 @@ public class THouseHoldLimitServiceImpl extends ServiceImpl<THouseHoldLimitMappe
//获取次日
Date
tomorrow
=
DateUtil
.
getDateByDayNum
(
1
);
//1.起缴月份为当月及之前的月份
if
(
!
DateUtil
.
isAfter
(
startDate
,
DateUtil
.
getDateByDayNum
(
0
)
)){
if
(
DateUtil
.
isCurrentOrBeforeMonth
(
startDate
)){
if
(
canBeHandle
){
//发起时间不看工作日
if
(
isBeforeThreshold
)
{
...
...
@@ -503,10 +504,10 @@ public class THouseHoldLimitServiceImpl extends ServiceImpl<THouseHoldLimitMappe
}
}
//2.起缴月份为次月
else
if
(
startDate
.
getTime
()
==
DateUtil
.
addMonthByDate
(
DateUtil
.
getDateByDayNum
(
0
),
1
).
getTime
(
)){
else
if
(
DateUtil
.
isNextMonth
(
startDate
)){
//当月办次月生效
if
(
CommonConstants
.
ONE_STRING
.
equals
(
addHandleRule
)){
if
(
canBeHandle
&&
isBeforeThreshold
){
if
(
canBeHandle
){
Date
today
=
new
Date
();
return
DateUtil
.
dateToString
(
today
,
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
);
}
else
{
...
...
@@ -518,7 +519,7 @@ public class THouseHoldLimitServiceImpl extends ServiceImpl<THouseHoldLimitMappe
}
}
//3.起缴月份为次月之后的月份
else
if
(
startDate
.
getTime
()
>
DateUtil
.
addMonthByDate
(
DateUtil
.
getDateByDayNum
(
0
),
1
).
getTime
(
)){
else
if
(
DateUtil
.
isNextNextMonthOrAfter
(
startDate
)){
//当月办次月生效
if
(
CommonConstants
.
ONE_STRING
.
equals
(
addHandleRule
)){
return
DateUtil
.
dateToString
(
startDatePrevMonth
,
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
);
...
...
yifu-social/yifu-social-biz/src/main/resources/mapper/THouseHoldLimitMapper.xml
View file @
fb3da26e
...
...
@@ -70,7 +70,7 @@
AND a.ID = #{tHouseHoldLimit.id}
</if>
<if
test=
"tHouseHoldLimit.name != null and tHouseHoldLimit.name.trim() != ''"
>
AND a.NAME
= #{tHouseHoldLimit.name}
AND a.NAME
like concat('%', #{tHouseHoldLimit.name}, '%')
</if>
<if
test=
"tHouseHoldLimit.type != null and tHouseHoldLimit.type.trim() != ''"
>
AND a.TYPE = #{tHouseHoldLimit.type}
...
...
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