Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-dj-pe-analysis
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7c270c05
authored
Mar 31, 2026
by
林永健
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perf(service): 优化数据统计服务性能
- 添加查询统计数据耗时监控日志 - 调整 merchantId 查询参数范围以提升性能
1 parent
ef8f88d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
rpc-dj-pe-analysis/src/main/java/cn/com/glsx/dj/peanalysis/service/GetDataStatsService.java
rpc-dj-pe-analysis/src/main/java/cn/com/glsx/dj/peanalysis/service/MerchantBiFollowService.java
rpc-dj-pe-analysis/src/main/java/cn/com/glsx/dj/peanalysis/service/GetDataStatsService.java
View file @
7c270c0
...
@@ -24,7 +24,6 @@ import java.util.List;
...
@@ -24,7 +24,6 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.stream.Collectors
;
@Service
@Service
@Slf4j
@Slf4j
...
@@ -37,6 +36,8 @@ public class GetDataStatsService {
...
@@ -37,6 +36,8 @@ public class GetDataStatsService {
DataResp
<
List
<
DataBusinessDTO
>>
dataResp
;
DataResp
<
List
<
DataBusinessDTO
>>
dataResp
;
// String url = OrePropertyConfigurer.getProperty("total.data.url", String.class, "http://dc.glsx.com.cn/data");
// String url = OrePropertyConfigurer.getProperty("total.data.url", String.class, "http://dc.glsx.com.cn/data");
String
url
=
OrePropertyConfigurer
.
getProperty
(
"total.data.url"
,
String
.
class
,
"http://192.168.3.211:8021/data"
);
String
url
=
OrePropertyConfigurer
.
getProperty
(
"total.data.url"
,
String
.
class
,
"http://192.168.3.211:8021/data"
);
long
l
=
System
.
currentTimeMillis
();
// post请求
// post请求
String
jsonResponse
;
String
jsonResponse
;
try
{
try
{
...
@@ -44,6 +45,8 @@ public class GetDataStatsService {
...
@@ -44,6 +45,8 @@ public class GetDataStatsService {
jsonResponse
=
HttpRequestUtils
.
postJson
(
url
,
jsonBody
,
new
HashMap
<>());
jsonResponse
=
HttpRequestUtils
.
postJson
(
url
,
jsonBody
,
new
HashMap
<>());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RpcServiceException
(
"查询统计数据异常"
);
throw
new
RpcServiceException
(
"查询统计数据异常"
);
}
finally
{
log
.
info
(
"查询统计数据耗时: {}ms"
,
System
.
currentTimeMillis
()
-
l
);
}
}
dataResp
=
JSONUtil
.
toBean
(
jsonResponse
,
new
TypeReference
<
DataResp
<
List
<
DataBusinessDTO
>>>()
{
dataResp
=
JSONUtil
.
toBean
(
jsonResponse
,
new
TypeReference
<
DataResp
<
List
<
DataBusinessDTO
>>>()
{
},
true
);
},
true
);
...
...
rpc-dj-pe-analysis/src/main/java/cn/com/glsx/dj/peanalysis/service/MerchantBiFollowService.java
View file @
7c270c0
...
@@ -475,7 +475,7 @@ public class MerchantBiFollowService {
...
@@ -475,7 +475,7 @@ public class MerchantBiFollowService {
// 构建查询参数
// 构建查询参数
SceneBaseReq
newReq
=
new
SceneBaseReq
();
SceneBaseReq
newReq
=
new
SceneBaseReq
();
BeanUtils
.
copyProperties
(
req
,
newReq
);
BeanUtils
.
copyProperties
(
req
,
newReq
);
newReq
.
setExts
(
"merchantId,biz
,itemCode
"
);
newReq
.
setExts
(
"merchantId,biz"
);
DataBizQueryParamsDTO
queryParams
=
newReq
.
convertQueryParam
();
DataBizQueryParamsDTO
queryParams
=
newReq
.
convertQueryParam
();
queryParams
.
setBrandIds
(
dataStatsConfig
.
defaultBrandId
);
queryParams
.
setBrandIds
(
dataStatsConfig
.
defaultBrandId
);
queryParams
.
setBizs
(
null
);
queryParams
.
setBizs
(
null
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment