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
48801cac
Commit
48801cac
authored
Jun 30, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量导入档案
parent
b2f5ac30
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
16 deletions
+27
-16
TEmployeeInfoController.java
.../v1/yifu/archives/controller/TEmployeeInfoController.java
+2
-2
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+25
-14
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeInfoController.java
View file @
48801cac
...
...
@@ -248,7 +248,7 @@ public class TEmployeeInfoController {
* @Date: 2022/6/21 19:42
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation
(
summary
=
"通过id减档人员档案表"
,
description
=
"通过id减档人员档案表"
)
@Operation
(
summary
=
"通过id减档人员档案表
temployeeinfo_minus
"
,
description
=
"通过id减档人员档案表"
)
@SysLog
(
"通过id减档人员档案表"
)
@GetMapping
(
"/minusEmployee"
)
@PreAuthorize
(
"@pms.hasPermission('temployeeinfo_minus')"
)
...
...
@@ -263,7 +263,7 @@ public class TEmployeeInfoController {
* @Date: 2022/6/21 19:42
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation
(
summary
=
"批量减档人员档案表"
,
description
=
"批量减档人员档案表"
)
@Operation
(
summary
=
"批量减档人员档案表
temployeeinfo_batch_minus
"
,
description
=
"批量减档人员档案表"
)
@SysLog
(
"批量减档人员档案表"
)
@PostMapping
(
"/batchMinusEmployee"
)
@PreAuthorize
(
"@pms.hasPermission('temployeeinfo_batch_minus')"
)
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
48801cac
...
...
@@ -587,23 +587,27 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return
null
;
}
private
R
<
TEmployeeInfo
>
checkEmployeeVOR
(
EmployeeVO
employeeInfo
)
{
private
void
checkEmployeeVOR
(
long
lineNum
,
EmployeeVO
employeeInfo
,
Map
<
Long
,
ErrorMessage
>
errorMsgMap
,
Set
<
String
>
errorMsg
)
{
if
(
Common
.
isEmpty
(
employeeInfo
.
getEmpIdcard
()))
{
return
R
.
failed
(
"员工身份证必填!"
);
errorMsg
.
add
(
"员工身份证必填!"
);
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
"员工身份证必填!"
));
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getDeptNo
()))
{
return
R
.
failed
(
"项目编码必填!"
);
errorMsg
.
add
(
"项目编码必填!"
);
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
"项目编码必填!"
));
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getEmpName
()))
{
return
R
.
failed
(
"员工姓名必填!"
);
errorMsg
.
add
(
"员工姓名必填!"
);
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
"员工姓名必填!"
));
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getEmpPhone
()))
{
return
R
.
failed
(
"手机号必填!"
);
errorMsg
.
add
(
"手机号必填!"
);
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
"手机号必填!"
));
}
if
(
Common
.
isEmpty
(
employeeInfo
.
getEmpNatrue
()))
{
return
R
.
failed
(
"员工类型必填!"
);
errorMsg
.
add
(
"员工类型必填!"
);
errorMsgMap
.
put
(
lineNum
,
new
ErrorMessage
(
"员工类型必填!"
));
}
return
null
;
}
@Override
...
...
@@ -629,26 +633,35 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
List
<
String
>
phoneList
=
new
ArrayList
<>();
Map
<
String
,
Integer
>
idCardMap
=
new
HashMap
<>();
String
idCard
;
ErrorMessage
errorMessage
;
// 个性化校验逻辑
Set
<
String
>
errorMsg
;
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
errorMsg
=
new
HashSet
<>();
// 判空
R
<
TEmployeeInfo
>
failed
=
this
.
checkEmployeeVOR
(
excelVOList
.
get
(
i
)
);
if
(
failed
!=
null
)
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
failed
.
getMsg
()));
this
.
checkEmployeeVOR
((
i
+
2L
),
excelVOList
.
get
(
i
),
errorMsgMap
,
errorMsg
);
idCard
=
excelVOList
.
get
(
i
).
getEmpIdcard
();
if
(
Common
.
isEmpty
(
idCard
))
{
errorMsg
.
add
(
"第"
+
(
i
+
2
)
+
"行身份证号为空!"
);
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行身份证号为空!"
));
}
else
{
if
(
idCardMap
.
get
(
idCard
)
!=
null
)
{
errorMsg
.
add
(
"第"
+
(
i
+
2
)
+
"行身份证号与第"
+
idCardMap
.
get
(
idCard
)
+
"行重复!"
);
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行身份证号与第"
+
idCardMap
.
get
(
idCard
)
+
"行重复!"
));
}
else
{
idCardMap
.
put
(
idCard
,
i
+
2
);
idCardList
.
add
(
idCard
);
}
}
if
(
Common
.
isEmpty
(
excelVOList
.
get
(
i
).
getEmpPhone
()))
{
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行手机号码为空!"
));
}
else
{
if
(
Common
.
isNotNull
(
excelVOList
.
get
(
i
).
getEmpPhone
()))
{
phoneList
.
add
(
excelVOList
.
get
(
i
).
getEmpPhone
());
}
// 数据合法情况
if
(!
CollUtil
.
isEmpty
(
errorMsg
))
{
// 数据不合法
errorMessageList
.
add
(
new
ErrorMessage
((
i
+
2L
),
errorMsg
));
}
}
// 查找档案库
Map
<
String
,
TEmployeeInfo
>
existEmpMap
=
new
HashMap
<>();
...
...
@@ -666,8 +679,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
}
// 个性化校验逻辑
Set
<
String
>
errorMsg
;
EmployeeVO
excel
;
// 已存在的档案信息
TEmployeeInfo
existEmp
;
...
...
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