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
0c755ff3
Commit
0c755ff3
authored
Jun 20, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户信息新增 系统内置标识 0 是 1 否
parent
c7cd69d4
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
114 additions
and
6 deletions
+114
-6
EmpEducationUpdateExcelVo.java
...d/plus/v1/yifu/archives/vo/EmpEducationUpdateExcelVo.java
+15
-0
TEmpDisabilityInfoController.java
...ifu/archives/controller/TEmpDisabilityInfoController.java
+1
-1
TEmpEducationController.java
.../v1/yifu/archives/controller/TEmpEducationController.java
+18
-1
TEmpFamilyController.java
...lus/v1/yifu/archives/controller/TEmpFamilyController.java
+1
-1
TEmpWorkRecordingController.java
...yifu/archives/controller/TEmpWorkRecordingController.java
+1
-1
TEmpEducationService.java
...d/plus/v1/yifu/archives/service/TEmpEducationService.java
+3
-0
TEmpEducationServiceImpl.java
.../yifu/archives/service/impl/TEmpEducationServiceImpl.java
+66
-0
YifuUser.java
.../com/yifu/cloud/plus/v1/yifu/common/core/vo/YifuUser.java
+8
-1
YifuUserDetailsService.java
.../yifu/common/security/service/YifuUserDetailsService.java
+1
-1
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmpEducationUpdateExcelVo.java
0 → 100644
View file @
0c755ff3
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
/**
* @Author fxj
* @Date 2022/6/20
* @Description
* @Version 1.0
*/
public
class
EmpEducationUpdateExcelVo
extends
EmpEducationExcelVO
{
/**
* @Author fxj
* @Description 主键
**/
private
String
id
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmpDisabilityInfoController.java
View file @
0c755ff3
...
...
@@ -129,7 +129,7 @@ public class TEmpDisabilityInfoController {
@SysLog
(
"批量新增员工伤残信息"
)
@PostMapping
(
"/importListAdd"
)
@PreAuthorize
(
"@pms.hasPermission('wxhr:tempdisabilityinfo_importListAdd')"
)
public
R
<
List
<
ErrorMessage
>>
batchAddByJsonString
(
@RequestExcel
List
<
EmpDisabilityExcelVO
>
excelVOList
,
BindingResult
bindingResult
)
{
public
R
<
List
<
ErrorMessage
>>
importListAdd
(
@RequestExcel
List
<
EmpDisabilityExcelVO
>
excelVOList
,
BindingResult
bindingResult
)
{
return
tEmpDisabilityInfoService
.
importTmpDisability
(
excelVOList
,
bindingResult
);
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmpEducationController.java
View file @
0c755ff3
...
...
@@ -25,6 +25,7 @@ import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmpEducationService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateExcelVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
...
...
@@ -147,7 +148,23 @@ public class TEmpEducationController {
@SysLog
(
"批量新增员工学历信息"
)
@PostMapping
(
"/importListAdd"
)
@PreAuthorize
(
"@pms.hasPermission('archives_education_importListAdd')"
)
public
R
<
List
<
ErrorMessage
>>
batchAddByJsonString
(
@RequestExcel
List
<
EmpEducationExcelVO
>
excelVOList
,
BindingResult
bindingResult
)
{
public
R
<
List
<
ErrorMessage
>>
importListAdd
(
@RequestExcel
List
<
EmpEducationExcelVO
>
excelVOList
,
BindingResult
bindingResult
)
{
return
tEmpEducationService
.
importEmpEducation
(
excelVOList
,
bindingResult
);
}
/**
* 批量更新员工学历信息
*
* @param excelVOList
* @return
* @Author fxj
* @Date 2019-08-16
**/
@Operation
(
description
=
"批量更新员工学历信息 hasPermission('archives_education_importListUpdate')"
)
@SysLog
(
"批量更新员工学历信息"
)
@PostMapping
(
"/importListUpate"
)
@PreAuthorize
(
"@pms.hasPermission('archives_education_importListUpdate')"
)
public
R
<
List
<
ErrorMessage
>>
importListUpate
(
@RequestExcel
List
<
EmpEducationUpdateExcelVo
>
excelVOList
,
BindingResult
bindingResult
)
{
return
tEmpEducationService
.
importEmpEducationUpdate
(
excelVOList
,
bindingResult
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmpFamilyController.java
View file @
0c755ff3
...
...
@@ -157,7 +157,7 @@ public class TEmpFamilyController {
@SysLog
(
"批量新增员工家庭信息"
)
@PostMapping
(
"/importListAdd"
)
@PreAuthorize
(
"@pms.hasPermission('archives_tempfamily_importListAdd')"
)
public
R
<
List
<
ErrorMessage
>>
batchAddByJsonString
(
@RequestExcel
List
<
EmpFamilyExcelVO
>
excelVOList
,
BindingResult
bindingResult
)
{
public
R
<
List
<
ErrorMessage
>>
importListAdd
(
@RequestExcel
List
<
EmpFamilyExcelVO
>
excelVOList
,
BindingResult
bindingResult
)
{
return
tEmpFamilyService
.
importEmpFamilys
(
excelVOList
,
bindingResult
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmpWorkRecordingController.java
View file @
0c755ff3
...
...
@@ -147,7 +147,7 @@ public class TEmpWorkRecordingController {
@SysLog
(
"批量新增员工工作信息"
)
@PostMapping
(
"/importListAdd"
)
@PreAuthorize
(
"@pms.hasPermission('archives_tempworkrecording_importListAdd')"
)
public
R
<
List
<
ErrorMessage
>>
batchAddByJsonString
(
@RequestExcel
List
<
EmpWorkRecordExcelVO
>
excelVOList
,
BindingResult
bindingResult
)
{
public
R
<
List
<
ErrorMessage
>>
importListAdd
(
@RequestExcel
List
<
EmpWorkRecordExcelVO
>
excelVOList
,
BindingResult
bindingResult
)
{
return
tEmpWorkRecordingService
.
importEmpWorkRecord
(
excelVOList
,
bindingResult
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmpEducationService.java
View file @
0c755ff3
...
...
@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.pig4cloud.plugin.excel.vo.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpEducation
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateExcelVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.validation.BindingResult
;
...
...
@@ -39,4 +40,6 @@ public interface TEmpEducationService extends IService<TEmpEducation> {
R
<
Boolean
>
updateByIdDiy
(
TEmpEducation
tEmpEducation
);
R
<
Boolean
>
saveDiy
(
TEmpEducation
tEmpEducation
);
R
<
List
<
ErrorMessage
>>
importEmpEducationUpdate
(
List
<
EmpEducationUpdateExcelVo
>
excelVOList
,
BindingResult
bindingResult
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpEducationServiceImpl.java
View file @
0c755ff3
...
...
@@ -27,6 +27,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpEducationMapper;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmpEducationService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateExcelVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
...
...
@@ -159,6 +160,71 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T
return
R
.
ok
();
}
/**
* @Author fxj
* @Description 批量更新学历
* @Date 16:25 2022/6/20
**/
@Override
public
R
<
List
<
ErrorMessage
>>
importEmpEducationUpdate
(
List
<
EmpEducationUpdateExcelVo
>
excelVOList
,
BindingResult
bindingResult
)
{
// 通用校验获取失败的数据
List
<
ErrorMessage
>
errorMessageList
=
(
List
<
ErrorMessage
>)
bindingResult
.
getTarget
();
Map
<
Long
,
ErrorMessage
>
errorMsgMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
errorMessageList
)){
errorMessageList
.
stream
().
forEach
(
errorMessage
->
errorMsgMap
.
put
(
errorMessage
.
getLineNum
(),
errorMessage
));
}
// 个性化校验逻辑
List
<
TEmpEducation
>
list
=
this
.
list
();
TEmployeeInfo
emp
;
TEmpEducation
exist
;
Set
<
String
>
errorMsg
;
// 执行数据插入操作 组装
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
// 已有验证报错直接下一个
if
(
Common
.
isNotNull
(
errorMsgMap
.
get
(
i
+
2
))){
continue
;
}
errorMsg
=
new
HashSet
<>();
EmpEducationExcelVO
excel
=
excelVOList
.
get
(
i
);
emp
=
employeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isEmpty
(
emp
)){
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_NOT_EXIST
,
excel
.
getEmpIdcard
()));
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
emp
.
getFileStatus
())){
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_REDUCED
,
excel
.
getEmpIdcard
()));
}
// 检查添加人员是否已经存在
boolean
match
=
list
.
stream
().
anyMatch
(
info
->
excel
.
getEducationName
().
equals
(
info
.
getEducationName
())
&&
excel
.
getEmpIdcard
().
equals
(
info
.
getEmpIdcard
()));
if
(
match
)
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_EDUCATION_EXISTING
,
excel
.
getEmpName
()));
}
exist
=
baseMapper
.
selectOne
(
Wrappers
.<
TEmpEducation
>
query
().
lambda
()
.
eq
(
TEmpEducation:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmpEducation:
:
getEducationName
,
excel
.
getEducationName
())
.
eq
(
TEmpEducation:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
exist
)){
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_EDUCATION_EXISTING
,
excel
.
getEducationName
()));
}
// 数据合法情况
if
(
CollUtil
.
isEmpty
(
errorMsg
))
{
insertExcelPost
(
excel
,
emp
);
}
else
{
// 数据不合法
errorMessageList
.
add
(
new
ErrorMessage
((
long
)
(
i
+
2
),
errorMsg
));
}
}
if
(
CollUtil
.
isNotEmpty
(
errorMessageList
))
{
return
R
.
failed
(
errorMessageList
);
}
return
R
.
ok
();
}
private
void
updateEducationOfEmp
(
TEmpEducation
education
)
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
education
.
getHighIdentification
())){
EmpEducationUpdateVo
updateVo
=
new
EmpEducationUpdateVo
();
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/vo/YifuUser.java
View file @
0c755ff3
...
...
@@ -52,7 +52,13 @@ public class YifuUser extends User {
@Getter
private
final
String
phone
;
public
YifuUser
(
String
id
,
Long
deptId
,
String
username
,
String
nickname
,
String
password
,
String
phone
,
boolean
enabled
,
/**
* 系统内置标识 0 是 1 否
*/
@Getter
private
String
systemFlag
;
public
YifuUser
(
String
id
,
Long
deptId
,
String
username
,
String
nickname
,
String
systemFlag
,
String
password
,
String
phone
,
boolean
enabled
,
boolean
accountNonExpired
,
boolean
credentialsNonExpired
,
boolean
accountNonLocked
,
Collection
<?
extends
GrantedAuthority
>
authorities
)
{
super
(
username
,
password
,
enabled
,
accountNonExpired
,
credentialsNonExpired
,
accountNonLocked
,
authorities
);
...
...
@@ -60,6 +66,7 @@ public class YifuUser extends User {
this
.
deptId
=
deptId
;
this
.
phone
=
phone
;
this
.
nickname
=
nickname
;
this
.
systemFlag
=
systemFlag
;
}
}
yifu-common/yifu-common-security/src/main/java/com/yifu.cloud.plus.v1/yifu/common/security/service/YifuUserDetailsService.java
View file @
0c755ff3
...
...
@@ -69,7 +69,7 @@ public interface YifuUserDetailsService extends UserDetailsService, Ordered {
SysUser
user
=
info
.
getSysUser
();
// 构造security用户
return
new
YifuUser
(
user
.
getUserId
(),
user
.
getDeptId
(),
user
.
getUsername
(),
user
.
getNickname
(),
return
new
YifuUser
(
user
.
getUserId
(),
user
.
getDeptId
(),
user
.
getUsername
(),
user
.
getNickname
(),
user
.
getSystemFlag
(),
SecurityConstants
.
BCRYPT
+
user
.
getPassword
(),
user
.
getPhone
(),
true
,
true
,
true
,
StrUtil
.
equals
(
user
.
getLockFlag
(),
CommonConstants
.
STATUS_NORMAL
),
authorities
);
}
...
...
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