Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rop-dj-strategy
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 f4cf2334
authored
Jan 27, 2026
by
杨卫
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:效果分析查询策略统计明细
1 parent
fa878076
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
7 deletions
src/main/java/cn/com/glsx/dj/strategy/response/StrategyEffectAnalysisResponse.java
src/main/java/cn/com/glsx/dj/strategy/response/StrategyTypeStatisticsResponse.java
src/main/java/cn/com/glsx/dj/strategy/service/StrategyDetailService.java
src/test/java/cn/com/glsx/dj/strategy/controller/StrategyDetailControllerTest.java
src/main/java/cn/com/glsx/dj/strategy/response/StrategyEffectAnalysisResponse.java
View file @
f4cf233
...
...
@@ -131,4 +131,11 @@ public class StrategyEffectAnalysisResponse implements Serializable {
notes
=
"策略总数"
)
private
Integer
strategyTotalCount
;
@ApiModelProperty
(
name
=
"strategyTypeStatisticsResponse"
,
notes
=
"策略类型统计详情"
,
example
=
"1"
)
private
List
<
StrategyTypeStatisticsResponse
>
strategyTypeStatisticsResponse
;
}
src/main/java/cn/com/glsx/dj/strategy/response/StrategyTypeStatisticsResponse.java
View file @
f4cf233
...
...
@@ -33,6 +33,13 @@ public class StrategyTypeStatisticsResponse implements Serializable {
)
private
Integer
strategyType
;
@ApiModelProperty
(
name
=
"strategyTypeName"
,
notes
=
"执行策略类型名称"
,
example
=
"学习类"
)
private
String
strategyTypeName
;
/**
* 百分占比
*/
...
...
src/main/java/cn/com/glsx/dj/strategy/service/StrategyDetailService.java
View file @
f4cf233
...
...
@@ -21,6 +21,7 @@ import cn.com.glsx.dj.strategy.request.StrategyEffectAnalysisRequest;
import
cn.com.glsx.dj.strategy.request.validation.StrategyEffectAnalysisValidation
;
import
cn.com.glsx.dj.strategy.response.MerchantDetailResponse
;
import
cn.com.glsx.dj.strategy.response.StrategyEffectAnalysisResponse
;
import
cn.com.glsx.dj.strategy.response.StrategyTypeStatisticsResponse
;
import
cn.com.glsx.dj.strategy.uitl.validation.BeanValidationUtils
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
...
...
@@ -173,12 +174,12 @@ public class StrategyDetailService {
log
.
error
(
"查询策略数失败: {}"
,
strategyStatisticsGroupMerchantNo
.
getMessage
());
throw
new
RpcServiceException
(
strategyStatisticsGroupMerchantNo
.
getError
(),
strategyStatisticsGroupMerchantNo
.
getMessage
());
}
Map
<
Integer
,
Integer
>
strategyCountMap
=
Optional
.
ofNullable
(
strategyStatisticsGroupMerchantNo
.
getResult
())
Map
<
Integer
,
MerchantStrategyStatisticsRespDTO
>
strategyCountMap
=
Optional
.
ofNullable
(
strategyStatisticsGroupMerchantNo
.
getResult
())
.
orElseGet
(
Lists:
:
newArrayList
)
.
stream
()
.
collect
(
Collectors
.
toMap
(
MerchantStrategyStatisticsRespDTO:
:
getMerchantNo
,
MerchantStrategyStatisticsRespDTO:
:
getStrategyCount
,
Function
.
identity
()
,
(
existing
,
replacement
)
->
existing
));
...
...
@@ -195,8 +196,16 @@ public class StrategyDetailService {
strategyEffectAnalysisResponse
.
setMainBrandsStr
(
detailResponse
.
getMainBrandsStr
());
});
// 策略总数
strategyEffectAnalysisResponse
.
setStrategyTotalCount
(
Optional
.
ofNullable
(
strategyCountMap
.
get
(
monitoringMsgDTO
.
getMerchantId4s
())).
orElse
(
0
));
// 策略统计
Optional
.
ofNullable
(
strategyCountMap
.
get
(
monitoringMsgDTO
.
getMerchantId4s
()))
.
ifPresent
(
strategyStatistics
->
{
strategyEffectAnalysisResponse
.
setStrategyTotalCount
(
Optional
.
ofNullable
(
strategyStatistics
.
getStrategyCount
()).
orElse
(
0
));
strategyEffectAnalysisResponse
.
setStrategyTypeStatisticsResponse
(
BeanUtil
.
copyToList
(
Optional
.
ofNullable
(
strategyStatistics
.
getStrategyTypeStatisticsList
()).
orElseGet
(
Lists:
:
newArrayList
)
,
StrategyTypeStatisticsResponse
.
class
)
);
});
return
strategyEffectAnalysisResponse
;
}).
collect
(
Collectors
.
toList
());
}
...
...
src/test/java/cn/com/glsx/dj/strategy/controller/StrategyDetailControllerTest.java
View file @
f4cf233
...
...
@@ -73,13 +73,13 @@ public class StrategyDetailControllerTest extends BaseControllerTest {
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<
String
,
String
>();
params
.
add
(
"v"
,
"1.0.0"
);
params
.
add
(
"method"
,
"dj.api.strategy.find.strategy.effect.analysis"
);
params
.
add
(
"startDate"
,
"2025-
12
-01 00:00:00"
);
params
.
add
(
"endDate"
,
"202
5-12-3
1 23:59:59"
);
params
.
add
(
"startDate"
,
"2025-
06
-01 00:00:00"
);
params
.
add
(
"endDate"
,
"202
6-05-0
1 23:59:59"
);
params
.
add
(
"businessType"
,
"1"
);
params
.
add
(
"monitorType"
,
"1"
);
params
.
add
(
"metricTypeId"
,
"152"
);
params
.
add
(
"periodType"
,
"2"
);
params
.
add
(
"sessionId"
,
"
3df2c254-906f-4d66-a43f-682dccff9d79
"
);
params
.
add
(
"sessionId"
,
"
f4f46dc9-2b72-47b9-bf71-c11424bc92ab
"
);
System
.
out
.
println
(
post
(
params
));
}
}
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