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 eb7e1f0c
authored
Jan 20, 2026
by
杨卫
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:策略中心代码
1 parent
a953efb4
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1010 additions
and
0 deletions
pom.xml
src/main/java/cn/com/glsx/dj/strategy/controller/StrategyDetailController.java
src/main/java/cn/com/glsx/dj/strategy/request/MerchantDetailRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/StrategyDetailRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/StrategyEffectAnalysisRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/StrategyStatisticsRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/StrategyTypeStatisticsRequest.java
src/main/java/cn/com/glsx/dj/strategy/response/MerchantDetailResponse.java
src/main/java/cn/com/glsx/dj/strategy/response/StrategyDetailResponse.java
src/main/java/cn/com/glsx/dj/strategy/response/StrategyEffectAnalysisResponse.java
src/main/java/cn/com/glsx/dj/strategy/response/StrategyOnlineStatisticsResponse.java
src/main/java/cn/com/glsx/dj/strategy/response/StrategyTotalStatisticsResponse.java
src/main/java/cn/com/glsx/dj/strategy/response/StrategyTypeStatisticsResponse.java
src/main/java/cn/com/glsx/dj/strategy/service/StrategyDetailService.java
pom.xml
View file @
eb7e1f0
...
@@ -44,6 +44,11 @@
...
@@ -44,6 +44,11 @@
<artifactId>
platform-merchants-api
</artifactId>
<artifactId>
platform-merchants-api
</artifactId>
<version>
5.5.1-SNAPSHOT
</version>
<version>
5.5.1-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
cn.com.glsx.dj
</groupId>
<artifactId>
rpc-dj-riskmanage-api
</artifactId>
<version>
5.6.1-SNAPSHOT
</version>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/dj/strategy/controller/StrategyDetailController.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
controller
;
import
cn.com.glsx.dj.strategy.request.*
;
import
cn.com.glsx.dj.strategy.response.*
;
import
cn.com.glsx.dj.strategy.service.StrategyDetailService
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
cn.hutool.core.collection.CollUtil
;
import
com.google.common.collect.Lists
;
import
com.rop.annotation.NeedInSessionType
;
import
com.rop.annotation.ServiceMethod
;
import
com.rop.annotation.ServiceMethodBean
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.List
;
import
java.util.Optional
;
/**
* 策略详情
* @author yangwei
* @version 1.0
* @since 2026/01/15 14:20
*/
@Slf4j
@Api
(
"策略中心-策略详情"
)
@RequiredArgsConstructor
@ServiceMethodBean
(
version
=
"1.0.0"
,
needInSession
=
NeedInSessionType
.
YES
)
public
class
StrategyDetailController
{
private
final
StrategyDetailService
strategyDetailService
;
@ApiOperation
(
"查询门店详情"
)
@ServiceMethod
(
method
=
"dj.api.strategy.find.merchant.detail"
)
public
RopResponse
<
MerchantDetailResponse
>
findMerchantDetail
(
MerchantDetailRequest
request
)
{
try
{
List
<
MerchantDetailResponse
>
responses
=
strategyDetailService
.
findMerchantDetail
(
Lists
.
newArrayList
(
request
.
getMerchantNo
()),
request
.
getBusinessType
());
MerchantDetailResponse
response
=
Optional
.
ofNullable
(
responses
).
filter
(
CollUtil:
:
isNotEmpty
).
map
(
list
->
list
.
get
(
0
)).
orElse
(
null
);
return
RopResponse
.
success
(
response
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"dj.api.strategy.find.merchant.detail occur error!"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
info
(
"dj.api.strategy.find.merchant.detail occur error!"
,
e
);
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERVICE_ERROR
);
}
}
@ApiOperation
(
"查询记录下/任务型策略详情"
)
@ServiceMethod
(
method
=
"dj.api.strategy.find.strategy.detail"
)
public
RopResponse
<
StrategyDetailResponse
>
findStrategyDetail
(
StrategyDetailRequest
request
)
{
try
{
return
RopResponse
.
success
(
null
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"dj.api.strategy.find.strategy.detail occur error!"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
info
(
"dj.api.strategy.find.strategy.detail occur error!"
,
e
);
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERVICE_ERROR
);
}
}
@ApiOperation
(
"策略分析-总数统计"
)
@ServiceMethod
(
method
=
"dj.api.strategy.find.strategy.total.statistics"
)
public
RopResponse
<
StrategyTotalStatisticsResponse
>
findStrategyTotalStatisticsDetail
(
StrategyStatisticsRequest
request
)
{
try
{
return
RopResponse
.
success
(
null
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"dj.api.strategy.find.strategy.total.statistics occur error!"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
info
(
"dj.api.strategy.find.strategy.total.statistics occur error!"
,
e
);
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERVICE_ERROR
);
}
}
@ApiOperation
(
"策略分析-策略类型分布"
)
@ServiceMethod
(
method
=
"dj.api.strategy.find.strategy.type.distribution"
)
public
RopResponse
<
StrategyTypeStatisticsResponse
>
findStrategyTypeDistribution
(
StrategyTypeStatisticsRequest
request
)
{
try
{
return
RopResponse
.
success
(
null
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"dj.api.strategy.find.strategy.type.distribution occur error!"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
info
(
"dj.api.strategy.find.strategy.type.distribution occur error!"
,
e
);
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERVICE_ERROR
);
}
}
@ApiOperation
(
"策略分析-线上运营分布"
)
@ServiceMethod
(
method
=
"dj.api.strategy.find.strategy.online.distribution"
)
public
RopResponse
<
StrategyOnlineStatisticsResponse
>
findStrategyOnlineDistribution
(
StrategyStatisticsRequest
request
)
{
try
{
return
RopResponse
.
success
(
null
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"dj.api.strategy.find.strategy.online.distribution occur error!"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
info
(
"dj.api.strategy.find.strategy.online.distribution occur error!"
,
e
);
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERVICE_ERROR
);
}
}
@ApiOperation
(
"策略分析-效果分析"
)
@ServiceMethod
(
method
=
"dj.api.strategy.find.strategy.effect.analysis"
)
public
RopResponse
<
StrategyEffectAnalysisResponse
>
findStrategyEffectAnalysis
(
StrategyEffectAnalysisRequest
request
)
{
try
{
return
RopResponse
.
success
(
null
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"dj.api.strategy.find.strategy.effect.analysis occur error!"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
info
(
"dj.api.strategy.find.strategy.effect.analysis occur error!"
,
e
);
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERVICE_ERROR
);
}
}
}
src/main/java/cn/com/glsx/dj/strategy/request/MerchantDetailRequest.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
cn.com.glsx.dj.peanalysis.validator.InList
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
/**
* 查询门店详情
* @author yangwei
* @version 1.0
* @since 2026/01/15 14:25
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"查询门店详情"
)
public
class
MerchantDetailRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
4632340285555170445L
;
@ApiModelProperty
(
name
=
"businessType"
,
notes
=
"bi侧业务类型,1.延保 2.轻改 3.权益"
,
example
=
"1"
)
@InList
(
values
=
{
"1"
,
"2"
,
"3"
},
message
=
"业务类型错误"
)
private
String
businessType
;
@ApiModelProperty
(
name
=
"merchantNo"
,
notes
=
"商户编号"
,
example
=
"1"
)
private
Integer
merchantNo
;
}
src/main/java/cn/com/glsx/dj/strategy/request/StrategyDetailRequest.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
/**
* 查询门店详情
* @author yangwei
* @version 1.0
* @since 2026/01/15 14:25
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"查询门店详情"
)
public
class
StrategyDetailRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
4632340285555170445L
;
@ApiModelProperty
(
name
=
"strategyId"
,
notes
=
"策略id"
,
example
=
"1"
)
private
Integer
strategyId
;
}
src/main/java/cn/com/glsx/dj/strategy/request/StrategyEffectAnalysisRequest.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
cn.com.glsx.dj.peanalysis.validator.InList
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 效果分析请求对象
*
* @author yangwei
* @version 1.0
* @since 2026/01/19 10:06
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"效果分析请求对象"
)
public
class
StrategyEffectAnalysisRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
6567788667848538498L
;
@ApiModelProperty
(
name
=
"startDate"
,
notes
=
"开始日期"
,
example
=
"1"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
startDate
;
@ApiModelProperty
(
name
=
"endDate"
,
notes
=
"结束日期"
,
example
=
"1"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
endDate
;
@ApiModelProperty
(
name
=
"businessType"
,
notes
=
"bi侧业务类型,1.延保 2.轻改 3.权益"
,
example
=
"1"
)
@InList
(
values
=
{
"1"
,
"2"
,
"3"
},
message
=
"业务类型错误"
)
private
String
businessType
;
@ApiModelProperty
(
name
=
"monitorType"
,
notes
=
"盯防类型:1=兜底指标(默认),2=生态系数"
,
example
=
"1"
)
private
Integer
monitorType
;
@ApiModelProperty
(
name
=
"metricTypeId"
,
notes
=
"指标类型ID"
,
example
=
"1"
)
private
Integer
metricTypeId
;
@ApiModelProperty
(
name
=
"periodType"
,
notes
=
"日期类型:0,按日;1,按周;2,按月;3,按年;4,自定义;"
,
example
=
"1"
)
private
Integer
periodType
;
}
src/main/java/cn/com/glsx/dj/strategy/request/StrategyStatisticsRequest.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
cn.com.glsx.dj.peanalysis.validator.InList
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @author yangwei
* @version 1.0
* @since 2026/01/16 15:02
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"策略统计请求对象"
)
public
class
StrategyStatisticsRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
679043651508536715L
;
@ApiModelProperty
(
name
=
"startDate"
,
notes
=
"开始日期"
,
example
=
"1"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
startDate
;
@ApiModelProperty
(
name
=
"endDate"
,
notes
=
"结束日期"
,
example
=
"1"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
endDate
;
@ApiModelProperty
(
name
=
"businessType"
,
notes
=
"bi侧业务类型,1.延保 2.轻改 3.权益"
,
example
=
"1"
)
@InList
(
values
=
{
"1"
,
"2"
,
"3"
},
message
=
"业务类型错误"
)
private
String
businessType
;
}
src/main/java/cn/com/glsx/dj/strategy/request/StrategyTypeStatisticsRequest.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
cn.com.glsx.dj.peanalysis.validator.InList
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 策略类型统计
* @author yangwei
* @version 1.0
* @since 2026/01/16 15:02
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"策略类型统计请求对象"
)
public
class
StrategyTypeStatisticsRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
679043651508536715L
;
@ApiModelProperty
(
name
=
"startDate"
,
notes
=
"开始日期"
,
example
=
"1"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
startDate
;
@ApiModelProperty
(
name
=
"endDate"
,
notes
=
"结束日期"
,
example
=
"1"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
endDate
;
@ApiModelProperty
(
name
=
"businessType"
,
notes
=
"bi侧业务类型,1.延保 2.轻改 3.权益"
,
example
=
"1"
)
@InList
(
values
=
{
"1"
,
"2"
,
"3"
},
message
=
"业务类型错误"
)
private
String
businessType
;
// 线上运营uuid
@ApiModelProperty
(
name
=
"uuid"
,
notes
=
"线上运营uuid"
,
example
=
"1"
)
private
String
uuid
;
}
src/main/java/cn/com/glsx/dj/strategy/response/MerchantDetailResponse.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
response
;
import
cn.com.glsx.dj.peanalysis.validator.InList
;
import
cn.com.glsx.dj.smartcarlife.response.CarBrandResponse
;
import
cn.com.glsx.dj.strategy.dto.OperatorResponse
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.SuperBuilder
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 查询门店详情响应对象
* @author yangwei
* @version 1.0
* @since 2026/01/15 14:39
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"查询门店详情"
)
@Accessors
(
chain
=
true
)
public
class
MerchantDetailResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
9204105732993941835L
;
@ApiModelProperty
(
name
=
"businessType"
,
notes
=
"bi侧业务类型,1.延保 2.轻改 3.权益"
,
example
=
"1"
)
@InList
(
values
=
{
"1"
,
"2"
,
"3"
},
message
=
"业务类型错误"
)
private
String
businessType
;
@ApiModelProperty
(
name
=
"merchantNo"
,
notes
=
"商户编号"
,
example
=
"1"
)
private
Integer
merchantNo
;
@ApiModelProperty
(
name
=
"directSalesFlag"
,
notes
=
"是否直营 0否 1是"
,
example
=
"1"
)
private
Integer
directSalesFlag
;
@ApiModelProperty
(
name
=
"mainServiceMerchantNo"
,
notes
=
"主服务商"
,
example
=
"1"
)
private
Integer
mainServiceMerchantNo
;
@ApiModelProperty
(
name
=
"carBrandResponses"
,
notes
=
"主营品牌"
,
example
=
"1"
)
private
List
<
CarBrandResponse
>
carBrandResponses
;
@ApiModelProperty
(
name
=
"mainServiceMerchantName"
,
notes
=
"主服务商名称"
,
example
=
"1"
)
private
String
mainServiceMerchantName
;
@ApiModelProperty
(
name
=
"onlineOperator"
,
notes
=
"线上运营"
)
private
List
<
OperatorResponse
>
onlineOperator
;
@ApiModelProperty
(
name
=
"areaOperator"
,
notes
=
"区域运营"
)
private
List
<
OperatorResponse
>
areaOperator
;
}
src/main/java/cn/com/glsx/dj/strategy/response/StrategyDetailResponse.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
response
;
import
cn.com.glsx.dj.strategy.dto.OperatorResponse
;
import
cn.com.glsx.dj.strategy.dto.TaskStrategyIssueResponse
;
import
com.google.common.collect.Lists
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
/**
* 策略详情
* @author yangwei
* @version 1.0
* @since 2026/01/15 15:13
*/
@Data
@ApiModel
(
"策略详情"
)
public
class
StrategyDetailResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
8354518127896801316L
;
@ApiModelProperty
(
name
=
"id"
,
notes
=
"策略id"
,
example
=
"1"
)
private
Integer
id
;
@ApiModelProperty
(
name
=
"strategyType"
,
notes
=
"执行策略类型"
,
example
=
"1"
)
private
Integer
strategyType
;
@ApiModelProperty
(
name
=
"strategyTypeName"
,
notes
=
"执行策略类型名称"
,
example
=
"1"
)
private
Integer
strategyTypeName
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
name
=
"startDate"
,
notes
=
"执行开始日期"
,
example
=
"1"
)
private
Date
startDate
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
name
=
"endDate"
,
notes
=
"执行结束日期"
,
example
=
"1"
)
private
Date
endDate
;
@ApiModelProperty
(
name
=
"executePersons"
,
notes
=
"执行人员列表"
)
private
List
<
OperatorResponse
>
executePersons
;
@ApiModelProperty
(
name
=
"description"
,
notes
=
"策略说明"
,
example
=
"1"
)
private
String
description
;
@ApiModelProperty
(
name
=
"orderTotalCount"
,
notes
=
"订单总数"
,
example
=
"1"
)
private
Integer
orderTotalCount
;
@ApiModelProperty
(
name
=
"orderTotalAmount"
,
notes
=
"订单总金额"
,
example
=
"1"
)
private
BigDecimal
orderTotalAmount
;
@ApiModelProperty
(
name
=
"discountTotalAmount"
,
notes
=
"优惠总金额"
,
example
=
"1"
)
private
BigDecimal
discountTotalAmount
;
@ApiModelProperty
(
name
=
"createdBy"
,
notes
=
"创建人"
,
example
=
"1"
)
private
String
createdBy
;
@ApiModelProperty
(
name
=
"createdDate"
,
notes
=
"创建时间"
,
example
=
"1"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createdDate
;
@ApiModelProperty
(
name
=
"title"
,
notes
=
"标题"
,
example
=
"1"
)
private
String
title
;
@ApiModelProperty
(
name
=
"subTitle"
,
notes
=
"副标题"
,
example
=
"1"
)
private
String
subTitle
;
@ApiModelProperty
(
name
=
"content"
,
notes
=
"内容"
,
example
=
"1"
)
private
String
content
;
@ApiModelProperty
(
name
=
"taskStrategyIssueList"
,
notes
=
"任务下发情况"
)
private
List
<
TaskStrategyIssueResponse
>
taskStrategyIssueList
=
Lists
.
newArrayList
();
}
src/main/java/cn/com/glsx/dj/strategy/response/StrategyEffectAnalysisResponse.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
response
;
import
cn.com.glsx.dj.strategy.dto.OperatorResponse
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* 效果分析响应对象
*
* @author yangwei
* @version 1.0
* @since 2026/01/19 10:10
*/
@Data
@ApiModel
(
"效果分析响应对象"
)
public
class
StrategyEffectAnalysisResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5108201884110659651L
;
@ApiModelProperty
(
name
=
"ruleId"
,
notes
=
"生成预警消息的规则id"
,
example
=
"1"
)
private
Integer
ruleId
;
@ApiModelProperty
(
name
=
"merchantId4s"
,
notes
=
"4s店门店号"
,
example
=
"1"
)
private
Integer
merchantId4s
;
@ApiModelProperty
(
name
=
"merchantName4s"
,
notes
=
"4s门店名称"
,
example
=
"1"
)
private
String
merchantName4s
;
@ApiModelProperty
(
name
=
"ruleType"
,
notes
=
"预警类型"
,
example
=
"1"
)
private
String
ruleType
;
@ApiModelProperty
(
name
=
"rule"
,
notes
=
"预警事项"
,
example
=
"1"
)
private
String
rule
;
@ApiModelProperty
(
name
=
"msgDetail"
,
notes
=
"预警明细说明"
,
example
=
"1"
)
private
String
msgDetail
;
@ApiModelProperty
(
name
=
"cycleIndicator"
,
notes
=
"周期指标值"
,
example
=
"1"
)
private
BigDecimal
cycleIndicator
;
@ApiModelProperty
(
name
=
"fallbackIndicator"
,
notes
=
"兜底指标"
,
example
=
"1"
)
private
BigDecimal
fallbackIndicator
;
@ApiModelProperty
(
name
=
"ruleDetail"
,
notes
=
"预警明细"
,
example
=
"1"
)
private
String
ruleDetail
;
@ApiModelProperty
(
name
=
"warningText"
,
notes
=
"盯店描述"
,
example
=
"1"
)
private
String
warningText
;
@ApiModelProperty
(
name
=
"nextCycleIndicator"
,
notes
=
"下期指标值"
,
example
=
"1"
)
private
BigDecimal
nextCycleIndicator
;
@ApiModelProperty
(
name
=
"onlineOperator"
,
notes
=
"线上运营"
)
private
List
<
OperatorResponse
>
onlineOperator
;
@ApiModelProperty
(
name
=
"areaOperator"
,
notes
=
"区域运营"
)
private
List
<
OperatorResponse
>
areaOperator
;
// 主营品牌
@ApiModelProperty
(
name
=
"mainBrands"
,
notes
=
"主营品牌"
)
private
List
<
String
>
mainBrands
;
// 策略总数
@ApiModelProperty
(
name
=
"strategyTotalCount"
,
notes
=
"策略总数"
)
private
Integer
strategyTotalCount
;
}
src/main/java/cn/com/glsx/dj/strategy/response/StrategyOnlineStatisticsResponse.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
response
;
import
cn.com.glsx.dj.strategy.enums.StrategyTypeEnum
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 策略线上运营分布统计详情
* @author yangwei
* @version 1.0
* @since 2026/01/16 15:12
*/
@Data
@ApiModel
(
"策略总数统计详情"
)
public
class
StrategyOnlineStatisticsResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2260151727820104100L
;
/**
* 执行策略类型,0-学习类,1-优秀录音分享类,3-任务型
* * 2-带教、4-销售精英到店提拉、5-强力促销、6-最终盘点,7-低客单产品购入;
* @see StrategyTypeEnum
*/
@ApiModelProperty
(
name
=
"strategyType"
,
notes
=
"0-学习类,1-优秀录音分享类,3-任务型 2-带教、4-销售精英到店提拉、5-强力促销、6-最终盘点,7-低客单产品购入"
,
example
=
"1"
)
private
Integer
strategyType
;
// 百分占比
@ApiModelProperty
(
name
=
"strategyCountPercent"
,
notes
=
"策略总数百分占比"
,
example
=
"1"
)
private
String
strategyCountPercent
;
// 策略总数
@ApiModelProperty
(
name
=
"strategyCount"
,
notes
=
"策略总数"
,
example
=
"1"
)
private
Integer
strategyCount
;
// 门店总数
@ApiModelProperty
(
name
=
"storeCount"
,
notes
=
"门店总数"
,
example
=
"1"
)
private
Integer
storeCount
;
// 占比
@ApiModelProperty
(
name
=
"storeCountPercent"
,
notes
=
"门店总数占比"
,
example
=
"1"
)
private
String
storeCountPercent
;
}
src/main/java/cn/com/glsx/dj/strategy/response/StrategyTotalStatisticsResponse.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
response
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 策略总数统计详情
* @author yangwei
* @version 1.0
* @since 2026/01/16 15:12
*/
@Data
@ApiModel
(
"策略总数统计详情"
)
public
class
StrategyTotalStatisticsResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2260151727820104100L
;
// 策略总数
@ApiModelProperty
(
name
=
"strategyTotalCount"
,
notes
=
"策略总数"
,
example
=
"1"
)
private
Integer
strategyTotalCount
;
// 本月策略总数
@ApiModelProperty
(
name
=
"strategyTotalCountInMonth"
,
notes
=
"本月策略总数"
,
example
=
"1"
)
private
Integer
strategyTotalCountInMonth
;
// 门店总数
@ApiModelProperty
(
name
=
"merchantTotalCount"
,
notes
=
"门店总数"
,
example
=
"1"
)
private
Integer
merchantTotalCount
;
// 本月门店总数
@ApiModelProperty
(
name
=
"merchantTotalCountInMonth"
,
notes
=
"本月门店总数"
,
example
=
"1"
)
private
Integer
merchantTotalCountInMonth
;
}
src/main/java/cn/com/glsx/dj/strategy/response/StrategyTypeStatisticsResponse.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
response
;
import
cn.com.glsx.dj.strategy.enums.StrategyTypeEnum
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 策略总数统计详情
* @author yangwei
* @version 1.0
* @since 2026/01/16 15:12
*/
@Data
@ApiModel
(
"策略总数统计详情"
)
public
class
StrategyTypeStatisticsResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2260151727820104100L
;
/**
* 执行策略类型,0-学习类,1-优秀录音分享类,3-任务型
* * 2-带教、4-销售精英到店提拉、5-强力促销、6-最终盘点,7-低客单产品购入;
* @see StrategyTypeEnum
*/
@ApiModelProperty
(
name
=
"strategyType"
,
notes
=
"执行策略类型,0-学习类,1-优秀录音分享类,3-任务型 2-带教、4-销售精英到店提拉、5-强力促销、6-最终盘点,7-低客单产品购入"
,
example
=
"1"
)
private
Integer
strategyType
;
// 百分占比
@ApiModelProperty
(
name
=
"percent"
,
notes
=
"百分占比"
,
example
=
"1"
)
private
String
percent
;
// 策略数
@ApiModelProperty
(
name
=
"strategyCount"
,
notes
=
"策略数"
,
example
=
"1"
)
private
Integer
strategyCount
;
}
src/main/java/cn/com/glsx/dj/strategy/service/StrategyDetailService.java
0 → 100644
View file @
eb7e1f0
package
cn
.
com
.
glsx
.
dj
.
strategy
.
service
;
import
cn.com.glsx.dj.mindworkplate.enums.CommonErrorEnum
;
import
cn.com.glsx.dj.peanalysis.dto.analysis.MerchantListOperatorDTO
;
import
cn.com.glsx.dj.peanalysis.dto.analysis.MerchantOperatorDetailDTO
;
import
cn.com.glsx.dj.peanalysis.enums.BusinessTypeEnum
;
import
cn.com.glsx.dj.peanalysis.remote.BiAnalyseBackgroundRemote
;
import
cn.com.glsx.dj.riskmanage.dto.MerchantServiceAndBrandDTO
;
import
cn.com.glsx.dj.riskmanage.remote.CommonRemote
;
import
cn.com.glsx.dj.smartcarlife.enums.SceneTypeEnum
;
import
cn.com.glsx.dj.strategy.response.MerchantDetailResponse
;
import
cn.com.glsx.dj.strategy.dto.OperatorResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.google.common.collect.Lists
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* @author yangwei
* @version 1.0
* @since 2026/01/19 14:15
*/
@Slf4j
@Service
@RequiredArgsConstructor
public
class
StrategyDetailService
{
private
final
CommonRemote
commonRemote
;
private
final
BiAnalyseBackgroundRemote
biAnalyseBackgroundRemote
;
/**
* 根据4s店商户号查询商户详情
* @author yangwei
* @since 2026/1/19 14:19
* @param merchantNos 商户号
* @param businessType 业务类型
* @return java.util.List<cn.com.glsx.dj.strategy.response.MerchantDetailResponse> 商户详情
*/
public
List
<
MerchantDetailResponse
>
findMerchantDetail
(
List
<
Integer
>
merchantNos
,
String
businessType
)
{
Optional
.
ofNullable
(
merchantNos
).
filter
(
CollUtil:
:
isNotEmpty
).
orElseThrow
(()
->
new
RpcServiceException
(
CommonErrorEnum
.
VALIDATION_ERROR
,
"商户号不能为空"
));
Optional
.
ofNullable
(
businessType
).
orElseThrow
(()
->
new
RpcServiceException
(
CommonErrorEnum
.
VALIDATION_ERROR
,
"业务类型不能为空"
));
// 获取运营人员
MerchantListOperatorDTO
merchantListOperatorDTO
=
new
MerchantListOperatorDTO
()
.
setStoreNos
(
merchantNos
.
stream
().
filter
(
ObjectUtil:
:
isNotNull
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
toList
()))
.
setBusinessType
(
businessType
);
RpcResponse
<
List
<
MerchantOperatorDetailDTO
>>
merchantListOperatorResp
=
biAnalyseBackgroundRemote
.
findMerchantListOperator
(
merchantListOperatorDTO
);
if
(
merchantListOperatorResp
.
isFailed
())
{
log
.
error
(
"查询商户运营人员失败: {}"
,
merchantListOperatorResp
.
getMessage
());
throw
new
RpcServiceException
(
merchantListOperatorResp
.
getError
(),
merchantListOperatorResp
.
getMessage
());
}
Map
<
String
,
MerchantOperatorDetailDTO
>
merchantNoMapOperator
=
Optional
.
ofNullable
(
merchantListOperatorResp
.
getResult
())
.
orElseGet
(
Lists:
:
newArrayList
)
.
stream
()
.
collect
(
Collectors
.
toMap
(
MerchantOperatorDetailDTO:
:
getStoreNo
,
Function
.
identity
(),
(
existing
,
replacement
)
->
existing
));
// 获取主营品牌和服务商
SceneTypeEnum
sceneTypeEnum
=
Lists
.
newArrayList
(
BusinessTypeEnum
.
BUSINESS_TYPE_1
.
getCode
(),
BusinessTypeEnum
.
BUSINESS_TYPE_3
.
getCode
()).
contains
(
businessType
)
?
SceneTypeEnum
.
SCENE1_0
:
SceneTypeEnum
.
SCENE1_1
;
RpcResponse
<
List
<
MerchantServiceAndBrandDTO
>>
merchantListServiceAndBrand
=
commonRemote
.
findMerchantListServiceAndBrand
(
merchantNos
,
ObjectUtil
.
toString
(
sceneTypeEnum
.
getValue
()));
if
(
merchantListServiceAndBrand
.
isFailed
())
{
log
.
error
(
"查询商户主营品牌和服务商失败: {}"
,
merchantListServiceAndBrand
.
getMessage
());
throw
new
RpcServiceException
(
merchantListServiceAndBrand
.
getError
(),
merchantListServiceAndBrand
.
getMessage
());
}
Map
<
Integer
,
MerchantServiceAndBrandDTO
>
merchantNoMapServiceAndBrand
=
Optional
.
ofNullable
(
merchantListServiceAndBrand
.
getResult
())
.
orElseGet
(
Lists:
:
newArrayList
)
.
stream
()
.
collect
(
Collectors
.
toMap
(
MerchantServiceAndBrandDTO:
:
getMerchantNo
,
Function
.
identity
(),
(
existing
,
replacement
)
->
existing
));
// 组装详情返回
return
merchantNos
.
stream
()
.
map
(
merchantNo
->
{
MerchantOperatorDetailDTO
merchantOperatorDetailDTO
=
Optional
.
ofNullable
(
merchantNoMapOperator
.
get
(
ObjectUtil
.
toString
(
merchantNo
)))
.
orElseGet
(
MerchantOperatorDetailDTO:
:
new
);
MerchantServiceAndBrandDTO
merchantServiceAndBrandDTO
=
Optional
.
ofNullable
(
merchantNoMapServiceAndBrand
.
get
(
merchantNo
))
.
orElseGet
(
MerchantServiceAndBrandDTO:
:
new
);
return
MerchantDetailResponse
.
builder
()
.
merchantNo
(
merchantNo
)
.
directSalesFlag
(
merchantServiceAndBrandDTO
.
getDirectSaleFlag
())
.
mainServiceMerchantNo
(
merchantServiceAndBrandDTO
.
getMainServiceMerchantNo
())
.
mainServiceMerchantName
(
merchantServiceAndBrandDTO
.
getMainServiceName
())
.
carBrandResponses
(
merchantServiceAndBrandDTO
.
getBrands
())
.
onlineOperator
(
BeanUtil
.
copyToList
(
merchantOperatorDetailDTO
.
getOnlineOperator
(),
OperatorResponse
.
class
))
.
areaOperator
(
BeanUtil
.
copyToList
(
merchantOperatorDetailDTO
.
getAreaOperator
(),
OperatorResponse
.
class
))
.
build
();
}).
collect
(
Collectors
.
toList
());
}
}
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