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
da52f6fe
Commit
da52f6fe
authored
Jul 07, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huyc 项目档案代码提交
parent
070e0679
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
59 deletions
+34
-59
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+34
-59
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
da52f6fe
...
@@ -324,91 +324,66 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -324,91 +324,66 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 新老项目档案List
// 新老项目档案List
List
<
EmployeeProjectNewOldVO
>
updateProjectList
=
new
ArrayList
<>();
List
<
EmployeeProjectNewOldVO
>
updateProjectList
=
new
ArrayList
<>();
List
<
EmployeeXProjectVO
>
selectList
=
excelVOList
.
stream
().
filter
(
e
->
e
.
getIsLeaveEmployee
().
equals
(
CommonConstants
.
IS_TRUE
)).
collect
(
Collectors
.
toList
());
List
<
TEmployeeProject
>
checkList
=
new
ArrayList
<>();
// 执行数据插入操作 组装 PostDto
// 执行数据插入操作 组装 PostDto
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
EmployeeXProjectVO
excel
=
excelVOList
.
get
(
i
);
EmployeeXProjectVO
excel
=
excelVOList
.
get
(
i
);
List
<
TEmployeeProject
>
idList
=
new
ArrayList
<>();
//根据身份证和项目编码获取项目档案
//根据身份证和项目编码获取项目档案
TEmployeeProject
tEmployeeProject
=
this
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
TEmployeeProject
tEmployeeProject
=
this
.
getOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeptNo
,
excel
.
getDeptNo
())
.
eq
(
TEmployeeProject:
:
getDeptNo
,
excel
.
getDeptNo
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
STATUS_NORMAL
));
TEmployeeInfo
tEmployeeInfoOld
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
if
(
Common
.
isNotNull
(
tEmployeeProject
))
{
if
(
Common
.
isNotNull
(
tEmployeeProject
))
{
if
(
tEmployeeProject
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getSocialStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
if
(
tEmployeeProject
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getSocialStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeProject
.
getFundStatus
()
!=
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
)));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
ARCHIVES_PROJECT_CHANGE_NOT_EXIST
)));
}
else
if
(
CommonConstants
.
IS_TRUE
.
equals
(
excel
.
getIsLeaveEmployee
()))
{
}
else
{
TEmployeeProject
tEmployeeProjectOld
=
this
.
getById
(
tEmployeeProject
.
getId
());
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeProject
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeProject
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeProject
.
setLeaveTime
(
LocalDateTime
.
now
());
updProjectList
.
add
(
tEmployeeProject
);
//查询该人员其他的项目档案
newOldProject
=
new
EmployeeProjectNewOldVO
();
newOldProject
.
setOldProjectEmployee
(
tEmployeeProjectOld
);
newOldProject
.
setNewProjectEmployee
(
tEmployeeProject
);
updateProjectList
.
add
(
newOldProject
);
//查询该人员所有的项目档案
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
ne
(
TEmployeeProject:
:
getDeptNo
,
tEmployeeProject
.
getDeptNo
())
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
tEmployeeProject
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectById
(
tEmployeeProject
.
getEmpId
());
if
(
Common
.
isNotNull
(
list
))
{
if
(
Common
.
isNotNull
(
list
))
{
boolean
flag
=
false
;
for
(
TEmployeeProject
tEmployeeProject1
:
list
)
{
for
(
TEmployeeProject
tEmployeeProject1
:
list
)
{
if
(!
selectList
.
stream
().
anyMatch
(
e
->
saveCheck
(
e
,
tEmployeeProject1
)))
{
if
(!
excelVOList
.
stream
().
anyMatch
(
e
->
saveCheck
(
e
,
tEmployeeProject1
)))
{
checkList
.
add
(
tEmployeeProject1
);
idList
.
add
(
tEmployeeProject1
);
flag
=
true
;
}
}
if
(
flag
)
{
boolean
checkUpd
=
false
;
for
(
TEmployeeProject
tEmployeeCheck
:
checkList
)
{
if
(
tEmployeeCheck
.
getInsuranceStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeCheck
.
getSocialStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
]
||
tEmployeeCheck
.
getFundStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
0
])
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
QT_PROJECT_CHANGE_NOT_EXIST
)));
checkUpd
=
true
;
break
;
}
}
}
}
if
(!
checkUpd
)
{
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeInfo
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeInfo
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeInfo
.
setLeaveTime
(
LocalDateTime
.
now
());
List
<
String
>
idList
=
list
.
stream
().
map
(
TEmployeeProject:
:
getId
).
collect
(
Collectors
.
toList
());
//从剩下的项目档案中查找员工类型并更新
setEmpNature
(
tEmployeeProject
.
getEmpIdcard
(),
tEmployeeInfo
,
idList
);
updList
.
add
(
tEmployeeInfo
);
}
}
}
}
}
else
{
}
else
{
tEmployeeInfo
.
setFileStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
idList
.
add
(
tEmployeeProject
);
tEmployeeInfo
.
setLeaveReason
(
excel
.
getLeaveReason
());
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_PERSON_SEARCH_EXIT
)));
tEmployeeInfo
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeInfo
.
setLeaveTime
(
LocalDateTime
.
now
());
updList
.
add
(
tEmployeeInfo
);
}
}
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
=
new
EmployeeNewOldVO
();
newOld
.
setOldEmployee
(
tEmployeeInfoOld
);
newOld
.
setOldEmployee
(
tEmployeeInfoOld
);
newOld
.
setNewEmployee
(
tEmployeeInfo
);
newOld
.
setNewEmployee
(
tEmployeeInfo
);
updateList
.
add
(
newOld
);
updateList
.
add
(
newOld
);
}
}
tEmployeeProject
.
setProjectStatus
(
CommonConstants
.
dingleDigitIntArray
[
1
]);
tEmployeeProject
.
setLeaveReason
(
excel
.
getLeaveReason
());
tEmployeeProject
.
setLeaveRemark
(
excel
.
getLeaveRemark
());
tEmployeeProject
.
setLeaveTime
(
LocalDateTime
.
now
());
updProjectList
.
add
(
tEmployeeProject
);
newOldProject
=
new
EmployeeProjectNewOldVO
();
newOldProject
.
setOldProjectEmployee
(
tEmployeeProjectOld
);
newOldProject
.
setNewProjectEmployee
(
tEmployeeProject
);
updateProjectList
.
add
(
newOldProject
);
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
MsgUtils
.
getMessage
(
ErrorCodes
.
PROJECT_PERSON_SEARCH_EXIT
)));
}
}
if
(
errorMessageList
.
size
()
>
CommonConstants
.
ZERO_INT
)
{
if
(
errorMessageList
.
size
()
>
CommonConstants
.
ZERO_INT
)
{
return
R
.
failed
(
errorMessageList
);
return
R
.
failed
(
errorMessageList
);
}
else
{
}
else
{
...
@@ -433,7 +408,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -433,7 +408,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(
updateProjectList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
if
(
updateProjectList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
for
(
EmployeeProjectNewOldVO
newOldVO
:
updateProjectList
)
{
for
(
EmployeeProjectNewOldVO
newOldVO
:
updateProjectList
)
{
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
]
tEmployeeLogService
.
saveModificationRecord
(
CommonConstants
.
dingleDigitIntArray
[
1
]
,
""
,
newOldVO
.
getNewProjectEmployee
().
getId
()
,
""
,
newOldVO
.
getNewProjectEmployee
().
getId
()
,
newOldVO
.
getOldProjectEmployee
(),
newOldVO
.
getNewProjectEmployee
());
,
newOldVO
.
getOldProjectEmployee
(),
newOldVO
.
getNewProjectEmployee
());
}
}
}
}
...
@@ -1075,7 +1050,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -1075,7 +1050,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//从剩下的项目档案中查找员工类型
//从剩下的项目档案中查找员工类型
public
void
setEmpNature
(
String
empIdcard
,
TEmployeeInfo
tEmployeeInfo
,
List
<
String
>
idlist
)
{
public
void
setEmpNature
(
String
empIdcard
,
TEmployeeInfo
tEmployeeInfo
,
List
<
String
>
idlist
)
{
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
List
<
TEmployeeProject
>
list
=
this
.
list
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
notI
n
(
TEmployeeProject:
:
getId
,
idlist
)
.
i
n
(
TEmployeeProject:
:
getId
,
idlist
)
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
empIdcard
)
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
empIdcard
)
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
));
...
...
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