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
1898706a
Commit
1898706a
authored
Jul 08, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huyc 项目档案代码提交
parent
10327474
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
62 deletions
+8
-62
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+8
-62
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
1898706a
...
...
@@ -219,21 +219,17 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
public
R
removeProjectInfo
(
String
id
)
{
TEmployeeProject
tEmployeeProject
=
this
.
getById
(
id
);
List
<
TEmployeeInfo
>
updList
=
new
ArrayList
<>();
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
//删除项目档案
this
.
removeById
(
id
);
TEmployeeInfo
tEmployeeInfoCop
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeInfo
.
getId
());
List
<
String
>
idList
=
new
ArrayList
<>();
idList
.
add
(
id
);
//从剩下的项目档案中查找员工类型并更新
setEmpNature
(
tEmployeeProject
.
getEmpIdcard
(),
tEmployeeInfo
,
idList
);
tEmployeeInfoMapper
.
updateById
(
tEmployeeInfo
);
//更新操作日志
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
0
],
tEmployeeInfoCop
.
getId
(),
""
,
tEmployeeInfoCop
,
tEmployeeInfo
);
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
updList
.
add
(
tEmployeeInfo
);
doJointTask
.
doUpdateEmployeeInfo
(
updList
);
}
return
R
.
ok
();
}
...
...
@@ -403,7 +399,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
EmployeeXProjectVO
excel
=
excelVOList
.
get
(
i
);
List
<
TEmployeeProject
>
idList
=
new
ArrayList
<>();
//根据身份证和项目编码获取项目档案
TEmployeeProject
tEmployeeProject
=
this
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
...
...
@@ -415,7 +410,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
tEmployeeProject
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getSocialStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getFundStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
])
{
idList
.
add
(
tEmployeeProject
);
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
)));
}
else
{
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
...
...
@@ -430,32 +424,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
newOldProject
.
setNewProjectEmployee
(
tEmployeeProject
);
updateProjectList
.
add
(
newOldProject
);
//查询该人员所有的项目档案
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
if
(
Common
.
isNotNull
(
list
))
{
for
(
TEmployeeProject
tEmployeeProject1
:
list
)
{
if
(!
excelVOList
.
stream
().
anyMatch
(
e
->
saveCheck
(
e
,
tEmployeeProject1
)))
{
idList
.
add
(
tEmployeeProject1
);
}
}
}
TEmployeeInfo
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
List
<
String
>
projectIdList
=
idList
.
stream
().
map
(
TEmployeeProject:
:
getId
).
collect
(
Collectors
.
toList
());
//从剩下的项目档案中查找员工类型并更新
setEmpNature
(
tEmployeeProject
.
getEmpIdcard
(),
tEmployeeInfo
,
projectIdList
);
updList
.
add
(
tEmployeeInfo
);
newOld
=
new
EmployeeNewOldVO
();
newOld
.
setOldEmployee
(
tEmployeeInfoOld
);
newOld
.
setNewEmployee
(
tEmployeeInfo
);
updateList
.
add
(
newOld
);
}
}
else
{
idList
.
add
(
tEmployeeProject
);
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_PERSON_SEARCH_EXIT
)));
}
}
...
...
@@ -464,7 +438,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
else
{
//更新项目档案
if
(
updProjectList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
this
.
updateBatchById
(
updProjectList
);
List
<
TEmployeeInfo
>
updEmpInfoList
=
updList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
doJointTask
.
doUpdateEmployeeInfo
(
updEmpInfoList
);
}
//更新人员档案
if
(
updList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
...
...
@@ -1033,11 +1008,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
num
==
CommonConstants
.
ONE_INT
)
{
tEmployeeInfo
.
setProjectNum
(
tEmployeeInfo
.
getProjectNum
().
intValue
()
+
CommonConstants
.
ONE_INT
);
}
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
}
else
if
(
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
())
&&
!
CommonConstants
.
ZERO_STRING
.
equals
(
empNature
))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
}
updateList
.
add
(
tEmployeeInfo
);
// 记录变更日志
TEmployeeInfo
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeInfo
.
getId
());
...
...
@@ -1139,30 +1109,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return
str
;
}
//从剩下的项目档案中查找员工类型
public
void
setEmpNature
(
String
empIdcard
,
TEmployeeInfo
tEmployeeInfo
,
List
<
String
>
idlist
)
{
if
(
Common
.
isNotNull
(
idlist
))
{
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
in
(
TEmployeeProject:
:
getId
,
idlist
)
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
empIdcard
)
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
if
(
Common
.
isNotNull
(
list
))
{
for
(
TEmployeeProject
t
:
list
)
{
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
t
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ZERO_STRING
);
break
;
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
t
.
getEmpNatrue
())
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
tEmployeeInfo
.
getEmpNatrue
()))
{
tEmployeeInfo
.
setEmpNatrue
(
CommonConstants
.
ONE_STRING
);
break
;
}
}
}
}
}
public
boolean
saveCheck
(
EmployeeXProjectVO
employeeXProjectVO
,
TEmployeeProject
tEmployeeProject
)
{
if
(
employeeXProjectVO
.
getDeptNo
().
equals
(
tEmployeeProject
.
getDeptNo
())
&&
employeeXProjectVO
.
getEmpIdcard
().
equals
(
tEmployeeProject
.
getEmpIdcard
()))
{
...
...
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