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
4ced80a2
Commit
4ced80a2
authored
Mar 19, 2026
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
社保公积金期缴日期计算如果是1号不再减1天-fxj
parent
31454e80
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
8 deletions
+106
-8
TEmployeePreLogServiceImpl.java
...ifu/archives/service/impl/TEmployeePreLogServiceImpl.java
+43
-5
EmployeeRegistrationController.java
...lus/v1/csp/controller/EmployeeRegistrationController.java
+13
-0
EmployeeRegistrationService.java
...loud/plus/v1/csp/service/EmployeeRegistrationService.java
+9
-0
EmployeeRegistrationServiceImpl.java
.../v1/csp/service/impl/EmployeeRegistrationServiceImpl.java
+41
-3
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeePreLogServiceImpl.java
View file @
4ced80a2
...
@@ -758,14 +758,14 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
...
@@ -758,14 +758,14 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
}
}
public
Date
addYearsMonths
(
TEmployeeContractDateVo
vo
)
{
public
Date
addYearsMonths
(
TEmployeeContractDateVo
vo
)
{
if
(
vo
==
null
||
vo
.
getRegistDate
()
==
null
)
return
null
;
if
(
vo
==
null
||
vo
.
getRegistDate
()
==
null
)
return
null
;
// 转换为LocalDate(自动处理时区)
// 转换为
LocalDate(自动处理时区)
LocalDate
localDate
=
vo
.
getRegistDate
().
toInstant
()
LocalDate
localDate
=
vo
.
getRegistDate
().
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
())
.
atZone
(
ZoneId
.
systemDefault
())
.
toLocalDate
();
.
toLocalDate
();
// 添加年数和月数
// 添加年数和月数
if
(
vo
.
getMonthAfter
()
==
0
&&
vo
.
getYearAfter
()
==
0
)
{
if
(
vo
.
getMonthAfter
()
==
0
&&
vo
.
getYearAfter
()
==
0
)
{
// 转回
Date
类型
// 转回
Date
类型
return
Date
.
from
(
localDate
.
atStartOfDay
()
return
Date
.
from
(
localDate
.
atStartOfDay
()
.
atZone
(
ZoneId
.
systemDefault
())
.
atZone
(
ZoneId
.
systemDefault
())
.
toInstant
());
.
toInstant
());
...
@@ -774,7 +774,45 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
...
@@ -774,7 +774,45 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
.
plusYears
(
vo
.
getYearAfter
())
.
plusYears
(
vo
.
getYearAfter
())
.
plusMonths
(
vo
.
getMonthAfter
())
.
plusMonths
(
vo
.
getMonthAfter
())
.
minusDays
(
1
);
.
minusDays
(
1
);
// 转回Date类型
// 转回 Date 类型
return
Date
.
from
(
localDate
.
atStartOfDay
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toInstant
());
}
}
/**
* @Description: 添加年数和月数,如果结果为月份 1 号则不减 1 天
* @Author: system
* @Date: 2026/03/19
* @param: vo - 包含注册日期、年数、月数的对象
* @return: java.util.Date
**/
public
Date
addYearsMonthsKeepFirstDay
(
TEmployeeContractDateVo
vo
)
{
if
(
vo
==
null
||
vo
.
getRegistDate
()
==
null
)
return
null
;
// 转换为 LocalDate(自动处理时区)
LocalDate
localDate
=
vo
.
getRegistDate
().
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toLocalDate
();
// 添加年数和月数
if
(
vo
.
getMonthAfter
()
==
0
&&
vo
.
getYearAfter
()
==
0
)
{
// 转回 Date 类型
return
Date
.
from
(
localDate
.
atStartOfDay
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toInstant
());
}
else
{
// 先计算加年加月后的日期
localDate
=
localDate
.
plusYears
(
vo
.
getYearAfter
())
.
plusMonths
(
vo
.
getMonthAfter
());
// 如果计算后的日期不是月份 1 号,则减 1 天;如果是 1 号则保持不变
if
(
localDate
.
getDayOfMonth
()
!=
1
)
{
localDate
=
localDate
.
minusDays
(
1
);
}
// 转回 Date 类型
return
Date
.
from
(
localDate
.
atStartOfDay
()
return
Date
.
from
(
localDate
.
atStartOfDay
()
.
atZone
(
ZoneId
.
systemDefault
())
.
atZone
(
ZoneId
.
systemDefault
())
.
toInstant
());
.
toInstant
());
...
@@ -1139,7 +1177,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
...
@@ -1139,7 +1177,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
vo
.
setMonthAfter
(
Integer
.
parseInt
(
preVo
.
getSocialDateType
()));
vo
.
setMonthAfter
(
Integer
.
parseInt
(
preVo
.
getSocialDateType
()));
vo
.
setYearAfter
(
0
);
vo
.
setYearAfter
(
0
);
vo
.
setRegistDate
(
pre
.
getJoinLeaveDate
());
vo
.
setRegistDate
(
pre
.
getJoinLeaveDate
());
Date
date
=
this
.
addYearsMonths
(
vo
);
Date
date
=
this
.
addYearsMonths
KeepFirstDay
(
vo
);
preVo
.
setSocialStartDate
(
date
);
preVo
.
setSocialStartDate
(
date
);
}
else
{
}
else
{
preVo
.
setSocialStartDate
(
pre
.
getJoinLeaveDate
());
preVo
.
setSocialStartDate
(
pre
.
getJoinLeaveDate
());
...
...
yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/controller/EmployeeRegistrationController.java
View file @
4ced80a2
...
@@ -395,6 +395,19 @@ public class EmployeeRegistrationController {
...
@@ -395,6 +395,19 @@ public class EmployeeRegistrationController {
return
R
.
ok
(
employeeRegistrationService
.
addYearsMonths
(
vo
));
return
R
.
ok
(
employeeRegistrationService
.
addYearsMonths
(
vo
));
}
}
/**
* 查询多少年多少月后对应的日期(如果日期为 1 号不做减 1 天操作)
*
* @author system
* @date 2026-03-19
**/
@Operation
(
summary
=
"查询多少年多少月后对应的日期(1 号不减 1 天)"
)
@SysLog
(
"查询多少年多少月后对应的日期(1 号不减 1 天)"
)
@PostMapping
(
"/addYearsMonthsKeepFirstDay"
)
public
R
addYearsMonthsKeepFirstDay
(
@RequestBody
TEmployeeContractDateVo
vo
)
{
return
R
.
ok
(
employeeRegistrationService
.
addYearsMonthsKeepFirstDay
(
vo
));
}
/**
/**
* @param vo
* @param vo
* @Description: 根据项目编码查询项目信息
* @Description: 根据项目编码查询项目信息
...
...
yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/EmployeeRegistrationService.java
View file @
4ced80a2
...
@@ -186,6 +186,15 @@ public interface EmployeeRegistrationService extends IService<EmployeeRegistrati
...
@@ -186,6 +186,15 @@ public interface EmployeeRegistrationService extends IService<EmployeeRegistrati
Date
addYearsMonths
(
TEmployeeContractDateVo
vo
);
Date
addYearsMonths
(
TEmployeeContractDateVo
vo
);
/**
* @Description: 添加年数和月数,如果结果为月份 1 号则不减 1 天
* @Author: system
* @Date: 2026/03/19
* @param: vo - 包含注册日期、年数、月数的对象
* @return: java.util.Date
**/
Date
addYearsMonthsKeepFirstDay
(
TEmployeeContractDateVo
vo
);
EkpDeptContractInfoVo
selectContractInfoByDetptNo
(
EkpDeptContractInfoVo
vo
);
EkpDeptContractInfoVo
selectContractInfoByDetptNo
(
EkpDeptContractInfoVo
vo
);
R
refuseOffer
(
EmployeeRegistration
employeeRegistration
);
R
refuseOffer
(
EmployeeRegistration
employeeRegistration
);
...
...
yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/impl/EmployeeRegistrationServiceImpl.java
View file @
4ced80a2
...
@@ -958,7 +958,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
...
@@ -958,7 +958,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
initDate
.
setMonthAfter
(
Integer
.
parseInt
(
preVo
.
getFundDateType
()));
initDate
.
setMonthAfter
(
Integer
.
parseInt
(
preVo
.
getFundDateType
()));
initDate
.
setYearAfter
(
0
);
initDate
.
setYearAfter
(
0
);
initDate
.
setRegistDate
(
preVo
.
getJoinLeaveDate
());
initDate
.
setRegistDate
(
preVo
.
getJoinLeaveDate
());
Date
date
=
this
.
addYearsMonths
(
initDate
);
Date
date
=
this
.
addYearsMonths
KeepFirstDay
(
initDate
);
preVo
.
setFundStartDate
(
date
);
preVo
.
setFundStartDate
(
date
);
}
}
}
}
...
@@ -1983,7 +1983,45 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
...
@@ -1983,7 +1983,45 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
.
plusYears
(
vo
.
getYearAfter
())
.
plusYears
(
vo
.
getYearAfter
())
.
plusMonths
(
vo
.
getMonthAfter
())
.
plusMonths
(
vo
.
getMonthAfter
())
.
minusDays
(
1
);
.
minusDays
(
1
);
// 转回Date类型
// 转回 Date 类型
return
Date
.
from
(
localDate
.
atStartOfDay
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toInstant
());
}
}
/**
* @Description: 添加年数和月数,如果结果为月份 1 号则不减 1 天
* @Author: system
* @Date: 2026/03/19
* @param: vo - 包含注册日期、年数、月数的对象
* @return: java.util.Date
**/
public
Date
addYearsMonthsKeepFirstDay
(
TEmployeeContractDateVo
vo
)
{
if
(
vo
==
null
||
vo
.
getRegistDate
()
==
null
)
return
null
;
// 转换为 LocalDate(自动处理时区)
LocalDate
localDate
=
vo
.
getRegistDate
().
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toLocalDate
();
// 添加年数和月数
if
(
vo
.
getMonthAfter
()
==
0
&&
vo
.
getYearAfter
()
==
0
)
{
// 转回 Date 类型
return
Date
.
from
(
localDate
.
atStartOfDay
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toInstant
());
}
else
{
// 先计算加年加月后的日期
localDate
=
localDate
.
plusYears
(
vo
.
getYearAfter
())
.
plusMonths
(
vo
.
getMonthAfter
());
// 如果计算后的日期不是月份 1 号,则减 1 天;如果是 1 号则保持不变
if
(
localDate
.
getDayOfMonth
()
!=
1
)
{
localDate
=
localDate
.
minusDays
(
1
);
}
// 转回 Date 类型
return
Date
.
from
(
localDate
.
atStartOfDay
()
return
Date
.
from
(
localDate
.
atStartOfDay
()
.
atZone
(
ZoneId
.
systemDefault
())
.
atZone
(
ZoneId
.
systemDefault
())
.
toInstant
());
.
toInstant
());
...
@@ -2249,7 +2287,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
...
@@ -2249,7 +2287,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
vo
.
setMonthAfter
(
Integer
.
parseInt
(
preVo
.
getSocialDateType
()));
vo
.
setMonthAfter
(
Integer
.
parseInt
(
preVo
.
getSocialDateType
()));
vo
.
setYearAfter
(
0
);
vo
.
setYearAfter
(
0
);
vo
.
setRegistDate
(
registration
.
getJoinLeaveDate
());
vo
.
setRegistDate
(
registration
.
getJoinLeaveDate
());
Date
date
=
this
.
addYearsMonths
(
vo
);
Date
date
=
this
.
addYearsMonths
KeepFirstDay
(
vo
);
preVo
.
setSocialStartDate
(
date
);
preVo
.
setSocialStartDate
(
date
);
}
else
{
}
else
{
preVo
.
setSocialStartDate
(
registration
.
getJoinLeaveDate
());
preVo
.
setSocialStartDate
(
registration
.
getJoinLeaveDate
());
...
...
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