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
b5066073
Commit
b5066073
authored
Jul 11, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化人员档案
parent
1bdf468e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
25 deletions
+26
-25
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+26
-25
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
b5066073
...
...
@@ -1466,9 +1466,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
// 通用校验获取失败的数据
Map
<
Long
,
ErrorMessage
>
errorMsgMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
errorMessageList
))
{
errorMessageList
.
stream
().
forEach
(
errorMessage
->
errorMsgMap
.
put
(
errorMessage
.
getLineNum
(),
errorMessage
));
}
// 获取身份证、手机号列表,批量查询档案
List
<
String
>
idCardList
=
new
ArrayList
<>();
...
...
@@ -1478,8 +1475,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
lineNum
=
i
+
2L
;
employeeVO
=
excelVOList
.
get
(
i
);
// 判断空值
this
.
judgeNull
(
errorMsgMap
,
employeeVO
,
lineNum
);
// 判空
if
(
Common
.
isEmpty
(
excelVOList
.
get
(
i
).
getEmpIdcard
()))
{
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
"员工身份证必填"
));
...
...
@@ -1493,6 +1488,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
"员工姓名必填"
));
}
}
if
(
Common
.
isNotNull
(
errorMessageList
))
{
errorMessageList
.
stream
().
forEach
(
errorMessage
->
errorMsgMap
.
put
(
errorMessage
.
getLineNum
(),
errorMessage
));
}
// 查找档案库
Map
<
String
,
TEmployeeInfo
>
existEmpMap
=
new
HashMap
<>();
Map
<
String
,
TEmployeeInfo
>
existPhoneMap
=
new
HashMap
<>();
...
...
@@ -1576,6 +1574,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
saveEmp
.
setEmpPhone
(
excel
.
getEmpPhone
());
}
// 判断空值
this
.
judgeNull
(
errorMsg
,
saveEmp
);
// 校验手机号
if
(
Common
.
isNotNull
(
excel
.
getEmpPhone
()))
{
existEmp
=
existPhoneMap
.
get
(
excel
.
getEmpPhone
());
...
...
@@ -1827,63 +1828,63 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
* @Date: 2022/7/6 15:10
* @return: void
**/
private
void
judgeNull
(
Map
<
Long
,
ErrorMessage
>
errorMsgMap
,
EmployeeVO
employeeInfo
,
long
lineNum
)
{
private
void
judgeNull
(
Set
<
String
>
errorMsg
,
TEmployeeInfo
employeeInfo
)
{
if
(
Common
.
isNotNull
(
employeeInfo
.
getEmpNatrue
())
&&
(
EmployeeConstants
.
EMP_NATRUE_ZERO
.
equals
(
employeeInfo
.
getEmpNatrue
())
||
EmployeeConstants
.
EMP_NATRUE_ONE
.
equals
(
employeeInfo
.
getEmpNatrue
())))
{
&&
(
CommonConstants
.
ZERO_STRING
.
equals
(
employeeInfo
.
getEmpNatrue
())
||
CommonConstants
.
ONE_STRING
.
equals
(
employeeInfo
.
getEmpNatrue
())))
{
// 2.员工类型为外包和派遣,额外必填项有:身份证开始日期、身份证截止日期、民族、户籍所在(省市县)、户口性质、档案所在地(省市县)、是否大专及以上、通信地址
if
(
Common
.
isEmpty
(
employeeInfo
.
getValidityStart
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
VALIDITY_START
)
);
errorMsg
.
add
(
EmployeeConstants
.
VALIDITY_START
);
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getValidityEnd
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
VALIDITY_END
)
);
errorMsg
.
add
(
EmployeeConstants
.
VALIDITY_END
);
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getEmpNational
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
EMP_NATIONAL
)
);
errorMsg
.
add
(
EmployeeConstants
.
EMP_NATIONAL
);
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getIdProvince
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
ID_PROVINCE
)
);
errorMsg
.
add
(
EmployeeConstants
.
ID_PROVINCE
);
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getEmpRegisType
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
EMP_REGIS_TYPE
)
);
errorMsg
.
add
(
EmployeeConstants
.
EMP_REGIS_TYPE
);
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getFileProvince
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
FILE_PROVINCE
)
);
errorMsg
.
add
(
EmployeeConstants
.
FILE_PROVINCE
);
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getContactAddress
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
CONTACT_ADDRESS
)
);
errorMsg
.
add
(
EmployeeConstants
.
CONTACT_ADDRESS
);
}
if
(
Common
.
isNotNull
(
employeeInfo
.
getIsCollege
())
&&
CommonConstants
.
IS_TRUE
.
equals
(
employeeInfo
.
getIsCollege
()
))
{
&&
CommonConstants
.
ONE_INT
==
employeeInfo
.
getIsCollege
(
))
{
// 3.员工类型为外包和派遣,并且是否大专及以上为是,再增加必填项:最高学历、学校、专业、入学时间、毕业时间
if
(
Common
.
isEmpty
(
employeeInfo
.
getHignEducation
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
HIGN_EDUCATION
)
);
errorMsg
.
add
(
EmployeeConstants
.
HIGN_EDUCATION
);
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getSchool
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
SCHOOL
)
);
errorMsg
.
add
(
EmployeeConstants
.
SCHOOL
);
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getMajor
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
MAJOR
)
);
errorMsg
.
add
(
EmployeeConstants
.
MAJOR
);
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getAdmissionDate
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
ADMISSION_DATE
)
);
errorMsg
.
add
(
EmployeeConstants
.
ADMISSION_DATE
);
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getGradutionDate
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
GRADUTION_DATE
)
);
errorMsg
.
add
(
EmployeeConstants
.
GRADUTION_DATE
);
}
}
}
if
(
Common
.
isNotNull
(
employeeInfo
.
getIdCity
())
&&
Common
.
isEmpty
(
employeeInfo
.
getIdProvince
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
ID_ROVINCE_MUST
)
);
errorMsg
.
add
(
EmployeeConstants
.
ID_ROVINCE_MUST
);
}
if
(
Common
.
isNotNull
(
employeeInfo
.
getIdTown
())
&&
Common
.
isEmpty
(
employeeInfo
.
getIdCity
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
ID_CITY_MUST
)
);
errorMsg
.
add
(
EmployeeConstants
.
ID_CITY_MUST
);
}
if
(
Common
.
isNotNull
(
employeeInfo
.
getFileCity
())
&&
Common
.
isEmpty
(
employeeInfo
.
getFileProvince
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
FILE_ROVINCE_MUST
)
);
errorMsg
.
add
(
EmployeeConstants
.
FILE_ROVINCE_MUST
);
}
if
(
Common
.
isNotNull
(
employeeInfo
.
getFileTown
())
&&
Common
.
isEmpty
(
employeeInfo
.
getFileCity
()))
{
errorMsg
Map
.
put
(
lineNum
,
new
ErrorMessage
(
EmployeeConstants
.
FILE_CITY_MUST
)
);
errorMsg
.
add
(
EmployeeConstants
.
FILE_CITY_MUST
);
}
}
...
...
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