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
fcb78861
Commit
fcb78861
authored
Apr 09, 2026
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
试用期相关优化-fxj
parent
51c6f926
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
26 deletions
+38
-26
TEmployeeContractPreNewServiceImpl.java
...ives/service/impl/TEmployeeContractPreNewServiceImpl.java
+18
-11
EmployeeRegistrationServiceImpl.java
.../v1/csp/service/impl/EmployeeRegistrationServiceImpl.java
+20
-15
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeContractPreNewServiceImpl.java
View file @
fcb78861
...
...
@@ -615,6 +615,12 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
}
}
//同商务合同一直 要 验证时间 截止时间大于等于开始时间、时间交叉
if
(
Common
.
isNotNull
(
preVo
.
getContractStart
())
&&
Common
.
isNotNull
(
preVo
.
getContractEnd
())){
if
(!
preVo
.
getContractEnd
().
after
(
preVo
.
getContractStart
())){
return
"合同截止日期需大于合同开始日期"
;
}
}
if
(
CommonConstants
.
FIVE_STRING
.
equals
(
preVo
.
getContractType
())){
//处理实习协议
preVo
.
setInternshipPeriodStart
(
DateUtil
.
addDayByDate
(
contract
.
getContractEnd
(),
1
));
...
...
@@ -633,12 +639,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
}
}
//同商务合同一直 要 验证时间 截止时间大于等于开始时间、时间交叉
if
(
Common
.
isNotNull
(
preVo
.
getContractStart
())
&&
Common
.
isNotNull
(
preVo
.
getContractEnd
())){
if
(!
preVo
.
getContractEnd
().
after
(
preVo
.
getContractStart
())){
return
"合同截止日期需大于合同开始日期"
;
}
}
if
(
CommonConstants
.
TWENTY_STRING
.
equals
(
preVo
.
getContractType
())){
//处理务派遣合同: 先看上一份合同是否为劳务协议,如果是取值上一份合同的劳务协议结束日期
Date
initDate
=
contract
.
getContractEnd
();
...
...
@@ -660,23 +661,29 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
preVo
.
setDispatchPeriodStart
(
DateUtil
.
addDayByDate
(
initDate
,
1
));
List
<
String
>
errorMessages
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
preVo
.
getDispatchPeriodYear
())
&&
Common
.
isNotNull
(
preVo
.
getDispatchPeriodMonth
())){
if
(
Common
.
isNotNull
(
preVo
.
getContractDurationYear
())
&&
Common
.
isNotNull
(
preVo
.
getContractDurationMonth
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
preVo
.
getSignType
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
preVo
.
getContractTerm
())){
//校验劳务派遣的派遣年限必须为两年
final
int
REQUIRED_SERVICE_YEARS
=
2
;
int
year
=
0
;
try
{
year
=
Integer
.
parseInt
(
Common
.
isEmpty
(
preVo
.
get
DispatchPeriodYear
())
?
"0"
:
preVo
.
getDispatchPeriod
Year
().
trim
());
year
=
Integer
.
parseInt
(
Common
.
isEmpty
(
preVo
.
get
ContractDurationYear
())
?
"0"
:
preVo
.
getContractDuration
Year
().
trim
());
}
catch
(
NumberFormatException
e
)
{
return
"
劳务派遣的派遣
年限格式不正确"
;
return
"
合同
年限格式不正确"
;
}
String
dispatchMonth
=
preVo
.
get
DispatchPeriod
Month
();
String
dispatchMonth
=
preVo
.
get
ContractDuration
Month
();
if
(
"12"
.
equals
(
dispatchMonth
))
{
year
=
year
+
1
;
}
if
(
year
<
REQUIRED_SERVICE_YEARS
)
{
return
"劳务派遣合同的合同年限不能小于 2 年,请检查"
;
//电子签 且 是劳务派遣合同 且 签订期限为固定期限的 合同年前置的合同不能小于 2 年,请检查";
return
"合同的合同年限不能小于 2 年,请检查"
;
}
}
if
(
Common
.
isNotNull
(
preVo
.
getDispatchPeriodMonth
())
&&
Common
.
isNotNull
(
preVo
.
getDispatchPeriodYear
()))
{
vo
=
new
TEmployeeContractDateVo
();
vo
.
setMonthAfter
(
Integer
.
parseInt
(
Common
.
isEmpty
(
preVo
.
getDispatchPeriodMonth
())
?
"0"
:
preVo
.
getDispatchPeriodMonth
()));
vo
.
setYearAfter
(
Integer
.
parseInt
(
Common
.
isEmpty
(
preVo
.
getDispatchPeriodYear
())
?
"0"
:
preVo
.
getDispatchPeriodYear
()));
...
...
yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/impl/EmployeeRegistrationServiceImpl.java
View file @
fcb78861
...
...
@@ -1151,35 +1151,46 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
employeeContractPreVo
.
setContractDurationMonth
(
CommonConstants
.
ZERO_STRING
);
}
}
// 校验合同有效期:合同截止日期不得早于合同开始日期
if
(
Common
.
isNotNull
(
employeeContractPreVo
.
getContractStart
())
&&
Common
.
isNotNull
(
employeeContractPreVo
.
getContractEnd
()))
{
if
(!
employeeContractPreVo
.
getContractEnd
().
after
(
employeeContractPreVo
.
getContractStart
()))
{
return
"合同截止日期需大于合同开始日期"
;
}
}
//劳务派遣合同相关校验
List
<
String
>
allErrorMessages
=
new
ArrayList
<>();
if
(
CommonConstants
.
TWENTY_STRING
.
equals
(
employeeContractPreVo
.
getContractType
())
||
"劳务派遣合同"
.
equals
(
employeeContractPreVo
.
getContractType
()))
{
if
(
Common
.
isNotNull
(
employeeContractPreVo
.
getDispatchPeriodYear
())
&&
Common
.
isNotNull
(
employeeContractPreVo
.
getDispatchPeriodMonth
()))
{
if
(
Common
.
isNotNull
(
employeeContractPreVo
.
getContractDurationYear
())
&&
Common
.
isNotNull
(
employeeContractPreVo
.
getContractDurationMonth
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
employeeContractPreVo
.
getSignType
())
&&
CommonConstants
.
ONE_STRING
.
equals
(
employeeContractPreVo
.
getContractTerm
()))
{
// 校验劳务派遣的派遣年限必须为两年
final
int
REQUIRED_SERVICE_YEARS
=
2
;
int
dispatchYears
=
0
;
try
{
dispatchYears
=
Integer
.
parseInt
(
employeeContractPreVo
.
get
DispatchPeriod
Year
().
trim
());
dispatchYears
=
Integer
.
parseInt
(
employeeContractPreVo
.
get
ContractDuration
Year
().
trim
());
}
catch
(
NumberFormatException
e
)
{
return
"
劳务派遣的派遣
年限格式不正确"
;
return
"
合同
年限格式不正确"
;
}
// 将派遣月份转换为年的小数部分(例如:6 个月=0.5 年)
int
dispatchMonths
=
0
;
try
{
dispatchMonths
=
Integer
.
parseInt
(
employeeContractPreVo
.
get
DispatchPeriod
Month
().
trim
());
dispatchMonths
=
Integer
.
parseInt
(
employeeContractPreVo
.
get
ContractDuration
Month
().
trim
());
}
catch
(
NumberFormatException
e
)
{
return
"
劳务派遣的派遣
月份格式不正确"
;
return
"
合同
月份格式不正确"
;
}
// 计算总派遣年限(年 + 月/12)
double
totalDispatchYears
=
dispatchYears
+
(
dispatchMonths
/
12.0
);
if
(
totalDispatchYears
<
REQUIRED_SERVICE_YEARS
)
{
return
"劳务派遣合同的合同年限不能小于 2 年,请检查"
;
////电子签 且 是劳务派遣合同 且 签订期限为固定期限的 合同年前置的合同不能小于 2 年,请检查";
return
"合同的合同年限不能小于 2 年,请检查"
;
}
}
if
(
Common
.
isNotNull
(
employeeContractPreVo
.
getDispatchPeriodStart
())
...
...
@@ -1210,7 +1221,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
// 检查必要字段是否为空 关键字段不为空才校验
if
(!
Common
.
isEmpty
(
employeeContractPreVo
.
getContractTerm
())
&&
!
Common
.
isEmpty
(
employeeContractPreVo
.
getTryPeriodNum
()))
{
&&
!
Common
.
isEmpty
(
employeeContractPreVo
.
getTryPeriodNum
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
employeeContractPreVo
.
getTryPeriodType
()))
{
// 安全解析试用期月数
int
tryPeriodMonths
=
0
;
try
{
...
...
@@ -1285,14 +1297,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
allErrorMessages
.
add
(
"合同的年限同派遣的期限不一致"
);
}
}
// 校验合同有效期:合同截止日期不得早于合同开始日期
if
(
Common
.
isNotNull
(
employeeContractPreVo
.
getContractStart
())
&&
Common
.
isNotNull
(
employeeContractPreVo
.
getContractEnd
()))
{
if
(!
employeeContractPreVo
.
getContractEnd
().
after
(
employeeContractPreVo
.
getContractStart
()))
{
return
"合同截止日期需大于合同开始日期"
;
}
}
// 如果有错误信息,根据具体错误项动态生成提示
if
(!
allErrorMessages
.
isEmpty
())
{
// 筛选出需要组合提示的错误项
...
...
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