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 6aec6d5d
authored
Jun 16, 2026
by
林冲
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v5.8.2' into 'master'
上线合并 See merge request
!2
2 parents
74830974
a72b2463
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1317 additions
and
11 deletions
pom.xml
src/main/java/cn/com/glsx/dj/strategy/config/dubbo/DubboConfig.java
src/main/java/cn/com/glsx/dj/strategy/controller/MerchantAnalysisController.java
src/main/java/cn/com/glsx/dj/strategy/controller/ProjectGroupController.java
src/main/java/cn/com/glsx/dj/strategy/controller/StrategyInfoController.java
src/main/java/cn/com/glsx/dj/strategy/controller/WarningController.java
src/main/java/cn/com/glsx/dj/strategy/request/EffectAnalysisRopRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/LearningRecordRopRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupIdRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupMetricQueryRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupQueryRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupSaveRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupStoreBatchAddRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupStoreDeleteRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupStoreQueryRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/ShopMerchantOperatorRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/WarningDetailQueryRopRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/WarningGroupListRopRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/WarningMetricListRopRequest.java
src/main/java/cn/com/glsx/dj/strategy/request/WarningRecordQueryRopRequest.java
src/main/java/cn/com/glsx/dj/strategy/response/MerchantDetailResponse.java
src/main/java/cn/com/glsx/dj/strategy/service/StoreDetailService.java
src/main/java/cn/com/glsx/dj/strategy/service/StrategyDetailService.java
src/main/java/cn/com/glsx/dj/strategy/uitl/CommonUtil.java
pom.xml
View file @
6aec6d5
...
...
@@ -17,7 +17,7 @@
<dependency>
<groupId>
cn.com.glsx.dj.strategy
</groupId>
<artifactId>
rpc-dj-strategy-api
</artifactId>
<version>
5.
6.0
-SNAPSHOT
</version>
<version>
5.
8.2
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.com.glsx.dj
</groupId>
...
...
@@ -27,17 +27,17 @@
<dependency>
<groupId>
cn.com.glsx.dj
</groupId>
<artifactId>
rpc-dj-smartcarlife-api
</artifactId>
<version>
5.
6.1
-SNAPSHOT
</version>
<version>
5.
8.2
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.com.glsx.dj.peanalysis
</groupId>
<artifactId>
rpc-dj-pe-analysis-api
</artifactId>
<version>
5.
6.1
-SNAPSHOT
</version>
<version>
5.
8.2
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.com.glsx
</groupId>
<artifactId>
rpc-dj-mindworkplate-api
</artifactId>
<version>
5.
6.1
-SNAPSHOT
</version>
<version>
5.
8.2
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.com.glsx.merchants
</groupId>
...
...
@@ -47,7 +47,7 @@
<dependency>
<groupId>
cn.com.glsx.dj
</groupId>
<artifactId>
rpc-dj-riskmanage-api
</artifactId>
<version>
5.
6.1
-SNAPSHOT
</version>
<version>
5.
8.2
-SNAPSHOT
</version>
</dependency>
</dependencies>
...
...
src/main/java/cn/com/glsx/dj/strategy/config/dubbo/DubboConfig.java
View file @
6aec6d5
...
...
@@ -3,8 +3,11 @@ package cn.com.glsx.dj.strategy.config.dubbo;
import
cn.com.glsx.dj.mindworkplate.remote.MonitoringRemote
;
import
cn.com.glsx.dj.peanalysis.remote.BusinessSceneAnalysisRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.SceneMerchantRefRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.SceneRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffInfoRemote
;
import
cn.com.glsx.dj.strategy.remote.ProjectGroupRemote
;
import
cn.com.glsx.dj.strategy.remote.StrategyInfoRemote
;
import
cn.com.glsx.dj.strategy.remote.WarningEngineRemote
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.scrm.proxy.remote.CommonProxyRemote
;
import
org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory
;
...
...
@@ -36,6 +39,11 @@ public class DubboConfig {
}
@Bean
public
ProjectGroupRemote
projectGroupRemote
()
{
return
factory
.
builder
(
ProjectGroupRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
version
(
"1.0.0"
).
build
();
}
@Bean
public
StaffInfoRemote
staffInfoRemote
()
{
return
factory
.
builder
(
StaffInfoRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
version
(
"1.0.0"
).
build
();
}
...
...
@@ -58,4 +66,14 @@ public class DubboConfig {
public
MerchantRemote
merchantRemote
()
{
return
factory
.
builder
(
MerchantRemote
.
class
).
timeout
(
timeout
).
check
(
check
).
version
(
"2.0.0"
).
build
();
}
@Bean
public
SceneRemote
sceneRemote
()
{
return
factory
.
builder
(
SceneRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
version
(
"1.0.0"
).
build
();
}
@Bean
public
WarningEngineRemote
warningEngineRemote
()
{
return
factory
.
builder
(
WarningEngineRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
version
(
"1.0.0"
).
build
();
}
}
src/main/java/cn/com/glsx/dj/strategy/controller/MerchantAnalysisController.java
View file @
6aec6d5
...
...
@@ -19,7 +19,10 @@ import cn.com.glsx.dj.strategy.dto.OperatorResponse;
import
cn.com.glsx.dj.strategy.dto.SceneMerchantBaseParam
;
import
cn.com.glsx.dj.strategy.dto.StaffHistoryRecordDTO
;
import
cn.com.glsx.dj.strategy.dto.StaffSummaryDTO
;
import
cn.com.glsx.dj.strategy.dto.warning.WarningRecordDTO
;
import
cn.com.glsx.dj.strategy.dto.warning.WarningRecordQueryRequest
;
import
cn.com.glsx.dj.strategy.remote.StrategyInfoRemote
;
import
cn.com.glsx.dj.strategy.remote.WarningEngineRemote
;
import
cn.com.glsx.dj.strategy.request.MerchantStaffHistoryRecordRequest
;
import
cn.com.glsx.dj.strategy.request.MonitorDictRopRequest
;
import
cn.com.glsx.dj.strategy.request.MonitorFilterRopRequest
;
...
...
@@ -82,11 +85,16 @@ public class MerchantAnalysisController {
@Resource
private
WarningMsgRemote
warningMsgRemote
;
@Resource
private
WarningEngineRemote
warningEngineRemote
;
@ApiOperation
(
"查询驻店员工列表"
)
@ServiceMethod
(
method
=
"dj.api.strategy.staff.list.analysis"
)
public
RopResponse
<
List
<
StaffAnalysisDTO
>>
listStaffAnalysis
(
SceneMerchantBaseRequest
request
)
{
try
{
SceneBaseReq
req
=
CommonUtil
.
convertRequest
(
SceneBaseReq
.
class
);
String
[]
resolved
=
CommonUtil
.
resolveTimeDimension
(
request
.
getCycleType
(),
request
.
getStartTime
(),
request
.
getEndTime
());
req
.
setResolved
(
resolved
);
RpcResponse
<
List
<
StaffAnalysisDTO
>>
response
=
businessSceneAnalysisRemote
.
listStaffAnalysis
(
req
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
...
...
@@ -104,10 +112,22 @@ public class MerchantAnalysisController {
@ApiOperation
(
"查询门店预警信息列表"
)
@ServiceMethod
(
method
=
"dj.api.strategy.merchant.list.warningInfo"
)
public
RopResponse
<
List
<
String
>>
listMerchantWarningInfo
(
SceneMerchantBaseRequest
request
)
{
public
RopResponse
<
List
<
WarningRecordDTO
>>
listMerchantWarningInfo
(
SceneMerchantBaseRequest
request
)
{
try
{
SceneBaseReq
req
=
CommonUtil
.
convertRequest
(
SceneBaseReq
.
class
);
RpcResponse
<
List
<
String
>>
response
=
businessSceneAnalysisRemote
.
listMerchantWarningInfo
(
req
);
WarningRecordQueryRequest
queryRequest
=
new
WarningRecordQueryRequest
();
String
[]
resolved
=
CommonUtil
.
resolveTimeDimension
(
request
.
getCycleType
(),
request
.
getStartTime
(),
request
.
getEndTime
());
queryRequest
.
setTimeDimension
(
resolved
[
0
]);
queryRequest
.
setStartDate
(
resolved
[
1
]);
queryRequest
.
setEndDate
(
resolved
[
2
]);
// 1.1 bizs -> businessType
queryRequest
.
setBusinessType
(
request
.
getBizs
());
// 1.4 monitorTarget=2(门店)
queryRequest
.
setMonitorTarget
(
2
);
// 1.5 门店号取第一个
if
(
CollectionUtils
.
isNotEmpty
(
request
.
getMerchantIds
()))
{
queryRequest
.
setStoreId
(
request
.
getMerchantIds
().
get
(
0
));
}
RpcResponse
<
List
<
WarningRecordDTO
>>
response
=
warningEngineRemote
.
findWarningDetailByStoreAndStaff
(
queryRequest
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
...
...
@@ -359,4 +379,70 @@ public class MerchantAnalysisController {
}
}
@ApiOperation
(
"策略中心-门店分析-门店经营概况-主机厂"
)
@ServiceMethod
(
method
=
"dj.api.strategy.merchant.analysis.store.detail.zjsummary"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
StoreDetailSummaryResponse
>
merchantDetailSummaryZJ
(
SceneMerchantBaseRequest
request
)
{
try
{
SceneBaseReq
req
=
CommonUtil
.
convertRequest
(
SceneBaseReq
.
class
);
RpcResponse
<
StoreDetailSummaryResponse
>
response
=
businessSceneAnalysisRemote
.
storeDetailSummaryZj
(
req
);
if
(
response
.
isSuccess
())
{
return
RopResponse
.
success
(
response
.
getResult
());
}
return
RopResponse
.
error
(
response
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"接口异常"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"策略中心-门店商品品类分析-主机厂"
)
@ServiceMethod
(
method
=
"dj.api.strategy.merchant.analysis.goods.summary.withWarnZJ"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
GoodsCategorySummaryResponse
>
merchantGoodsSummaryWithWarmZJ
(
SceneMerchantBaseRequest
request
)
{
try
{
SceneBaseReq
req
=
CommonUtil
.
convertRequest
(
SceneBaseReq
.
class
);
// 调用主机厂版方法,交付数从目标配置表获取
RpcResponse
<
GoodsCategorySummaryResponse
>
response
=
businessSceneAnalysisRemote
.
goodsSummaryZj
(
req
);
if
(
response
.
isSuccess
())
{
GoodsCategorySummaryResponse
result
=
Optional
.
ofNullable
(
response
.
getResult
()).
orElse
(
new
GoodsCategorySummaryResponse
());
// 处理兜底指标
Optional
.
ofNullable
(
req
.
getMerchantIds
())
.
filter
(
CollUtil:
:
isNotEmpty
)
.
flatMap
(
list
->
Optional
.
ofNullable
(
list
.
get
(
0
)).
map
(
ObjectUtil:
:
toString
))
.
filter
(
StrUtil:
:
isNotEmpty
)
.
ifPresent
(
merchantId
->
{
RpcResponse
<
EarlyWarningThresholdConfig
>
warningConfigRes
=
warningMsgRemote
.
findByMerchantNo
(
merchantId
);
if
(!
warningConfigRes
.
hasResult
())
{
log
.
error
(
"兜底预警目标配置查询异常: {}"
,
warningConfigRes
);
return
;
}
EarlyWarningThresholdConfig
warningConfig
=
warningConfigRes
.
getResult
();
// 电池转化率
result
.
setBatteryWarrantyConversionBottomTarget
(
warningConfig
.
getBatteryConversionRate
());
// 电池渗透率
result
.
setBatteryWarrantyPenetrationBottomTarget
(
warningConfig
.
getBatteryPenetrationRate
());
// 延保转化率
result
.
setVehicleWarrantyConversionBottomTarget
(
warningConfig
.
getEwConRate
());
// 延保渗透率
result
.
setVehicleWarrantyPenetrationBottomTarget
(
warningConfig
.
getEwPenetrationRate
());
// 延保安心包转化率
result
.
setSafetyPackageConversionBottomTarget
(
warningConfig
.
getEwAxbConRate
());
// 安心包渗透率
result
.
setSafetyPackagePenetrationBottomTarget
(
warningConfig
.
getEwAxbPenetrationRate
());
// 延保轮胎转化率
result
.
setTireWarrantyConversionBottomTarget
(
warningConfig
.
getEwLtConRate
());
// 轮胎渗透率
result
.
setTireWarrantyPenetrationBottomTarget
(
warningConfig
.
getEwLtPenetrationRate
());
});
return
RopResponse
.
success
(
result
);
}
return
RopResponse
.
error
(
response
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"接口异常"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/dj/strategy/controller/ProjectGroupController.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
controller
;
import
cn.com.glsx.dj.strategy.dto.projectgroup.*
;
import
cn.com.glsx.dj.strategy.remote.ProjectGroupRemote
;
import
cn.com.glsx.dj.strategy.request.*
;
import
cn.com.glsx.dj.strategy.uitl.CommonUtil
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
com.rop.annotation.IgnoreSignType
;
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.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
/**
* 项目组管理控制器。
*/
@Slf4j
@ServiceMethodBean
(
version
=
"1.0.0"
,
needInSession
=
NeedInSessionType
.
YES
)
@Api
(
"项目组管理"
)
public
class
ProjectGroupController
{
@Autowired
private
ProjectGroupRemote
projectGroupRemote
;
@ApiOperation
(
"项目组分页列表"
)
@ServiceMethod
(
method
=
"dj.api.strategy.project.group.list"
,
needInSession
=
NeedInSessionType
.
NO
,
ignoreSign
=
IgnoreSignType
.
YES
)
public
RopResponse
<
RpcPagination
<
ProjectGroupListDTO
>>
pageProjectGroup
(
ProjectGroupQueryRequest
request
)
{
try
{
RpcPagination
<
ProjectGroupQueryDTO
>
pagination
=
CommonUtil
.
getRpcPagination
(
ProjectGroupQueryDTO
.
class
);
RpcResponse
<
RpcPagination
<
ProjectGroupListDTO
>>
response
=
projectGroupRemote
.
pageProjectGroup
(
pagination
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.project.group.list exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"查询项目组详情"
)
@ServiceMethod
(
method
=
"dj.api.strategy.project.group.detail"
)
public
RopResponse
<
ProjectGroupDetailDTO
>
getProjectGroupDetail
(
ProjectGroupIdRequest
request
)
{
try
{
ProjectGroupIdDTO
dto
=
CommonUtil
.
convertRequest
(
ProjectGroupIdDTO
.
class
);
RpcResponse
<
ProjectGroupDetailDTO
>
response
=
projectGroupRemote
.
getProjectGroupDetail
(
dto
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"dj.api.strategy.project.group.detail rpcServiceException"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.project.group.detail exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"保存项目组(支持编辑)"
)
@ServiceMethod
(
method
=
"dj.api.strategy.project.group.save"
)
public
RopResponse
<
Boolean
>
saveProjectGroup
(
ProjectGroupSaveRequest
request
)
{
try
{
ProjectGroupSaveDTO
dto
=
CommonUtil
.
convertRequest
(
ProjectGroupSaveDTO
.
class
);
dto
.
setOperator
(
resolveOperator
());
RpcResponse
<
Boolean
>
response
=
projectGroupRemote
.
saveProjectGroup
(
dto
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"dj.api.strategy.project.group.save rpcServiceException"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.project.group.save exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"删除项目组"
)
@ServiceMethod
(
method
=
"dj.api.strategy.project.group.delete"
)
public
RopResponse
<
Boolean
>
deleteProjectGroup
(
ProjectGroupIdRequest
request
)
{
try
{
ProjectGroupIdDTO
dto
=
CommonUtil
.
convertRequest
(
ProjectGroupIdDTO
.
class
);
dto
.
setOperator
(
resolveOperator
());
RpcResponse
<
Boolean
>
response
=
projectGroupRemote
.
deleteProjectGroup
(
dto
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"dj.api.strategy.project.group.delete rpcServiceException"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.project.group.delete exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"项目组门店分页列表"
)
@ServiceMethod
(
method
=
"dj.api.strategy.project.group.store.list"
,
needInSession
=
NeedInSessionType
.
NO
,
ignoreSign
=
IgnoreSignType
.
YES
)
public
RopResponse
<
RpcPagination
<
ProjectGroupStoreDTO
>>
pageProjectGroupStore
(
ProjectGroupStoreQueryRequest
request
)
{
try
{
RpcPagination
<
ProjectGroupStoreQueryDTO
>
pagination
=
CommonUtil
.
getRpcPagination
(
ProjectGroupStoreQueryDTO
.
class
);
RpcResponse
<
RpcPagination
<
ProjectGroupStoreDTO
>>
response
=
projectGroupRemote
.
pageProjectGroupStore
(
pagination
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.project.group.store.list exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
/* 异步导入项目组门店的接口放在rop-dj-smartcarlife */
@ApiOperation
(
"批量新增项目组门店"
)
@ServiceMethod
(
method
=
"dj.api.strategy.project.group.store.add"
)
public
RopResponse
<
Boolean
>
addProjectGroupStores
(
ProjectGroupStoreBatchAddRequest
request
)
{
try
{
ProjectGroupStoreBatchAddDTO
dto
=
CommonUtil
.
convertRequest
(
ProjectGroupStoreBatchAddDTO
.
class
);
dto
.
setOperator
(
resolveOperator
());
RpcResponse
<
Boolean
>
response
=
projectGroupRemote
.
addProjectGroupStores
(
dto
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"dj.api.strategy.project.group.store.add rpcServiceException"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.project.group.store.add exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"删除项目组门店"
)
@ServiceMethod
(
method
=
"dj.api.strategy.project.group.store.delete"
)
public
RopResponse
<
Boolean
>
deleteProjectGroupStore
(
ProjectGroupStoreDeleteRequest
request
)
{
try
{
ProjectGroupStoreDeleteDTO
dto
=
CommonUtil
.
convertRequest
(
ProjectGroupStoreDeleteDTO
.
class
);
dto
.
setOperator
(
resolveOperator
());
RpcResponse
<
Boolean
>
response
=
projectGroupRemote
.
deleteProjectGroupStore
(
dto
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"dj.api.strategy.project.group.store.delete rpcServiceException"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.project.group.store.delete exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"查询预警类型列表"
)
@ServiceMethod
(
method
=
"dj.api.strategy.project.group.warning.meta.types"
)
public
RopResponse
<
List
<
WarningTypeOptionDTO
>>
listWarningTypes
(
ProjectGroupQueryRequest
request
)
{
try
{
RpcResponse
<
List
<
WarningTypeOptionDTO
>>
response
=
projectGroupRemote
.
listWarningTypes
();
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
().
stream
()
.
filter
(
item
->
Objects
.
equals
(
item
.
getShowType
(),
0
)).
collect
(
Collectors
.
toList
()));
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.project.group.warning.meta.types exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"查询应用业务列表"
)
@ServiceMethod
(
method
=
"dj.api.strategy.project.group.warning.meta.bizs"
)
public
RopResponse
<
List
<
BizOptionDTO
>>
listBizs
(
ProjectGroupQueryRequest
request
)
{
try
{
RpcResponse
<
List
<
BizOptionDTO
>>
response
=
projectGroupRemote
.
listBizs
();
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.project.group.warning.meta.bizs exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"查询指标列表"
)
@ServiceMethod
(
method
=
"dj.api.strategy.project.group.warning.meta.metrics"
)
public
RopResponse
<
List
<
MetricOptionDTO
>>
listMetrics
(
ProjectGroupMetricQueryRequest
request
)
{
try
{
ProjectGroupMetricQueryDTO
dto
=
CommonUtil
.
convertRequest
(
ProjectGroupMetricQueryDTO
.
class
);
RpcResponse
<
List
<
MetricOptionDTO
>>
response
=
projectGroupRemote
.
listMetrics
(
dto
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.project.group.warning.meta.metrics exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
/**
* 获取当前操作人。
*
* @return 操作人
*/
private
String
resolveOperator
()
{
return
CommonUtil
.
getUserName
();
}
}
src/main/java/cn/com/glsx/dj/strategy/controller/StrategyInfoController.java
View file @
6aec6d5
...
...
@@ -10,6 +10,9 @@ import cn.com.glsx.dj.smartcarlife.remote.StaffInfoRemote;
import
cn.com.glsx.dj.strategy.dto.BatchInsertStrategyInfo
;
import
cn.com.glsx.dj.strategy.dto.MerchantBusinessInfo
;
import
cn.com.glsx.dj.strategy.dto.MerchantBusinessOverview
;
import
cn.com.glsx.dj.strategy.dto.ShopMerchantOperatorReqDTO
;
import
cn.com.glsx.dj.strategy.dto.ShopMerchantOperatorRespDTO
;
import
cn.com.glsx.dj.strategy.enums.StrategyDataSourceEnum
;
import
cn.com.glsx.dj.strategy.model.StrategyInfo
;
import
cn.com.glsx.dj.strategy.remote.StrategyInfoRemote
;
import
cn.com.glsx.dj.strategy.request.*
;
...
...
@@ -27,6 +30,8 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
@Slf4j
@ServiceMethodBean
(
version
=
"1.0.0"
,
needInSession
=
NeedInSessionType
.
YES
)
@Api
(
"策略中心-策略信息"
)
...
...
@@ -68,6 +73,7 @@ public class StrategyInfoController {
//String accountName = loginUser.getLoginAccout();
batchInsertStrategyInfo
.
setCreatedBy
(
loginUser
.
getUserName
());
batchInsertStrategyInfo
.
setCreatedUUid
(
loginUser
.
getUuid
());
batchInsertStrategyInfo
.
getStrategyInfo
().
setDataSource
(
StrategyDataSourceEnum
.
STRATEGY_CENTER
.
getValue
());
RpcResponse
<
Boolean
>
response
=
strategyInfoRemote
.
batchCreate
(
batchInsertStrategyInfo
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
...
...
@@ -125,6 +131,26 @@ public class StrategyInfoController {
}
}
@ApiOperation
(
"查询驻店员工(已按手机号去重)"
)
@ServiceMethod
(
method
=
"dj.api.strategy.staff.page.distinct.phone"
)
public
RopResponse
<
RpcPagination
<
StaffInfoDTO
>>
listStaffWithPageDistinctPhone
(
StaffInfoSearchRequest
request
)
{
try
{
RpcPagination
<
StaffInfoDTO
>
pagination
=
CommonUtil
.
getRpcPagination
(
StaffInfoDTO
.
class
);
RpcResponse
<
RpcPagination
<
StaffInfoDTO
>>
response
=
staffInfoRemote
.
listStaffWithPageDistinctPhone
(
pagination
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"=====dj.api.strategy.staff.page.distinct.phone rpcServiceException:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"=====dj.api.strategy.staff.page.distinct.phone exception:{}"
,
e
.
getMessage
(),
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"查询门店展业时间线"
)
@ServiceMethod
(
method
=
"dj.api.strategy.merchant.timeline"
)
public
RopResponse
<
MerchantBusinessOverview
>
listStrategyMerchantTimeline
(
MerchantBusinessRequest
request
)
{
...
...
@@ -177,7 +203,7 @@ public class StrategyInfoController {
}
@ApiOperation
(
"查询策略详情(学习
和课程类
)"
)
@ApiOperation
(
"查询策略详情(学习
、课程、带教申请、协同类策略:人员更换评估/商务政策更新评估/多品类拓张/流量问题改善
)"
)
@ServiceMethod
(
method
=
"dj.api.strategy.info.queryStrategyInfoById"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
StrategyInfo
>
queryStrategyInfoById
(
StrategyInfoQueryRequest
request
)
{
try
{
...
...
@@ -266,4 +292,24 @@ public class StrategyInfoController {
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"查询当前门店+业务下的全部区域运营"
)
@ServiceMethod
(
method
=
"dj.api.strategy.shop.merchant.operators"
,
needInSession
=
NeedInSessionType
.
NO
,
ignoreSign
=
IgnoreSignType
.
YES
)
public
RopResponse
<
List
<
ShopMerchantOperatorRespDTO
>>
listShopMerchantOperators
(
ShopMerchantOperatorRequest
request
)
{
try
{
ShopMerchantOperatorReqDTO
reqDTO
=
CommonUtil
.
convertRequest
(
ShopMerchantOperatorReqDTO
.
class
);
RpcResponse
<
List
<
ShopMerchantOperatorRespDTO
>>
response
=
strategyInfoRemote
.
listShopMerchantOperators
(
reqDTO
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"=====dj.api.strategy.shop.merchant.operators rpcServiceException:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"=====dj.api.strategy.shop.merchant.operators exception:{}"
,
e
.
getMessage
(),
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/dj/strategy/controller/WarningController.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
controller
;
import
cn.com.glsx.dj.strategy.dto.projectgroup.GroupOptionDTO
;
import
cn.com.glsx.dj.strategy.dto.projectgroup.MetricOptionDTO
;
import
cn.com.glsx.dj.strategy.dto.projectgroup.ProjectGroupMetricQueryDTO
;
import
cn.com.glsx.dj.strategy.dto.projectgroup.WarningTypeOptionDTO
;
import
cn.com.glsx.dj.strategy.dto.warning.EffectAnalysisDTO
;
import
cn.com.glsx.dj.strategy.dto.warning.EffectAnalysisRequest
;
import
cn.com.glsx.dj.strategy.dto.warning.StoreWarningSummaryDTO
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.dj.strategy.dto.warning.WarningRecordDTO
;
import
cn.com.glsx.dj.strategy.dto.warning.WarningRecordQueryRequest
;
import
cn.com.glsx.dj.strategy.remote.ProjectGroupRemote
;
import
cn.com.glsx.dj.strategy.remote.WarningEngineRemote
;
import
cn.com.glsx.dj.strategy.request.EffectAnalysisRopRequest
;
import
cn.com.glsx.dj.strategy.request.WarningDetailQueryRopRequest
;
import
cn.com.glsx.dj.strategy.request.WarningGroupListRopRequest
;
import
cn.com.glsx.dj.strategy.request.WarningMetricListRopRequest
;
import
cn.com.glsx.dj.strategy.request.WarningRecordQueryRopRequest
;
import
cn.com.glsx.dj.strategy.service.StoreDetailService
;
import
cn.com.glsx.dj.strategy.service.StrategyDetailService
;
import
cn.com.glsx.dj.strategy.uitl.CommonUtil
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
cn.hutool.core.collection.CollUtil
;
import
com.rop.AbstractRopRequest
;
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.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.text.SimpleDateFormat
;
import
java.util.List
;
/**
* 预警引擎查询控制器。
*
* @author yangwei_by_claude
* @version 1.0
* @since 2026/05/28 14:00
*/
@Slf4j
@ServiceMethodBean
(
version
=
"1.0.0"
,
needInSession
=
NeedInSessionType
.
YES
)
@Api
(
"预警引擎"
)
public
class
WarningController
{
@Autowired
private
WarningEngineRemote
warningEngineRemote
;
@Autowired
private
ProjectGroupRemote
projectGroupRemote
;
@Autowired
private
StrategyDetailService
strategyDetailService
;
@Autowired
private
StoreDetailService
storeDetailService
;
@ApiOperation
(
"预警类型下拉"
)
@ServiceMethod
(
method
=
"dj.api.strategy.warning.type.list"
)
public
RopResponse
<
List
<
WarningTypeOptionDTO
>>
listWarningTypes
(
AbstractRopRequest
request
)
{
try
{
RpcResponse
<
List
<
WarningTypeOptionDTO
>>
response
=
projectGroupRemote
.
listWarningTypes
();
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"dj.api.strategy.warning.type.list rpcServiceException"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.warning.type.list exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"项目组下拉列表"
)
@ServiceMethod
(
method
=
"dj.api.strategy.warning.group.list"
)
public
RopResponse
<
List
<
GroupOptionDTO
>>
listGroups
(
WarningGroupListRopRequest
request
)
{
try
{
RpcResponse
<
List
<
GroupOptionDTO
>>
response
=
warningEngineRemote
.
listGroups
();
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"dj.api.strategy.warning.group.list rpcServiceException"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.warning.group.list exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"指标类型下拉"
)
@ServiceMethod
(
method
=
"dj.api.strategy.warning.metric.list"
)
public
RopResponse
<
List
<
MetricOptionDTO
>>
listMetrics
(
WarningMetricListRopRequest
request
)
{
try
{
ProjectGroupMetricQueryDTO
dto
=
new
ProjectGroupMetricQueryDTO
();
dto
.
setWarningType
(
request
.
getWarningType
());
dto
.
setBiz
(
request
.
getBusinessType
());
RpcResponse
<
List
<
MetricOptionDTO
>>
response
=
warningEngineRemote
.
listMetrics
(
dto
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"dj.api.strategy.warning.metric.list rpcServiceException"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.warning.metric.list exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"门店预警汇总列表"
)
@ServiceMethod
(
method
=
"dj.api.strategy.warning.summary"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
List
<
StoreWarningSummaryDTO
>>
findWarningSummary
(
WarningRecordQueryRopRequest
request
)
{
try
{
WarningRecordQueryRequest
req
=
CommonUtil
.
convertRequest
(
WarningRecordQueryRequest
.
class
);
req
.
setQueryStartDate
(
req
.
getStartDate
());
req
.
setQueryEndDate
(
req
.
getEndDate
());
// cycleType → timeDimension + 起止日期
String
[]
resolved
=
CommonUtil
.
resolveTimeDimension
(
request
.
getCycleType
(),
req
.
getStartDate
(),
req
.
getEndDate
());
req
.
setTimeDimension
(
resolved
[
0
]);
req
.
setStartDate
(
resolved
[
1
]);
req
.
setEndDate
(
resolved
[
2
]);
RpcResponse
<
List
<
StoreWarningSummaryDTO
>>
response
=
warningEngineRemote
.
findWarningSummary
(
req
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
List
<
StoreWarningSummaryDTO
>
result
=
response
.
getResult
();
if
(
CollUtil
.
isNotEmpty
(
result
)
&&
request
.
getBusinessType
()
!=
null
)
{
storeDetailService
.
enrichStoreWarningSummaries
(
result
,
request
.
getBusinessType
());
}
return
RopResponse
.
success
(
result
);
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"dj.api.strategy.warning.summary rpcServiceException"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.warning.summary exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"指定门店+员工预警明细"
)
@ServiceMethod
(
method
=
"dj.api.strategy.warning.store.staff.detail"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
List
<
WarningRecordDTO
>>
findWarningDetailByStoreAndStaff
(
WarningDetailQueryRopRequest
request
)
{
try
{
WarningRecordQueryRequest
req
=
CommonUtil
.
convertRequest
(
WarningRecordQueryRequest
.
class
);
if
(
request
.
getCycleType
()
==
4
)
{
return
RopResponse
.
success
(
CollUtil
.
newArrayList
());
}
// cycleType → timeDimension + 起止日期
String
[]
resolved
=
CommonUtil
.
resolveTimeDimension
(
request
.
getCycleType
(),
req
.
getStartDate
(),
req
.
getEndDate
());
req
.
setTimeDimension
(
resolved
[
0
]);
req
.
setStartDate
(
resolved
[
1
]);
req
.
setEndDate
(
resolved
[
2
]);
RpcResponse
<
List
<
WarningRecordDTO
>>
response
=
warningEngineRemote
.
findWarningDetailByStoreAndStaff
(
req
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
return
RopResponse
.
success
(
response
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"dj.api.strategy.warning.store.staff.detail rpcServiceException"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.warning.store.staff.detail exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
@ApiOperation
(
"效果分析"
)
@ServiceMethod
(
method
=
"dj.api.strategy.analysis.effect"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
RpcPagination
<
EffectAnalysisDTO
>>
analysisEffect
(
EffectAnalysisRopRequest
request
)
{
try
{
// cycleType → timeDimension + 起止日期
String
[]
resolved
=
CommonUtil
.
resolveTimeDimension
(
request
.
getCycleType
(),
request
.
getStartDate
(),
request
.
getEndDate
());
EffectAnalysisRequest
req
=
new
EffectAnalysisRequest
();
req
.
setBusinessType
(
request
.
getBusinessType
());
req
.
setWarningType
(
request
.
getWarningType
());
req
.
setTimeDimension
(
resolved
[
0
]);
req
.
setStartDate
(
resolved
[
1
]);
req
.
setEndDate
(
resolved
[
2
]);
req
.
setPageNum
(
request
.
getPageNum
());
req
.
setPageSize
(
request
.
getPageSize
());
RpcResponse
<
RpcPagination
<
EffectAnalysisDTO
>>
response
=
warningEngineRemote
.
analysisEffect
(
req
);
if
(
response
.
hasError
())
{
log
.
error
(
response
.
getMessage
());
return
RopResponse
.
error
(
response
.
getError
(),
response
.
getMessage
());
}
// 填充门店详情(品牌、运营人员、策略统计)
RpcPagination
<
EffectAnalysisDTO
>
pageResult
=
response
.
getResult
();
if
(
pageResult
!=
null
&&
CollUtil
.
isNotEmpty
(
pageResult
.
getList
()))
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
storeDetailService
.
enrichStoreDetails
(
pageResult
.
getList
(),
request
.
getBusinessType
(),
sdf
.
parse
(
request
.
getStartDate
()),
sdf
.
parse
(
request
.
getEndDate
()));
}
return
RopResponse
.
success
(
pageResult
);
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"dj.api.strategy.analysis.effect rpcServiceException"
,
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"dj.api.strategy.analysis.effect exception"
,
e
);
return
RopResponse
.
error
(
e
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/dj/strategy/request/EffectAnalysisRopRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 效果分析 ROP 请求。
*
* @author yangwei_by_claude
* @version 1.0
* @since 2026/05/29 14:00
*/
@Data
public
class
EffectAnalysisRopRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"业务线: 1=延保 2=轻改 3=权益"
,
required
=
true
)
private
Integer
businessType
;
@ApiModelProperty
(
notes
=
"预警类型: 5=黄色预警 4=红色预警 3=生态预警 2=兜底预警"
,
required
=
true
)
private
Integer
warningType
;
@ApiModelProperty
(
notes
=
"周期类型: 2=周 3=月 4=自定义"
,
required
=
true
)
private
Integer
cycleType
;
@ApiModelProperty
(
notes
=
"开始日期 yyyy-MM-dd"
,
required
=
true
)
private
String
startDate
;
@ApiModelProperty
(
notes
=
"结束日期 yyyy-MM-dd"
,
required
=
true
)
private
String
endDate
;
@ApiModelProperty
(
notes
=
"页码,默认1"
)
private
Integer
pageNum
=
1
;
@ApiModelProperty
(
notes
=
"每页数量,默认10"
)
private
Integer
pageSize
=
10
;
}
src/main/java/cn/com/glsx/dj/strategy/request/LearningRecordRopRequest.java
View file @
6aec6d5
...
...
@@ -27,6 +27,12 @@ public class LearningRecordRopRequest extends AbstractRopRequest implements Seri
private
Integer
businessType
;
/**
* 订单成交标记:null-全部,0-战败,1-成功
*/
@ApiModelProperty
(
value
=
"订单成交标记:null-全部,0-战败,1-成功"
)
private
Integer
orderFinishFlag
;
/**
* 员工名称
*/
@ApiModelProperty
(
value
=
"员工名称"
)
...
...
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupIdRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
java.io.Serializable
;
/**
* 项目组主键请求。
*/
@Data
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ProjectGroupIdRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
4716282542230217983L
;
@ApiModelProperty
(
notes
=
"项目组id"
,
required
=
true
)
private
Integer
groupId
;
}
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupMetricQueryRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
java.io.Serializable
;
/**
* 项目组指标查询请求。
*/
@Data
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ProjectGroupMetricQueryRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5042839967492626538L
;
@ApiModelProperty
(
notes
=
"预警类型"
,
required
=
true
)
private
Integer
warningType
;
@ApiModelProperty
(
notes
=
"应用业务"
,
required
=
true
)
private
Integer
biz
;
@ApiModelProperty
(
notes
=
"指标名称"
)
private
String
indexName
;
}
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupQueryRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
java.io.Serializable
;
/**
* 项目组分页查询请求。
*/
@Data
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ProjectGroupQueryRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
7767199288574249277L
;
@ApiModelProperty
(
notes
=
"项目组名称"
)
private
String
groupName
;
@ApiModelProperty
(
notes
=
"页码,默认1"
)
private
Integer
pageNum
=
1
;
@ApiModelProperty
(
notes
=
"每页数量,默认10"
)
private
Integer
pageSize
=
10
;
}
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupSaveRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
cn.com.glsx.dj.strategy.dto.projectgroup.ProjectGroupWarningConfigDTO
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 项目组保存请求。
*/
@Data
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ProjectGroupSaveRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
5058723870412054385L
;
@ApiModelProperty
(
notes
=
"项目组id"
)
private
Integer
groupId
;
@ApiModelProperty
(
notes
=
"项目组名称"
,
required
=
true
)
private
String
groupName
;
@ApiModelProperty
(
notes
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
notes
=
"预警配置列表"
)
private
List
<
ProjectGroupWarningConfigDTO
>
warningConfigs
;
}
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupStoreBatchAddRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 项目组门店批量新增请求。
*/
@Data
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ProjectGroupStoreBatchAddRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
6204195079502439942L
;
@ApiModelProperty
(
notes
=
"项目组id"
,
required
=
true
)
private
Integer
groupId
;
@ApiModelProperty
(
notes
=
"门店号列表"
,
required
=
true
)
private
List
<
Integer
>
merchantIds
;
}
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupStoreDeleteRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
java.io.Serializable
;
/**
* 项目组门店删除请求。
*/
@Data
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ProjectGroupStoreDeleteRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5863398764922603071L
;
@ApiModelProperty
(
notes
=
"关系id"
,
required
=
true
)
private
Integer
id
;
}
src/main/java/cn/com/glsx/dj/strategy/request/ProjectGroupStoreQueryRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
java.io.Serializable
;
/**
* 项目组门店分页查询请求。
*/
@Data
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ProjectGroupStoreQueryRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
7647830130669942460L
;
@ApiModelProperty
(
notes
=
"项目组id"
,
required
=
true
)
private
Integer
groupId
;
@ApiModelProperty
(
notes
=
"搜索关键字"
)
private
String
search
;
@ApiModelProperty
(
notes
=
"门店号"
)
private
String
merchantId
;
@ApiModelProperty
(
notes
=
"门店名称"
)
private
String
merchantName
;
@ApiModelProperty
(
notes
=
"页码,默认1"
)
private
Integer
pageNum
=
1
;
@ApiModelProperty
(
notes
=
"每页数量,默认10"
)
private
Integer
pageSize
=
10
;
}
src/main/java/cn/com/glsx/dj/strategy/request/ShopMerchantOperatorRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
* 查询门店区域运营列表请求
*/
@Data
public
class
ShopMerchantOperatorRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"门店商户号"
,
required
=
true
)
@NotNull
(
message
=
"门店商户号不能为空"
)
private
Integer
merchantId
;
@ApiModelProperty
(
notes
=
"业务类型:1-延保,2-轻改,3-权益"
,
required
=
true
)
@NotNull
(
message
=
"业务类型不能为空"
)
private
Integer
businessType
;
}
src/main/java/cn/com/glsx/dj/strategy/request/WarningDetailQueryRopRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
java.util.List
;
/**
* 门店员工预警明细查询 ROP 请求。
*
* @author yangwei_by_claude
* @version 1.0
* @since 2026/05/30 15:00
*/
@Data
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
WarningDetailQueryRopRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"业务线: 1=延保 2=轻改 3=权益"
,
required
=
true
)
private
Integer
businessType
;
@ApiModelProperty
(
notes
=
"周期类型: 2=周 3=月 4=自定义"
,
required
=
true
)
private
Integer
cycleType
;
@ApiModelProperty
(
notes
=
"开始日期 yyyy-MM-dd"
,
required
=
true
)
private
String
startDate
;
@ApiModelProperty
(
notes
=
"结束日期 yyyy-MM-dd"
,
required
=
true
)
private
String
endDate
;
@ApiModelProperty
(
notes
=
"门店ID(查询指定门店预警明细时使用)"
)
private
Integer
storeId
;
@ApiModelProperty
(
notes
=
"员工ID(查询指定员工预警明细时使用)"
)
private
String
staffId
;
@ApiModelProperty
(
notes
=
"员工ID(查询指定员工预警明细时使用)"
)
private
List
<
String
>
staffIds
;
@ApiModelProperty
(
notes
=
"监控对象 1=员工 2=门店"
)
private
Integer
monitorTarget
;
}
src/main/java/cn/com/glsx/dj/strategy/request/WarningGroupListRopRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
/**
* 项目组下拉列表 ROP 请求。
*
* @author yangwei_by_claude
* @version 1.0
* @since 2026/05/29 16:00
*/
@Data
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
WarningGroupListRopRequest
extends
AbstractRopRequest
{
}
src/main/java/cn/com/glsx/dj/strategy/request/WarningMetricListRopRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
/**
* 预警指标列表 ROP 请求。
*
* @author yangwei_by_claude
* @version 1.0
* @since 2026/05/29 17:00
*/
@Data
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
WarningMetricListRopRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"业务线: 1=延保 2=轻改 3=权益"
,
required
=
true
)
private
Integer
businessType
;
@ApiModelProperty
(
notes
=
"预警类型: 5=黄色预警 4=红色预警 3=生态预警 2=兜底预警"
,
required
=
true
)
private
Integer
warningType
;
}
src/main/java/cn/com/glsx/dj/strategy/request/WarningRecordQueryRopRequest.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
request
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* 预警记录查询 ROP 请求。
*
* @author yangwei_by_claude
* @version 1.0
* @since 2026/05/28 14:00
*/
@Data
public
class
WarningRecordQueryRopRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
notes
=
"业务线: 1=延保 2=轻改 3=权益"
,
required
=
true
)
private
Integer
businessType
;
@ApiModelProperty
(
notes
=
"预警类型: 5=黄色预警 4=红色预警 3=生态预警 2=兜底预警 (null=全部)"
)
private
Integer
warningType
;
@ApiModelProperty
(
notes
=
"指标类型ID"
)
private
Integer
metricTypeId
;
@ApiModelProperty
(
notes
=
"周期类型: 2=周 3=月 4=自定义"
)
private
Integer
cycleType
;
@ApiModelProperty
(
notes
=
"开始日期 yyyy-MM-dd"
,
required
=
true
)
private
String
startDate
;
@ApiModelProperty
(
notes
=
"结束日期 yyyy-MM-dd"
,
required
=
true
)
private
String
endDate
;
@ApiModelProperty
(
notes
=
"项目组筛选"
)
private
Integer
groupId
;
@ApiModelProperty
(
notes
=
"门店名称模糊搜索"
)
private
String
storeName
;
@ApiModelProperty
(
notes
=
"是否已下发策略"
)
private
Integer
isStrategySent
;
@ApiModelProperty
(
notes
=
"区域ID"
)
private
Integer
regionId
;
@ApiModelProperty
(
notes
=
"一级品牌ID列表"
)
private
List
<
Integer
>
firstbrandIds
;
@ApiModelProperty
(
notes
=
"二级品牌ID列表"
)
private
List
<
Integer
>
twoBrandIds
;
@ApiModelProperty
(
notes
=
"区域运营人员ID"
)
private
String
regionalOperatorId
;
@ApiModelProperty
(
notes
=
"线上运营人员ID"
)
private
String
onlineOperatorId
;
@ApiModelProperty
(
notes
=
"区域督导人员ID"
)
private
String
flightSupervisionId
;
@ApiModelProperty
(
notes
=
"门店ID(查询指定门店预警明细时使用)"
)
private
Integer
storeId
;
@ApiModelProperty
(
notes
=
"员工ID(查询指定员工预警明细时使用)"
)
private
String
staffId
;
}
src/main/java/cn/com/glsx/dj/strategy/response/MerchantDetailResponse.java
View file @
6aec6d5
...
...
@@ -98,4 +98,10 @@ public class MerchantDetailResponse implements Serializable {
notes
=
"区域运营"
)
private
List
<
OperatorResponse
>
areaOperator
;
@ApiModelProperty
(
name
=
"flightSupervision"
,
notes
=
"区域督导"
)
private
List
<
OperatorResponse
>
flightSupervision
;
}
src/main/java/cn/com/glsx/dj/strategy/service/StoreDetailService.java
0 → 100644
View file @
6aec6d5
package
cn
.
com
.
glsx
.
dj
.
strategy
.
service
;
import
cn.com.glsx.dj.strategy.dto.MerchantStrategyStatisticsReqDTO
;
import
cn.com.glsx.dj.strategy.dto.MerchantStrategyStatisticsRespDTO
;
import
cn.com.glsx.dj.strategy.dto.warning.EffectAnalysisDTO
;
import
cn.com.glsx.dj.strategy.dto.warning.StoreWarningSummaryDTO
;
import
cn.com.glsx.dj.strategy.remote.StrategyDetailRemote
;
import
cn.com.glsx.dj.strategy.response.MerchantDetailResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.hutool.core.collection.CollUtil
;
import
com.google.common.collect.Lists
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* 门店详情查询服务——复用 StrategyDetailService.findMerchantDetail 获取品牌和运营人员。
*
* @author yangwei_by_claude
* @version 1.0
* @since 2026/05/29 16:00
*/
@Slf4j
@Service
@RequiredArgsConstructor
public
class
StoreDetailService
{
private
final
StrategyDetailService
strategyDetailService
;
private
final
StrategyDetailRemote
strategyDetailRemote
;
/**
* 批量填充效果分析DTO的门店详情字段(品牌、运营人员、策略统计)。
*
* @param dtoList 效果分析DTO列表
* @param businessType 业务类型
* @param startDate 统计开始日期
* @param endDate 统计结束日期
*/
public
void
enrichStoreDetails
(
List
<
EffectAnalysisDTO
>
dtoList
,
Integer
businessType
,
Date
startDate
,
Date
endDate
)
{
if
(
CollUtil
.
isEmpty
(
dtoList
))
{
return
;
}
String
bizStr
=
String
.
valueOf
(
businessType
);
List
<
Integer
>
storeIds
=
dtoList
.
stream
()
.
map
(
dto
->
Integer
.
valueOf
(
dto
.
getMerchantNo
()))
.
collect
(
Collectors
.
toList
());
// 1. 复用 StrategyDetailService.findMerchantDetail 获取品牌和运营人员
Map
<
Integer
,
MerchantDetailResponse
>
merchantDetailMap
=
Collections
.
emptyMap
();
try
{
List
<
MerchantDetailResponse
>
details
=
strategyDetailService
.
findMerchantDetail
(
storeIds
,
bizStr
);
if
(
CollUtil
.
isNotEmpty
(
details
))
{
merchantDetailMap
=
details
.
stream
()
.
collect
(
Collectors
.
toMap
(
MerchantDetailResponse:
:
getMerchantNo
,
Function
.
identity
(),
(
a
,
b
)
->
a
));
}
}
catch
(
Exception
e
)
{
log
.
error
(
"查询商户详情失败"
,
e
);
}
// 2. 查询策略统计
Map
<
Integer
,
MerchantStrategyStatisticsRespDTO
>
strategyMap
=
Collections
.
emptyMap
();
try
{
RpcResponse
<
List
<
MerchantStrategyStatisticsRespDTO
>>
resp
=
strategyDetailRemote
.
findStrategyStatisticsGroupMerchantNo
(
MerchantStrategyStatisticsReqDTO
.
builder
()
.
businessType
(
bizStr
)
.
startDate
(
startDate
)
.
endDate
(
endDate
)
.
merchantNos
(
storeIds
)
.
build
());
if
(
resp
.
isSuccess
()
&&
CollUtil
.
isNotEmpty
(
resp
.
getResult
()))
{
strategyMap
=
resp
.
getResult
().
stream
()
.
filter
(
d
->
d
.
getMerchantNo
()
!=
null
)
.
collect
(
Collectors
.
toMap
(
MerchantStrategyStatisticsRespDTO:
:
getMerchantNo
,
Function
.
identity
(),
(
a
,
b
)
->
a
));
}
}
catch
(
Exception
e
)
{
log
.
error
(
"查询策略数失败"
,
e
);
}
// 3. 填充每个DTO
for
(
EffectAnalysisDTO
dto
:
dtoList
)
{
Integer
storeId
=
Integer
.
valueOf
(
dto
.
getMerchantNo
());
MerchantDetailResponse
detail
=
merchantDetailMap
.
get
(
storeId
);
if
(
detail
!=
null
)
{
dto
.
setMainBrandsStr
(
detail
.
getMainBrandsStr
());
dto
.
setOnlineOperator
(
detail
.
getOnlineOperator
());
dto
.
setAreaOperator
(
detail
.
getAreaOperator
());
dto
.
setMainServiceMerchantName
(
detail
.
getMainServiceMerchantName
());
dto
.
setFlightSupervision
(
detail
.
getFlightSupervision
());
}
else
{
dto
.
setOnlineOperator
(
Collections
.
emptyList
());
dto
.
setAreaOperator
(
Collections
.
emptyList
());
dto
.
setFlightSupervision
(
Collections
.
emptyList
());
}
MerchantStrategyStatisticsRespDTO
strategyStats
=
strategyMap
.
get
(
storeId
);
if
(
strategyStats
!=
null
)
{
dto
.
setStrategyTotalCount
(
Optional
.
ofNullable
(
strategyStats
.
getStrategyCount
()).
orElse
(
0
));
dto
.
setStrategyTypeStatisticsResponse
(
strategyStats
.
getStrategyTypeStatisticsList
());
}
else
{
dto
.
setStrategyTotalCount
(
0
);
dto
.
setStrategyTypeStatisticsResponse
(
Collections
.
emptyList
());
}
}
}
/**
* 批量填充门店预警汇总的门店详情字段(品牌、运营人员、督导),不查策略统计。
*
* @param dtoList 门店预警汇总列表
* @param businessType 业务类型
*/
public
void
enrichStoreWarningSummaries
(
List
<
StoreWarningSummaryDTO
>
dtoList
,
Integer
businessType
)
{
if
(
CollUtil
.
isEmpty
(
dtoList
))
{
return
;
}
String
bizStr
=
String
.
valueOf
(
businessType
);
List
<
Integer
>
storeIds
=
dtoList
.
stream
()
.
map
(
dto
->
Integer
.
valueOf
(
dto
.
getMerchantNo
()))
.
collect
(
Collectors
.
toList
());
Map
<
Integer
,
MerchantDetailResponse
>
merchantDetailMap
=
Collections
.
emptyMap
();
try
{
List
<
MerchantDetailResponse
>
details
=
strategyDetailService
.
findMerchantDetail
(
storeIds
,
bizStr
);
if
(
CollUtil
.
isNotEmpty
(
details
))
{
merchantDetailMap
=
details
.
stream
()
.
collect
(
Collectors
.
toMap
(
MerchantDetailResponse:
:
getMerchantNo
,
Function
.
identity
(),
(
a
,
b
)
->
a
));
}
}
catch
(
Exception
e
)
{
log
.
error
(
"查询商户详情失败"
,
e
);
}
for
(
StoreWarningSummaryDTO
dto
:
dtoList
)
{
Integer
storeId
=
Integer
.
valueOf
(
dto
.
getMerchantNo
());
MerchantDetailResponse
detail
=
merchantDetailMap
.
get
(
storeId
);
if
(
detail
!=
null
)
{
dto
.
setMainBrandsStr
(
detail
.
getMainBrandsStr
());
dto
.
setOnlineOperator
(
detail
.
getOnlineOperator
());
dto
.
setAreaOperator
(
detail
.
getAreaOperator
());
dto
.
setFlightSupervision
(
detail
.
getFlightSupervision
());
}
else
{
dto
.
setOnlineOperator
(
Collections
.
emptyList
());
dto
.
setAreaOperator
(
Collections
.
emptyList
());
dto
.
setFlightSupervision
(
Collections
.
emptyList
());
}
}
}
}
src/main/java/cn/com/glsx/dj/strategy/service/StrategyDetailService.java
View file @
6aec6d5
...
...
@@ -10,9 +10,13 @@ import cn.com.glsx.dj.peanalysis.enums.BusinessTypeEnum;
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.MerchantServiceAndBrandQueryDTO
;
import
cn.com.glsx.dj.riskmanage.remote.CommonRemote
;
import
cn.com.glsx.dj.smartcarlife.dto.merchant.CarBrandDTO
;
import
cn.com.glsx.dj.smartcarlife.dto.scene.SceneDTO
;
import
cn.com.glsx.dj.smartcarlife.dto.scene.SceneQueryFilterDTO
;
import
cn.com.glsx.dj.smartcarlife.enums.SceneTypeEnum
;
import
cn.com.glsx.dj.smartcarlife.remote.SceneRemote
;
import
cn.com.glsx.dj.strategy.dto.MerchantStrategyStatisticsReqDTO
;
import
cn.com.glsx.dj.strategy.dto.MerchantStrategyStatisticsRespDTO
;
import
cn.com.glsx.dj.strategy.dto.OperatorResponse
;
...
...
@@ -57,6 +61,7 @@ public class StrategyDetailService {
private
final
MonitoringRemote
monitoringRemote
;
private
final
StrategyDetailRemote
strategyDetailRemote
;
private
final
BiAnalyseBackgroundRemote
biAnalyseBackgroundRemote
;
private
final
SceneRemote
sceneRemote
;
...
...
@@ -89,8 +94,33 @@ public class StrategyDetailService {
// 获取主营品牌和服务商
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
()));
// 根据businessType查询小场景的baseSceneCode列表
SceneQueryFilterDTO
sceneQueryFilter
=
new
SceneQueryFilterDTO
();
sceneQueryFilter
.
setSceneType
((
int
)
sceneTypeEnum
.
getValue
());
if
(
BusinessTypeEnum
.
BUSINESS_TYPE_1
.
getCode
().
equals
(
businessType
))
{
// 延保:scene businessType = 2
sceneQueryFilter
.
setBusinessType
(
2
);
}
else
if
(
BusinessTypeEnum
.
BUSINESS_TYPE_3
.
getCode
().
equals
(
businessType
))
{
// 权益:scene businessType = 1
sceneQueryFilter
.
setBusinessType
(
1
);
}
// 轻改:businessType传空
RpcResponse
<
List
<
SceneDTO
>>
sceneResp
=
sceneRemote
.
getScenesByParams
(
sceneQueryFilter
);
List
<
String
>
baseSceneCodeList
=
null
;
if
(
sceneResp
.
isSuccess
()
&&
CollUtil
.
isNotEmpty
(
sceneResp
.
getResult
()))
{
baseSceneCodeList
=
sceneResp
.
getResult
().
stream
()
.
map
(
SceneDTO:
:
getBaseSceneCode
)
.
filter
(
StrUtil:
:
isNotBlank
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
}
MerchantServiceAndBrandQueryDTO
queryDTO
=
new
MerchantServiceAndBrandQueryDTO
()
.
setMerchantNos
(
merchantNos
)
.
setScene
(
ObjectUtil
.
toString
(
sceneTypeEnum
.
getValue
()))
.
setBaseSceneCodeList
(
baseSceneCodeList
);
RpcResponse
<
List
<
MerchantServiceAndBrandDTO
>>
merchantListServiceAndBrand
=
commonRemote
.
findMerchantListServiceAndBrandV2
(
queryDTO
);
if
(
merchantListServiceAndBrand
.
isFailed
())
{
log
.
error
(
"查询商户主营品牌和服务商失败: {}"
,
merchantListServiceAndBrand
.
getMessage
());
throw
new
RpcServiceException
(
merchantListServiceAndBrand
.
getError
(),
merchantListServiceAndBrand
.
getMessage
());
...
...
@@ -116,6 +146,7 @@ public class StrategyDetailService {
.
carBrandResponses
(
merchantServiceAndBrandDTO
.
getBrands
())
.
onlineOperator
(
BeanUtil
.
copyToList
(
merchantOperatorDetailDTO
.
getOnlineOperator
(),
OperatorResponse
.
class
))
.
areaOperator
(
BeanUtil
.
copyToList
(
merchantOperatorDetailDTO
.
getAreaOperator
(),
OperatorResponse
.
class
))
.
flightSupervision
(
BeanUtil
.
copyToList
(
merchantOperatorDetailDTO
.
getFlightSupervision
(),
OperatorResponse
.
class
))
.
mainBrandsStr
(
mainBrandStrBuilder
(
merchantServiceAndBrandDTO
.
getBrands
()))
.
build
();
}).
collect
(
Collectors
.
toList
());
...
...
src/main/java/cn/com/glsx/dj/strategy/uitl/CommonUtil.java
View file @
6aec6d5
...
...
@@ -4,6 +4,7 @@ package cn.com.glsx.dj.strategy.uitl;
import
cn.com.glsx.dj.smartcarlife.dto.LoginUserDTO
;
import
cn.com.glsx.dj.smartcarlife.model.ServiceMerchant
;
import
cn.com.glsx.dj.strategy.constant.RopConstants
;
import
cn.com.glsx.dj.strategy.enums.TimeDimensionEnum
;
import
cn.com.glsx.dj.strategy.interceptor.ThreadLocalCache
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
...
...
@@ -26,8 +27,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
java.lang.reflect.Field
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
...
...
@@ -226,6 +230,73 @@ public class CommonUtil {
}
}
/** 周期类型:周 */
public
static
final
int
CYCLE_TYPE_WEEK
=
2
;
/** 周期类型:月 */
public
static
final
int
CYCLE_TYPE_MONTH
=
3
;
/** 周期类型:自定义 */
public
static
final
int
CYCLE_TYPE_CUSTOM
=
4
;
/** 日期格式化 */
private
static
final
SimpleDateFormat
DATE_FORMAT
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
/**
* 根据 cycleType 解析时间维度、计算起止日期。
* <ul>
* <li>周(2):当前周→LDW(endDate=T-1,周一则endDate=startDate),非当前周→W(dates不变)</li>
* <li>月(3):当前月→LDM(endDate=T-1,1号则endDate=startDate),非当前月→M(dates不变)</li>
* <li>自定义(4):timeDimension=null,dates不变</li>
* </ul>
*/
public
static
String
[]
resolveTimeDimension
(
Integer
cycleType
,
String
startDate
,
String
endDate
)
{
if
(
cycleType
==
null
||
cycleType
==
CYCLE_TYPE_CUSTOM
)
{
return
new
String
[]{
null
,
startDate
,
endDate
};
}
if
(
startDate
==
null
||
startDate
.
isEmpty
())
{
return
new
String
[]{
null
,
null
,
null
};
}
try
{
Calendar
todayCal
=
Calendar
.
getInstance
();
todayCal
.
setTime
(
new
Date
());
int
todayDayOfWeek
=
todayCal
.
get
(
Calendar
.
DAY_OF_WEEK
);
int
todayDayOfMonth
=
todayCal
.
get
(
Calendar
.
DAY_OF_MONTH
);
int
todayWeekOfYear
=
todayCal
.
get
(
Calendar
.
WEEK_OF_YEAR
);
int
todayMonth
=
todayCal
.
get
(
Calendar
.
MONTH
);
int
todayYear
=
todayCal
.
get
(
Calendar
.
YEAR
);
Calendar
startCal
=
Calendar
.
getInstance
();
startCal
.
setTime
(
DATE_FORMAT
.
parse
(
startDate
));
if
(
cycleType
==
CYCLE_TYPE_WEEK
)
{
boolean
isCurrentWeek
=
startCal
.
get
(
Calendar
.
WEEK_OF_YEAR
)
==
todayWeekOfYear
&&
startCal
.
get
(
Calendar
.
YEAR
)
==
todayYear
;
if
(!
isCurrentWeek
)
{
return
new
String
[]{
TimeDimensionEnum
.
W
.
getCode
(),
startDate
,
endDate
};
}
// 当前周:周一 endDate=startDate,否则 endDate=T-1
String
end
=
todayDayOfWeek
==
Calendar
.
MONDAY
?
startDate
:
getTMinusOne
(
todayCal
);
return
new
String
[]{
TimeDimensionEnum
.
LDW
.
getCode
(),
startDate
,
end
};
}
else
if
(
cycleType
==
CYCLE_TYPE_MONTH
)
{
boolean
isCurrentMonth
=
startCal
.
get
(
Calendar
.
MONTH
)
==
todayMonth
&&
startCal
.
get
(
Calendar
.
YEAR
)
==
todayYear
;
if
(!
isCurrentMonth
)
{
return
new
String
[]{
TimeDimensionEnum
.
M
.
getCode
(),
startDate
,
endDate
};
}
// 当前月:1号 endDate=startDate,否则 endDate=T-1
String
end
=
todayDayOfMonth
==
1
?
startDate
:
getTMinusOne
(
todayCal
);
return
new
String
[]{
TimeDimensionEnum
.
LDM
.
getCode
(),
startDate
,
end
};
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"解析时间维度失败"
,
e
);
}
return
new
String
[]{
null
,
startDate
,
endDate
};
}
private
static
String
getTMinusOne
(
Calendar
cal
)
{
Calendar
c
=
(
Calendar
)
cal
.
clone
();
c
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
return
DATE_FORMAT
.
format
(
c
.
getTime
());
}
public
static
LoginUserDTO
getLoginUser
()
{
RopRequestContext
content
=
ThreadLocalCache
.
getRopRequestContext
();
if
(
content
==
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