Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-process-server
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 840c87af
authored
Sep 26, 2023
by
林永健
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+] 增加首页客户旅程统计接口
1 parent
73643ab9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
12 deletions
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/SopInstCustomerStatisticDTO.java
platform-process/src/main/java/cn/com/glsx/process/modules/client/CustomerSopJourneyFeignClient_T.java
platform-process/src/main/java/cn/com/glsx/process/modules/controller/SopInstController.java
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopInstService.java
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/SopInstCustomerStatisticDTO.java
0 → 100644
View file @
840c87a
package
cn
.
com
.
glsx
.
process
.
modules
.
model
;
import
cn.com.glsx.process.modules.entity.SopInst
;
import
lombok.Data
;
import
org.springframework.beans.BeanUtils
;
import
java.util.Map
;
@Data
public
class
SopInstCustomerStatisticDTO
extends
SopInst
{
/**
* 客户统计数据:Map<阶段, 客户数>
*/
private
Map
<
String
,
Long
>
statistics
;
public
SopInstCustomerStatisticDTO
(
SopInst
inst
)
{
BeanUtils
.
copyProperties
(
inst
,
this
);
}
}
\ No newline at end of file
\ No newline at end of file
platform-process/src/main/java/cn/com/glsx/process/modules/client/CustomerSopJourneyFeignClient_T.java
View file @
840c87a
package
cn
.
com
.
glsx
.
process
.
modules
.
client
;
package
cn
.
com
.
glsx
.
process
.
modules
.
client
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDTO
;
import
cn.com.glsx.cdp.modules.model.customer.*
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDetailDTO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneySearch
;
import
cn.com.glsx.cdp.modules.model.customer.ModifySopJourneyStageRequest
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.core.web.Result
;
import
com.glsx.plat.core.web.Result
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
...
@@ -13,6 +10,8 @@ import org.springframework.web.bind.annotation.PostMapping;
...
@@ -13,6 +10,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
/**
/**
* @Title: CustomerSopJourneyFeignClient.java
* @Title: CustomerSopJourneyFeignClient.java
* @Description: 客户sop旅程
* @Description: 客户sop旅程
...
@@ -35,4 +34,8 @@ public interface CustomerSopJourneyFeignClient_T {
...
@@ -35,4 +34,8 @@ public interface CustomerSopJourneyFeignClient_T {
@Operation
(
description
=
"修改客户旅程"
)
@Operation
(
description
=
"修改客户旅程"
)
@PostMapping
(
"/sopJourneyStage/modify"
)
@PostMapping
(
"/sopJourneyStage/modify"
)
Result
<
Boolean
>
modifyStage
(
@RequestBody
ModifySopJourneyStageRequest
request
);
Result
<
Boolean
>
modifyStage
(
@RequestBody
ModifySopJourneyStageRequest
request
);
@Operation
(
description
=
"查询客户旅程客户统计数据"
)
@PostMapping
(
"/statistics"
)
Result
<
List
<
CustomerSopJourneyStatisticsDTO
>>
statisticsCustomerSopJourney
(
@RequestBody
CustomerSopJourneySearch
request
);
}
}
platform-process/src/main/java/cn/com/glsx/process/modules/controller/SopInstController.java
View file @
840c87a
...
@@ -4,10 +4,7 @@ import cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDTO;
...
@@ -4,10 +4,7 @@ import cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDTO;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDetailDTO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDetailDTO
;
import
cn.com.glsx.process.modules.BaseController
;
import
cn.com.glsx.process.modules.BaseController
;
import
cn.com.glsx.process.modules.entity.SopInst
;
import
cn.com.glsx.process.modules.entity.SopInst
;
import
cn.com.glsx.process.modules.model.SopCustomerSearch
;
import
cn.com.glsx.process.modules.model.*
;
import
cn.com.glsx.process.modules.model.SopInstDTO
;
import
cn.com.glsx.process.modules.model.SopInstSearch
;
import
cn.com.glsx.process.modules.model.SopJourneyStageUpdate
;
import
cn.com.glsx.process.modules.service.SopInstService
;
import
cn.com.glsx.process.modules.service.SopInstService
;
import
cn.com.glsx.process.util.FileUploadServerData
;
import
cn.com.glsx.process.util.FileUploadServerData
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
...
@@ -44,6 +41,12 @@ public class SopInstController extends BaseController {
...
@@ -44,6 +41,12 @@ public class SopInstController extends BaseController {
return
sopInstService
.
selectByGroupId
(
search
);
return
sopInstService
.
selectByGroupId
(
search
);
}
}
@Operation
(
summary
=
"查询门店下SOP模板实例分页列表(包含客户统计数据)"
,
description
=
"查询门店下SOP模板实例分页列表(包含客户统计数据)"
)
@GetMapping
(
"/customer/statistic"
)
public
PageInfo
<
SopInstCustomerStatisticDTO
>
selectByGroupIdWithCustomer
(
@Validated
SopInstSearch
search
)
{
return
sopInstService
.
selectByGroupIdWithCustomer
(
search
);
}
@Operation
(
summary
=
"查询模板实例客户分页列表"
,
description
=
"查询模板实例客户分页列表"
)
@Operation
(
summary
=
"查询模板实例客户分页列表"
,
description
=
"查询模板实例客户分页列表"
)
@GetMapping
(
"/customers"
)
@GetMapping
(
"/customers"
)
public
Result
<
PageInfo
<
CustomerSopJourneyDTO
>>
customers
(
SopCustomerSearch
search
)
{
public
Result
<
PageInfo
<
CustomerSopJourneyDTO
>>
customers
(
SopCustomerSearch
search
)
{
...
...
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopInstService.java
View file @
840c87a
package
cn
.
com
.
glsx
.
process
.
modules
.
service
;
package
cn
.
com
.
glsx
.
process
.
modules
.
service
;
import
cn.com.glsx.cdp.api.customer.CustomerSopJourneyFeignClient
;
import
cn.com.glsx.cdp.api.customer.CustomerSopJourneyFeignClient
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDTO
;
import
cn.com.glsx.cdp.modules.model.customer.*
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDetailDTO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneySearch
;
import
cn.com.glsx.cdp.modules.model.customer.ModifySopJourneyStageRequest
;
import
cn.com.glsx.process.modules.client.CustomerSopJourneyFeignClient_T
;
import
cn.com.glsx.process.modules.client.CustomerSopJourneyFeignClient_T
;
import
cn.com.glsx.process.modules.converter.SopInstConverter
;
import
cn.com.glsx.process.modules.converter.SopInstConverter
;
import
cn.com.glsx.process.modules.converter.SopTplConverter
;
import
cn.com.glsx.process.modules.converter.SopTplConverter
;
...
@@ -132,6 +129,34 @@ public class SopInstService {
...
@@ -132,6 +129,34 @@ public class SopInstService {
}
}
/**
/**
* 首页统计接口
* 查询门店下SOP模板实例分页列表(包含客户统计数据)
*/
public
PageInfo
<
SopInstCustomerStatisticDTO
>
selectByGroupIdWithCustomer
(
SopInstSearch
search
)
{
PageHelper
.
startPage
(
search
.
getPageNumber
(),
search
.
getPageSize
());
List
<
SopInst
>
list
=
sopInstMapper
.
selectByGroupId
(
search
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
new
PageInfo
<>();
}
// 获取实例id列表
List
<
SopInstCustomerStatisticDTO
>
res
=
list
.
stream
().
map
(
SopInstCustomerStatisticDTO:
:
new
).
collect
(
Collectors
.
toList
());
List
<
String
>
instIds
=
res
.
stream
().
filter
(
p
->
StringUtils
.
hasLength
(
p
.
getInstId
())).
map
(
p
->
p
.
getInstId
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
instIds
))
{
return
new
PageInfo
<>(
res
);
}
// feign 阶段-客户统计数据
CustomerSopJourneySearch
req
=
new
CustomerSopJourneySearch
();
req
.
setSopJourneyIds
(
instIds
);
Result
<
List
<
CustomerSopJourneyStatisticsDTO
>>
result
=
customerSopJourneyFeignClientT
.
statisticsCustomerSopJourney
(
req
);
if
(
result
!=
null
&&
!
CollectionUtils
.
isEmpty
(
result
.
getData
()))
{
Map
<
String
,
List
<
CustomerSopJourneyStatisticsDTO
>>
resultMap
=
result
.
getData
().
stream
().
collect
(
Collectors
.
groupingBy
(
p
->
p
.
getSopJourneyId
()));
res
.
forEach
(
p
->
p
.
setStatistics
(
resultMap
.
getOrDefault
(
p
.
getInstId
(),
new
ArrayList
<>())
.
stream
().
collect
(
Collectors
.
toMap
(
i
->
i
.
getSopJourneyStage
(),
i
->
i
.
getCount
(),
Long:
:
sum
))));
}
return
new
PageInfo
<>(
res
);
}
/**
* 通过实例默认输入参数查询指定门店模板实例
* 通过实例默认输入参数查询指定门店模板实例
*
*
* @param customData
* @param customData
...
...
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