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
6155c9aa
Commit
6155c9aa
authored
Jun 28, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员档案相关-批量减档,返回多列
parent
8aaf0c4c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
29 deletions
+42
-29
TEmployeeInfoController.java
.../v1/yifu/archives/controller/TEmployeeInfoController.java
+1
-2
TEmployeeInfoService.java
...d/plus/v1/yifu/archives/service/TEmployeeInfoService.java
+1
-1
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+40
-26
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeInfoController.java
View file @
6155c9aa
...
...
@@ -258,7 +258,6 @@ public class TEmployeeInfoController {
}
/**
* @param idList
* @Description: 通过ids批量减档人员档案表
* @Author: hgw
* @Date: 2022/6/21 19:42
...
...
@@ -268,7 +267,7 @@ public class TEmployeeInfoController {
@SysLog
(
"批量减档人员档案表"
)
@GetMapping
(
"/batchMinusEmployee"
)
@PreAuthorize
(
"@pms.hasPermission('temployeeinfo_batch_minus')"
)
public
R
<
List
<
ErrorMessage
>>
batchMinusEmployee
(
@RequestExcel
List
<
EmployeeLeaveVO
>
excelList
,
BindingResult
bindingResult
)
{
public
R
<
List
<
ErrorMessage
VO
>>
batchMinusEmployee
(
@RequestExcel
List
<
EmployeeLeaveVO
>
excelList
,
BindingResult
bindingResult
)
{
return
tEmployeeInfoService
.
batchMinusEmployee
(
excelList
,
bindingResult
);
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeInfoService.java
View file @
6155c9aa
...
...
@@ -128,7 +128,7 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
* @Date: 2022/6/23 17:12
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.pig4cloud.plugin.excel.vo.ErrorMessage>>
**/
R
<
List
<
ErrorMessage
>>
batchMinusEmployee
(
List
<
EmployeeLeaveVO
>
excelVOList
,
BindingResult
bindingResult
);
R
<
List
<
ErrorMessage
VO
>>
batchMinusEmployee
(
List
<
EmployeeLeaveVO
>
excelVOList
,
BindingResult
bindingResult
);
/**
* @param employeeInfo 档案信息
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
6155c9aa
...
...
@@ -241,30 +241,19 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 数据合法情况
if
(!
CollUtil
.
isEmpty
(
errorMsg
))
{
isTrue
=
false
;
errorMessageVO
=
new
ErrorMessageVO
();
errorMessageVO
.
setLineNum
(
i
+
2
);
errorMessageVO
.
setResult
(
CommonConstants
.
ZERO_INT
);
errorMessageVO
.
setEmpName
(
employee
.
getEmpName
());
errorMessageVO
.
setEmpIdCard
(
employee
.
getEmpIdcard
());
errorMessageVO
.
setErrorSet
(
errorMsg
);
errorMessageVO
=
this
.
getErrorMessageVO
(
i
,
CommonConstants
.
ZERO_INT
,
employee
.
getEmpName
()
,
employee
.
getEmpIdcard
(),
errorMsg
);
// 数据不合法
errorMessageList
.
add
(
errorMessageVO
);
}
else
{
errorMessageVO
=
new
ErrorMessageVO
();
errorMessageVO
.
setLineNum
(
i
+
2
);
errorMessageVO
.
setResult
(
CommonConstants
.
ONE_INT
);
errorMessageVO
.
setEmpName
(
employee
.
getEmpName
());
errorMessageVO
.
setEmpIdCard
(
employee
.
getEmpIdcard
());
errorMessageList
.
add
(
errorMessageVO
);
errorMessageVO
=
this
.
getErrorMessageVO
(
i
,
CommonConstants
.
ONE_INT
,
employee
.
getEmpName
()
,
employee
.
getEmpIdcard
(),
errorMsg
);
canDeleteList
.
add
(
employee
);
}
errorMessageList
.
add
(
errorMessageVO
);
}
else
{
isTrue
=
false
;
errorMsg
.
add
(
"未找到人员!"
);
errorMessageVO
=
new
ErrorMessageVO
();
errorMessageVO
.
setLineNum
(
i
+
2
);
errorMessageVO
.
setResult
(
CommonConstants
.
ZERO_INT
);
errorMessageVO
.
setErrorSet
(
errorMsg
);
errorMessageVO
=
this
.
getErrorMessageVO
(
i
,
CommonConstants
.
ZERO_INT
,
null
,
null
,
errorMsg
);
errorMessageList
.
add
(
errorMessageVO
);
}
}
...
...
@@ -288,6 +277,17 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
}
private
ErrorMessageVO
getErrorMessageVO
(
int
i
,
int
result
,
String
empName
,
String
idCard
,
Set
<
String
>
errorMsg
)
{
ErrorMessageVO
errorMessageVO
=
new
ErrorMessageVO
();
errorMessageVO
.
setLineNum
(
i
+
2
);
// 结果:0错误;1正确
errorMessageVO
.
setResult
(
result
);
errorMessageVO
.
setEmpName
(
empName
);
errorMessageVO
.
setEmpIdCard
(
idCard
);
errorMessageVO
.
setErrorSet
(
errorMsg
);
return
errorMessageVO
;
}
@Override
public
R
<
String
>
restoreEmployee
(
String
id
,
String
projectIds
)
{
TEmployeeInfo
employee
=
this
.
getById
(
id
);
...
...
@@ -324,7 +324,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
@Override
public
R
<
List
<
ErrorMessage
>>
batchMinusEmployee
(
List
<
EmployeeLeaveVO
>
excelVOList
,
BindingResult
bindingResult
)
{
public
R
<
List
<
ErrorMessage
VO
>>
batchMinusEmployee
(
List
<
EmployeeLeaveVO
>
excelVOList
,
BindingResult
bindingResult
)
{
if
(
excelVOList
==
null
||
excelVOList
.
isEmpty
())
{
return
R
.
failed
(
CommonConstants
.
DATA_CAN_NOT_EMPTY
);
}
...
...
@@ -332,8 +332,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
CommonConstants
.
PLEASE_LOG_IN
);
}
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
Map
<
Long
,
ErrorMessage
>
errorMsgMap
=
new
HashMap
<>();
List
<
ErrorMessageVO
>
errorMessageList
=
new
ArrayList
<>();
ErrorMessageVO
errorMessageVO
;
Map
<
Integer
,
Integer
>
errorMsgMap
=
new
HashMap
<>();
TEmployeeInfo
employee
;
List
<
TEmployeeInfo
>
canDeleteList
=
new
ArrayList
<>();
...
...
@@ -342,6 +343,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
List
<
String
>
idCardList
=
new
ArrayList
<>();
String
idCard
;
boolean
isTrue
=
true
;
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
errorMsg
=
new
HashSet
<>();
excel
=
excelVOList
.
get
(
i
);
...
...
@@ -349,18 +351,24 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
idCard
=
excel
.
getEmpIdcard
();
if
(
Common
.
isEmpty
(
idCard
))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_IDCARD_MUST
,
excel
.
getEmpIdcard
()));
errorMsgMap
.
put
(
(
i
+
2L
),
new
ErrorMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_IDCARD_MUST
)
);
errorMsgMap
.
put
(
i
+
2
,
CommonConstants
.
ZERO_INT
);
}
else
{
idCardList
.
add
(
idCard
);
}
if
(
Common
.
isEmpty
(
excel
.
getLeaveReason
()))
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_LEAVEREASON_MUST
,
excel
.
getEmpIdcard
()));
errorMsgMap
.
put
(
(
i
+
2L
),
new
ErrorMessage
(
ErrorCodes
.
ARCHIVES_IMPORT_EMP_IDCARD_MUST
)
);
errorMsgMap
.
put
(
i
+
2
,
CommonConstants
.
ZERO_INT
);
}
// 数据不合法
if
(!
CollUtil
.
isEmpty
(
errorMsg
))
{
errorMessageList
.
add
(
new
ErrorMessage
((
i
+
2L
),
errorMsg
));
isTrue
=
false
;
errorMessageVO
=
this
.
getErrorMessageVO
(
i
,
CommonConstants
.
ZERO_INT
,
excel
.
getEmpName
()
,
idCard
,
errorMsg
);
}
else
{
errorMessageVO
=
this
.
getErrorMessageVO
(
i
,
CommonConstants
.
ONE_INT
,
excel
.
getEmpName
()
,
idCard
,
errorMsg
);
}
errorMessageList
.
add
(
errorMessageVO
);
}
// 查找档案库
Map
<
String
,
TEmployeeInfo
>
existEmpMap
=
new
HashMap
<>();
...
...
@@ -373,7 +381,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 执行数据插入操作 组装
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
// 已有验证报错直接下一个
if
(
Common
.
isNotNull
(
errorMsgMap
.
get
(
(
i
+
2L
)
)))
{
if
(
Common
.
isNotNull
(
errorMsgMap
.
get
(
i
+
2
)))
{
continue
;
}
errorMsg
=
new
HashSet
<>();
...
...
@@ -398,10 +406,16 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
// 数据不合法
if
(!
CollUtil
.
isEmpty
(
errorMsg
))
{
errorMessageList
.
add
(
new
ErrorMessage
((
i
+
2L
),
errorMsg
));
isTrue
=
false
;
errorMessageVO
=
this
.
getErrorMessageVO
(
i
,
CommonConstants
.
ZERO_INT
,
excel
.
getEmpName
()
,
excel
.
getEmpIdcard
(),
errorMsg
);
}
else
{
errorMessageVO
=
this
.
getErrorMessageVO
(
i
,
CommonConstants
.
ONE_INT
,
excel
.
getEmpName
()
,
excel
.
getEmpIdcard
(),
errorMsg
);
}
errorMessageList
.
add
(
errorMessageVO
);
}
if
(
CollUtil
.
isNotEmpty
(
errorMessageList
))
{
if
(
!
isTrue
&&
CollUtil
.
isNotEmpty
(
errorMessageList
))
{
return
R
.
failed
(
errorMessageList
);
}
else
{
// 仅更新自己
...
...
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