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
cfb74e83
Commit
cfb74e83
authored
Jul 11, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
543ffbe8
84eec9e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
28 deletions
+26
-28
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+26
-28
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
cfb74e83
...
...
@@ -56,7 +56,6 @@ import org.springframework.cache.CacheManager;
import
org.springframework.cache.support.SimpleValueWrapper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.BindingResult
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -1466,20 +1465,13 @@ 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
<>();
List
<
String
>
phoneList
=
new
ArrayList
<>();
EmployeeVO
employeeVO
;
long
lineNum
;
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 +1485,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 +1571,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 +1825,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