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
551fdbd9
Commit
551fdbd9
authored
Jun 27, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huyc 项目档案代码提交
parent
9c2423c7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
2 deletions
+42
-2
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+42
-2
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
551fdbd9
...
...
@@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.pig4cloud.plugin.excel.vo.ErrorMessage
;
import
com.yifu.cloud.plus.v1.check.entity.TCheckIdCard
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
...
...
@@ -39,11 +40,15 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO
;
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
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.support.SimpleValueWrapper
;
...
...
@@ -66,6 +71,7 @@ import java.util.stream.Collectors;
*/
@Service
@RequiredArgsConstructor
@EnableConfigurationProperties
(
DaprCheckProperties
.
class
)
public
class
TEmployeeProjectServiceImpl
extends
ServiceImpl
<
TEmployeeProjectMapper
,
TEmployeeProject
>
implements
TEmployeeProjectService
{
private
final
TEmployeeLogService
tEmployeeLogService
;
...
...
@@ -76,6 +82,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
private
final
TCustomerInfoMapper
tCustomerInfoMapper
;
private
final
DaprCheckProperties
daprCheckProperties
;
// 缓存信息
private
final
CacheManager
cacheManager
;
...
...
@@ -216,6 +224,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
List
<
TEmployeeInfo
>
updateList
=
new
ArrayList
();
List
<
TEmployeeProject
>
proInsList
=
new
ArrayList
();
List
<
TEmployeeProject
>
proupdateList
=
new
ArrayList
();
// 获取身份证、手机号列表,批量查询档案
Map
<
String
,
Integer
>
idCardMap
=
new
HashMap
<>();
String
idCard
;
// 执行数据插入操作 组装 PostDto
for
(
int
i
=
0
;
i
<
excelVOList
.
size
();
i
++)
{
EmployeeProjectVO
excel
=
excelVOList
.
get
(
i
);
...
...
@@ -226,6 +239,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
continue
;
}
idCard
=
excel
.
getEmpIdcard
();
if
(
idCardMap
.
get
(
idCard
)
!=
null
)
{
errorMsgMap
.
put
((
i
+
2L
),
new
ErrorMessage
(
"第"
+
(
i
+
2
)
+
"行身份证号与第"
+
idCardMap
.
get
(
idCard
)
+
"行重复!"
));
}
else
{
idCardMap
.
put
(
idCard
,
i
+
2
);
}
//根据身份证获取人员档案
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
...
...
@@ -239,8 +259,28 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//不存在复档或复项的情况
//档案无(在档人员、离职库皆无),项目无
if
(
Common
.
isEmpty
(
tEmployeeInfo
)
&&
Common
.
isEmpty
(
tEmployeeProject
))
{
// 校验身份证实名
TCheckIdCard
checkIdCard
=
new
TCheckIdCard
();
checkIdCard
.
setName
(
excel
.
getEmpName
());
checkIdCard
.
setIdCard
(
excel
.
getEmpIdcard
());
List
<
TCheckIdCard
>
checkList
=
new
ArrayList
<>();
checkList
.
add
(
checkIdCard
);
R
<
List
<
TCheckIdCard
>>
checkListR
=
HttpDaprUtil
.
invokeMethodPost
(
daprCheckProperties
.
getAppUrl
(),
daprCheckProperties
.
getAppId
()
,
"/tcheckidcard/inner/checkIdCard"
,
checkList
,
TCheckIdCard
.
class
,
SecurityConstants
.
FROM_IN
);
Boolean
isSave
=
false
;
if
(
checkListR
!=
null
&&
checkListR
.
getData
()
!=
null
)
{
for
(
TCheckIdCard
check
:
checkListR
.
getData
())
{
if
(
check
.
getIsTrue
()
==
CommonConstants
.
ZERO_INT
)
{
errorMsg
.
add
(
check
.
getReason
());
isSave
=
true
;
break
;
}
}
}
if
(!
isSave
)
{
insertExcelPost
(
excel
,
insertList
);
insertExcelPro
(
excel
,
proInsList
);
}
//档案有(在档人员),项目无
}
else
if
(
Common
.
isNotNull
(
tEmployeeInfo
)
&&
Common
.
isEmpty
(
tEmployeeProject
)
&&
CommonConstants
.
dingleDigitIntArray
[
0
]
==
tEmployeeInfo
.
getFileStatus
())
{
...
...
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