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 fe5f4eb1
authored
Jan 27, 2026
by
林永健
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/v5.6.0' into v5.6.0
2 parents
98a57a82
f4cf2334
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
11 deletions
src/main/java/cn/com/glsx/dj/strategy/controller/StrategyInfoController.java
src/main/java/cn/com/glsx/dj/strategy/response/MerchantDetailResponse.java
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/controller/StrategyInfoController.java
View file @
fe5f4eb
...
@@ -65,8 +65,8 @@ public class StrategyInfoController {
...
@@ -65,8 +65,8 @@ public class StrategyInfoController {
try
{
try
{
BatchInsertStrategyInfo
batchInsertStrategyInfo
=
CommonUtil
.
convertRequest
(
BatchInsertStrategyInfo
.
class
);
BatchInsertStrategyInfo
batchInsertStrategyInfo
=
CommonUtil
.
convertRequest
(
BatchInsertStrategyInfo
.
class
);
LoginUserDTO
loginUser
=
CommonUtil
.
getLoginUser
();
LoginUserDTO
loginUser
=
CommonUtil
.
getLoginUser
();
String
accountName
=
loginUser
.
getLoginAccout
();
//
String accountName = loginUser.getLoginAccout();
batchInsertStrategyInfo
.
setCreatedBy
(
accountName
);
batchInsertStrategyInfo
.
setCreatedBy
(
loginUser
.
getUserName
()
);
batchInsertStrategyInfo
.
setCreatedUUid
(
loginUser
.
getUuid
());
batchInsertStrategyInfo
.
setCreatedUUid
(
loginUser
.
getUuid
());
RpcResponse
<
Boolean
>
response
=
strategyInfoRemote
.
batchCreate
(
batchInsertStrategyInfo
);
RpcResponse
<
Boolean
>
response
=
strategyInfoRemote
.
batchCreate
(
batchInsertStrategyInfo
);
if
(
response
.
hasError
())
{
if
(
response
.
hasError
())
{
...
...
src/main/java/cn/com/glsx/dj/strategy/response/MerchantDetailResponse.java
View file @
fe5f4eb
...
@@ -74,6 +74,13 @@ public class MerchantDetailResponse implements Serializable {
...
@@ -74,6 +74,13 @@ public class MerchantDetailResponse implements Serializable {
private
List
<
CarBrandDTO
>
carBrandResponses
;
private
List
<
CarBrandDTO
>
carBrandResponses
;
@ApiModelProperty
(
@ApiModelProperty
(
name
=
"mainBrandsStr"
,
notes
=
"主营品牌字符串"
,
example
=
"1"
)
private
String
mainBrandsStr
;
@ApiModelProperty
(
name
=
"mainServiceMerchantName"
,
name
=
"mainServiceMerchantName"
,
notes
=
"主服务商名称"
,
notes
=
"主服务商名称"
,
example
=
"1"
example
=
"1"
...
...
src/main/java/cn/com/glsx/dj/strategy/response/StrategyEffectAnalysisResponse.java
View file @
fe5f4eb
...
@@ -119,10 +119,23 @@ public class StrategyEffectAnalysisResponse implements Serializable {
...
@@ -119,10 +119,23 @@ public class StrategyEffectAnalysisResponse implements Serializable {
)
)
private
List
<
CarBrandDTO
>
mainBrands
;
private
List
<
CarBrandDTO
>
mainBrands
;
@ApiModelProperty
(
name
=
"mainBrandsStr"
,
notes
=
"主营品牌字符串"
)
private
String
mainBrandsStr
;
// 策略总数
// 策略总数
@ApiModelProperty
(
@ApiModelProperty
(
name
=
"strategyTotalCount"
,
name
=
"strategyTotalCount"
,
notes
=
"策略总数"
notes
=
"策略总数"
)
)
private
Integer
strategyTotalCount
;
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 @
fe5f4eb
...
@@ -33,6 +33,13 @@ public class StrategyTypeStatisticsResponse implements Serializable {
...
@@ -33,6 +33,13 @@ public class StrategyTypeStatisticsResponse implements Serializable {
)
)
private
Integer
strategyType
;
private
Integer
strategyType
;
@ApiModelProperty
(
name
=
"strategyTypeName"
,
notes
=
"执行策略类型名称"
,
example
=
"学习类"
)
private
String
strategyTypeName
;
/**
/**
* 百分占比
* 百分占比
*/
*/
...
...
src/main/java/cn/com/glsx/dj/strategy/service/StrategyDetailService.java
View file @
fe5f4eb
...
@@ -8,8 +8,10 @@ import cn.com.glsx.dj.peanalysis.dto.analysis.MerchantListOperatorDTO;
...
@@ -8,8 +8,10 @@ import cn.com.glsx.dj.peanalysis.dto.analysis.MerchantListOperatorDTO;
import
cn.com.glsx.dj.peanalysis.dto.analysis.MerchantOperatorDetailDTO
;
import
cn.com.glsx.dj.peanalysis.dto.analysis.MerchantOperatorDetailDTO
;
import
cn.com.glsx.dj.peanalysis.enums.BusinessTypeEnum
;
import
cn.com.glsx.dj.peanalysis.enums.BusinessTypeEnum
;
import
cn.com.glsx.dj.peanalysis.remote.BiAnalyseBackgroundRemote
;
import
cn.com.glsx.dj.peanalysis.remote.BiAnalyseBackgroundRemote
;
import
cn.com.glsx.dj.riskmanage.consts.SymbolConstants
;
import
cn.com.glsx.dj.riskmanage.dto.MerchantServiceAndBrandDTO
;
import
cn.com.glsx.dj.riskmanage.dto.MerchantServiceAndBrandDTO
;
import
cn.com.glsx.dj.riskmanage.remote.CommonRemote
;
import
cn.com.glsx.dj.riskmanage.remote.CommonRemote
;
import
cn.com.glsx.dj.smartcarlife.dto.merchant.CarBrandDTO
;
import
cn.com.glsx.dj.smartcarlife.enums.SceneTypeEnum
;
import
cn.com.glsx.dj.smartcarlife.enums.SceneTypeEnum
;
import
cn.com.glsx.dj.strategy.dto.MerchantStrategyStatisticsReqDTO
;
import
cn.com.glsx.dj.strategy.dto.MerchantStrategyStatisticsReqDTO
;
import
cn.com.glsx.dj.strategy.dto.MerchantStrategyStatisticsRespDTO
;
import
cn.com.glsx.dj.strategy.dto.MerchantStrategyStatisticsRespDTO
;
...
@@ -19,6 +21,7 @@ import cn.com.glsx.dj.strategy.request.StrategyEffectAnalysisRequest;
...
@@ -19,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.request.validation.StrategyEffectAnalysisValidation
;
import
cn.com.glsx.dj.strategy.response.MerchantDetailResponse
;
import
cn.com.glsx.dj.strategy.response.MerchantDetailResponse
;
import
cn.com.glsx.dj.strategy.response.StrategyEffectAnalysisResponse
;
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.dj.strategy.uitl.validation.BeanValidationUtils
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
...
@@ -28,6 +31,7 @@ import cn.hutool.core.date.DatePattern;
...
@@ -28,6 +31,7 @@ import cn.hutool.core.date.DatePattern;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -112,6 +116,7 @@ public class StrategyDetailService {
...
@@ -112,6 +116,7 @@ public class StrategyDetailService {
.
carBrandResponses
(
merchantServiceAndBrandDTO
.
getBrands
())
.
carBrandResponses
(
merchantServiceAndBrandDTO
.
getBrands
())
.
onlineOperator
(
BeanUtil
.
copyToList
(
merchantOperatorDetailDTO
.
getOnlineOperator
(),
OperatorResponse
.
class
))
.
onlineOperator
(
BeanUtil
.
copyToList
(
merchantOperatorDetailDTO
.
getOnlineOperator
(),
OperatorResponse
.
class
))
.
areaOperator
(
BeanUtil
.
copyToList
(
merchantOperatorDetailDTO
.
getAreaOperator
(),
OperatorResponse
.
class
))
.
areaOperator
(
BeanUtil
.
copyToList
(
merchantOperatorDetailDTO
.
getAreaOperator
(),
OperatorResponse
.
class
))
.
mainBrandsStr
(
mainBrandStrBuilder
(
merchantServiceAndBrandDTO
.
getBrands
()))
.
build
();
.
build
();
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
...
@@ -169,12 +174,12 @@ public class StrategyDetailService {
...
@@ -169,12 +174,12 @@ public class StrategyDetailService {
log
.
error
(
"查询策略数失败: {}"
,
strategyStatisticsGroupMerchantNo
.
getMessage
());
log
.
error
(
"查询策略数失败: {}"
,
strategyStatisticsGroupMerchantNo
.
getMessage
());
throw
new
RpcServiceException
(
strategyStatisticsGroupMerchantNo
.
getError
(),
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
)
.
orElseGet
(
Lists:
:
newArrayList
)
.
stream
()
.
stream
()
.
collect
(
Collectors
.
toMap
(
.
collect
(
Collectors
.
toMap
(
MerchantStrategyStatisticsRespDTO:
:
getMerchantNo
,
MerchantStrategyStatisticsRespDTO:
:
getMerchantNo
,
MerchantStrategyStatisticsRespDTO:
:
getStrategyCount
,
Function
.
identity
()
,
(
existing
,
replacement
)
->
existing
(
existing
,
replacement
)
->
existing
));
));
...
@@ -188,11 +193,45 @@ public class StrategyDetailService {
...
@@ -188,11 +193,45 @@ public class StrategyDetailService {
strategyEffectAnalysisResponse
.
setOnlineOperator
(
detailResponse
.
getOnlineOperator
());
strategyEffectAnalysisResponse
.
setOnlineOperator
(
detailResponse
.
getOnlineOperator
());
strategyEffectAnalysisResponse
.
setAreaOperator
(
detailResponse
.
getAreaOperator
());
strategyEffectAnalysisResponse
.
setAreaOperator
(
detailResponse
.
getAreaOperator
());
strategyEffectAnalysisResponse
.
setMainBrands
(
detailResponse
.
getCarBrandResponses
());
strategyEffectAnalysisResponse
.
setMainBrands
(
detailResponse
.
getCarBrandResponses
());
strategyEffectAnalysisResponse
.
setMainBrandsStr
(
detailResponse
.
getMainBrandsStr
());
});
// 策略统计
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
)
);
});
});
// 策略总数
strategyEffectAnalysisResponse
.
setStrategyTotalCount
(
Optional
.
ofNullable
(
strategyCountMap
.
get
(
monitoringMsgDTO
.
getMerchantId4s
())).
orElse
(
0
));
return
strategyEffectAnalysisResponse
;
return
strategyEffectAnalysisResponse
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
/**
* 根据品牌列表构建主要品牌字符串
* 理想汽车-理想/理想汽车-理想汽车
* @author yangwei
* @since 2026/1/27 11:05
* @param carBrands 品牌列表
* @return java.lang.String
*/
public
String
mainBrandStrBuilder
(
List
<
CarBrandDTO
>
carBrands
)
{
if
(
CollUtil
.
isEmpty
(
carBrands
))
{
return
StrUtil
.
EMPTY
;
}
return
carBrands
.
stream
()
.
filter
(
ObjectUtil:
:
isNotNull
)
.
flatMap
(
carBrandDTO
->
Optional
.
ofNullable
(
carBrandDTO
.
getChildren
())
.
map
(
children
->
children
.
stream
()
.
map
(
ele
->
carBrandDTO
.
getLabel
()
+
SymbolConstants
.
HYPHEN
+
ele
.
getLabel
())
.
collect
(
Collectors
.
toList
()))
.
orElse
(
Lists
.
newArrayList
(
carBrandDTO
.
getLabel
()))
.
stream
())
.
collect
(
Collectors
.
joining
(
SymbolConstants
.
SLASH
));
}
}
}
src/test/java/cn/com/glsx/dj/strategy/controller/StrategyDetailControllerTest.java
View file @
fe5f4eb
...
@@ -18,7 +18,7 @@ public class StrategyDetailControllerTest extends BaseControllerTest {
...
@@ -18,7 +18,7 @@ public class StrategyDetailControllerTest extends BaseControllerTest {
params
.
add
(
"method"
,
"dj.api.strategy.find.merchant.detail"
);
params
.
add
(
"method"
,
"dj.api.strategy.find.merchant.detail"
);
params
.
add
(
"businessType"
,
"1"
);
params
.
add
(
"businessType"
,
"1"
);
params
.
add
(
"merchantNo"
,
"44211227"
);
params
.
add
(
"merchantNo"
,
"44211227"
);
params
.
add
(
"sessionId"
,
"
fbac2a25-22ba-43c3-8d29-36e8d4cf0dda
"
);
params
.
add
(
"sessionId"
,
"
3df2c254-906f-4d66-a43f-682dccff9d79
"
);
System
.
out
.
println
(
post
(
params
));
System
.
out
.
println
(
post
(
params
));
}
}
...
@@ -28,7 +28,7 @@ public class StrategyDetailControllerTest extends BaseControllerTest {
...
@@ -28,7 +28,7 @@ public class StrategyDetailControllerTest extends BaseControllerTest {
params
.
add
(
"v"
,
"1.0.0"
);
params
.
add
(
"v"
,
"1.0.0"
);
params
.
add
(
"method"
,
"dj.api.strategy.find.strategy.detail"
);
params
.
add
(
"method"
,
"dj.api.strategy.find.strategy.detail"
);
params
.
add
(
"strategyId"
,
"16"
);
params
.
add
(
"strategyId"
,
"16"
);
params
.
add
(
"sessionId"
,
"f
bac2a25-22ba-43c3-8d29-36e8d4cf0dda
"
);
params
.
add
(
"sessionId"
,
"f
4f46dc9-2b72-47b9-bf71-c11424bc92ab
"
);
System
.
out
.
println
(
post
(
params
));
System
.
out
.
println
(
post
(
params
));
}
}
...
@@ -73,13 +73,13 @@ public class StrategyDetailControllerTest extends BaseControllerTest {
...
@@ -73,13 +73,13 @@ public class StrategyDetailControllerTest extends BaseControllerTest {
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<
String
,
String
>();
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<
String
,
String
>();
params
.
add
(
"v"
,
"1.0.0"
);
params
.
add
(
"v"
,
"1.0.0"
);
params
.
add
(
"method"
,
"dj.api.strategy.find.strategy.effect.analysis"
);
params
.
add
(
"method"
,
"dj.api.strategy.find.strategy.effect.analysis"
);
params
.
add
(
"startDate"
,
"2025-
12
-01 00:00:00"
);
params
.
add
(
"startDate"
,
"2025-
06
-01 00:00:00"
);
params
.
add
(
"endDate"
,
"202
5-12-3
1 23:59:59"
);
params
.
add
(
"endDate"
,
"202
6-05-0
1 23:59:59"
);
params
.
add
(
"businessType"
,
"1"
);
params
.
add
(
"businessType"
,
"1"
);
params
.
add
(
"monitorType"
,
"1"
);
params
.
add
(
"monitorType"
,
"1"
);
params
.
add
(
"metricTypeId"
,
"152"
);
params
.
add
(
"metricTypeId"
,
"152"
);
params
.
add
(
"periodType"
,
"2"
);
params
.
add
(
"periodType"
,
"2"
);
params
.
add
(
"sessionId"
,
"f
bac2a25-22ba-43c3-8d29-36e8d4cf0dda
"
);
params
.
add
(
"sessionId"
,
"f
4f46dc9-2b72-47b9-bf71-c11424bc92ab
"
);
System
.
out
.
println
(
post
(
params
));
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