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
93cce868
Commit
93cce868
authored
Apr 21, 2026
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.7.22-薪资人员导入校验16周岁
parent
46ea3e9e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
6 deletions
+38
-6
TSalaryEmployeeServiceImpl.java
.../yifu/salary/service/impl/TSalaryEmployeeServiceImpl.java
+38
-6
No files found.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryEmployeeServiceImpl.java
View file @
93cce868
...
@@ -1155,14 +1155,17 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -1155,14 +1155,17 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
return
R
.
failed
(
"请登录!"
);
return
R
.
failed
(
"请登录!"
);
}
}
TCheckIdCard
idCardCheck
;
TCheckIdCard
idCardCheck
;
int
nowDay
=
Integer
.
parseInt
(
DateUtil
.
getThisDay
());
for
(
TSalaryEmployee
emp
:
excelVOList
)
{
for
(
TSalaryEmployee
emp
:
excelVOList
)
{
if
(
Common
.
isNotNull
(
emp
.
getEmpIdcard
()))
{
if
(
Common
.
isNotNull
(
emp
.
getEmpIdcard
()))
{
if
(!
isNot16Age
(
emp
.
getEmpIdcard
(),
nowDay
))
{
idCardCheck
=
new
TCheckIdCard
();
idCardCheck
=
new
TCheckIdCard
();
idCardCheck
.
setIdCard
(
emp
.
getEmpIdcard
());
idCardCheck
.
setIdCard
(
emp
.
getEmpIdcard
());
idCardCheck
.
setName
(
emp
.
getEmpName
());
idCardCheck
.
setName
(
emp
.
getEmpName
());
idCardCheck
.
setCreateUser
(
user
.
getId
());
idCardCheck
.
setCreateUser
(
user
.
getId
());
idCardCheck
.
setReason
(
user
.
getNickname
());
idCardCheck
.
setReason
(
user
.
getNickname
());
checkList
.
add
(
idCardCheck
);
checkList
.
add
(
idCardCheck
);
}
idCardList
.
add
(
emp
.
getEmpIdcard
());
idCardList
.
add
(
emp
.
getEmpIdcard
());
}
}
if
(
Common
.
isNotNull
(
emp
.
getEmpPhone
()))
{
if
(
Common
.
isNotNull
(
emp
.
getEmpPhone
()))
{
...
@@ -1391,6 +1394,10 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -1391,6 +1394,10 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
"新增员工,除了支行,其他必填"
));
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
"新增员工,除了支行,其他必填"
));
continue
;
continue
;
}
else
{
}
else
{
if
(
isNot16Age
(
idCard
,
nowDay
))
{
errorMessageList
.
add
(
new
ErrorMessage
((
i
),
"人员未满16周岁,禁用童工"
));
continue
;
}
if
(
excel
.
getTaxMonth
().
length
()
==
6
)
{
if
(
excel
.
getTaxMonth
().
length
()
==
6
)
{
try
{
try
{
Integer
.
parseInt
(
excel
.
getTaxMonth
());
Integer
.
parseInt
(
excel
.
getTaxMonth
());
...
@@ -1489,6 +1496,31 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
...
@@ -1489,6 +1496,31 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
}
}
}
}
// 判断是否未满16周岁(只有一种:身份证格式正确,且+16年大于等于当前日期
// 未满16周岁的,返回true,表示需要返回错误信息
public
static
boolean
isNot16Age
(
String
idCard
,
int
nowDay
)
{
try
{
if
(
Common
.
isNotNull
(
idCard
)
&&
(
idCard
.
length
()
==
15
||
idCard
.
length
()
==
18
))
{
int
birthDay
;
if
(
idCard
.
length
()
==
18
)
{
// 18位身份证:第7-14位是出生年月日 (YYYYMMDD)
birthDay
=
Integer
.
parseInt
(
idCard
.
substring
(
6
,
14
));
}
else
{
// 15位身份证年份需要补全19xx年(15位身份证都是19开头的)
birthDay
=
Integer
.
parseInt
(
"19"
+
idCard
.
substring
(
6
,
12
));
}
birthDay
+=
160000
;
return
birthDay
>=
nowDay
;
}
else
{
// 其他情况不判断16周岁
return
false
;
}
}
catch
(
Exception
e
)
{
// 特殊或错误身份证,不判断16周岁-2026-04-20同倩倩确认
return
false
;
}
}
/**
/**
* 同步ekp薪酬人员信息
* 同步ekp薪酬人员信息
*
*
...
...
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