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
7e7beacc
Commit
7e7beacc
authored
Nov 11, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实缴费用导入接口修改
parent
ab1323d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
17 deletions
+27
-17
TPaymentInfoServiceImpl.java
.../v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
+27
-17
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
View file @
7e7beacc
...
...
@@ -416,6 +416,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override
public
R
<
List
<
ErrorMessage
>>
importSocialDiy
(
InputStream
inputStream
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
String
sumNumKey
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
"sum_key"
;
if
(
Common
.
isNotNull
((
String
)
redisUtil
.
get
(
sumNumKey
)))
{
redisUtil
.
remove
(
sumNumKey
);
}
String
importSuccessKey
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_WAIT_EXPORT
;
if
(
Common
.
isNotNull
((
String
)
redisUtil
.
get
(
importSuccessKey
)))
{
redisUtil
.
remove
(
importSuccessKey
);
}
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
//养老
ConcurrentHashMap
<
String
,
BigDecimal
>
pensionMoneyMap
=
new
ConcurrentHashMap
<>();
...
...
@@ -479,8 +487,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
*/
private
void
saveData
()
{
log
.
info
(
"{}条数据,开始存储数据库!"
,
cachedDataList
.
size
());
importTPaymentSocialInfo
(
cachedDataList
,
errorMessageList
,
user
,
rowNumber
,
pensionMoneyMap
,
bigMoneyMap
,
unEmpMoneyMap
,
birMoneyMap
,
injuryMoneyMap
,
medicalMoneyMap
,
accrualMoneyMap
);
importTPaymentSocialInfo
(
cachedDataList
,
sumNumKey
,
importSuccessKey
,
errorMessageList
,
user
,
rowNumber
,
pensionMoneyMap
,
bigMoneyMap
,
unEmpMoneyMap
,
birMoneyMap
,
injuryMoneyMap
,
medicalMoneyMap
,
accrualMoneyMap
);
log
.
info
(
"存储数据库成功!"
);
}
}).
sheet
().
doRead
();
...
...
@@ -498,7 +507,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return
R
.
ok
(
errorMessageList
);
}
private
void
importTPaymentSocialInfo
(
List
<
TPaymentInfoVo
>
list
,
List
<
ErrorMessage
>
errorMessageList
,
private
void
importTPaymentSocialInfo
(
List
<
TPaymentInfoVo
>
list
,
String
sumNumKey
,
String
importSuccessKey
,
List
<
ErrorMessage
>
errorMessageList
,
YifuUser
user
,
Integer
rowNumber
,
ConcurrentHashMap
<
String
,
BigDecimal
>
pensionMoneyMap
,
ConcurrentHashMap
<
String
,
BigDecimal
>
bigMoneyMap
,
...
...
@@ -726,12 +736,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
// -----------------------------生成paymentInfoMap本段结束--------------------------------
// -----------------------------生成paymentInfoMap本段结束--------------------------------
// -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List
<
TPaymentInfoVo
>
tempList
=
new
ArrayList
<>();
// -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List
<
TPaymentInfoVo
>
tempList
=
new
ArrayList
<>();
String
importSuccessKey
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_WAIT_EXPORT
;
List
<
CompletableFuture
<
List
<
ErrorMessage
>>>
completableFutureList
=
new
ArrayList
<>();
// 创建一个数值格式化对象
...
...
@@ -739,7 +748,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// 设置精确到小数点后2位
numberFormat
.
setMaximumFractionDigits
(
2
);
String
maerialRatio
=
""
;
String
sumNumKey
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
"sum_key"
;
Integer
bfInt
=
(
Integer
)
redisUtil
.
get
(
sumNumKey
);
if
(
Common
.
isNotNull
(
bfInt
))
{
if
(
rowNumber
>
bfInt
+
1
)
{
...
...
@@ -748,7 +756,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
redisUtil
.
set
(
sumNumKey
,
bfInt
,
360L
);
}
else
{
maerialRatio
=
"100"
;
redisUtil
.
remove
(
sumNumKey
);
}
}
else
{
if
(
rowNumber
>=
100
)
{
...
...
@@ -757,7 +764,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
redisUtil
.
set
(
sumNumKey
,
bfInt
,
360L
);
}
else
{
maerialRatio
=
"100"
;
redisUtil
.
remove
(
sumNumKey
);
}
}
redisUtil
.
set
(
importSuccessKey
,
maerialRatio
,
360L
);
...
...
@@ -1349,6 +1355,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Override
public
R
<
List
<
ErrorMessage
>>
importSocialHeFeiDiy
(
InputStream
inputStream
,
String
random
,
String
type
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
String
sumNumKey
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
"sum_key"
;
if
(
Common
.
isNotNull
((
String
)
redisUtil
.
get
(
sumNumKey
)))
{
redisUtil
.
remove
(
sumNumKey
);
}
String
importSuccessKey
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_WAIT_EXPORT
;
if
(
Common
.
isNotNull
((
String
)
redisUtil
.
get
(
importSuccessKey
)))
{
redisUtil
.
remove
(
importSuccessKey
);
}
List
<
ErrorMessage
>
errorMessageList
=
new
ArrayList
<>();
ExcelUtil
<
TPaymentHeFeiVo
>
util1
=
new
ExcelUtil
<>(
TPaymentHeFeiVo
.
class
);
ConcurrentHashMap
<
String
,
BigDecimal
>
pensionMoneyMap
=
new
ConcurrentHashMap
<>();
...
...
@@ -1403,7 +1417,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
private
void
saveData
()
{
log
.
info
(
"{}条数据,开始存储数据库!"
,
cachedDataList
.
size
());
importTPaymentSocialHeFei
(
cachedDataList
,
errorMessageList
,
user
,
type
,
rowNumber
,
pensionMoneyMap
,
bigMoneyMap
,
unEmpMoneyMap
,
injuryMoneyMap
,
medicalMoneyMap
);
bigMoneyMap
,
unEmpMoneyMap
,
injuryMoneyMap
,
medicalMoneyMap
,
sumNumKey
,
importSuccessKey
);
log
.
info
(
"存储数据库成功!"
);
}
}).
sheet
().
doRead
();
...
...
@@ -1687,7 +1701,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
ConcurrentHashMap
<
String
,
BigDecimal
>
bigMoneyMap
,
ConcurrentHashMap
<
String
,
BigDecimal
>
unEmpMoneyMap
,
ConcurrentHashMap
<
String
,
BigDecimal
>
injuryMoneyMap
,
ConcurrentHashMap
<
String
,
BigDecimal
>
medicalMoneyMap
)
{
ConcurrentHashMap
<
String
,
BigDecimal
>
medicalMoneyMap
,
String
sumNumKey
,
String
importSuccessKey
)
{
HashMap
<
String
,
String
>
areaMap
=
new
HashMap
<>();
HashMap
<
String
,
String
>
areaMap2
=
new
HashMap
<>();
...
...
@@ -1860,14 +1875,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List
<
CompletableFuture
<
List
<
ErrorMessage
>>>
completableFutureList
=
new
ArrayList
<>();
String
importSuccessKey
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
CommonConstants
.
PAYMENT_SOCIAL_WAIT_EXPORT
;
// 创建一个数值格式化对象
NumberFormat
numberFormat
=
NumberFormat
.
getInstance
();
// 设置精确到小数点后2位
numberFormat
.
setMaximumFractionDigits
(
2
);
String
maerialRatio
=
""
;
String
sumNumKey
=
user
.
getId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
"sum_key"
;
Integer
bfInt
=
(
Integer
)
redisUtil
.
get
(
sumNumKey
);
if
(
Common
.
isNotNull
(
bfInt
))
{
if
(
rowNumber
>
bfInt
+
1
)
{
...
...
@@ -1876,7 +1888,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
redisUtil
.
set
(
sumNumKey
,
bfInt
,
360L
);
}
else
{
maerialRatio
=
"100"
;
redisUtil
.
remove
(
sumNumKey
);
}
}
else
{
if
(
rowNumber
>=
100
)
{
...
...
@@ -1885,7 +1896,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
redisUtil
.
set
(
sumNumKey
,
bfInt
,
360L
);
}
else
{
maerialRatio
=
"100"
;
redisUtil
.
remove
(
sumNumKey
);
}
}
redisUtil
.
set
(
importSuccessKey
,
maerialRatio
,
360L
);
...
...
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