Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-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 c9973a06
authored
Jan 27, 2026
by
杨卫
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:效果分析查询策略统计明细
1 parent
a6ab8d87
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
3 deletions
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/MerchantStrategyStatisticsRespDTO.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/StrategyDetailService.java
rpc-dj-strategy/src/main/resources/META-INF/orm/StrategyInfoMapper.xml
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/MerchantStrategyStatisticsRespDTO.java
View file @
c9973a0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
/**
/**
* 门店策略统计
* 门店策略统计
...
@@ -11,6 +13,7 @@ import java.io.Serializable;
...
@@ -11,6 +13,7 @@ import java.io.Serializable;
* @since 2026/01/22 16:29
* @since 2026/01/22 16:29
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
public
class
MerchantStrategyStatisticsRespDTO
implements
Serializable
{
public
class
MerchantStrategyStatisticsRespDTO
implements
Serializable
{
/**
/**
...
@@ -22,4 +25,14 @@ public class MerchantStrategyStatisticsRespDTO implements Serializable {
...
@@ -22,4 +25,14 @@ public class MerchantStrategyStatisticsRespDTO implements Serializable {
* 策略数量
* 策略数量
*/
*/
private
Integer
strategyCount
;
private
Integer
strategyCount
;
/**
* 策略类型统计
*/
private
Integer
strategyType
;
/**
* 策略类型统计列表
*/
private
List
<
StrategyTypeStatisticsRespDTO
>
strategyTypeStatisticsList
;
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/StrategyDetailService.java
View file @
c9973a0
...
@@ -450,6 +450,32 @@ public class StrategyDetailService {
...
@@ -450,6 +450,32 @@ public class StrategyDetailService {
public
List
<
MerchantStrategyStatisticsRespDTO
>
findStrategyStatisticsGroupMerchantNo
(
MerchantStrategyStatisticsReqDTO
request
)
{
public
List
<
MerchantStrategyStatisticsRespDTO
>
findStrategyStatisticsGroupMerchantNo
(
MerchantStrategyStatisticsReqDTO
request
)
{
BeanValidationUtils
.
validateAndThrow
(
request
);
BeanValidationUtils
.
validateAndThrow
(
request
);
return
strategyInfoMapper
.
findStrategyStatisticsGroupMerchantNo
(
request
);
List
<
MerchantStrategyStatisticsRespDTO
>
strategyStatisticsGroupMerchantNo
=
strategyInfoMapper
.
findStrategyStatisticsGroupMerchantNo
(
request
);
if
(
CollUtil
.
isEmpty
(
strategyStatisticsGroupMerchantNo
))
{
log
.
info
(
"策略分析-门店策略分布结果为空"
);
return
Lists
.
newArrayList
();
}
Map
<
Integer
,
String
>
strategyTypeMap
=
Arrays
.
stream
(
StrategyTypeEnum
.
values
())
.
collect
(
Collectors
.
toMap
(
StrategyTypeEnum:
:
getValue
,
StrategyTypeEnum:
:
getDisplayName
,
(
v1
,
v2
)
->
v1
));
Map
<
Integer
,
List
<
MerchantStrategyStatisticsRespDTO
>>
merchantNoMapStrategyStrategyStatistics
=
strategyStatisticsGroupMerchantNo
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
MerchantStrategyStatisticsRespDTO:
:
getMerchantNo
));
return
merchantNoMapStrategyStrategyStatistics
.
entrySet
()
.
stream
()
.
map
(
entry
->
{
Integer
key
=
entry
.
getKey
();
List
<
MerchantStrategyStatisticsRespDTO
>
value
=
Optional
.
ofNullable
(
entry
.
getValue
()).
orElseGet
(
ArrayList:
:
new
);
return
new
MerchantStrategyStatisticsRespDTO
()
.
setMerchantNo
(
key
)
.
setStrategyCount
(
value
.
stream
().
map
(
MerchantStrategyStatisticsRespDTO:
:
getStrategyCount
).
reduce
(
0
,
Integer:
:
sum
))
.
setStrategyTypeStatisticsList
(
value
.
stream
().
map
(
ele
->
StrategyTypeStatisticsRespDTO
.
builder
()
.
strategyType
(
ele
.
getStrategyType
())
.
strategyTypeName
(
strategyTypeMap
.
get
(
ele
.
getStrategyType
()))
.
strategyCount
(
ele
.
getStrategyCount
())
.
build
()
).
collect
(
Collectors
.
toList
())
);
}).
collect
(
Collectors
.
toList
());
}
}
}
}
rpc-dj-strategy/src/main/resources/META-INF/orm/StrategyInfoMapper.xml
View file @
c9973a0
...
@@ -137,7 +137,8 @@
...
@@ -137,7 +137,8 @@
resultType=
"cn.com.glsx.dj.strategy.dto.MerchantStrategyStatisticsRespDTO"
>
resultType=
"cn.com.glsx.dj.strategy.dto.MerchantStrategyStatisticsRespDTO"
>
select
select
merchant_id merchantNo,
merchant_id merchantNo,
count(*) strategyCount
count(*) strategyCount,
strategy_type strategyType
from dj_car_life_strategy_info
from dj_car_life_strategy_info
where deleted_flag = 'N'
where deleted_flag = 'N'
<if
test=
"businessType != null and businessType != ''"
>
<if
test=
"businessType != null and businessType != ''"
>
...
@@ -152,7 +153,7 @@
...
@@ -152,7 +153,7 @@
<if
test=
"startDate != null and endDate != null"
>
<if
test=
"startDate != null and endDate != null"
>
AND created_date between #{startDate} and #{endDate}
AND created_date between #{startDate} and #{endDate}
</if>
</if>
group by merchant_id order by strategyCount desc
group by merchant_id
, strategy_type
order by strategyCount desc
</select>
</select>
<select
id=
"selectStrategyIdsForPush"
resultType=
"java.lang.Integer"
>
<select
id=
"selectStrategyIdsForPush"
resultType=
"java.lang.Integer"
>
...
...
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