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
c71d141c
Commit
c71d141c
authored
Dec 16, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化修改
parent
b567f158
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
42 deletions
+35
-42
TIncomeServiceImpl.java
.../plus/v1/yifu/social/service/impl/TIncomeServiceImpl.java
+35
-42
No files found.
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TIncomeServiceImpl.java
View file @
c71d141c
...
@@ -58,10 +58,6 @@ import java.io.IOException;
...
@@ -58,10 +58,6 @@ import java.io.IOException;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
/**
/**
* 收入明细表
* 收入明细表
...
@@ -322,53 +318,50 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
...
@@ -322,53 +318,50 @@ public class TIncomeServiceImpl extends ServiceImpl<TIncomeMapper, TIncome> impl
@Override
@Override
public
void
pushDetail
()
{
public
void
pushDetail
()
{
ThreadPoolExecutor
threadPool
=
new
ThreadPoolExecutor
(
50
,
50
,
100
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(
10
));
List
<
TIncome
>
list
=
baseMapper
.
selectList
(
Wrappers
.<
TIncome
>
query
().
lambda
()
List
<
TIncome
>
list
=
baseMapper
.
selectList
(
Wrappers
.<
TIncome
>
query
().
lambda
()
.
eq
(
TIncome:
:
getSendStatus
,
CommonConstants
.
ZERO_STRING
));
.
eq
(
TIncome:
:
getSendStatus
,
CommonConstants
.
ZERO_STRING
));
ConcurrentHashMap
<
String
,
Integer
>
map
=
new
Concurrent
HashMap
<>();
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
ConcurrentHashMap
<
String
,
String
>
idMap
=
new
Concurrent
HashMap
<>();
Map
<
String
,
String
>
idMap
=
new
HashMap
<>();
//收入更新
//收入更新
List
<
TIncome
>
updateList
=
new
ArrayList
<>();
List
<
TIncome
>
updateList
=
new
ArrayList
<>();
threadPool
.
execute
(()
->
{
for
(
TIncome
income
:
list
)
{
for
(
TIncome
income
:
list
)
{
String
sendBack
=
this
.
getSendBack
(
income
);
String
sendBack
=
this
.
getSendBack
(
income
);
income
.
setSendTime
(
new
Date
());
income
.
setSendTime
(
new
Date
());
if
(
Common
.
isNotNull
(
sendBack
)
&&
sendBack
.
length
()
==
32
)
{
if
(
Common
.
isNotNull
(
sendBack
)
&&
sendBack
.
length
()
==
32
)
{
income
.
setSendStatus
(
CommonConstants
.
ONE_STRING
);
income
.
setSendStatus
(
CommonConstants
.
ONE_STRING
);
income
.
setSendMonth
(
DateUtil
.
addMonth
(
0
));
income
.
setSendMonth
(
DateUtil
.
addMonth
(
0
));
income
.
setEkpId
(
sendBack
);
income
.
setEkpId
(
sendBack
);
updateList
.
add
(
income
);
updateList
.
add
(
income
);
if
(
updateList
.
size
()
>=
CommonConstants
.
FIVES_INT
)
{
if
(
updateList
.
size
()
>=
CommonConstants
.
FIVES_INT
)
{
baseMapper
.
updateIncomeById
(
updateList
);
updateList
.
clear
();
}
}
else
{
if
(
Common
.
isNotNull
(
map
.
get
(
sendBack
))
&&
map
.
get
(
sendBack
)
>
0
)
{
int
i
=
map
.
get
(
sendBack
)
+
1
;
map
.
put
(
sendBack
,
i
);
idMap
.
put
(
sendBack
,
income
.
getId
());
//单个异常超过十次,保存异常内容
if
(
i
>=
10
)
{
baseMapper
.
updateIncomeById
(
updateList
);
baseMapper
.
updateIncomeById
(
updateList
);
updateList
.
clear
();
for
(
Map
.
Entry
<
String
,
Integer
>
entry
:
map
.
entrySet
())
{
}
TSendEkpError
error
=
new
TSendEkpError
();
}
else
{
error
.
setCreateTime
(
new
Date
());
if
(
map
.
get
(
sendBack
)
>
0
)
{
error
.
setCreateDay
(
DateUtil
.
getThisDay
());
int
i
=
map
.
get
(
sendBack
)
+
1
;
error
.
setType
(
CommonConstants
.
FIVE_STRING
);
map
.
put
(
sendBack
,
i
);
error
.
setLinkId
(
income
.
getId
());
idMap
.
put
(
sendBack
,
income
.
getId
());
error
.
setTitle
(
entry
.
getKey
());
//单个异常超过十次,保存异常内容
error
.
setNums
(
entry
.
getValue
());
if
(
i
>=
10
)
{
tSendEkpErrorService
.
save
(
error
);
baseMapper
.
updateIncomeById
(
updateList
);
for
(
Map
.
Entry
<
String
,
Integer
>
entry
:
map
.
entrySet
())
{
TSendEkpError
error
=
new
TSendEkpError
();
error
.
setCreateTime
(
new
Date
());
error
.
setCreateDay
(
DateUtil
.
getThisDay
());
error
.
setType
(
CommonConstants
.
FIVE_STRING
);
error
.
setLinkId
(
income
.
getId
());
error
.
setTitle
(
entry
.
getKey
());
error
.
setNums
(
entry
.
getValue
());
tSendEkpErrorService
.
save
(
error
);
}
break
;
}
}
}
else
{
break
;
map
.
put
(
sendBack
,
1
);
idMap
.
put
(
sendBack
,
income
.
getId
());
}
}
}
else
{
map
.
put
(
sendBack
,
1
);
idMap
.
put
(
sendBack
,
income
.
getId
());
}
}
}
}
}
);
}
for
(
Map
.
Entry
<
String
,
Integer
>
entry
:
map
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
Integer
>
entry
:
map
.
entrySet
())
{
TSendEkpError
error
=
new
TSendEkpError
();
TSendEkpError
error
=
new
TSendEkpError
();
error
.
setCreateTime
(
new
Date
());
error
.
setCreateTime
(
new
Date
());
...
...
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