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
8ac021ed
Commit
8ac021ed
authored
Jun 20, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
0c755ff3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
56 deletions
+68
-56
EmpEducationUpdateExcelVo.java
...d/plus/v1/yifu/archives/vo/EmpEducationUpdateExcelVo.java
+3
-0
TEmpEducationServiceImpl.java
.../yifu/archives/service/impl/TEmpEducationServiceImpl.java
+23
-28
TEmpFamilyServiceImpl.java
.../v1/yifu/archives/service/impl/TEmpFamilyServiceImpl.java
+20
-13
TEmpWorkRecordingServiceImpl.java
...u/archives/service/impl/TEmpWorkRecordingServiceImpl.java
+22
-15
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmpEducationUpdateExcelVo.java
View file @
8ac021ed
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
lombok.Data
;
/**
* @Author fxj
* @Date 2022/6/20
* @Description
* @Version 1.0
*/
@Data
public
class
EmpEducationUpdateExcelVo
extends
EmpEducationExcelVO
{
/**
* @Author fxj
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpEducationServiceImpl.java
View file @
8ac021ed
...
...
@@ -84,19 +84,7 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T
.
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
()));
}
checkRes
(
emp
,
errorMsg
,
excel
,
list
);
exist
=
baseMapper
.
selectOne
(
Wrappers
.<
TEmpEducation
>
query
().
lambda
()
.
eq
(
TEmpEducation:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmpEducation:
:
getEducationName
,
excel
.
getEducationName
())
...
...
@@ -185,28 +173,16 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T
continue
;
}
errorMsg
=
new
HashSet
<>();
EmpEducation
ExcelVO
excel
=
excelVOList
.
get
(
i
);
EmpEducation
UpdateExcelVo
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
()));
}
checkRes
(
emp
,
errorMsg
,
excel
,
list
);
exist
=
baseMapper
.
selectOne
(
Wrappers
.<
TEmpEducation
>
query
().
lambda
()
.
eq
(
TEmpEducation:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmpEducation:
:
getEducationName
,
excel
.
getEducationName
())
.
eq
(
TEmpEducation:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmpEducation:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
ne
(
TEmpEducation:
:
getId
,
excel
.
getId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
exist
)){
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_EDUCATION_EXISTING
,
excel
.
getEducationName
()));
...
...
@@ -225,6 +201,25 @@ public class TEmpEducationServiceImpl extends ServiceImpl<TEmpEducationMapper, T
return
R
.
ok
();
}
private
void
checkRes
(
TEmployeeInfo
emp
,
Set
<
String
>
errorMsg
,
EmpEducationExcelVO
excel
,
List
<
TEmpEducation
>
list
)
{
if
(
Common
.
isEmpty
(
emp
)){
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_NOT_EXIST
,
excel
.
getEmpIdcard
()));
return
;
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
emp
.
getFileStatus
())){
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_REDUCED
,
excel
.
getEmpIdcard
()));
return
;
}
// 检查添加人员是否已经存在
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
()));
return
;
}
}
private
void
updateEducationOfEmp
(
TEmpEducation
education
)
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
education
.
getHighIdentification
())){
EmpEducationUpdateVo
updateVo
=
new
EmpEducationUpdateVo
();
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpFamilyServiceImpl.java
View file @
8ac021ed
...
...
@@ -83,19 +83,7 @@ public class TEmpFamilyServiceImpl extends ServiceImpl<TEmpFamilyMapper, TEmpFam
.
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
.
getFamilyName
().
equals
(
info
.
getFamilyName
())
&&
excel
.
getEmpIdcard
().
equals
(
info
.
getEmpIdcard
()));
if
(
match
)
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_FAMILY_NAME_EXISTING
,
excel
.
getFamilyName
()));
}
checkRes
(
list
,
emp
,
errorMsg
,
excel
);
exist
=
baseMapper
.
selectOne
(
Wrappers
.<
TEmpFamily
>
query
().
lambda
()
.
eq
(
TEmpFamily:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmpFamily:
:
getFamilyName
,
excel
.
getFamilyName
())
...
...
@@ -118,6 +106,25 @@ public class TEmpFamilyServiceImpl extends ServiceImpl<TEmpFamilyMapper, TEmpFam
return
R
.
ok
();
}
private
void
checkRes
(
List
<
TEmpFamily
>
list
,
TEmployeeInfo
emp
,
Set
<
String
>
errorMsg
,
EmpFamilyExcelVO
excel
)
{
if
(
Common
.
isEmpty
(
emp
)){
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_NOT_EXIST
,
excel
.
getEmpIdcard
()));
return
;
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
emp
.
getFileStatus
())){
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_REDUCED
,
excel
.
getEmpIdcard
()));
return
;
}
// 检查添加人员是否已经存在
boolean
match
=
list
.
stream
().
anyMatch
(
info
->
excel
.
getFamilyName
().
equals
(
info
.
getFamilyName
())
&&
excel
.
getEmpIdcard
().
equals
(
info
.
getEmpIdcard
()));
if
(
match
)
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_FAMILY_NAME_EXISTING
,
excel
.
getFamilyName
()));
return
;
}
}
@Override
public
String
checkRepeat
(
String
empIdcard
,
String
familyName
,
String
updateId
)
{
LambdaQueryWrapper
<
TEmpFamily
>
wrapper
=
Wrappers
.
lambdaQuery
();
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpWorkRecordingServiceImpl.java
View file @
8ac021ed
...
...
@@ -75,21 +75,7 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM
.
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
.
getWorkDepart
().
equals
(
info
.
getWorkDepart
())
&&
excel
.
getWorkUnit
().
equals
(
info
.
getWorkUnit
())
&&
excel
.
getWorkJob
().
equals
(
info
.
getWorkJob
())
&&
excel
.
getEmpIdcard
().
equals
(
info
.
getEmpIdcard
()));
if
(
match
)
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_FAMILY_NAME_EXISTING
,
excel
.
getEmpName
()));
}
checkRes
(
list
,
emp
,
errorMsg
,
excel
);
exist
=
baseMapper
.
selectOne
(
Wrappers
.<
TEmpWorkRecording
>
query
().
lambda
()
.
eq
(
TEmpWorkRecording:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmpWorkRecording:
:
getWorkUnit
,
excel
.
getWorkUnit
())
...
...
@@ -114,6 +100,27 @@ public class TEmpWorkRecordingServiceImpl extends ServiceImpl<TEmpWorkRecordingM
return
R
.
ok
();
}
private
void
checkRes
(
List
<
TEmpWorkRecording
>
list
,
TEmployeeInfo
emp
,
Set
<
String
>
errorMsg
,
EmpWorkRecordExcelVO
excel
)
{
if
(
Common
.
isEmpty
(
emp
)){
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_NOT_EXIST
,
excel
.
getEmpIdcard
()));
return
;
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
emp
.
getFileStatus
())){
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_REDUCED
,
excel
.
getEmpIdcard
()));
return
;
}
// 检查添加人员是否已经存在
boolean
match
=
list
.
stream
().
anyMatch
(
info
->
excel
.
getWorkDepart
().
equals
(
info
.
getWorkDepart
())
&&
excel
.
getWorkUnit
().
equals
(
info
.
getWorkUnit
())
&&
excel
.
getWorkJob
().
equals
(
info
.
getWorkJob
())
&&
excel
.
getEmpIdcard
().
equals
(
info
.
getEmpIdcard
()));
if
(
match
)
{
errorMsg
.
add
(
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_EMP_FAMILY_NAME_EXISTING
,
excel
.
getEmpName
()));
return
;
}
}
/**
* 插入excel work record
*/
...
...
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