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
cdd316b0
Commit
cdd316b0
authored
Nov 27, 2020
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流量汇总
parent
8a3846bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
4 deletions
+92
-4
TkioFlowHistory.java
src/main/java/common/model/TkioFlowHistory.java
+69
-0
TkioFlowHistoryRepository.java
...ain/java/common/repository/TkioFlowHistoryRepository.java
+17
-0
TrackingFlowTask.java
src/main/java/track/task/TrackingFlowTask.java
+6
-4
No files found.
src/main/java/common/model/TkioFlowHistory.java
0 → 100644
View file @
cdd316b0
package
common
.
model
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
/**
* @author liyin
* @description
* @date
*/
@Entity
public
class
TkioFlowHistory
{
@Id
private
Long
id
;
private
String
ds
;
private
String
email
;
private
String
contractCode
;
private
Long
flow
;
private
Long
costFlow
;
public
String
getDs
()
{
return
ds
;
}
public
void
setDs
(
String
ds
)
{
this
.
ds
=
ds
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getContractCode
()
{
return
contractCode
;
}
public
void
setContractCode
(
String
contractCode
)
{
this
.
contractCode
=
contractCode
;
}
public
Long
getFlow
()
{
return
flow
;
}
public
void
setFlow
(
Long
flow
)
{
this
.
flow
=
flow
;
}
public
Long
getCostFlow
()
{
return
costFlow
;
}
public
void
setCostFlow
(
Long
costFlow
)
{
this
.
costFlow
=
costFlow
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
}
src/main/java/common/repository/TkioFlowHistoryRepository.java
0 → 100644
View file @
cdd316b0
package
common
.
repository
;
import
common.model.TkioFlowHistory
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
public
interface
TkioFlowHistoryRepository
extends
JpaRepository
<
TkioFlowHistory
,
Long
>
{
@Transactional
@Modifying
@Query
(
value
=
" insert into tkio_flow_history select * from tkio_flow where email = ?1 and cost_flow > 0 "
,
nativeQuery
=
true
)
BigDecimal
backDatasByEmail
(
String
email
);
}
src/main/java/track/task/TrackingFlowTask.java
View file @
cdd316b0
...
...
@@ -3,10 +3,7 @@ package track.task;
import
common.model.CalculationFlow
;
import
common.model.Contract
;
import
common.model.TkioFlow
;
import
common.repository.CalculationFlowRepository
;
import
common.repository.ContractChangeRepository
;
import
common.repository.ContractRepository
;
import
common.repository.TkioFlowRepository
;
import
common.repository.*
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -47,6 +44,8 @@ public class TrackingFlowTask {
private
ContractChangeRepository
contractChangeRepository
;
@Autowired
private
CalculationFlowRepository
calculationFlowRepository
;
@Autowired
private
TkioFlowHistoryRepository
tkioFlowHistoryRepository
;
public
void
syncFlow
(){
List
<
CalculationFlow
>
calculationFlows
=
calculationFlowRepository
.
findByStatus
(
0
);
...
...
@@ -54,6 +53,9 @@ public class TrackingFlowTask {
List
<
TkioFlow
>
tkioFlowList
=
new
ArrayList
<>();
calculationFlow
.
setStatus
(
1
);
calculationFlowRepository
.
save
(
calculationFlow
);
//记录历史数据
tkioFlowHistoryRepository
.
backDatasByEmail
(
calculationFlow
.
getEmail
());
tkioFlowRepository
.
deleteByEmail
(
calculationFlow
.
getEmail
());
String
email
=
calculationFlow
.
getEmail
();
//查询用户下所有appkey
...
...
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