Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
c8423da3
Commit
c8423da3
authored
Mar 30, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 销售线索 列表
parent
c2b65cf0
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
250 additions
and
7 deletions
+250
-7
TabHaobanExternalClerkRelatedMapper.java
...rvice/dao/mapper/TabHaobanExternalClerkRelatedMapper.java
+10
-0
PotentialCustomerBO.java
...n/manage/service/pojo/bo/content/PotentialCustomerBO.java
+12
-0
ExternalClerkRelatedService.java
...n/manage/service/service/ExternalClerkRelatedService.java
+8
-0
PotentialCustomerServiceImpl.java
...ce/service/content/impl/PotentialCustomerServiceImpl.java
+57
-6
ExternalClerkRelatedServiceImpl.java
...service/service/impl/ExternalClerkRelatedServiceImpl.java
+19
-0
TabHaobanExternalClerkRelatedMapper.xml
.../resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
+12
-0
PotentialCustomerServiceTest.java
...3-service/src/test/java/PotentialCustomerServiceTest.java
+43
-0
PotentialCustomerController.java
...e/web/controller/content/PotentialCustomerController.java
+18
-1
MaterialDataAdaptor.java
...e/web/controller/content/adaptor/MaterialDataAdaptor.java
+42
-0
MemberVisitMaterialBO.java
...e/web/vo/content/statistics/bo/MemberVisitMaterialBO.java
+29
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanExternalClerkRelatedMapper.java
View file @
c8423da3
...
@@ -398,4 +398,13 @@ public interface TabHaobanExternalClerkRelatedMapper {
...
@@ -398,4 +398,13 @@ public interface TabHaobanExternalClerkRelatedMapper {
*/
*/
List
<
String
>
queryExternalUserIdWithStaffId
(
@Param
(
"staffId"
)
String
staffId
);
List
<
String
>
queryExternalUserIdWithStaffId
(
@Param
(
"staffId"
)
String
staffId
);
/**
* 查询会员与导购的好友关系
* @param clerkId
* @param memberIds
* @return
*/
List
<
TabHaobanExternalClerkRelated
>
queryClerkMemberRelations
(
@Param
(
"clerkId"
)
String
clerkId
,
@Param
(
"memberIds"
)
List
<
String
>
memberIds
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/bo/content/PotentialCustomerBO.java
View file @
c8423da3
...
@@ -100,4 +100,16 @@ public class PotentialCustomerBO {
...
@@ -100,4 +100,16 @@ public class PotentialCustomerBO {
* 更新时间
* 更新时间
*/
*/
private
Date
updateTime
;
private
Date
updateTime
;
/**
* 导购与会员是否有好友
* 1 是好友; 0不是
*/
private
Integer
hasMemberRelation
;
/**
* 会员全渠道成交
* 1 有过成交; 0 没有成交
*/
private
Integer
dealRecord
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/ExternalClerkRelatedService.java
View file @
c8423da3
...
@@ -90,4 +90,12 @@ public interface ExternalClerkRelatedService {
...
@@ -90,4 +90,12 @@ public interface ExternalClerkRelatedService {
*/
*/
List
<
String
>
queryExternalRelatedWithStaffId
(
String
staffId
);
List
<
String
>
queryExternalRelatedWithStaffId
(
String
staffId
);
/***
* 查询会员与导购的关系
* @param clerkId
* @param memberIds
* @return
*/
List
<
TabHaobanExternalClerkRelated
>
queryClerkMemberRelations
(
String
clerkId
,
List
<
String
>
memberIds
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/impl/PotentialCustomerServiceImpl.java
View file @
c8423da3
...
@@ -5,19 +5,18 @@ import com.gic.api.base.commons.Page;
...
@@ -5,19 +5,18 @@ import com.gic.api.base.commons.Page;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.service.dao.mapper.content.TabHaobanPotentialCustomerMapper
;
import
com.gic.haoban.manage.service.dao.mapper.content.TabHaobanPotentialCustomerMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated
;
import
com.gic.haoban.manage.service.entity.content.TabHaobanPotentialCustomer
;
import
com.gic.haoban.manage.service.entity.content.TabHaobanPotentialCustomer
;
import
com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO
;
import
com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerBO
;
import
com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerBO
;
import
com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerStaticsBO
;
import
com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerStaticsBO
;
import
com.gic.haoban.manage.service.pojo.bo.content.context.PotentialCustomerNotifyContext
;
import
com.gic.haoban.manage.service.pojo.bo.content.context.PotentialCustomerNotifyContext
;
import
com.gic.haoban.manage.service.pojo.qo.content.InteractRecordQO
;
import
com.gic.haoban.manage.service.pojo.qo.content.InteractRecordQO
;
import
com.gic.haoban.manage.service.pojo.qo.content.PotentialCustomerQO
;
import
com.gic.haoban.manage.service.pojo.qo.content.PotentialCustomerQO
;
import
com.gic.haoban.manage.service.service.ExternalClerkRelatedService
;
import
com.gic.haoban.manage.service.service.content.InteractRecordService
;
import
com.gic.haoban.manage.service.service.content.InteractRecordService
;
import
com.gic.haoban.manage.service.service.content.PotentialCustomerService
;
import
com.gic.haoban.manage.service.service.content.PotentialCustomerService
;
import
com.gic.haoban.manage.service.service.content.adaptor.PotentialCustomerNotifyBuilder
;
import
com.gic.haoban.manage.service.service.content.adaptor.PotentialCustomerNotifyBuilder
;
import
com.gic.haoban.manage.service.service.notify.NoticeMessageService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.google.common.collect.Lists
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -26,9 +25,11 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -26,9 +25,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.
ArrayList
;
import
java.util.
Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -48,7 +49,7 @@ public class PotentialCustomerServiceImpl implements PotentialCustomerService {
...
@@ -48,7 +49,7 @@ public class PotentialCustomerServiceImpl implements PotentialCustomerService {
@Autowired
@Autowired
private
InteractRecordService
interactRecordService
;
private
InteractRecordService
interactRecordService
;
@Autowired
@Autowired
private
NoticeMessageService
noticeMessage
Service
;
private
ExternalClerkRelatedService
externalClerkRelated
Service
;
/**
/**
...
@@ -67,7 +68,57 @@ public class PotentialCustomerServiceImpl implements PotentialCustomerService {
...
@@ -67,7 +68,57 @@ public class PotentialCustomerServiceImpl implements PotentialCustomerService {
PageHelper
.
startPage
(
potentialCustomerQO
.
getPageNum
(),
potentialCustomerQO
.
getPageSize
());
PageHelper
.
startPage
(
potentialCustomerQO
.
getPageNum
(),
potentialCustomerQO
.
getPageSize
());
com
.
github
.
pagehelper
.
Page
<
TabHaobanPotentialCustomer
>
pageResult
=
com
.
github
.
pagehelper
.
Page
<
TabHaobanPotentialCustomer
>
pageResult
=
(
com
.
github
.
pagehelper
.
Page
<
TabHaobanPotentialCustomer
>)
potentialCustomerMapper
.
queryPotentialCustomerList
(
potentialCustomerQO
);
(
com
.
github
.
pagehelper
.
Page
<
TabHaobanPotentialCustomer
>)
potentialCustomerMapper
.
queryPotentialCustomerList
(
potentialCustomerQO
);
return
PageUtil
.
changePageHelperToCurrentPage
(
pageResult
,
PotentialCustomerBO
.
class
);
Page
<
PotentialCustomerBO
>
customerBOPage
=
PageUtil
.
changePageHelperToCurrentPage
(
pageResult
,
PotentialCustomerBO
.
class
);
if
(
CollectionUtils
.
isEmpty
(
customerBOPage
.
getResult
()))
{
log
.
info
(
"查询销售线索列表为空 params: {}"
,
JSON
.
toJSONString
(
potentialCustomerQO
));
return
customerBOPage
;
}
List
<
String
>
memberIds
=
customerBOPage
.
getResult
()
.
stream
()
.
map
(
PotentialCustomerBO:
:
getMemberId
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
Map
<
String
,
Integer
>
clerkMemberRelationMap
=
this
.
queryMemberRelation
(
potentialCustomerQO
.
getClerkId
(),
memberIds
,
potentialCustomerQO
.
getHasMemberRelation
());
// 构建是否是会员
for
(
PotentialCustomerBO
potentialCustomerBO
:
customerBOPage
.
getResult
())
{
// 默认未成交过
potentialCustomerBO
.
setDealRecord
(
0
);
if
(
potentialCustomerBO
.
getDealRecordNum
()
!=
null
&&
potentialCustomerBO
.
getDealRecordNum
()
>
0
)
{
potentialCustomerBO
.
setDealRecord
(
1
);
}
if
(
potentialCustomerQO
.
getHasMemberRelation
()
!=
null
)
{
// 查询条件是有好友关系的
potentialCustomerBO
.
setHasMemberRelation
(
1
);
continue
;
}
// 获取有好友关系的
Integer
hasRelation
=
clerkMemberRelationMap
.
get
(
potentialCustomerBO
.
getMemberId
());
potentialCustomerBO
.
setHasMemberRelation
(
Optional
.
ofNullable
(
hasRelation
).
orElse
(
0
));
}
return
customerBOPage
;
}
/**
* 查询与导购的关系
*
* @param clerkId
* @param memberIds
* @return
*/
private
Map
<
String
,
Integer
>
queryMemberRelation
(
String
clerkId
,
List
<
String
>
memberIds
,
Integer
hasMemberRelation
)
{
if
(
hasMemberRelation
!=
null
)
{
log
.
info
(
"按好友条件搜索 无须查询"
);
return
Collections
.
emptyMap
();
}
List
<
TabHaobanExternalClerkRelated
>
clerkRelateds
=
externalClerkRelatedService
.
queryClerkMemberRelations
(
clerkId
,
memberIds
);
if
(
CollectionUtils
.
isEmpty
(
clerkRelateds
))
{
log
.
info
(
"查询导购与本批次会员不存在好友关系 clerkId:{}"
,
clerkId
);
return
Collections
.
emptyMap
();
}
return
clerkRelateds
.
stream
()
.
collect
(
Collectors
.
toMap
(
TabHaobanExternalClerkRelated:
:
getMemberId
,
item
->
1
,
(
v1
,
v2
)
->
v1
));
}
}
/**
/**
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/ExternalClerkRelatedServiceImpl.java
View file @
c8423da3
...
@@ -501,4 +501,23 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ
...
@@ -501,4 +501,23 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ
public
List
<
String
>
queryExternalRelatedWithStaffId
(
String
staffId
)
{
public
List
<
String
>
queryExternalRelatedWithStaffId
(
String
staffId
)
{
return
this
.
mapper
.
queryExternalUserIdWithStaffId
(
staffId
);
return
this
.
mapper
.
queryExternalUserIdWithStaffId
(
staffId
);
}
}
/***
* 查询会员与导购的关系
* @param clerkId
* @param memberIds
* @return
*/
@Override
public
List
<
TabHaobanExternalClerkRelated
>
queryClerkMemberRelations
(
String
clerkId
,
List
<
String
>
memberIds
)
{
if
(
StringUtils
.
isBlank
(
clerkId
))
{
logger
.
info
(
"查询导购与会员的关系,导购id不存在 {}"
,
clerkId
);
return
Collections
.
emptyList
();
}
if
(
CollectionUtils
.
isEmpty
(
memberIds
))
{
logger
.
info
(
"查询导购与会员的关系,会员id数组为空 {}"
,
clerkId
);
return
Collections
.
emptyList
();
}
return
this
.
mapper
.
queryClerkMemberRelations
(
clerkId
,
memberIds
);
}
}
}
haoban-manage3-service/src/main/resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
View file @
c8423da3
...
@@ -768,4 +768,15 @@
...
@@ -768,4 +768,15 @@
and status_flag in (1, 3, 4);
and status_flag in (1, 3, 4);
</select>
</select>
<select
id=
"queryClerkMemberRelations"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
where clerk_id = #{clerkId}
and status_flag in (1, 3, 4)
and member_id in
<foreach
collection=
"memberIds"
item=
"memberId"
open=
"("
close=
")"
separator=
","
>
#{memberId}
</foreach>
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/test/java/PotentialCustomerServiceTest.java
0 → 100644
View file @
c8423da3
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerBO
;
import
com.gic.haoban.manage.service.pojo.qo.content.PotentialCustomerQO
;
import
com.gic.haoban.manage.service.service.content.PotentialCustomerService
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
/**
* @Author MUSI
* @Date 2023/3/30 10:15 PM
* @Description
* @Version
**/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@ContextConfiguration
(
locations
=
{
"classpath:applicationContext-conf.xml"
})
public
class
PotentialCustomerServiceTest
{
@Autowired
PotentialCustomerService
potentialCustomerService
;
String
eid
=
"ff8080815dacd3a2015dacd3ef5c0000"
;
String
wxEid
=
"ca66a01b79474c40b3e7c7f93daf1a3b"
;
String
staffId
=
"e608b51b267e4943b87e222a343b4f25"
;
String
clerkId
=
"fbc508e395f846ef9005852c420e1c4f"
;
String
memberId
=
"ff8080818147efc8018148d1759903c8"
;
@Test
public
void
queryPotentialCustomerTest
(){
PotentialCustomerQO
potentialCustomerQO
=
new
PotentialCustomerQO
();
potentialCustomerQO
.
setEnterpriseId
(
eid
);
potentialCustomerQO
.
setWxEnterpriseId
(
wxEid
);
potentialCustomerQO
.
setClerkId
(
clerkId
);
potentialCustomerQO
.
setSeeFlag
(
0
);
potentialCustomerQO
.
setStarFlag
(
0
);
Page
<
PotentialCustomerBO
>
customerBOPage
=
potentialCustomerService
.
queryPotentialCustomerPage
(
potentialCustomerQO
);
System
.
out
.
println
(
JSON
.
toJSONString
(
customerBOPage
));
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/PotentialCustomerController.java
View file @
c8423da3
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
content
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
content
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
...
@@ -10,6 +11,7 @@ import com.gic.haoban.manage.api.dto.qdto.content.PotentialCustomerQDTO;
...
@@ -10,6 +11,7 @@ import com.gic.haoban.manage.api.dto.qdto.content.PotentialCustomerQDTO;
import
com.gic.haoban.manage.api.enums.content.ShareBizType
;
import
com.gic.haoban.manage.api.enums.content.ShareBizType
;
import
com.gic.haoban.manage.api.service.content.PotentialCustomerApiService
;
import
com.gic.haoban.manage.api.service.content.PotentialCustomerApiService
;
import
com.gic.haoban.manage.web.controller.content.adaptor.ContentMaterialAdaptor
;
import
com.gic.haoban.manage.web.controller.content.adaptor.ContentMaterialAdaptor
;
import
com.gic.haoban.manage.web.controller.content.adaptor.MaterialDataAdaptor
;
import
com.gic.haoban.manage.web.qo.content.potential.PotentialCustomerMarkRecordVO
;
import
com.gic.haoban.manage.web.qo.content.potential.PotentialCustomerMarkRecordVO
;
import
com.gic.haoban.manage.web.qo.content.potential.PotentialCustomerQO
;
import
com.gic.haoban.manage.web.qo.content.potential.PotentialCustomerQO
;
import
com.gic.haoban.manage.web.vo.content.ContentMaterialInfoVO
;
import
com.gic.haoban.manage.web.vo.content.ContentMaterialInfoVO
;
...
@@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -37,6 +40,11 @@ public class PotentialCustomerController {
...
@@ -37,6 +40,11 @@ public class PotentialCustomerController {
private
PotentialCustomerApiService
potentialCustomerApiService
;
private
PotentialCustomerApiService
potentialCustomerApiService
;
@Autowired
@Autowired
ContentMaterialAdaptor
contentMaterialAdaptor
;
ContentMaterialAdaptor
contentMaterialAdaptor
;
@Autowired
MaterialDataAdaptor
materialDataAdaptor
;
/**
/**
* 销售线索列表
* 销售线索列表
*
*
...
@@ -51,6 +59,7 @@ public class PotentialCustomerController {
...
@@ -51,6 +59,7 @@ public class PotentialCustomerController {
ServiceResponse
<
Page
<
PotentialCustomerDTO
>>
serviceResponse
=
ServiceResponse
<
Page
<
PotentialCustomerDTO
>>
serviceResponse
=
potentialCustomerApiService
.
queryPotentialCustomer
(
searchQDTO
);
potentialCustomerApiService
.
queryPotentialCustomer
(
searchQDTO
);
if
(!
serviceResponse
.
isSuccess
())
{
if
(!
serviceResponse
.
isSuccess
())
{
log
.
info
(
"查询销售线索异常 {}"
,
JSON
.
toJSONString
(
serviceResponse
));
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
}
List
<
PotentialCustomerDTO
>
customerDTOS
=
serviceResponse
.
getResult
().
getResult
();
List
<
PotentialCustomerDTO
>
customerDTOS
=
serviceResponse
.
getResult
().
getResult
();
...
@@ -61,6 +70,13 @@ public class PotentialCustomerController {
...
@@ -61,6 +70,13 @@ public class PotentialCustomerController {
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
Map
<
Long
,
ContentMaterialBaseDTO
>
materialInfoMap
=
contentMaterialAdaptor
.
queryMaterialInfoMap
(
potentialCustomerQO
.
getEnterpriseId
(),
materialIds
);
Map
<
Long
,
ContentMaterialBaseDTO
>
materialInfoMap
=
contentMaterialAdaptor
.
queryMaterialInfoMap
(
potentialCustomerQO
.
getEnterpriseId
(),
materialIds
);
List
<
String
>
memberIds
=
customerDTOS
.
stream
()
.
filter
(
item
->
ShareBizType
.
MATERIAL
.
getCode
().
equals
(
item
.
getBizType
()))
.
map
(
PotentialCustomerDTO:
:
getMemberId
)
.
collect
(
Collectors
.
toList
());
Map
<
String
,
Integer
>
memberVisitMap
=
materialDataAdaptor
.
queryMemberVisitMap
(
potentialCustomerQO
.
getEnterpriseId
(),
null
,
potentialCustomerQO
.
getClerkId
(),
memberIds
);
List
<
PotentialCustomerVO
>
customerVOS
=
customerDTOS
List
<
PotentialCustomerVO
>
customerVOS
=
customerDTOS
.
stream
()
.
stream
()
.
map
(
item
->
{
.
map
(
item
->
{
...
@@ -73,6 +89,8 @@ public class PotentialCustomerController {
...
@@ -73,6 +89,8 @@ public class PotentialCustomerController {
BeanUtils
.
copyProperties
(
contentMaterialBaseDTO
,
contentMaterialInfoVO
);
BeanUtils
.
copyProperties
(
contentMaterialBaseDTO
,
contentMaterialInfoVO
);
temp
.
setContentMaterialInfoVO
(
contentMaterialInfoVO
);
temp
.
setContentMaterialInfoVO
(
contentMaterialInfoVO
);
}
}
Integer
visitNum
=
memberVisitMap
.
get
(
item
.
getMemberId
());
temp
.
setVisitNum
(
Optional
.
ofNullable
(
visitNum
).
orElse
(
0
));
return
temp
;
return
temp
;
})
})
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
...
@@ -83,7 +101,6 @@ public class PotentialCustomerController {
...
@@ -83,7 +101,6 @@ public class PotentialCustomerController {
}
}
/**
/**
* 标记销售线索为已看
* 标记销售线索为已看
*
*
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/adaptor/MaterialDataAdaptor.java
View file @
c8423da3
...
@@ -11,6 +11,7 @@ import com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO;
...
@@ -11,6 +11,7 @@ import com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO;
import
com.gic.haoban.manage.web.vo.content.statistics.MaterialDataOverviewVO
;
import
com.gic.haoban.manage.web.vo.content.statistics.MaterialDataOverviewVO
;
import
com.gic.haoban.manage.web.vo.content.statistics.MaterialStoreUsedDataVO
;
import
com.gic.haoban.manage.web.vo.content.statistics.MaterialStoreUsedDataVO
;
import
com.gic.haoban.manage.web.vo.content.statistics.bo.MaterialTodayDataBO
;
import
com.gic.haoban.manage.web.vo.content.statistics.bo.MaterialTodayDataBO
;
import
com.gic.haoban.manage.web.vo.content.statistics.bo.MemberVisitMaterialBO
;
import
com.gic.haoban.manage.web.vo.content.statistics.report.MaterialPersonalUsedDataVO
;
import
com.gic.haoban.manage.web.vo.content.statistics.report.MaterialPersonalUsedDataVO
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
...
@@ -22,6 +23,8 @@ import java.util.Collections;
...
@@ -22,6 +23,8 @@ import java.util.Collections;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
/**
/**
* @Author MUSI
* @Author MUSI
...
@@ -79,6 +82,11 @@ public class MaterialDataAdaptor {
...
@@ -79,6 +82,11 @@ public class MaterialDataAdaptor {
*/
*/
private
static
final
String
MATERIAL_AREA_MONTH_DATA
=
"data_cms_store_month_report_total"
;
private
static
final
String
MATERIAL_AREA_MONTH_DATA
=
"data_cms_store_month_report_total"
;
/**
* 会员最近30天访问素材总数
*/
private
static
final
String
MEMBER_RECENTLY_30_DAY_VISIT
=
"data_matl_haoban_user_30day_stats_real"
;
/**
/**
* 查询素材首页使用数据
* 查询素材首页使用数据
...
@@ -340,6 +348,7 @@ public class MaterialDataAdaptor {
...
@@ -340,6 +348,7 @@ public class MaterialDataAdaptor {
/**
/**
* 取经数据概览数据
* 取经数据概览数据
*
* @return
* @return
*/
*/
public
MaterialStoreUsedDataVO
queryMaterialAreaOverviewData
(
String
enterpriseId
,
String
clerkId
,
public
MaterialStoreUsedDataVO
queryMaterialAreaOverviewData
(
String
enterpriseId
,
String
clerkId
,
...
@@ -397,4 +406,37 @@ public class MaterialDataAdaptor {
...
@@ -397,4 +406,37 @@ public class MaterialDataAdaptor {
return
Collections
.
emptyMap
();
return
Collections
.
emptyMap
();
}
}
/**
* 会员最近30天的浏览素材数量
*
* @param enterpriseId
* @param storeId
* @param clerkId
* @param memberIds
* @return
*/
public
Map
<
String
,
Integer
>
queryMemberVisitMap
(
String
enterpriseId
,
String
storeId
,
String
clerkId
,
List
<
String
>
memberIds
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
inlineParams
=
new
HashMap
<>();
params
.
put
(
"inFields"
,
inlineParams
);
if
(
StringUtils
.
isNotBlank
(
clerkId
))
{
inlineParams
.
put
(
"clerkId"
,
clerkId
);
}
inlineParams
.
put
(
"enterprsieId"
,
enterpriseId
);
inlineParams
.
put
(
"customerId"
,
StringUtils
.
join
(
memberIds
,
","
));
Map
<
String
,
Object
>
result
=
this
.
doHttp
(
JSON
.
toJSONString
(
params
),
MEMBER_RECENTLY_30_DAY_VISIT
);
if
(
result
.
get
(
"data"
)
==
null
)
{
return
Collections
.
emptyMap
();
}
List
<
MemberVisitMaterialBO
>
memberVisitMaterialBos
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
result
.
get
(
"data"
)),
MemberVisitMaterialBO
.
class
);
if
(
CollectionUtils
.
isEmpty
(
memberVisitMaterialBos
))
{
return
Collections
.
emptyMap
();
}
return
memberVisitMaterialBos
.
stream
()
.
collect
(
Collectors
.
toMap
(
MemberVisitMaterialBO:
:
getCustomerId
,
item
->
Optional
.
ofNullable
(
item
.
getMatlNum30Day
())
.
map
(
Integer:
:
new
).
orElse
(
0
),
(
v1
,
v2
)
->
v1
));
}
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/content/statistics/bo/MemberVisitMaterialBO.java
0 → 100644
View file @
c8423da3
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
content
.
statistics
.
bo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Author MUSI
* @Date 2023/3/30 10:59 PM
* @Description
* @Version
**/
@Data
public
class
MemberVisitMaterialBO
implements
Serializable
{
private
String
enterpriseId
;
private
String
clerkId
;
/**
* 会员id
*/
private
String
customerId
;
/**
* 最近30天访问素材数
*/
private
String
matlNum30Day
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment