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
223d6d66
Commit
223d6d66
authored
Jun 28, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员档案相关-批量删除,返回多列
parent
f942dabe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
13 deletions
+87
-13
ErrorMessageVO.java
...m/yifu/cloud/plus/v1/yifu/archives/vo/ErrorMessageVO.java
+51
-0
TEmployeeInfoController.java
.../v1/yifu/archives/controller/TEmployeeInfoController.java
+2
-1
TEmployeeInfoService.java
...d/plus/v1/yifu/archives/service/TEmployeeInfoService.java
+2
-1
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+32
-11
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/ErrorMessageVO.java
0 → 100644
View file @
223d6d66
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Set
;
/**
* 封装-返回给前端的错误信息
*
* @author hgw
* @date 2022-6-28 11:27:08
*/
@Data
public
class
ErrorMessageVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Schema
(
description
=
"行号"
)
private
int
lineNum
;
@Schema
(
description
=
"姓名"
)
private
String
empName
;
@Schema
(
description
=
"身份证号"
)
private
String
empIdCard
;
@Schema
(
description
=
"结果:0错误;1正确(例如:是否允许删除:0否;1是)"
)
private
int
result
;
@Schema
(
description
=
"错误信息Set(多重错误合并返回,给Set,前端按需组装)"
)
private
Set
<
String
>
errorSet
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeInfoController.java
View file @
223d6d66
...
...
@@ -26,6 +26,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeLeaveVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorMessageVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
...
...
@@ -236,7 +237,7 @@ public class TEmployeeInfoController {
@SysLog
(
"通过ids批量删除人员档案表"
)
@GetMapping
(
"/batchDeleteEmployee"
)
@PreAuthorize
(
"@pms.hasPermission('temployeeinfo_batch_del')"
)
public
R
<
List
<
ErrorMessage
>>
batchDeleteEmployee
(
@RequestBody
List
<
String
>
idList
)
{
public
R
<
List
<
ErrorMessage
VO
>>
batchDeleteEmployee
(
@RequestBody
List
<
String
>
idList
)
{
return
tEmployeeInfoService
.
batchDeleteEmployee
(
idList
);
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeInfoService.java
View file @
223d6d66
...
...
@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeLeaveVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorMessageVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.validation.BindingResult
;
...
...
@@ -101,7 +102,7 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
* @Date: 2022/6/23 16:45
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R
<
List
<
ErrorMessage
>>
batchDeleteEmployee
(
List
<
String
>
idList
);
R
<
List
<
ErrorMessage
VO
>>
batchDeleteEmployee
(
List
<
String
>
idList
);
/**
* @param id
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
223d6d66
...
...
@@ -204,50 +204,71 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
@Override
public
R
<
List
<
ErrorMessage
>>
batchDeleteEmployee
(
List
<
String
>
idList
)
{
public
R
<
List
<
ErrorMessage
VO
>>
batchDeleteEmployee
(
List
<
String
>
idList
)
{
if
(
idList
==
null
||
idList
.
isEmpty
())
{
return
R
.
failed
(
"请选择!"
);
}
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
List
<
ErrorMessage
VO
>
errorMessageList
=
new
ArrayList
<>();
TEmployeeInfo
employee
;
String
id
;
List
<
TEmployeeInfo
>
canDeleteList
=
new
ArrayList
<>();
ErrorMessageVO
errorMessageVO
;
Set
<
String
>
errorMsg
;
boolean
isTrue
=
true
;
for
(
int
i
=
0
;
i
<
idList
.
size
();
i
++)
{
errorMsg
=
new
HashSet
<>();
id
=
idList
.
get
(
i
);
employee
=
this
.
getById
(
id
);
if
(
employee
!=
null
)
{
if
(
employee
.
getStatus
()
!=
CommonConstants
.
ZERO_INT
)
{
errorMsg
.
add
(
"
身份证【"
+
employee
.
getEmpIdcard
()
+
"】的人员:非草稿状态,无法删除
"
);
errorMsg
.
add
(
"
非草稿状态!
"
);
}
if
(
employee
.
getContractStatus
()
!=
CommonConstants
.
ZERO_INT
)
{
errorMsg
.
add
(
"
身份证【"
+
employee
.
getEmpIdcard
()
+
"】的人员:合同状态非初始,无法删除
"
);
errorMsg
.
add
(
"
合同状态非初始!
"
);
}
if
(
employee
.
getInsuranceStatus
()
!=
CommonConstants
.
ZERO_INT
)
{
errorMsg
.
add
(
"
身份证【"
+
employee
.
getEmpIdcard
()
+
"】的人员:商险状态非初始,无法删除
"
);
errorMsg
.
add
(
"
商险状态非初始!
"
);
}
if
(
employee
.
getSocialStatus
()
!=
CommonConstants
.
ZERO_INT
)
{
errorMsg
.
add
(
"
身份证【"
+
employee
.
getEmpIdcard
()
+
"】的人员:社保状态非初始,无法删除
"
);
errorMsg
.
add
(
"
社保状态非初始!
"
);
}
if
(
employee
.
getFundStatus
()
!=
CommonConstants
.
ZERO_INT
)
{
errorMsg
.
add
(
"
身份证【"
+
employee
.
getEmpIdcard
()
+
"】的人员:公积金状态非初始,无法删除
"
);
errorMsg
.
add
(
"
公积金状态非初始!
"
);
}
if
(
employee
.
getSalaryStatus
()
!=
CommonConstants
.
ZERO_INT
)
{
errorMsg
.
add
(
"
身份证【"
+
employee
.
getEmpIdcard
()
+
"】的人员:工资状态非初始,无法删除
"
);
errorMsg
.
add
(
"
工资状态非初始!
"
);
}
// 数据合法情况
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
);
// 数据不合法
errorMessageList
.
add
(
new
ErrorMessage
((
i
+
1L
),
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
);
canDeleteList
.
add
(
employee
);
}
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
((
i
+
1L
),
errorMsg
));
isTrue
=
false
;
errorMsg
.
add
(
"未找到人员!"
);
errorMessageVO
=
new
ErrorMessageVO
();
errorMessageVO
.
setLineNum
(
i
+
2
);
errorMessageVO
.
setResult
(
CommonConstants
.
ZERO_INT
);
errorMessageVO
.
setErrorSet
(
errorMsg
);
errorMessageList
.
add
(
errorMessageVO
);
}
}
if
(
CollUtil
.
isNotEmpty
(
errorMessageList
))
{
if
(
!
isTrue
&&
CollUtil
.
isNotEmpty
(
errorMessageList
))
{
return
R
.
failed
(
errorMessageList
);
}
else
{
List
<
TEmployeeProject
>
projectList
;
...
...
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