Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
Overview
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
reyun
manager
Commits
4c01dad6
Commit
4c01dad6
authored
Oct 20, 2020
by
lzxry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步流量定时任务bug修复
parent
7be2b9ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
TrackingFlowTask.java
src/main/java/track/task/TrackingFlowTask.java
+3
-6
No files found.
src/main/java/track/task/TrackingFlowTask.java
View file @
4c01dad6
...
@@ -2,14 +2,11 @@ package track.task;
...
@@ -2,14 +2,11 @@ package track.task;
import
common.model.CalculationFlow
;
import
common.model.CalculationFlow
;
import
common.model.Contract
;
import
common.model.Contract
;
import
common.model.ContractChange
;
import
common.model.TkioFlow
;
import
common.model.TkioFlow
;
import
common.repository.CalculationFlowRepository
;
import
common.repository.CalculationFlowRepository
;
import
common.repository.ContractChangeRepository
;
import
common.repository.ContractChangeRepository
;
import
common.repository.ContractRepository
;
import
common.repository.ContractRepository
;
import
common.repository.TkioFlowRepository
;
import
common.repository.TkioFlowRepository
;
import
dic.ContractStatusEnum
;
import
org.joda.time.DateTime
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -19,7 +16,6 @@ import tkio.repository.AppRepository;
...
@@ -19,7 +16,6 @@ import tkio.repository.AppRepository;
import
tkio.service.AccountFlowRestrictService
;
import
tkio.service.AccountFlowRestrictService
;
import
util.DateUtil
;
import
util.DateUtil
;
import
javax.persistence.Entity
;
import
java.math.BigInteger
;
import
java.math.BigInteger
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -50,7 +46,7 @@ public class TrackingFlowTask {
...
@@ -50,7 +46,7 @@ public class TrackingFlowTask {
private
CalculationFlowRepository
calculationFlowRepository
;
private
CalculationFlowRepository
calculationFlowRepository
;
public
void
syncFlow
(){
public
void
syncFlow
(){
List
<
CalculationFlow
>
calculationFlows
=
calculationFlowRepository
.
findByStatus
(
0
);
List
<
CalculationFlow
>
calculationFlows
=
calculationFlowRepository
.
findByStatus
(
3
);
for
(
CalculationFlow
calculationFlow
:
calculationFlows
)
{
for
(
CalculationFlow
calculationFlow
:
calculationFlows
)
{
List
<
TkioFlow
>
tkioFlowList
=
new
ArrayList
<>();
List
<
TkioFlow
>
tkioFlowList
=
new
ArrayList
<>();
calculationFlow
.
setStatus
(
1
);
calculationFlow
.
setStatus
(
1
);
...
@@ -126,7 +122,7 @@ public class TrackingFlowTask {
...
@@ -126,7 +122,7 @@ public class TrackingFlowTask {
for
(
int
i
=
0
;
i
<
contractsArray
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
contractsArray
.
length
;
i
++)
{
TkioFlow
tkioFlow
=
getTkioFlow
(
clickNum
,
yesterday
,
contractsArray
[
i
]);
TkioFlow
tkioFlow
=
getTkioFlow
(
clickNum
,
yesterday
,
contractsArray
[
i
]);
if
(
tkioFlow
!=
null
&&
i
<
contractsArray
.
length
-
1
&&
tkioFlow
.
getCostFlow
()
>
0L
)
{
//处理成本流量,如果超出了,依次算在下一个合同上
if
(
tkioFlow
!=
null
&&
i
<
contractsArray
.
length
-
1
&&
tkioFlow
.
getCostFlow
()
!=
null
&&
tkioFlow
.
getCostFlow
()
>
0L
)
{
//处理成本流量,如果超出了,依次算在下一个合同上
clickNum
=
BigInteger
.
valueOf
(
tkioFlow
.
getCostFlow
());
clickNum
=
BigInteger
.
valueOf
(
tkioFlow
.
getCostFlow
());
tkioFlow
.
setCostFlow
(
null
);
tkioFlow
.
setCostFlow
(
null
);
tkioFlowList
.
add
(
tkioFlow
);
tkioFlowList
.
add
(
tkioFlow
);
...
@@ -181,6 +177,7 @@ public class TrackingFlowTask {
...
@@ -181,6 +177,7 @@ public class TrackingFlowTask {
calculationFlow
.
setStatus
(
2
);
calculationFlow
.
setStatus
(
2
);
calculationFlowRepository
.
save
(
calculationFlow
);
calculationFlowRepository
.
save
(
calculationFlow
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
logger
.
error
(
"CalculationFlow:Id::"
+
calculationFlow
.
getId
()+
":全流量同步失败"
,
e
);
calculationFlow
.
setStatus
(
3
);
calculationFlow
.
setStatus
(
3
);
calculationFlowRepository
.
save
(
calculationFlow
);
calculationFlowRepository
.
save
(
calculationFlow
);
}
}
...
...
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