Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-cdp-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 608ef577
authored
Nov 06, 2023
by
周海宝
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v1.0.1' into 'master'
[+]新增查询数量接口 See merge request
!2
2 parents
2b82a30e
07b52206
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
5 deletions
platform-cdp-api/src/main/java/cn/com/glsx/cdp/api/customer/CustomerSopJourneyFeignClient.java
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/api/customer/CustomerSopJourneyController.java
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/mapper/CustomerSopJourneyMapper.java
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/service/CustomerSopJourneyService.java
platform-cdp/src/main/resources/mapper/CustomerSopJourneyMapper.xml
platform-cdp/src/test/java/cn/com/glsx/cn/com/glsx/TestApplication.java
platform-cdp-api/src/main/java/cn/com/glsx/cdp/api/customer/CustomerSopJourneyFeignClient.java
View file @
608ef57
...
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.PostMapping;
...
@@ -10,6 +10,7 @@ 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.Map
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -39,5 +40,7 @@ public interface CustomerSopJourneyFeignClient {
...
@@ -39,5 +40,7 @@ public interface CustomerSopJourneyFeignClient {
@PostMapping
(
"/statistics"
)
@PostMapping
(
"/statistics"
)
Result
<
List
<
CustomerSopJourneyStatisticsDTO
>>
statisticsCustomerSopJourney
(
@RequestBody
CustomerSopJourneySearch
request
);
Result
<
List
<
CustomerSopJourneyStatisticsDTO
>>
statisticsCustomerSopJourney
(
@RequestBody
CustomerSopJourneySearch
request
);
@Operation
(
description
=
"查询客户旅程客户数量"
)
@PostMapping
(
"/journeycount"
)
Result
<
Map
<
String
,
Integer
>>
customerSopJourneyCount
(
@RequestBody
CustomerSopJourneySearch
request
);
}
}
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/api/customer/CustomerSopJourneyController.java
View file @
608ef57
...
@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Slf4j
@Slf4j
...
@@ -94,4 +95,15 @@ public class CustomerSopJourneyController implements CustomerSopJourneyFeignClie
...
@@ -94,4 +95,15 @@ public class CustomerSopJourneyController implements CustomerSopJourneyFeignClie
return
Result
.
failure
(
SysConstants
.
ResultStatus
.
failure
.
getCode
(),
e
.
getMessage
());
return
Result
.
failure
(
SysConstants
.
ResultStatus
.
failure
.
getCode
(),
e
.
getMessage
());
}
}
}
}
@Operation
(
description
=
"查询客户旅程客户数量"
)
@PostMapping
(
"/journeycount"
)
@Override
public
Result
<
Map
<
String
,
Integer
>>
customerSopJourneyCount
(
@RequestBody
CustomerSopJourneySearch
request
)
{
log
.
info
(
"查询客户旅程客户数量参数:{}"
,
request
);
RpcPagination
<
CustomerSopJourneyBO
>
pagination
=
CommonUtils
.
getRpcPagination
(
request
,
CustomerSopJourneyBO
.
class
);
Map
<
String
,
Integer
>
data
=
customerSopJourneyService
.
customerSopJourneyCount
(
pagination
.
getCondition
());
log
.
info
(
"查询客户旅程客户数量返回:{}"
,
data
);
return
Result
.
success
(
data
);
}
}
}
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/mapper/CustomerSopJourneyMapper.java
View file @
608ef57
...
@@ -4,13 +4,19 @@ import cn.com.glsx.cdp.modules.entity.CustomerSopJourney;
...
@@ -4,13 +4,19 @@ import cn.com.glsx.cdp.modules.entity.CustomerSopJourney;
import
cn.com.glsx.cdp.modules.model.CustomerSopJourneyBO
;
import
cn.com.glsx.cdp.modules.model.CustomerSopJourneyBO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyStatisticsDTO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyStatisticsDTO
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Mapper
@Mapper
public
interface
CustomerSopJourneyMapper
extends
CommonBaseMapper
<
CustomerSopJourney
>
{
public
interface
CustomerSopJourneyMapper
extends
CommonBaseMapper
<
CustomerSopJourney
>
{
List
<
CustomerSopJourneyBO
>
listCustomerSopJourney
(
CustomerSopJourneyBO
customerSopJourneyBO
);
List
<
CustomerSopJourneyBO
>
listCustomerSopJourney
(
CustomerSopJourneyBO
customerSopJourneyBO
);
List
<
CustomerSopJourneyStatisticsDTO
>
statisticsCustomerSopJourney
(
CustomerSopJourneyBO
request
);
List
<
CustomerSopJourneyStatisticsDTO
>
statisticsCustomerSopJourney
(
CustomerSopJourneyBO
request
);
@MapKey
(
"sop_journey_stage"
)
List
<
Map
<
String
,
Integer
>>
customerSopJourneyCount
(
CustomerSopJourneyBO
customerSopJourneyBO
);
}
}
\ No newline at end of file
\ No newline at end of file
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/service/CustomerSopJourneyService.java
View file @
608ef57
...
@@ -19,9 +19,7 @@ import org.springframework.transaction.annotation.Propagation;
...
@@ -19,9 +19,7 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.Arrays
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
@Slf4j
@Slf4j
@Service
@Service
...
@@ -93,4 +91,14 @@ public class CustomerSopJourneyService {
...
@@ -93,4 +91,14 @@ public class CustomerSopJourneyService {
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATABASE_ERROR
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATABASE_ERROR
);
}
}
}
}
public
Map
<
String
,
Integer
>
customerSopJourneyCount
(
CustomerSopJourneyBO
customerSopJourneyBO
)
{
Map
<
String
,
Integer
>
stringIntegerMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Integer
>>
maps
=
customerSopJourneyMapper
.
customerSopJourneyCount
(
customerSopJourneyBO
);
System
.
out
.
println
(
maps
);
for
(
Map
<
String
,
Integer
>
map
:
maps
)
{
stringIntegerMap
.
put
(
map
.
get
(
"sop_journey_stage"
)+
""
,
Integer
.
parseInt
(
map
.
get
(
"count"
)+
""
));
}
return
stringIntegerMap
;
}
}
}
platform-cdp/src/main/resources/mapper/CustomerSopJourneyMapper.xml
View file @
608ef57
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
<result
column=
"updated_time"
jdbcType=
"TIMESTAMP"
property=
"updatedTime"
/>
<result
column=
"updated_time"
jdbcType=
"TIMESTAMP"
property=
"updatedTime"
/>
<result
column=
"del_flag"
jdbcType=
"INTEGER"
property=
"delFlag"
/>
<result
column=
"del_flag"
jdbcType=
"INTEGER"
property=
"delFlag"
/>
</resultMap>
</resultMap>
<resultMap
id=
"BOResultMap"
type=
"cn.com.glsx.cdp.modules.model.CustomerSopJourneyBO"
extends=
"BaseResultMap"
>
<resultMap
id=
"BOResultMap"
type=
"cn.com.glsx.cdp.modules.model.CustomerSopJourneyBO"
extends=
"BaseResultMap"
>
<association
property=
"customer"
javaType=
"cn.com.glsx.cdp.modules.model.CustomerBO"
>
<association
property=
"customer"
javaType=
"cn.com.glsx.cdp.modules.model.CustomerBO"
>
<result
column=
"org_id"
jdbcType=
"VARCHAR"
property=
"orgId"
/>
<result
column=
"org_id"
jdbcType=
"VARCHAR"
property=
"orgId"
/>
...
@@ -56,6 +57,7 @@
...
@@ -56,6 +57,7 @@
<result
column=
"c_ex_json"
jdbcType=
"LONGVARCHAR"
property=
"exJson"
/>
<result
column=
"c_ex_json"
jdbcType=
"LONGVARCHAR"
property=
"exJson"
/>
</association>
</association>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
...
@@ -158,5 +160,16 @@
...
@@ -158,5 +160,16 @@
</where>
</where>
group by csj.sop_journey_id, csj.sop_journey_stage
group by csj.sop_journey_id, csj.sop_journey_stage
</select>
</select>
<select
id=
"customerSopJourneyCount"
resultType=
"java.util.Map"
parameterType=
"cn.com.glsx.cdp.modules.model.CustomerSopJourneyBO"
>
select
csj.sop_journey_stage as sop_journey_stage,count(1) as count
from cdp_customer_sop_journey csj
left join cdp_customer c on csj.one_id = c.one_id and c.del_flag = 0
<where>
<include
refid=
"base_param"
/>
</where>
group by csj.sop_journey_stage
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
platform-cdp/src/test/java/cn/com/glsx/cn/com/glsx/TestApplication.java
View file @
608ef57
package
cn
.
com
.
glsx
.
cn
.
com
.
glsx
;
package
cn
.
com
.
glsx
.
cn
.
com
.
glsx
;
import
cn.com.glsx.Application
;
import
cn.com.glsx.Application
;
import
cn.com.glsx.cdp.modules.model.CustomerSopJourneyBO
;
import
cn.com.glsx.cdp.modules.service.CustomerSopJourneyService
;
import
cn.com.glsx.cdp.modules.service.UserDemoService
;
import
cn.com.glsx.cdp.modules.service.UserDemoService
;
import
com.alibaba.fastjson.JSONObject
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.Map
;
/**
/**
* 测试spring cloud 服务调用方式
* 测试spring cloud 服务调用方式
*/
*/
...
@@ -18,9 +23,17 @@ public class TestApplication {
...
@@ -18,9 +23,17 @@ public class TestApplication {
@Autowired
@Autowired
private
UserDemoService
userDemoService
;
private
UserDemoService
userDemoService
;
@Autowired
private
CustomerSopJourneyService
customerSopJourneyService
;
@Test
@Test
public
void
test
()
{
public
void
test
()
{
CustomerSopJourneyBO
customerSopJourneyBO
=
new
CustomerSopJourneyBO
();
customerSopJourneyBO
.
setSopJourneyId
(
"xblc7"
);
customerSopJourneyBO
.
setOrgId
(
"44211227"
);
customerSopJourneyBO
.
setSopFollowUpPersonPhone
(
"13800000001"
);
Map
<
String
,
Integer
>
stringIntegerMap
=
customerSopJourneyService
.
customerSopJourneyCount
(
customerSopJourneyBO
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
stringIntegerMap
));
}
}
}
}
\ No newline at end of file
\ No newline at end of file
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