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
bc55e647
Commit
bc55e647
authored
Nov 30, 2020
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流量查询方式更改
parent
f5cf2cbd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
9 deletions
+42
-9
TkioFlowHistoryRepository.java
...ain/java/common/repository/TkioFlowHistoryRepository.java
+0
-9
FlowService.java
src/main/java/tkio/service/FlowService.java
+8
-0
FlowServiceImpl.java
src/main/java/tkio/service/impl/FlowServiceImpl.java
+34
-0
TrackingFlowTask.java
src/main/java/track/task/TrackingFlowTask.java
+0
-0
No files found.
src/main/java/common/repository/TkioFlowHistoryRepository.java
View file @
bc55e647
...
@@ -2,16 +2,7 @@ package common.repository;
...
@@ -2,16 +2,7 @@ package common.repository;
import
common.model.TkioFlowHistory
;
import
common.model.TkioFlowHistory
;
import
org.springframework.data.jpa.repository.JpaRepository
;
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
>
{
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
)
void
backDatasByEmail
(
String
email
);
}
}
src/main/java/tkio/service/FlowService.java
0 → 100644
View file @
bc55e647
package
tkio
.
service
;
import
java.math.BigInteger
;
import
java.util.List
;
public
interface
FlowService
{
BigInteger
getFlowByAccount
(
String
yesterday
,
String
yesterday1
,
List
<
String
>
appkeys
);
}
src/main/java/tkio/service/impl/FlowServiceImpl.java
0 → 100644
View file @
bc55e647
package
tkio
.
service
.
impl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
;
import
org.springframework.stereotype.Service
;
import
tkio.service.FlowService
;
import
java.math.BigInteger
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Service
public
class
FlowServiceImpl
implements
FlowService
{
@Autowired
@Qualifier
(
"tikoTemplate"
)
JdbcTemplate
etlJdbcTemplate
;
@Override
public
BigInteger
getFlowByAccount
(
String
startDate
,
String
pastDate
,
List
<
String
>
appkeys
)
{
NamedParameterJdbcTemplate
nameJdbc
=
new
NamedParameterJdbcTemplate
(
etlJdbcTemplate
);
String
sql
=
" SELECT sum(click_num+ IFNULL(num_impression,0)) as click_sum FROM tkio.measures_trackingio_new "
+
" WHERE appid in (:appids ) AND ds>= :startdate and ds<= :enddate "
;
Map
param
=
new
HashMap
();
param
.
put
(
"appids"
,
appkeys
);
param
.
put
(
"startdate"
,
startDate
);
param
.
put
(
"enddate"
,
pastDate
);
return
nameJdbc
.
queryForObject
(
sql
,
param
,
BigInteger
.
class
);
}
}
src/main/java/track/task/TrackingFlowTask.java
View file @
bc55e647
This diff is collapsed.
Click to expand it.
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