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 6c43a554
authored
Jun 22, 2026
by
潘诗林
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v5.8.3' of
http://192.168.3.233:8090/dj/rop-dj-pad
into v5.8.3
2 parents
f73815e8
f08ec41a
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1257 additions
and
2 deletions
pom.xml
src/main/java/cn/com/glsx/dj/pad/config/SmartCarLifeDubboConfig.java
src/main/java/cn/com/glsx/dj/pad/config/StrategyDubboConfig.java
src/main/java/cn/com/glsx/dj/pad/controller/order/GoodsOrderController.java
src/main/java/cn/com/glsx/dj/pad/controller/strategy/CustomerSopController.java
src/main/java/cn/com/glsx/dj/pad/controller/strategy/MarketingActivityProductController.java
src/main/java/cn/com/glsx/dj/pad/enums/RopErrorEnum.java
src/main/java/cn/com/glsx/dj/pad/request/order/CustomerProfileInfoRequest.java
src/main/java/cn/com/glsx/dj/pad/request/order/PreliminaryOrderBatchRequest.java
src/main/java/cn/com/glsx/dj/pad/request/strategy/CustomerSopTaskDetailRequest.java
src/main/java/cn/com/glsx/dj/pad/request/strategy/CustomerSopTaskPageRequest.java
src/main/java/cn/com/glsx/dj/pad/request/strategy/MarketingActivityProductRequest.java
src/main/java/cn/com/glsx/dj/pad/response/strategy/CarSeriesResponse.java
src/main/java/cn/com/glsx/dj/pad/response/strategy/CustomerSopTaskDetailResponse.java
src/main/java/cn/com/glsx/dj/pad/response/strategy/CustomerSopTaskPageResponse.java
src/main/java/cn/com/glsx/dj/pad/response/strategy/MarketingStageGroupResponse.java
src/main/java/cn/com/glsx/dj/pad/response/strategy/ProductResponse.java
src/main/java/cn/com/glsx/dj/pad/response/strategy/StrategyDataStatusResponse.java
src/main/java/cn/com/glsx/dj/pad/service/CustomerSopService.java
src/main/java/cn/com/glsx/dj/pad/service/MarketingActivityProductService.java
pom.xml
View file @
6c43a55
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<dependency>
<dependency>
<groupId>
cn.com.glsx.dj
</groupId>
<groupId>
cn.com.glsx.dj
</groupId>
<artifactId>
rpc-dj-smartcarlife-api
</artifactId>
<artifactId>
rpc-dj-smartcarlife-api
</artifactId>
<version>
5.
7.5
-SNAPSHOT
</version>
<version>
5.
8.3
-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
cn.com.glsx.scrm
</groupId>
<groupId>
cn.com.glsx.scrm
</groupId>
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
<dependency>
<dependency>
<groupId>
cn.com.glsx.dj.strategy
</groupId>
<groupId>
cn.com.glsx.dj.strategy
</groupId>
<artifactId>
rpc-dj-strategy-api
</artifactId>
<artifactId>
rpc-dj-strategy-api
</artifactId>
<version>
5.
6.0
-SNAPSHOT
</version>
<version>
5.
8.3
-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
cn.com.glsx.dj
</groupId>
<groupId>
cn.com.glsx.dj
</groupId>
...
...
src/main/java/cn/com/glsx/dj/pad/config/SmartCarLifeDubboConfig.java
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
config
;
package
cn
.
com
.
glsx
.
dj
.
pad
.
config
;
import
cn.com.glsx.dj.smartcarlife.remote.CustomerInfoRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.GoodsCategoryConfigurationRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.GoodsCategoryConfigurationRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.GoodsOrderRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.GoodsOrderRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.LifeMerchantCouponRemote
;
import
org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory
;
import
org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
@@ -50,5 +52,22 @@ public class SmartCarLifeDubboConfig extends DubboConfig {
...
@@ -50,5 +52,22 @@ public class SmartCarLifeDubboConfig extends DubboConfig {
.
build
();
.
build
();
}
}
@Bean
public
CustomerInfoRemote
customerInfoRemote
()
{
return
factory
.
builder
(
CustomerInfoRemote
.
class
)
.
check
(
false
)
.
timeout
(
30000
)
.
build
();
}
@Bean
public
LifeMerchantCouponRemote
lifeMerchantCouponRemote
(){
return
factory
.
builder
(
LifeMerchantCouponRemote
.
class
).
timeout
(
30000
).
check
(
false
).
build
();
}
}
}
src/main/java/cn/com/glsx/dj/pad/config/StrategyDubboConfig.java
0 → 100644
View file @
6c43a55
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/order/GoodsOrderController.java
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
controller
.
order
;
package
cn
.
com
.
glsx
.
dj
.
pad
.
controller
.
order
;
import
cn.com.glsx.dj.carboutique.response.LoginUserInfoResponse
;
import
cn.com.glsx.dj.pad.enums.RopErrorEnum
;
import
cn.com.glsx.dj.pad.request.order.CustomerProfileInfoRequest
;
import
cn.com.glsx.dj.pad.request.order.HistoryOrderPageRequest
;
import
cn.com.glsx.dj.pad.request.order.HistoryOrderPageRequest
;
import
cn.com.glsx.dj.pad.request.order.PreliminaryOrderBatchRequest
;
import
cn.com.glsx.dj.pad.response.HistoryOrderPageResponse
;
import
cn.com.glsx.dj.pad.response.HistoryOrderPageResponse
;
import
cn.com.glsx.dj.pad.service.category.GoodsOrderService
;
import
cn.com.glsx.dj.pad.service.category.GoodsOrderService
;
import
cn.com.glsx.dj.pad.util.CommonUtil
;
import
cn.com.glsx.dj.smartcarlife.dto.CustomerProfileInfoDTO
;
import
cn.com.glsx.dj.smartcarlife.dto.GoodsOrderCustomerDTO
;
import
cn.com.glsx.dj.smartcarlife.dto.GoodsOrderDTO
;
import
cn.com.glsx.dj.smartcarlife.dto.LifeMerchantCouponDTO
;
import
cn.com.glsx.dj.smartcarlife.enums.CarLifeEnum
;
import
cn.com.glsx.dj.smartcarlife.enums.SceneTypeEnum
;
import
cn.com.glsx.dj.smartcarlife.remote.GoodsOrderRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.LifeMerchantCouponRemote
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
cn.com.glsx.scrm.proxy.enums.UserTypeEnum
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.rop.annotation.NeedInSessionType
;
import
com.rop.annotation.NeedInSessionType
;
import
com.rop.annotation.ServiceMethod
;
import
com.rop.annotation.ServiceMethod
;
import
com.rop.annotation.ServiceMethodBean
;
import
com.rop.annotation.ServiceMethodBean
;
...
@@ -14,6 +30,11 @@ import io.swagger.annotations.Api;
...
@@ -14,6 +30,11 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
import
java.util.Objects
;
/**
/**
* pad 端商品订单控制器
* pad 端商品订单控制器
...
@@ -30,6 +51,12 @@ public class GoodsOrderController {
...
@@ -30,6 +51,12 @@ public class GoodsOrderController {
private
final
GoodsOrderService
goodsOrderService
;
private
final
GoodsOrderService
goodsOrderService
;
@Autowired
private
LifeMerchantCouponRemote
lifeMerchantCouponRemote
;
@Autowired
private
GoodsOrderRemote
goodsOrderRemote
;
@ApiOperation
(
"pad历史录单分页列表"
)
@ApiOperation
(
"pad历史录单分页列表"
)
@ServiceMethod
(
method
=
"dj.pad.api.history.order.page"
,
needInSession
=
NeedInSessionType
.
YES
)
@ServiceMethod
(
method
=
"dj.pad.api.history.order.page"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
RpcPagination
<
HistoryOrderPageResponse
>>
pageOrder
(
HistoryOrderPageRequest
request
)
{
public
RopResponse
<
RpcPagination
<
HistoryOrderPageResponse
>>
pageOrder
(
HistoryOrderPageRequest
request
)
{
...
@@ -45,4 +72,111 @@ public class GoodsOrderController {
...
@@ -45,4 +72,111 @@ public class GoodsOrderController {
}
}
@ServiceMethod
(
method
=
"dj.api.smartcarlife.order.preliminaryOrder.batch"
,
needInSession
=
NeedInSessionType
.
YES
)
@ApiOperation
(
"批量预录入订单"
)
public
RopResponse
<
Boolean
>
batchPreliminaryOrder
(
PreliminaryOrderBatchRequest
request
)
{
LifeMerchantCouponDTO
merchantCouponDTO
=
getMerchantCoupon
(
request
.
getMerchantId
(),
request
.
getPreliminaryOrders
().
size
());
if
(
Objects
.
isNull
(
merchantCouponDTO
)
||
(
merchantCouponDTO
.
getAmount
()
-
merchantCouponDTO
.
getGetAmount
())
<
1
)
{
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERVICE_ERROR
,
"无可用的优惠券或优惠券数量不足"
);
}
GoodsOrderDTO
record
=
buildGoodsOrderDTO
(
request
);
record
.
setMerchantCouponId
(
merchantCouponDTO
.
getId
());
for
(
GoodsOrderCustomerDTO
preliminaryOrder
:
request
.
getPreliminaryOrders
())
{
record
.
setCustomer
(
preliminaryOrder
);
record
.
setSceneType
(
preliminaryOrder
.
getSceneType
());
record
.
setBusinessType
(
preliminaryOrder
.
getBusinessType
());
record
.
setBaseSceneCode
(
preliminaryOrder
.
getBaseSceneCode
());
RpcResponse
<
GoodsOrderDTO
>
res
=
goodsOrderRemote
.
preliminaryOrder
(
record
);
if
(!
res
.
hasResult
())
{
return
RopResponse
.
result
(
RopErrorEnum
.
SCL_CREATEORDER_FAILURE
,
res
.
getMessage
());
}
}
return
RopResponse
.
success
(
true
);
}
private
GoodsOrderDTO
buildGoodsOrderDTO
(
PreliminaryOrderBatchRequest
request
)
{
LoginUserInfoResponse
loginUserInfo
=
CommonUtil
.
getLoginUserInfo
();
GoodsOrderDTO
record
=
CommonUtil
.
convertRequest
(
GoodsOrderDTO
.
class
);
record
.
setSource
(
CarLifeEnum
.
OrderSource
.
PAD_INPUT
.
getValue
());
record
.
setSellerMerchantId
(
loginUserInfo
.
getMerchantId
());
record
.
setAdvanceUserId
(
loginUserInfo
.
getUuid
());
record
.
setAdvanceUserName
(
loginUserInfo
.
getName
());
record
.
setUpdatedBy
(
loginUserInfo
.
getName
());
record
.
setSceneType
(
SceneTypeEnum
.
SCENE1_1
.
getValue
());
record
.
setSellerUserId
(
loginUserInfo
.
getUuid
());
if
(
loginUserInfo
.
getUserType
()
==
UserTypeEnum
.
EMPLOYEE
.
getValue
())
{
record
.
setSellerName
(
loginUserInfo
.
getName
());
}
else
{
record
.
setSellerName
(
"管理员"
);
}
return
record
;
}
/**
* 查询4s店可用优惠券
*
* @param merchantId 4s店商户号
* @return 商户优惠券id
*/
public
LifeMerchantCouponDTO
getMerchantCoupon
(
Integer
merchantId
,
Integer
size
)
{
LifeMerchantCouponDTO
condition
=
LifeMerchantCouponDTO
.
builder
().
merchantId
(
merchantId
).
enabledFlag
(
CarLifeEnum
.
Flag
.
Y
.
name
()).
build
();
RpcResponse
<
List
<
LifeMerchantCouponDTO
>>
res
=
lifeMerchantCouponRemote
.
list
(
condition
);
LifeMerchantCouponDTO
lifeMerchantCouponDTOResult
=
null
;
if
(
res
.
hasResult
())
{
if
(
CollectionUtils
.
isNotEmpty
(
res
.
getResult
()))
{
// 默认取第一个
lifeMerchantCouponDTOResult
=
res
.
getResult
().
get
(
0
);
// 遍历发现有太阳膜的话取太阳膜类型的券
for
(
LifeMerchantCouponDTO
lifeMerchantCouponDTO
:
res
.
getResult
())
{
if
(
lifeMerchantCouponDTO
.
getCouponInfo
()
!=
null
&&
"太阳膜"
.
equals
(
lifeMerchantCouponDTO
.
getCouponInfo
().
getCouponTypeName
()))
{
lifeMerchantCouponDTOResult
=
lifeMerchantCouponDTO
;
break
;
}
}
}
}
return
lifeMerchantCouponDTOResult
;
}
/**
* 客户建档详情
*/
@ServiceMethod
(
method
=
"dj.api.smartcarlife.order.customerProfileInfo"
,
needInSession
=
NeedInSessionType
.
YES
)
@ApiOperation
(
"客户建档详情"
)
public
RopResponse
<
CustomerProfileInfoDTO
>
customerProfileInfo
(
CustomerProfileInfoRequest
request
)
{
// LoginUserInfoResponse loginUserInfo = CommonUtil.getLoginUserInfo();
CustomerProfileInfoDTO
dto
=
CommonUtil
.
convertRequest
(
CustomerProfileInfoDTO
.
class
);
RpcResponse
<
CustomerProfileInfoDTO
>
res
=
goodsOrderRemote
.
getCustomerProfileInfo
(
dto
);
return
CommonUtil
.
convertRopResponse
(
res
);
}
/**
* 客户档案提交
*/
@ServiceMethod
(
method
=
"dj.api.smartcarlife.order.submitCustomerProfile"
,
needInSession
=
NeedInSessionType
.
YES
)
@ApiOperation
(
"客户档案提交"
)
public
RopResponse
<
Boolean
>
submitCustomerProfile
(
CustomerProfileInfoRequest
request
)
{
LoginUserInfoResponse
loginUserInfo
=
CommonUtil
.
getLoginUserInfo
();
CustomerProfileInfoDTO
dto
=
CommonUtil
.
convertRequest
(
CustomerProfileInfoDTO
.
class
);
if
(
ObjectUtil
.
isNotEmpty
(
loginUserInfo
))
{
dto
.
setUpdatedBy
(
loginUserInfo
.
getName
());
}
else
{
dto
.
setUpdatedBy
(
"system"
);
}
RpcResponse
<
Boolean
>
res
=
goodsOrderRemote
.
submitCustomerProfile
(
dto
);
return
CommonUtil
.
convertRopResponse
(
res
);
}
/**
* 客户建档分页查询
*/
@ServiceMethod
(
method
=
"dj.api.smartcarlife.order.pageCustomerProfileInfo"
,
needInSession
=
NeedInSessionType
.
YES
)
@ApiOperation
(
"客户建档分页查询"
)
public
RopResponse
<
RpcPagination
<
CustomerProfileInfoDTO
>>
pageCustomerProfileInfo
(
CustomerProfileInfoRequest
request
)
{
CustomerProfileInfoDTO
dto
=
CommonUtil
.
convertRequest
(
CustomerProfileInfoDTO
.
class
);
RpcResponse
<
RpcPagination
<
CustomerProfileInfoDTO
>>
res
=
goodsOrderRemote
.
pageCustomerProfileInfo
(
dto
);
return
CommonUtil
.
convertRopResponse
(
res
);
}
}
}
src/main/java/cn/com/glsx/dj/pad/controller/strategy/CustomerSopController.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
controller
.
strategy
;
import
cn.com.glsx.dj.pad.request.strategy.CustomerSopTaskDetailRequest
;
import
cn.com.glsx.dj.pad.request.strategy.CustomerSopTaskPageRequest
;
import
cn.com.glsx.dj.pad.response.strategy.CustomerSopTaskDetailResponse
;
import
cn.com.glsx.dj.pad.response.strategy.CustomerSopTaskPageResponse
;
import
cn.com.glsx.dj.pad.service.CustomerSopService
;
import
cn.com.glsx.dj.pad.util.CommonUtil
;
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
;
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
;
@Slf4j
@Api
(
"SOP任务客户接口"
)
@RequiredArgsConstructor
@ServiceMethodBean
(
version
=
"1.0.0"
,
needInSession
=
NeedInSessionType
.
YES
)
public
class
CustomerSopController
{
private
final
CustomerSopService
customerSopService
;
@ApiOperation
(
"查询今日待执行触达客户"
)
@ServiceMethod
(
method
=
"dj.pad.api.today.sop.task.customer.page"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
RpcPagination
<
CustomerSopTaskPageResponse
>>
pageTodayPendingCustomers
(
CustomerSopTaskPageRequest
request
)
{
try
{
CommonUtil
.
getMerchantId
();
return
RopResponse
.
success
(
customerSopService
.
pageTodayPendingCustomers
(
request
));
}
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
);
}
}
@ApiOperation
(
"查询近7天已触达客户"
)
@ServiceMethod
(
method
=
"dj.pad.api.last.week.sop.task.customer.page"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
RpcPagination
<
CustomerSopTaskPageResponse
>>
pageLastWeekReachedCustomers
(
CustomerSopTaskPageRequest
request
)
{
try
{
return
RopResponse
.
success
(
customerSopService
.
pageLastWeekReachedCustomers
(
request
));
}
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
);
}
}
@ApiOperation
(
"查询客户今日未触达任务列表"
)
@ServiceMethod
(
method
=
"dj.pad.api.today.sop.task.detail.list"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
List
<
CustomerSopTaskDetailResponse
>>
listTodayPendingTaskDetails
(
CustomerSopTaskDetailRequest
request
)
{
try
{
return
RopResponse
.
success
(
customerSopService
.
listTodayPendingTaskDetails
(
request
));
}
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
);
}
}
@ApiOperation
(
"查询客户近7天推送任务记录列表"
)
@ServiceMethod
(
method
=
"dj.pad.api.last.week.sop.task.detail.list"
,
needInSession
=
NeedInSessionType
.
YES
)
public
RopResponse
<
List
<
CustomerSopTaskDetailResponse
>>
listLastWeekTaskRecords
(
CustomerSopTaskDetailRequest
request
)
{
try
{
return
RopResponse
.
success
(
customerSopService
.
listLastWeekTaskRecords
(
request
));
}
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
);
}
}
}
src/main/java/cn/com/glsx/dj/pad/controller/strategy/MarketingActivityProductController.java
0 → 100644
View file @
6c43a55
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
;
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
org.springframework.util.CollectionUtils
;
import
java.util.List
;
@Slf4j
@Api
(
"营销活动商品接口"
)
@RequiredArgsConstructor
@ServiceMethodBean
(
version
=
"1.0.0"
,
needInSession
=
NeedInSessionType
.
YES
)
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
)
{
try
{
return
RopResponse
.
success
(
marketingActivityProductService
.
listActiveProducts
(
request
));
}
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
);
}
}
@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
);
}
}
}
src/main/java/cn/com/glsx/dj/pad/enums/RopErrorEnum.java
View file @
6c43a55
...
@@ -6,6 +6,18 @@ import java.util.HashMap;
...
@@ -6,6 +6,18 @@ import java.util.HashMap;
import
java.util.Map
;
import
java.util.Map
;
public
enum
RopErrorEnum
implements
ErrorEnum
{
public
enum
RopErrorEnum
implements
ErrorEnum
{
/*******************智享车生活订单模块*************************/
/** 创建子订单-子订单创建失败**/
SCL_CREATESUBORDER_FAILURE
(
"30010101"
,
"子订单创建失败"
),
SCL_CREATEORDER_FAILURE
(
"30010201"
,
"订单创建失败"
),
SCL_ORDER_LIST_FAILURE
(
"30010202"
,
"订单查询失败"
),
SCL_ORDER_SEARCH_FAILURE
(
"30010203"
,
"订单搜索失败"
),
SCL_WAITINPUTORDER_COUNT_FAILURE
(
"30010301"
,
"获取待补录订单统计失败"
),
SCL_WAITINPUTORDER_PAGE_FAILURE
(
"30010302"
,
"分页查询待补录订单失败"
),
SCL_BATCH_INSERT_FAIL_ORDER_FAILURE
(
"30010303"
,
"批量导入战败订单失败"
),
SCL_GET_LAST_ORDER_USER_FAIL_FAILURE
(
"30010304"
,
"查询转化员上一笔订单4s店销售失败"
),
SCL_WAITINPUTORDER_GET_BY_ID_FAILURE
(
"30010305"
,
"根据id查询待补录订单信息错误"
),
/** 登录-登录账号异常**/
/** 登录-登录账号异常**/
SCL_WORKWECHAT_SELECT_ACCOUNT_ERROR
(
"30990201"
,
"登录账号异常"
),
SCL_WORKWECHAT_SELECT_ACCOUNT_ERROR
(
"30990201"
,
"登录账号异常"
),
/** 获取登录信息-登录失效**/
/** 获取登录信息-登录失效**/
...
...
src/main/java/cn/com/glsx/dj/pad/request/order/CustomerProfileInfoRequest.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
request
.
order
;
import
cn.com.glsx.dj.smartcarlife.dto.GoodsSubOrderDTO
;
import
cn.com.glsx.dj.smartcarlife.model.CustomerInviteRecord
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
CustomerProfileInfoRequest
extends
AbstractRopRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
6674947501301910191L
;
/**
* 客户id
*/
@ApiModelProperty
(
notes
=
"客户id"
)
private
Integer
id
;
/**
* 客户姓名
*/
@ApiModelProperty
(
notes
=
"客户姓名"
)
private
String
customerName
;
/**
* 客户手机号
*/
@ApiModelProperty
(
notes
=
"客户手机号"
)
private
String
customerPhone
;
/**
* 客户状态 1-待跟进 2-已升级 3-战败 4-已退款
*/
@ApiModelProperty
(
notes
=
"客户状态 1-待跟进 2-已升级 3-战败 4-已退款"
)
private
Integer
customerStatus
;
/**
* 车架号
*/
@ApiModelProperty
(
notes
=
"车架号"
)
private
String
standNo
;
/**
* 到店日期
*/
@ApiModelProperty
(
notes
=
"到店日期"
)
private
Date
inviteDate
;
/**
* 车辆品牌id
*/
@ApiModelProperty
(
notes
=
"车辆品牌id"
)
private
Integer
carBrandId
;
/**
* 车辆品牌名称
*/
@ApiModelProperty
(
notes
=
"车辆品牌名称"
)
private
String
carBrand
;
/**
* 子品牌id
*/
@ApiModelProperty
(
notes
=
"子品牌id"
)
private
Integer
carChildsBrandId
;
/**
* 子品牌名字
*/
@ApiModelProperty
(
notes
=
"子品牌名字"
)
private
String
carChildsBrandName
;
/**
* 车系id
*/
@ApiModelProperty
(
notes
=
"车系id"
)
private
Integer
carSeriesId
;
/**
* 车系名字
*/
@ApiModelProperty
(
notes
=
"车系名字"
)
private
String
carSeriesName
;
/**
* 交付日期
*/
@ApiModelProperty
(
notes
=
"交付日期"
)
private
Date
deliveryDate
;
/**
* 建档日期 创建时间
*/
@ApiModelProperty
(
notes
=
"建档日期 创建时间"
)
private
Date
createdDate
;
/**
* 客户来源
*/
@ApiModelProperty
(
notes
=
"客户来源"
)
private
Integer
source
;
/**
* 流量来源 - 4s店id
*/
@ApiModelProperty
(
notes
=
"流量来源 - 4s店id"
)
private
Integer
merchantId
;
/**
* 流量来源 - 4s店名称
*/
@ApiModelProperty
(
notes
=
"流量来源 - 4s店名称"
)
private
String
merchantName
;
/**
* 流量来源 - 推荐人id
*/
@ApiModelProperty
(
notes
=
"流量来源 - 推荐人id"
)
private
String
userId
;
/**
* 流量来源 - 推荐人名称
*/
@ApiModelProperty
(
notes
=
"流量来源 - 推荐人名称"
)
private
String
employeeName
;
/**
* 预录员(转化员)用户ID 驻店零售id
*/
@ApiModelProperty
(
notes
=
"预录员(转化员)用户ID 驻店零售id"
)
private
String
advanceUserId
;
/**
* 预录员(转化员)用户名称 驻店零售名称
*/
@ApiModelProperty
(
notes
=
"预录员(转化员)用户名称 驻店零售名称"
)
private
String
advanceUserName
;
/**
* 客户群id
*/
@ApiModelProperty
(
notes
=
"客户群id"
)
private
String
qwGroupId
;
/**
* 客户群名称
*/
@ApiModelProperty
(
notes
=
"客户群名称"
)
private
String
qwGroupName
;
/**
* 微信id
*/
@ApiModelProperty
(
notes
=
"微信id"
)
private
String
wxId
;
/**
* 微信名称
*/
@ApiModelProperty
(
notes
=
"微信名称"
)
private
String
wxName
;
/**
* 备注
*/
@ApiModelProperty
(
notes
=
"备注"
)
private
String
remark
;
/**
* 修改人
*/
@ApiModelProperty
(
notes
=
"修改人"
)
private
String
updatedBy
;
/**
* 商品信息
*/
@ApiModelProperty
(
notes
=
"商品信息"
)
private
List
<
GoodsSubOrderDTO
>
goodsSubOrderDTOS
;
/**
* 客户邀约记录
*/
@ApiModelProperty
(
notes
=
"客户邀约记录"
)
private
List
<
CustomerInviteRecord
>
inviteRecord
;
/**
* 分页参数 pageNum
*/
@ApiModelProperty
(
notes
=
"分页参数 pageNum"
)
private
Integer
pageNum
;
@ApiModelProperty
(
notes
=
"分页参数 pageSize"
)
private
Integer
pageSize
;
}
src/main/java/cn/com/glsx/dj/pad/request/order/PreliminaryOrderBatchRequest.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
request
.
order
;
import
cn.com.glsx.dj.smartcarlife.dto.GoodsOrderCustomerDTO
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.ToString
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
* @author chenx
*/
@Data
@ToString
public
class
PreliminaryOrderBatchRequest
extends
AbstractRopRequest
{
@NotNull
@ApiModelProperty
(
name
=
"userId"
,
notes
=
"销售顾问用户ID"
,
dataType
=
"int"
,
required
=
true
)
private
String
userId
;
@NotNull
@ApiModelProperty
(
name
=
"merchantId"
,
notes
=
"4S店商户号"
,
dataType
=
"int"
,
required
=
true
)
private
Integer
merchantId
;
@NotNull
@ApiModelProperty
(
name
=
"employeeName"
,
notes
=
"销售顾问名称"
,
dataType
=
"String"
,
required
=
true
)
private
String
employeeName
;
@NotNull
@ApiModelProperty
(
name
=
"sellerMerchantId"
,
notes
=
"园区店商户号"
,
dataType
=
"int"
,
required
=
true
)
private
Integer
sellerMerchantId
;
@NotEmpty
@ApiModelProperty
(
name
=
"preliminaryOrders"
,
notes
=
"快速建档客户信息集合"
,
required
=
true
)
private
List
<
GoodsOrderCustomerDTO
>
preliminaryOrders
;
}
src/main/java/cn/com/glsx/dj/pad/request/strategy/CustomerSopTaskDetailRequest.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
request
.
strategy
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
"SOP任务客户明细查询请求"
)
public
class
CustomerSopTaskDetailRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
value
=
"4S店商户号"
,
required
=
true
)
private
Integer
merchantId
;
@ApiModelProperty
(
value
=
"客户ID"
,
required
=
true
)
private
Integer
customerInstanceId
;
}
src/main/java/cn/com/glsx/dj/pad/request/strategy/CustomerSopTaskPageRequest.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
request
.
strategy
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
"SOP任务客户分页查询请求"
)
public
class
CustomerSopTaskPageRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
value
=
"当前页码"
,
required
=
true
)
private
Integer
pageNum
;
@ApiModelProperty
(
value
=
"每页数据条数"
,
required
=
true
)
private
Integer
pageSize
;
@ApiModelProperty
(
value
=
"4S店商户号"
,
required
=
true
)
private
Integer
merchantId
;
}
src/main/java/cn/com/glsx/dj/pad/request/strategy/MarketingActivityProductRequest.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
request
.
strategy
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
"营销活动商品查询请求"
)
public
class
MarketingActivityProductRequest
extends
AbstractRopRequest
{
@ApiModelProperty
(
value
=
"4S店商户号"
,
required
=
true
)
private
Integer
merchantId
;
}
src/main/java/cn/com/glsx/dj/pad/response/strategy/CarSeriesResponse.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
response
.
strategy
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
@ApiModel
(
"车系响应"
)
public
class
CarSeriesResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
name
=
"carSeriesId"
,
notes
=
"车系ID,通用车系为-1"
)
private
Integer
carSeriesId
;
@ApiModelProperty
(
name
=
"carSeriesName"
,
notes
=
"车系名称"
)
private
String
carSeriesName
;
@ApiModelProperty
(
name
=
"productList"
,
notes
=
"车系下商品/套餐列表"
)
private
List
<
ProductResponse
>
productList
;
}
src/main/java/cn/com/glsx/dj/pad/response/strategy/CustomerSopTaskDetailResponse.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
response
.
strategy
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
@ApiModel
(
"SOP任务明细响应"
)
public
class
CustomerSopTaskDetailResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
name
=
"taskId"
,
notes
=
"任务ID"
)
private
Integer
taskId
;
@ApiModelProperty
(
name
=
"strategyId"
,
notes
=
"策略ID"
)
private
Integer
strategyId
;
@ApiModelProperty
(
name
=
"actionType"
,
notes
=
"任务动态类型,1=向客户群发送消息"
)
private
Integer
actionType
;
@ApiModelProperty
(
name
=
"messageType"
,
notes
=
"消息类型,1=文本 2=图片 3=视频 4=网页链接"
)
private
Integer
messageType
;
@ApiModelProperty
(
name
=
"messageContent"
,
notes
=
"消息内容"
)
private
String
messageContent
;
@ApiModelProperty
(
name
=
"taskStatus"
,
notes
=
"任务状态,0=待确认(不触发) 1=已触达 2=不触达(已拒绝) 3=推送失败"
)
private
Integer
taskStatus
;
@ApiModelProperty
(
name
=
"confirmBy"
,
notes
=
"操作人(任务确认人)"
)
private
String
confirmBy
;
@ApiModelProperty
(
name
=
"pushResult"
,
notes
=
"推送结果,2=成功 3=失败"
)
private
Integer
pushResult
;
}
src/main/java/cn/com/glsx/dj/pad/response/strategy/CustomerSopTaskPageResponse.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
response
.
strategy
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
@Data
@ApiModel
(
"SOP任务客户分页列表响应"
)
public
class
CustomerSopTaskPageResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
name
=
"customerInstanceId"
,
notes
=
"客户ID"
)
private
Integer
customerInstanceId
;
@ApiModelProperty
(
name
=
"customerName"
,
notes
=
"客户姓名"
)
private
String
customerName
;
@ApiModelProperty
(
name
=
"customerPhone"
,
notes
=
"客户手机号"
)
private
String
customerPhone
;
@ApiModelProperty
(
name
=
"customerStatus"
,
notes
=
"客户状态"
)
private
String
customerStatus
;
@ApiModelProperty
(
name
=
"qwGroupName"
,
notes
=
"企微客户群名称"
)
private
String
qwGroupName
;
@ApiModelProperty
(
name
=
"carSeriesName"
,
notes
=
"车型名称"
)
private
String
carSeriesName
;
@ApiModelProperty
(
name
=
"orderHandleTime"
,
notes
=
"订单处理时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
orderHandleTime
;
@ApiModelProperty
(
name
=
"confirmBy"
,
notes
=
"跟进人"
)
private
String
confirmBy
;
@ApiModelProperty
(
name
=
"lastExecuteTime"
,
notes
=
"最近一次任务执行时间"
)
@JsonFormat
(
pattern
=
"MM-dd HH:mm"
,
timezone
=
"GMT+8"
)
private
Date
lastExecuteTime
;
@ApiModelProperty
(
name
=
"tagList"
,
notes
=
"客户标签名称列表"
)
private
List
<
String
>
tagList
;
}
src/main/java/cn/com/glsx/dj/pad/response/strategy/MarketingStageGroupResponse.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
response
.
strategy
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
@ApiModel
(
"营销阶段分组响应"
)
public
class
MarketingStageGroupResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
name
=
"marketingStage"
,
notes
=
"活动类型,0=售前活动 1=售后活动"
)
private
Integer
marketingStage
;
@ApiModelProperty
(
name
=
"carSeriesList"
,
notes
=
"车系列表"
)
private
List
<
CarSeriesResponse
>
carSeriesList
;
}
src/main/java/cn/com/glsx/dj/pad/response/strategy/ProductResponse.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
response
.
strategy
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
@Data
@ApiModel
(
"营销活动商品响应"
)
public
class
ProductResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
name
=
"productId"
,
notes
=
"商品套餐主键ID"
)
private
Integer
productId
;
@ApiModelProperty
(
name
=
"productType"
,
notes
=
"商品类型,0=套餐 1=商品(枚举见ProductTypeEnum)"
)
private
Integer
productType
;
@ApiModelProperty
(
name
=
"tabName"
,
notes
=
"套餐/商品名称"
)
private
String
tabName
;
@ApiModelProperty
(
name
=
"tabDescription"
,
notes
=
"商品描述"
)
private
String
tabDescription
;
@ApiModelProperty
(
name
=
"isMainPush"
,
notes
=
"主推/次推,0=否 1=是"
)
private
Integer
isMainPush
;
@ApiModelProperty
(
name
=
"currentPrice"
,
notes
=
"原价"
)
private
BigDecimal
currentPrice
;
@ApiModelProperty
(
name
=
"discountPrice"
,
notes
=
"活动价"
)
private
BigDecimal
discountPrice
;
@ApiModelProperty
(
name
=
"mainImageUrl"
,
notes
=
"Banner图"
)
private
String
mainImageUrl
;
@ApiModelProperty
(
name
=
"thumbImageUrl"
,
notes
=
"小图"
)
private
String
thumbImageUrl
;
@ApiModelProperty
(
name
=
"detailImageUrl"
,
notes
=
"详情图"
)
private
String
detailImageUrl
;
@ApiModelProperty
(
name
=
"startTime"
,
notes
=
"活动开始时间"
)
@JsonFormat
(
pattern
=
"MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
@ApiModelProperty
(
name
=
"endTime"
,
notes
=
"活动结束时间"
)
@JsonFormat
(
pattern
=
"MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
}
src/main/java/cn/com/glsx/dj/pad/response/strategy/StrategyDataStatusResponse.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
response
.
strategy
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
@ApiModel
(
"策略首页数据状态响应"
)
public
class
StrategyDataStatusResponse
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
notes
=
"营销活动是否有数据 true=有数据,false=无数据"
)
private
Boolean
marketingActivityHasData
;
@ApiModelProperty
(
notes
=
"挖掘潜客机会是否有数据 true=有数据,false=无数据"
)
private
Boolean
customerListHasData
;
}
src/main/java/cn/com/glsx/dj/pad/service/CustomerSopService.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
service
;
import
cn.com.glsx.dj.pad.request.strategy.CustomerSopTaskDetailRequest
;
import
cn.com.glsx.dj.pad.request.strategy.CustomerSopTaskPageRequest
;
import
cn.com.glsx.dj.pad.response.strategy.CustomerSopTaskDetailResponse
;
import
cn.com.glsx.dj.pad.response.strategy.CustomerSopTaskPageResponse
;
import
cn.com.glsx.dj.pad.util.CommonUtil
;
import
cn.com.glsx.dj.strategy.dto.ProfileQueryReqDTO
;
import
cn.com.glsx.dj.strategy.dto.CustomerProfileRespDTO
;
import
cn.com.glsx.dj.strategy.dto.sop.CustomerSopTaskDetailReqDTO
;
import
cn.com.glsx.dj.strategy.dto.sop.CustomerSopTaskDetailRespDTO
;
import
cn.com.glsx.dj.strategy.dto.sop.CustomerSopTaskPageReqDTO
;
import
cn.com.glsx.dj.strategy.dto.sop.CustomerSopTaskRespDTO
;
import
cn.com.glsx.dj.strategy.remote.CustomerSopRemote
;
import
cn.com.glsx.dj.strategy.remote.CustomerTagProfileRemote
;
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
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Slf4j
@Service
@RequiredArgsConstructor
public
class
CustomerSopService
{
private
final
CustomerSopRemote
customerSopRemote
;
private
final
CustomerTagProfileRemote
customerTagProfileRemote
;
public
RpcPagination
<
CustomerSopTaskPageResponse
>
pageTodayPendingCustomers
(
CustomerSopTaskPageRequest
request
)
{
RpcPagination
<
CustomerSopTaskPageReqDTO
>
pagination
=
CommonUtil
.
getRpcPagination
(
CustomerSopTaskPageReqDTO
.
class
);
pagination
.
setPageNum
(
request
.
getPageNum
());
pagination
.
setPageSize
(
request
.
getPageSize
());
CustomerSopTaskPageReqDTO
condition
=
new
CustomerSopTaskPageReqDTO
();
condition
.
setMerchantId
(
request
.
getMerchantId
());
pagination
.
setCondition
(
condition
);
RpcResponse
<
RpcPagination
<
CustomerSopTaskRespDTO
>>
response
=
customerSopRemote
.
pageTodayPendingCustomers
(
pagination
);
if
(!
response
.
isSuccess
())
{
throw
new
RpcServiceException
(
response
.
getMessage
());
}
RpcPagination
<
CustomerSopTaskRespDTO
>
rpcPage
=
response
.
getResult
();
List
<
CustomerSopTaskRespDTO
>
rpcList
=
rpcPage
.
getList
();
if
(
CollectionUtils
.
isEmpty
(
rpcList
))
{
return
buildEmptyPage
(
request
);
}
Map
<
String
,
List
<
String
>>
tagMap
=
queryTags
(
rpcList
);
List
<
CustomerSopTaskPageResponse
>
respList
=
rpcList
.
stream
()
.
map
(
dto
->
convertToPageResponse
(
dto
,
tagMap
))
.
collect
(
Collectors
.
toList
());
RpcPagination
<
CustomerSopTaskPageResponse
>
result
=
new
RpcPagination
<>();
result
.
setPageNum
(
rpcPage
.
getPageNum
());
result
.
setPageSize
(
rpcPage
.
getPageSize
());
result
.
setTotal
(
rpcPage
.
getTotal
());
result
.
setList
(
respList
);
return
result
;
}
public
RpcPagination
<
CustomerSopTaskPageResponse
>
pageLastWeekReachedCustomers
(
CustomerSopTaskPageRequest
request
)
{
RpcPagination
<
CustomerSopTaskPageReqDTO
>
pagination
=
CommonUtil
.
getRpcPagination
(
CustomerSopTaskPageReqDTO
.
class
);
pagination
.
setPageNum
(
request
.
getPageNum
());
pagination
.
setPageSize
(
request
.
getPageSize
());
CustomerSopTaskPageReqDTO
condition
=
new
CustomerSopTaskPageReqDTO
();
condition
.
setMerchantId
(
request
.
getMerchantId
());
pagination
.
setCondition
(
condition
);
RpcResponse
<
RpcPagination
<
CustomerSopTaskRespDTO
>>
response
=
customerSopRemote
.
pageLastWeekReachedCustomers
(
pagination
);
if
(!
response
.
isSuccess
())
{
throw
new
RpcServiceException
(
response
.
getMessage
());
}
RpcPagination
<
CustomerSopTaskRespDTO
>
rpcPage
=
response
.
getResult
();
List
<
CustomerSopTaskRespDTO
>
rpcList
=
rpcPage
.
getList
();
if
(
CollectionUtils
.
isEmpty
(
rpcList
))
{
return
buildEmptyPage
(
request
);
}
Map
<
String
,
List
<
String
>>
tagMap
=
queryTags
(
rpcList
);
List
<
CustomerSopTaskPageResponse
>
respList
=
rpcList
.
stream
()
.
map
(
dto
->
convertToPageResponse
(
dto
,
tagMap
))
.
collect
(
Collectors
.
toList
());
RpcPagination
<
CustomerSopTaskPageResponse
>
result
=
new
RpcPagination
<>();
result
.
setPageNum
(
rpcPage
.
getPageNum
());
result
.
setPageSize
(
rpcPage
.
getPageSize
());
result
.
setTotal
(
rpcPage
.
getTotal
());
result
.
setList
(
respList
);
return
result
;
}
public
List
<
CustomerSopTaskDetailResponse
>
listTodayPendingTaskDetails
(
CustomerSopTaskDetailRequest
request
)
{
CustomerSopTaskDetailReqDTO
reqDTO
=
new
CustomerSopTaskDetailReqDTO
();
reqDTO
.
setMerchantId
(
request
.
getMerchantId
());
reqDTO
.
setCustomerInstanceId
(
request
.
getCustomerInstanceId
());
RpcResponse
<
List
<
CustomerSopTaskDetailRespDTO
>>
response
=
customerSopRemote
.
listTodayPendingTaskDetails
(
reqDTO
);
if
(!
response
.
isSuccess
())
{
throw
new
RpcServiceException
(
response
.
getMessage
());
}
List
<
CustomerSopTaskDetailRespDTO
>
rpcList
=
response
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
rpcList
))
{
return
Collections
.
emptyList
();
}
return
rpcList
.
stream
()
.
map
(
this
::
convertToDetailResponse
)
.
collect
(
Collectors
.
toList
());
}
public
List
<
CustomerSopTaskDetailResponse
>
listLastWeekTaskRecords
(
CustomerSopTaskDetailRequest
request
)
{
CustomerSopTaskDetailReqDTO
reqDTO
=
new
CustomerSopTaskDetailReqDTO
();
reqDTO
.
setMerchantId
(
request
.
getMerchantId
());
reqDTO
.
setCustomerInstanceId
(
request
.
getCustomerInstanceId
());
RpcResponse
<
List
<
CustomerSopTaskDetailRespDTO
>>
response
=
customerSopRemote
.
listLastWeekTaskRecords
(
reqDTO
);
if
(!
response
.
isSuccess
())
{
throw
new
RpcServiceException
(
response
.
getMessage
());
}
List
<
CustomerSopTaskDetailRespDTO
>
rpcList
=
response
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
rpcList
))
{
return
Collections
.
emptyList
();
}
return
rpcList
.
stream
()
.
map
(
this
::
convertToDetailResponse
)
.
collect
(
Collectors
.
toList
());
}
private
Map
<
String
,
List
<
String
>>
queryTags
(
List
<
CustomerSopTaskRespDTO
>
rpcList
)
{
List
<
String
>
phones
=
rpcList
.
stream
()
.
map
(
CustomerSopTaskRespDTO:
:
getCustomerPhone
)
.
filter
(
phone
->
phone
!=
null
&&
!
phone
.
isEmpty
())
.
distinct
()
.
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
phones
))
{
return
Collections
.
emptyMap
();
}
ProfileQueryReqDTO
req
=
new
ProfileQueryReqDTO
();
req
.
setPhoneList
(
phones
);
RpcResponse
<
List
<
CustomerProfileRespDTO
>>
response
=
customerTagProfileRemote
.
queryCustomerProfileByPhones
(
req
);
if
(!
response
.
isSuccess
()
||
CollectionUtils
.
isEmpty
(
response
.
getResult
()))
{
return
Collections
.
emptyMap
();
}
return
response
.
getResult
().
stream
()
.
collect
(
Collectors
.
groupingBy
(
CustomerProfileRespDTO:
:
getPhone
,
Collectors
.
mapping
(
CustomerProfileRespDTO:
:
getEnumName
,
Collectors
.
toList
())
));
}
private
CustomerSopTaskPageResponse
convertToPageResponse
(
CustomerSopTaskRespDTO
dto
,
Map
<
String
,
List
<
String
>>
tagMap
)
{
CustomerSopTaskPageResponse
resp
=
new
CustomerSopTaskPageResponse
();
BeanUtils
.
copyProperties
(
dto
,
resp
);
resp
.
setTagList
(
tagMap
.
getOrDefault
(
dto
.
getCustomerPhone
(),
Collections
.
emptyList
()));
return
resp
;
}
private
CustomerSopTaskDetailResponse
convertToDetailResponse
(
CustomerSopTaskDetailRespDTO
dto
)
{
CustomerSopTaskDetailResponse
resp
=
new
CustomerSopTaskDetailResponse
();
BeanUtils
.
copyProperties
(
dto
,
resp
);
return
resp
;
}
private
RpcPagination
<
CustomerSopTaskPageResponse
>
buildEmptyPage
(
CustomerSopTaskPageRequest
request
)
{
RpcPagination
<
CustomerSopTaskPageResponse
>
result
=
new
RpcPagination
<>();
result
.
setPageNum
(
request
.
getPageNum
());
result
.
setPageSize
(
request
.
getPageSize
());
result
.
setTotal
(
0L
);
result
.
setList
(
Collections
.
emptyList
());
return
result
;
}
}
src/main/java/cn/com/glsx/dj/pad/service/MarketingActivityProductService.java
0 → 100644
View file @
6c43a55
package
cn
.
com
.
glsx
.
dj
.
pad
.
service
;
import
cn.com.glsx.dj.pad.request.strategy.MarketingActivityProductRequest
;
import
cn.com.glsx.dj.pad.response.strategy.CarSeriesResponse
;
import
cn.com.glsx.dj.pad.response.strategy.MarketingStageGroupResponse
;
import
cn.com.glsx.dj.pad.response.strategy.ProductResponse
;
import
cn.com.glsx.dj.strategy.dto.marketing.ActivityProductListReqDTO
;
import
cn.com.glsx.dj.strategy.dto.marketing.CarSeriesRespDTO
;
import
cn.com.glsx.dj.strategy.dto.marketing.MarketingStageGroupRespDTO
;
import
cn.com.glsx.dj.strategy.dto.marketing.ProductRespDTO
;
import
cn.com.glsx.dj.strategy.remote.MarketingActivityProductRemote
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Slf4j
@Service
@RequiredArgsConstructor
public
class
MarketingActivityProductService
{
private
final
MarketingActivityProductRemote
marketingActivityProductRemote
;
public
List
<
MarketingStageGroupResponse
>
listActiveProducts
(
MarketingActivityProductRequest
request
)
{
ActivityProductListReqDTO
reqDTO
=
new
ActivityProductListReqDTO
();
reqDTO
.
setMerchantId
(
request
.
getMerchantId
());
RpcResponse
<
List
<
MarketingStageGroupRespDTO
>>
response
=
marketingActivityProductRemote
.
listActiveProducts
(
reqDTO
);
if
(!
response
.
isSuccess
())
{
throw
new
RpcServiceException
(
response
.
getMessage
());
}
List
<
MarketingStageGroupRespDTO
>
rpcList
=
response
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
rpcList
))
{
return
Collections
.
emptyList
();
}
return
rpcList
.
stream
()
.
map
(
this
::
convertStageGroup
)
.
collect
(
Collectors
.
toList
());
}
private
MarketingStageGroupResponse
convertStageGroup
(
MarketingStageGroupRespDTO
dto
)
{
MarketingStageGroupResponse
resp
=
new
MarketingStageGroupResponse
();
resp
.
setMarketingStage
(
dto
.
getMarketingStage
());
List
<
CarSeriesResponse
>
carSeriesList
=
dto
.
getCarSeriesList
().
stream
()
.
map
(
this
::
convertCarSeries
)
.
collect
(
Collectors
.
toList
());
resp
.
setCarSeriesList
(
carSeriesList
);
return
resp
;
}
private
CarSeriesResponse
convertCarSeries
(
CarSeriesRespDTO
dto
)
{
CarSeriesResponse
resp
=
new
CarSeriesResponse
();
BeanUtils
.
copyProperties
(
dto
,
resp
,
"productList"
);
List
<
ProductResponse
>
productList
=
dto
.
getProductList
().
stream
()
.
map
(
this
::
convertProduct
)
.
collect
(
Collectors
.
toList
());
resp
.
setProductList
(
productList
);
return
resp
;
}
private
ProductResponse
convertProduct
(
ProductRespDTO
dto
)
{
ProductResponse
resp
=
new
ProductResponse
();
BeanUtils
.
copyProperties
(
dto
,
resp
);
return
resp
;
}
}
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