Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rop-dj-pad
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 4460e72d
authored
Jun 22, 2026
by
chenxi
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增StrategyDubboConfig 引入rpc-dj-strategy-api dubbo接口
1 parent
19142045
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
0 deletions
src/main/java/cn/com/glsx/dj/pad/config/StrategyDubboConfig.java
src/main/java/cn/com/glsx/dj/pad/controller/strategy/MarketingActivityProductController.java
src/main/java/cn/com/glsx/dj/pad/config/StrategyDubboConfig.java
0 → 100644
View file @
4460e72
package
cn
.
com
.
glsx
.
dj
.
pad
.
config
;
import
cn.com.glsx.dj.strategy.remote.CustomerSopRemote
;
import
cn.com.glsx.dj.strategy.remote.CustomerTagProfileRemote
;
import
cn.com.glsx.dj.strategy.remote.MarketingActivityProductRemote
;
import
org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
/**
* rpc-dj-strategy-api RPC-API Inject Spring Bean
* @author chenxi
* @version 1.0
* @since 2026/06/33 10:51
*/
@Configuration
public
class
StrategyDubboConfig
extends
DubboConfig
{
@Autowired
private
ReferenceBuilderFactory
factory
;
@Bean
public
CustomerSopRemote
getCustomerSopRemote
()
{
return
factory
.
builder
(
CustomerSopRemote
.
class
).
check
(
false
).
timeout
(
30000
).
version
(
"1.0.0"
).
build
();
}
@Bean
public
CustomerTagProfileRemote
getCustomerTagProfileRemote
()
{
return
factory
.
builder
(
CustomerTagProfileRemote
.
class
).
check
(
false
).
version
(
"1.0.0"
).
timeout
(
30000
).
build
();
}
@Bean
public
MarketingActivityProductRemote
getMarketingActivityProductRemote
()
{
return
factory
.
builder
(
MarketingActivityProductRemote
.
class
).
check
(
false
).
version
(
"1.0.0"
).
timeout
(
30000
).
build
();
}
}
src/main/java/cn/com/glsx/dj/pad/controller/strategy/MarketingActivityProductController.java
View file @
4460e72
package
cn
.
com
.
glsx
.
dj
.
pad
.
controller
.
strategy
;
import
cn.com.glsx.dj.pad.request.strategy.CustomerSopTaskPageRequest
;
import
cn.com.glsx.dj.pad.request.strategy.MarketingActivityProductRequest
;
import
cn.com.glsx.dj.pad.response.strategy.MarketingStageGroupResponse
;
import
cn.com.glsx.dj.pad.response.strategy.StrategyDataStatusResponse
;
import
cn.com.glsx.dj.pad.service.CustomerSopService
;
import
cn.com.glsx.dj.pad.service.MarketingActivityProductService
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
...
...
@@ -13,6 +17,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
...
...
@@ -24,6 +29,8 @@ public class MarketingActivityProductController {
private
final
MarketingActivityProductService
marketingActivityProductService
;
private
final
CustomerSopService
customerSopService
;
@ApiOperation
(
"查询当前进行中的营销活动商品列表"
)
@ServiceMethod
(
method
=
"dj.pad.api.active.marketing.activity.product.list"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
List
<
MarketingStageGroupResponse
>>
listActiveProducts
(
MarketingActivityProductRequest
request
)
{
...
...
@@ -37,4 +44,38 @@ public class MarketingActivityProductController {
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERVICE_ERROR
);
}
}
@ApiOperation
(
"查询策略首页数据状态(营销活动和客户列表是否有数据)"
)
@ServiceMethod
(
method
=
"dj.pad.api.strategy.data.status"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
StrategyDataStatusResponse
>
getDataStatus
(
MarketingActivityProductRequest
request
)
{
try
{
List
<
MarketingStageGroupResponse
>
activityList
=
marketingActivityProductService
.
listActiveProducts
(
request
);
boolean
marketingActivityHasData
=
!
CollectionUtils
.
isEmpty
(
activityList
);
CustomerSopTaskPageRequest
pageRequest
=
new
CustomerSopTaskPageRequest
();
pageRequest
.
setMerchantId
(
request
.
getMerchantId
());
pageRequest
.
setPageNum
(
1
);
pageRequest
.
setPageSize
(
1
);
RpcPagination
<?>
todayPage
=
customerSopService
.
pageTodayPendingCustomers
(
pageRequest
);
boolean
customerHasData
=
!
CollectionUtils
.
isEmpty
(
todayPage
.
getList
());
if
(!
customerHasData
)
{
RpcPagination
<?>
lastWeekPage
=
customerSopService
.
pageLastWeekReachedCustomers
(
pageRequest
);
customerHasData
=
!
CollectionUtils
.
isEmpty
(
lastWeekPage
.
getList
());
}
StrategyDataStatusResponse
response
=
new
StrategyDataStatusResponse
();
response
.
setMarketingActivityHasData
(
marketingActivityHasData
);
response
.
setCustomerListHasData
(
customerHasData
);
return
RopResponse
.
success
(
response
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
e
.
getMessage
(),
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
info
(
e
.
getMessage
(),
e
);
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERVICE_ERROR
);
}
}
}
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