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
842d1d6e
Commit
842d1d6e
authored
Feb 06, 2023
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.5' into MVP1.5
parents
4c6502cc
15d6e033
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
182 additions
and
110 deletions
+182
-110
ErrorDetailVO.java
...yifu/cloud/plus/v1/yifu/common/core/vo/ErrorDetailVO.java
+13
-0
InsuranceHandleImportParam.java
...lus/v1/yifu/insurances/vo/InsuranceHandleImportParam.java
+6
-0
InsuranceInsuredParam.java
...oud/plus/v1/yifu/insurances/vo/InsuranceInsuredParam.java
+6
-0
InsuranceRegisterInvoiceNoParam.java
...1/yifu/insurances/vo/InsuranceRegisterInvoiceNoParam.java
+5
-0
InsuranceRegisterParam.java
...ud/plus/v1/yifu/insurances/vo/InsuranceRegisterParam.java
+6
-0
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+8
-0
TPaymentInfo.java
...m/yifu/cloud/plus/v1/yifu/social/entity/TPaymentInfo.java
+0
-1
TPaymentInfoServiceImpl.java
.../v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
+138
-109
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/vo/ErrorDetailVO.java
View file @
842d1d6e
...
...
@@ -50,6 +50,8 @@ public class ErrorDetailVO implements Serializable {
// 提示信息
private
String
message
;
// 颜色
private
String
color
=
"red"
;
// 所有行的结果,当第一行的allTrue=1时,需要反馈文件,否则直接提示成功
private
int
allTrue
=
0
;
...
...
@@ -70,4 +72,15 @@ public class ErrorDetailVO implements Serializable {
this
.
message
=
message
;
}
public
ErrorDetailVO
(
Integer
lineNum
,
int
result
,
String
empIdCard
,
String
socialHousehold
,
String
providentHousehold
,
String
empName
,
String
message
,
String
color
)
{
this
.
lineNum
=
lineNum
;
this
.
result
=
result
;
this
.
empIdCard
=
empIdCard
;
this
.
socialHousehold
=
socialHousehold
;
this
.
providentHousehold
=
providentHousehold
;
this
.
empName
=
empName
;
this
.
message
=
message
;
this
.
color
=
color
;
}
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceHandleImportParam.java
View file @
842d1d6e
...
...
@@ -78,4 +78,10 @@ public class InsuranceHandleImportParam implements Serializable {
*/
@Schema
(
description
=
"错误信息"
)
private
String
errorMessage
;
/**
* 错误标志 0 正确 1错误
*/
@Schema
(
description
=
"错误标志"
)
private
String
flag
;
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceInsuredParam.java
View file @
842d1d6e
...
...
@@ -94,6 +94,12 @@ public class InsuranceInsuredParam implements Serializable {
@Schema
(
description
=
"错误信息"
)
private
String
errorMessage
;
/**
* 错误标志 0 正确 1错误
*/
@Schema
(
description
=
"错误标志"
)
private
String
flag
;
/**
* 数据传递对象
*/
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceRegisterInvoiceNoParam.java
View file @
842d1d6e
...
...
@@ -64,6 +64,11 @@ public class InsuranceRegisterInvoiceNoParam implements Serializable {
@Schema
(
description
=
"发票号"
)
private
String
invoiceNo
;
/**
* 错误标志 0 正确 1错误
*/
@Schema
(
description
=
"错误标志"
)
private
String
flag
;
/**
* 错误信息
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceRegisterParam.java
View file @
842d1d6e
...
...
@@ -83,6 +83,12 @@ public class InsuranceRegisterParam implements Serializable {
@Schema
(
description
=
"错误信息"
)
private
String
errorMessage
;
/**
* 错误标志 0 正确 1错误
*/
@Schema
(
description
=
"错误标志"
)
private
String
flag
;
/**
* 数据传递对象
*/
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
842d1d6e
...
...
@@ -3387,6 +3387,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
outer:
for
(
int
i
=
0
;
i
<
distinctList
.
size
();
i
++)
{
InsuranceRegisterParam
param
=
distinctList
.
get
(
i
);
param
.
setFlag
(
CommonConstants
.
ONE_STRING
);
// 必填校验
if
(
StringUtils
.
isBlank
(
param
.
getEmpName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_NAME_NOT_EMPTY
);
...
...
@@ -3635,6 +3636,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
param
.
setErrorMessage
(
CommonConstants
.
RESULT_DATA_SUCESS
);
param
.
setFlag
(
CommonConstants
.
ZERO_STRING
);
//所有校验通过后设置查到的结果
param
.
setDetail
(
detail
);
}
...
...
@@ -3652,6 +3654,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
private
List
<
InsuranceRegisterInvoiceNoParam
>
registeredInvoiceNoCheck
(
List
<
InsuranceRegisterInvoiceNoParam
>
paramList
,
List
<
TInsuranceAreaRes
>
insuranceAreaResList
){
List
<
InsuranceRegisterInvoiceNoParam
>
collect
=
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
for
(
InsuranceRegisterInvoiceNoParam
param
:
collect
)
{
param
.
setFlag
(
CommonConstants
.
ONE_STRING
);
// 必填校验
if
(
StringUtils
.
isBlank
(
param
.
getEmpName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_NAME_NOT_EMPTY
);
...
...
@@ -3730,6 +3733,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
param
.
setErrorMessage
(
CommonConstants
.
RESULT_DATA_SUCESS
);
param
.
setFlag
(
CommonConstants
.
ZERO_STRING
);
//所有校验通过后设置查到的结果
param
.
setDetail
(
detail
);
}
...
...
@@ -3749,6 +3753,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
private
List
<
InsuranceInsuredParam
>
updateInsuranceInsuredCheck
(
List
<
InsuranceInsuredParam
>
paramList
,
List
<
TInsuranceAreaRes
>
insuranceAreaResList
){
List
<
InsuranceInsuredParam
>
collect
=
paramList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
for
(
InsuranceInsuredParam
param
:
collect
)
{
param
.
setFlag
(
CommonConstants
.
ONE_STRING
);
// 必填校验
if
(
StringUtils
.
isBlank
(
param
.
getEmpName
())){
param
.
setErrorMessage
(
InsurancesConstants
.
EMP_NAME_NOT_EMPTY
);
...
...
@@ -3869,6 +3874,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
param
.
setErrorMessage
(
CommonConstants
.
RESULT_DATA_SUCESS
);
param
.
setFlag
(
CommonConstants
.
ZERO_STRING
);
//所有校验通过后设置查到的结果
param
.
setDetail
(
detail
);
}
...
...
@@ -6124,6 +6130,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
for
(
int
i
=
0
;
i
<
distinctList
.
size
();
i
++)
{
InsuranceHandleImportParam
param
=
distinctList
.
get
(
i
);
//办理结果
param
.
setFlag
(
CommonConstants
.
ONE_STRING
);
String
handType
=
param
.
getHandType
();
if
(
StringUtils
.
isBlank
(
handType
)){
param
.
setErrorMessage
(
InsurancesConstants
.
HAND_RESULT_IS_EMPTY
);
...
...
@@ -6289,6 +6296,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
param
.
setId
(
detailId
);
param
.
setErrorMessage
(
CommonConstants
.
RESULT_DATA_SUCESS
);
param
.
setFlag
(
CommonConstants
.
ZERO_STRING
);
}
return
distinctList
;
}
...
...
yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/entity/TPaymentInfo.java
View file @
842d1d6e
...
...
@@ -48,7 +48,6 @@ public class TPaymentInfo extends BaseEntity {
/**
* 主键
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@Schema
(
description
=
"主键"
)
private
String
id
;
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
View file @
842d1d6e
...
...
@@ -72,6 +72,7 @@ import java.math.BigDecimal;
import
java.math.RoundingMode
;
import
java.net.URLEncoder
;
import
java.text.NumberFormat
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.ConcurrentHashMap
;
...
...
@@ -1427,8 +1428,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if
(
Common
.
isNotNull
(
redisUtil
.
get
(
importSuccessKey
)))
{
redisUtil
.
remove
(
importSuccessKey
);
}
//批量插入的集合
List
<
TPaymentInfo
>
batchInsertList
=
new
ArrayList
<>();
//养老插入的集合
ConcurrentHashMap
<
String
,
TPaymentInfo
>
batchYlInsertList
=
new
ConcurrentHashMap
<>();
//工伤插入的集合
ConcurrentHashMap
<
String
,
TPaymentInfo
>
batchGsInsertList
=
new
ConcurrentHashMap
<>();
//失业插入的集合
ConcurrentHashMap
<
String
,
TPaymentInfo
>
batchSyInsertList
=
new
ConcurrentHashMap
<>();
//医疗插入的集合
ConcurrentHashMap
<
String
,
TPaymentInfo
>
batchYyInsertList
=
new
ConcurrentHashMap
<>();
//获取所有项目信息
Map
<
String
,
TSettleDomainSelectVo
>
domainMap
=
this
.
getSelectVoMapById
();
//地区数据
...
...
@@ -1499,21 +1506,13 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
*/
private
void
saveData
()
{
log
.
info
(
"{}条数据,开始存储数据库!"
,
cachedDataList
.
size
());
importTPaymentSocialHeFei
(
cachedDataList
,
errorMessageList
,
user
,
type
,
rowNumber
,
pensionMoneyMap
,
importTPaymentSocialHeFei
(
cachedDataList
,
errorMessageList
,
type
,
rowNumber
,
pensionMoneyMap
,
bigMoneyMap
,
unEmpMoneyMap
,
injuryMoneyMap
,
medicalMoneyMap
,
sumNumKey
,
importSuccessKey
,
batchInsertList
,
areaMap
,
areaMap2
,
domainMap
);
,
batchGsInsertList
,
batchSyInsertList
,
batchYlInsertList
,
batchYyInsertList
,
areaMap
,
areaMap2
,
domainMap
);
log
.
info
(
"存储数据库成功!"
);
}
}).
sheet
().
doRead
();
//批量插入数据
if
(!
batchInsertList
.
isEmpty
())
{
this
.
saveBatch
(
batchInsertList
);
batchInsertList
.
clear
();
}
}
catch
(
Exception
e
)
{
log
.
error
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
,
e
);
return
R
.
failed
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
);
}
pensionMoneyMap
.
clear
();
bigMoneyMap
.
clear
();
unEmpMoneyMap
.
clear
();
...
...
@@ -1522,6 +1521,40 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
areaMap
.
clear
();
areaMap2
.
clear
();
domainMap
.
clear
();
//批量插入数据
//养老
List
<
TPaymentInfo
>
list
;
if
(!
batchYlInsertList
.
isEmpty
())
{
list
=
new
ArrayList
<>(
batchYlInsertList
.
values
());
this
.
saveBatch
(
list
);
batchYlInsertList
.
clear
();
list
.
clear
();
}
//工伤
if
(!
batchGsInsertList
.
isEmpty
())
{
list
=
new
ArrayList
<>(
batchGsInsertList
.
values
());
this
.
saveBatch
(
list
);
batchGsInsertList
.
clear
();
list
.
clear
();
}
//医疗
if
(!
batchYyInsertList
.
isEmpty
())
{
list
=
new
ArrayList
<>(
batchYyInsertList
.
values
());
this
.
saveBatch
(
list
);
batchYyInsertList
.
clear
();
list
.
clear
();
}
//失业
if
(!
batchSyInsertList
.
isEmpty
())
{
list
=
new
ArrayList
<>(
batchSyInsertList
.
values
());
this
.
saveBatch
(
list
);
batchSyInsertList
.
clear
();
list
.
clear
();
}
}
catch
(
Exception
e
)
{
log
.
error
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
,
e
);
return
R
.
failed
(
CommonConstants
.
IMPORT_DATA_ANALYSIS_ERROR
);
}
return
this
.
judgeAllMessage
(
errorMessageList
);
}
...
...
@@ -1777,16 +1810,23 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo
.
setSettleDomainCode
(
domain
.
getDepartNo
());
paymentInfo
.
setUnitId
(
domain
.
getCustomerId
());
paymentInfo
.
setUnitName
(
domain
.
getCustomerName
());
}
else
{
paymentInfo
.
setSettleDomainName
(
""
);
paymentInfo
.
setSettleDomainCode
(
""
);
paymentInfo
.
setUnitId
(
""
);
paymentInfo
.
setUnitName
(
""
);
}
paymentInfo
.
setFundProvince
(
tProvidentFund
.
getFundProvince
());
paymentInfo
.
setFundCity
(
tProvidentFund
.
getFundCity
());
paymentInfo
.
setFundTown
(
tProvidentFund
.
getFundTown
());
paymentInfo
.
setProvidentHousehold
(
tProvidentFund
.
getProvidentHouseholdName
());
}
if
(
Common
.
isNotNull
(
tProvidentFund
))
{
paymentInfo
.
setInauguralTeam
(
tProvidentFund
.
getInauguralTeam
()
);
paymentInfo
.
setInauguralTeam
(
Common
.
isNotNull
(
tProvidentFund
.
getInauguralTeam
())
?
tProvidentFund
.
getInauguralTeam
():
""
);
paymentInfo
.
setEmpNo
(
tProvidentFund
.
getEmpNo
());
}
else
{
paymentInfo
.
setInauguralTeam
(
""
);
paymentInfo
.
setEmpNo
(
""
);
}
paymentInfo
.
setProvidentPayMonth
(
infoVo
.
getProvidentPayMonth
());
if
(
null
!=
paymentInfo
.
getFundProvince
())
{
...
...
@@ -1808,6 +1848,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo
.
setProvidentPayAddr
(
paymentInfo
.
getProvidentPayAddr
()
+
CommonConstants
.
CENTER_SPLIT_LINE_STRING
+
temp
);
}
}
else
{
paymentInfo
.
setFundTown
(
""
);
}
paymentInfo
.
setProvidentCreateMonth
(
infoVo
.
getProvidentCreateMonth
());
...
...
@@ -1821,11 +1863,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo
.
setSumAll
(
paymentInfo
.
getProvidentSum
());
paymentInfo
.
setFundId
(
UUID
.
randomUUID
().
toString
());
batchInsertList
.
add
(
paymentInfo
);
//批量插入数据
if
(
batchInsertList
.
size
()
>=
100000
)
{
this
.
saveBatch
(
batchInsertList
);
batchInsertList
.
clear
();
}
paymentInfoMap
.
put
(
paymentInfo
.
getProvidentPayAddr
()
+
CommonConstants
.
DOWN_LINE_STRING
+
paymentInfo
.
getEmpIdcard
().
trim
()
...
...
@@ -1844,14 +1881,18 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
private
void
importTPaymentSocialHeFei
(
List
<
TPaymentHeFeiVo
>
list
,
List
<
ErrorDetailVO
>
errorMessageList
,
YifuUser
user
,
String
type
,
Integer
rowNumber
,
String
type
,
Integer
rowNumber
,
ConcurrentHashMap
<
String
,
BigDecimal
>
pensionMoneyMap
,
ConcurrentHashMap
<
String
,
BigDecimal
>
bigMoneyMap
,
ConcurrentHashMap
<
String
,
BigDecimal
>
unEmpMoneyMap
,
ConcurrentHashMap
<
String
,
BigDecimal
>
injuryMoneyMap
,
ConcurrentHashMap
<
String
,
BigDecimal
>
medicalMoneyMap
,
String
sumNumKey
,
String
importSuccessKey
,
List
<
TPaymentInfo
>
batchInsertList
,
HashMap
<
String
,
String
>
areaMap
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
batchGsInsertList
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
batchSyInsertList
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
batchYlInsertList
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
batchYyInsertList
,
HashMap
<
String
,
String
>
areaMap
,
HashMap
<
String
,
String
>
areaMap2
,
Map
<
String
,
TSettleDomainSelectVo
>
domainMap
)
{
// 将以下代码提取出来,使用paymentInfoMap提升性能,避免list多次循环查询数据库浪费性能
...
...
@@ -2006,8 +2047,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// -----------------------------生成paymentInfoMap本段结束--------------------------------
// -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List
<
TPaymentHeFeiVo
>
tempList
=
new
ArrayList
<>();
List
<
CompletableFuture
<
List
<
ErrorDetailVO
>>>
completableFutureList
=
new
ArrayList
<>();
// 创建一个数值格式化对象
...
...
@@ -2037,70 +2076,30 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
try
{
// 1.list.size()不足partSize,直接执行
if
(
list
.
size
()
<
partSize
)
{
if
(
list
.
size
()
<
100
)
{
CompletableFuture
<
List
<
ErrorDetailVO
>>
listCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialListThree
(
user
,
list
,
areaMap
,
areaMap2
,
->
executeImportSocialListThree
(
list
,
areaMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
paymentInfoBigMap
,
type
,
errorMessageList
,
pensionMoneyMap
,
bigMoneyMap
,
unEmpMoneyMap
,
injuryMoneyMap
,
medicalMoneyMap
,
batchInsertList
,
domainMap
),
unEmpMoneyMap
,
injuryMoneyMap
,
medicalMoneyMap
,
batchGsInsertList
,
batchSyInsertList
,
batchYlInsertList
,
batchYyInsertList
,
domainMap
),
yfSocialImportThreadPoolExecutor
);
completableFutureList
.
add
(
listCompletableFuture
);
}
// 2.list.size()大于partSize,循环分批执行
int
lastIdx
=
0
;
if
(
partSize
<=
list
.
size
())
{
// 处理第一个0位元素
final
List
<
TPaymentHeFeiVo
>
finalList
=
list
.
subList
(
0
,
1
);
CompletableFuture
<
List
<
ErrorDetailVO
>>
oneCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialListThree
(
user
,
finalList
,
areaMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
paymentInfoBigMap
,
type
,
errorMessageList
,
pensionMoneyMap
,
bigMoneyMap
,
unEmpMoneyMap
,
injuryMoneyMap
,
medicalMoneyMap
,
batchInsertList
,
domainMap
),
yfSocialImportThreadPoolExecutor
);
completableFutureList
.
add
(
oneCompletableFuture
);
lastIdx
=
1
;
for
(
int
i
=
1
;
i
<
list
.
size
();
i
++)
{
}
else
{
int
j
=
25
;
for
(
int
i
=
0
;
i
<
100
;
i
=
i
+
25
)
{
// partSize数量的list为一个执行单元
tempList
.
add
(
list
.
get
(
i
));
if
(
i
%
partSize
==
0
)
{
lastIdx
=
i
;
List
<
TPaymentHeFeiVo
>
finalTempList1
=
tempList
;
List
<
TPaymentHeFeiVo
>
finalTempList1
=
list
.
subList
(
i
,
i
+
j
);
CompletableFuture
<
List
<
ErrorDetailVO
>>
listCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialListThree
(
user
,
finalTempList1
->
executeImportSocialListThree
(
finalTempList1
,
areaMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
paymentInfoBigMap
,
type
,
errorMessageList
,
pensionMoneyMap
,
bigMoneyMap
,
unEmpMoneyMap
,
injuryMoneyMap
,
medicalMoneyMap
,
batchInsertList
,
domainMap
),
injuryMoneyMap
,
medicalMoneyMap
,
batchGsInsertList
,
batchSyInsertList
,
batchYlInsertList
,
batchYyInsertList
,
domainMap
),
yfSocialImportThreadPoolExecutor
);
completableFutureList
.
add
(
listCompletableFuture
);
tempList
=
new
ArrayList
<>();
}
}
}
// 3.第2种方式执行完后,有余数的情况下,执行3
if
(
lastIdx
!=
0
)
{
tempList
=
new
ArrayList
<>();
if
(
lastIdx
==
1
)
{
for
(
int
i
=
lastIdx
;
i
<
list
.
size
();
i
++)
{
tempList
.
add
(
list
.
get
(
i
));
}
}
else
{
for
(
int
i
=
lastIdx
+
1
;
i
<
list
.
size
();
i
++)
{
tempList
.
add
(
list
.
get
(
i
));
}
lastIdx
+=
1
;
}
List
<
TPaymentHeFeiVo
>
finalTempList
=
tempList
;
CompletableFuture
<
List
<
ErrorDetailVO
>>
listCompletableFuture
=
CompletableFuture
.
supplyAsync
(()
->
executeImportSocialListThree
(
user
,
finalTempList
,
areaMap
,
areaMap2
,
paymentInfoPensionMap
,
paymentInfoMedicalMap
,
paymentInfoUnEmpMap
,
paymentInfoInjuryMap
,
paymentInfoBigMap
,
type
,
errorMessageList
,
pensionMoneyMap
,
bigMoneyMap
,
unEmpMoneyMap
,
injuryMoneyMap
,
medicalMoneyMap
,
batchInsertList
,
domainMap
)
,
yfSocialImportThreadPoolExecutor
);
completableFutureList
.
add
(
listCompletableFuture
);
}
// 阻塞当前线程,等待所有的线程执行完毕
...
...
@@ -2114,15 +2113,24 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
while
(
computeFlag
);
paymentInfoBigMap
.
clear
();
paymentInfoInjuryMap
.
clear
();
paymentInfoUnEmpMap
.
clear
();
paymentInfoPensionMap
.
clear
();
paymentInfoMedicalMap
.
clear
();
}
catch
(
Exception
e
)
{
log
.
error
(
"社保缴费库数据批量导入异常:"
+
e
);
paymentInfoBigMap
.
clear
();
paymentInfoInjuryMap
.
clear
();
paymentInfoUnEmpMap
.
clear
();
paymentInfoPensionMap
.
clear
();
paymentInfoMedicalMap
.
clear
();
}
}
}
}
private
List
<
ErrorDetailVO
>
executeImportSocialListThree
(
YifuUser
user
,
List
<
TPaymentHeFeiVo
>
list
,
private
List
<
ErrorDetailVO
>
executeImportSocialListThree
(
List
<
TPaymentHeFeiVo
>
list
,
HashMap
<
String
,
String
>
areaMap
,
HashMap
<
String
,
String
>
areaMap2
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
paymentInfoPensionMap
,
...
...
@@ -2136,7 +2144,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
ConcurrentHashMap
<
String
,
BigDecimal
>
unEmpMoneyMap
,
ConcurrentHashMap
<
String
,
BigDecimal
>
injuryMoneyMap
,
ConcurrentHashMap
<
String
,
BigDecimal
>
medicalMoneyMap
,
List
<
TPaymentInfo
>
batchInsertList
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
batchGsInsertList
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
batchSyInsertList
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
batchYlInsertList
,
ConcurrentHashMap
<
String
,
TPaymentInfo
>
batchYyInsertList
,
Map
<
String
,
TSettleDomainSelectVo
>
domainMap
)
{
if
(
Common
.
isNotNull
(
list
))
{
TPaymentInfo
payExists
;
...
...
@@ -2154,8 +2165,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if
(
Common
.
isNotNull
(
socialInfoList
))
{
for
(
TSocialFundInfo
tSocialInfo1
:
socialInfoList
)
{
socialMap
.
put
(
tSocialInfo1
.
getEmpIdcard
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tSocialInfo1
.
getSocialCity
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tSocialInfo1
.
getSocialProvince
()
+
CommonConstants
.
DOWN_LINE_STRING
+
tSocialInfo1
.
getSocialCity
()
+
CommonConstants
.
DOWN_LINE_STRING
+
(
null
==
tSocialInfo1
.
getSocialTown
()
?
"null"
:
tSocialInfo1
.
getSocialTown
()),
tSocialInfo1
);
}
...
...
@@ -2216,6 +2227,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
"的社保数据(请查验社保缴纳地)"
));
continue
;
}
}
else
{
tSocialInfo
=
null
;
}
//判断是否存在养老缴费数据
...
...
@@ -2225,7 +2238,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if
(
pensionMoneyMap
.
get
(
exitMoney
)
!=
null
&&
BigDecimalUtils
.
safeMultiply
(
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMoney
()),
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitMoney
())),
pensionMoneyMap
.
get
(
exitMoney
)).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
errorMessageList
.
add
(
new
ErrorDetailVO
(
infoVo
.
getRowIndex
(),
CommonConstants
.
ZERO_INT
,
infoVo
.
getEmpIdcard
(),
""
,
""
,
SocialConstants
.
ERROR_TEMPLATE
+
errorMessageList
.
add
(
new
ErrorDetailVO
(
infoVo
.
getRowIndex
(),
CommonConstants
.
ZERO_INT
,
infoVo
.
getEmpIdcard
(),
""
,
""
,
infoVo
.
getEmpName
(),
SocialConstants
.
ERROR_TEMPLATE
+
"的养老缴费数据"
));
continue
;
}
else
{
...
...
@@ -2262,7 +2275,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if
(
unEmpMoneyMap
.
get
(
exitMoney
)
!=
null
&&
BigDecimalUtils
.
safeMultiply
(
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitMoney
()),
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMoney
())),
unEmpMoneyMap
.
get
(
exitMoney
)).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
errorMessageList
.
add
(
new
ErrorDetailVO
(
infoVo
.
getRowIndex
(),
CommonConstants
.
ZERO_INT
,
infoVo
.
getEmpIdcard
(),
""
,
""
,
SocialConstants
.
ERROR_TEMPLATE
+
errorMessageList
.
add
(
new
ErrorDetailVO
(
infoVo
.
getRowIndex
(),
CommonConstants
.
ZERO_INT
,
infoVo
.
getEmpIdcard
(),
""
,
""
,
infoVo
.
getEmpName
(),
SocialConstants
.
ERROR_TEMPLATE
+
"的失业缴费数据"
));
continue
;
}
else
{
...
...
@@ -2300,7 +2313,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if
(
medicalMoneyMap
.
get
(
exitMoney
)
!=
null
&&
BigDecimalUtils
.
safeMultiply
(
BigDecimalUtils
.
safeAdd
(
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitMedicalMoney
()),
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMedicalMoney
())),
medicalMoneyMap
.
get
(
exitMoney
)).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
errorMessageList
.
add
(
new
ErrorDetailVO
(
infoVo
.
getRowIndex
(),
CommonConstants
.
ZERO_INT
,
infoVo
.
getEmpIdcard
(),
""
,
""
,
SocialConstants
.
ERROR_TEMPLATE
+
errorMessageList
.
add
(
new
ErrorDetailVO
(
infoVo
.
getRowIndex
(),
CommonConstants
.
ZERO_INT
,
infoVo
.
getEmpIdcard
(),
""
,
""
,
infoVo
.
getEmpName
(),
SocialConstants
.
ERROR_TEMPLATE
+
"的医保缴费数据"
));
continue
;
}
else
{
...
...
@@ -2340,7 +2353,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalMoney
()),
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitMoney
())),
injuryMoneyMap
.
get
(
exitMoney
)).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
errorMessageList
.
add
(
new
ErrorDetailVO
(
infoVo
.
getRowIndex
(),
CommonConstants
.
ZERO_INT
,
infoVo
.
getEmpIdcard
(),
""
,
""
,
SocialConstants
.
ERROR_TEMPLATE
+
errorMessageList
.
add
(
new
ErrorDetailVO
(
infoVo
.
getRowIndex
(),
CommonConstants
.
ZERO_INT
,
infoVo
.
getEmpIdcard
(),
""
,
""
,
infoVo
.
getEmpName
(),
SocialConstants
.
ERROR_TEMPLATE
+
"的工伤缴费数据"
));
continue
;
}
else
{
...
...
@@ -2379,7 +2392,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getUnitBigailmentMoney
()),
BigDecimalUtils
.
isNullToZero
(
infoVo
.
getPersonalBigailmentMoney
())),
bigMoneyMap
.
get
(
exitMoney
)).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
errorMessageList
.
add
(
new
ErrorDetailVO
(
infoVo
.
getRowIndex
(),
CommonConstants
.
ZERO_INT
,
infoVo
.
getEmpIdcard
(),
""
,
""
,
SocialConstants
.
ERROR_TEMPLATE
+
errorMessageList
.
add
(
new
ErrorDetailVO
(
infoVo
.
getRowIndex
(),
CommonConstants
.
ZERO_INT
,
infoVo
.
getEmpIdcard
(),
""
,
""
,
infoVo
.
getEmpName
(),
SocialConstants
.
ERROR_TEMPLATE
+
"的医疗救助金缴费数据"
));
continue
;
}
else
{
...
...
@@ -2424,10 +2437,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists
.
setEmpIdcard
(
socialInfo
.
getEmpIdcard
());
payExists
.
setEmpName
(
socialInfo
.
getEmpName
());
payExists
.
setSettleDomainId
(
socialInfo
.
getSettleDomain
());
payExists
.
setSettleDomain
Name
(
socialInfo
.
getSettleDomainName
()
);
payExists
.
set
SettleDomainCode
(
socialInfo
.
getSettleDomainCode
()
);
payExists
.
set
UnitId
(
socialInfo
.
getUnitId
()
);
payExists
.
setUnitName
(
socialInfo
.
getUnitName
()
);
payExists
.
setSettleDomain
Code
(
Common
.
isNotNull
(
socialInfo
.
getSettleDomainCode
())
?
socialInfo
.
getSettleDomainCode
():
""
);
payExists
.
set
UnitId
(
Common
.
isNotNull
(
socialInfo
.
getUnitId
())
?
socialInfo
.
getUnitId
():
""
);
payExists
.
set
SettleDomainName
(
Common
.
isNotNull
(
socialInfo
.
getSettleDomainName
())
?
socialInfo
.
getSettleDomainName
():
""
);
payExists
.
setUnitName
(
Common
.
isNotNull
(
socialInfo
.
getUnitName
())
?
socialInfo
.
getUnitName
():
""
);
payExists
.
setSocialProvince
(
socialInfo
.
getSocialProvince
());
payExists
.
setSocialCity
(
socialInfo
.
getSocialCity
());
payExists
.
setSocialTown
(
socialInfo
.
getSocialTown
());
...
...
@@ -2447,6 +2460,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists
.
setSettleDomainCode
(
domain
.
getDepartNo
());
payExists
.
setUnitId
(
domain
.
getCustomerId
());
payExists
.
setUnitName
(
domain
.
getCustomerName
());
}
else
{
payExists
.
setSettleDomainName
(
""
);
payExists
.
setSettleDomainCode
(
""
);
payExists
.
setUnitId
(
""
);
payExists
.
setUnitName
(
""
);
}
payExists
.
setSocialProvince
(
tSocialInfo
.
getSocialProvince
());
payExists
.
setSocialCity
(
tSocialInfo
.
getSocialCity
());
...
...
@@ -2454,8 +2472,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists
.
setSocialHousehold
(
tSocialInfo
.
getSocialHouseholdName
());
}
if
(
Common
.
isNotNull
(
tSocialInfo
))
{
payExists
.
setInauguralTeam
(
tSocialInfo
.
getInauguralTeam
()
);
payExists
.
setInauguralTeam
(
Common
.
isNotNull
(
tSocialInfo
.
getInauguralTeam
())
?
tSocialInfo
.
getInauguralTeam
():
""
);
payExists
.
setEmpNo
(
tSocialInfo
.
getEmpNo
());
}
else
{
payExists
.
setInauguralTeam
(
""
);
payExists
.
setEmpNo
(
""
);
}
payExists
.
setSocialPayMonth
(
infoVo
.
getSocialPayMonth
());
...
...
@@ -2476,9 +2497,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if
(
Common
.
isNotNull
(
temp
))
{
payExists
.
setSocialPayAddr
(
payExists
.
getSocialPayAddr
()
+
CommonConstants
.
CENTER_SPLIT_LINE_STRING
+
temp
);
}
}
else
{
payExists
.
setSocialTown
(
""
);
}
payExists
.
setSocialSecurityNo
(
infoVo
.
getSocialSecurityNo
());
payExists
.
setSocialCreateMonth
(
infoVo
.
getSocialCreateMonth
());
payExists
.
setSumAll
(
payExists
.
getSocialSum
());
payExists
.
setCreateTime
(
LocalDateTime
.
now
());
payExists
.
setSocialId
(
UUID
.
randomUUID
().
toString
());
if
(
PaymentConstants
.
PENSION_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
payExists
.
setUnitPensionMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setUnitPensionSet
(
infoVo
.
getUnitSet
());
...
...
@@ -2487,6 +2513,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
,
payExists
.
getUnitSocialSum
()));
payExists
.
setSocialSecurityPersonalSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getPersonalPensionMoney
()
,
payExists
.
getSocialSecurityPersonalSum
()));
payExists
.
setSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitSocialSum
(),
payExists
.
getSocialSecurityPersonalSum
()));
batchYlInsertList
.
put
(
UUID
.
randomUUID
().
toString
(),
payExists
);
}
if
(
PaymentConstants
.
UNEMPLOYEEMENT_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
payExists
.
setUnitUnemploymentMoney
(
infoVo
.
getUnitMoney
());
...
...
@@ -2496,12 +2524,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
,
payExists
.
getUnitSocialSum
()));
payExists
.
setSocialSecurityPersonalSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getPersonalUnemploymentMoney
()
,
payExists
.
getSocialSecurityPersonalSum
()));
payExists
.
setSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitSocialSum
(),
payExists
.
getSocialSecurityPersonalSum
()));
batchSyInsertList
.
put
(
UUID
.
randomUUID
().
toString
(),
payExists
);
}
if
(
PaymentConstants
.
INJURY_RISK
.
equals
(
infoVo
.
getRiskType
()))
{
payExists
.
setUnitInjuryMoney
(
infoVo
.
getUnitMoney
());
payExists
.
setUnitInjurySet
(
infoVo
.
getUnitSet
());
payExists
.
setUnitSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitInjuryMoney
()
,
payExists
.
getUnitSocialSum
()));
payExists
.
setSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitSocialSum
(),
payExists
.
getSocialSecurityPersonalSum
()));
batchGsInsertList
.
put
(
UUID
.
randomUUID
().
toString
(),
payExists
);
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
type
))
{
payExists
.
setUnitMedicalMoney
(
infoVo
.
getUnitMedicalMoney
());
...
...
@@ -2517,18 +2549,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists
.
setSocialSecurityPersonalSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getPersonalMedicalMoney
()
,
payExists
.
getPersonalBigmailmentMoney
()
,
payExists
.
getSocialSecurityPersonalSum
()));
}
payExists
.
setSocialSum
(
BigDecimalUtils
.
safeAdd
(
payExists
.
getUnitSocialSum
(),
payExists
.
getSocialSecurityPersonalSum
()));
payExists
.
setSumAll
(
payExists
.
getSocialSum
());
payExists
.
setCreateBy
(
user
.
getId
());
payExists
.
setCreateName
(
user
.
getNickname
());
payExists
.
setSocialId
(
UUID
.
randomUUID
().
toString
());
batchInsertList
.
add
(
payExists
);
//批量插入数据
if
(
batchInsertList
.
size
()
>=
50000
)
{
this
.
saveBatch
(
batchInsertList
);
batchInsertList
.
clear
();
batchYyInsertList
.
put
(
UUID
.
randomUUID
().
toString
(),
payExists
);
}
errorMessageList
.
add
(
new
ErrorDetailVO
(
infoVo
.
getRowIndex
(),
CommonConstants
.
ONE_INT
,
infoVo
.
getEmpIdcard
(),
payExists
.
getSocialHousehold
(),
payExists
.
getProvidentHousehold
(),
infoVo
.
getEmpName
(),
"对应员工身份证"
+
infoVo
.
getEmpIdcard
()
+
CommonConstants
.
SAVE_SUCCESS
,
CommonConstants
.
GREEN
));
continue
;
}
}
return
errorMessageList
;
...
...
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