Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 18abb724
authored
Mar 04, 2021
by
水库浪子
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
客户画像,客户标签获取接口提交
1 parent
17ebedbf
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
110 additions
and
19 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCategoryController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatContactMappingController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerPortraitController.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerPortrait.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerPortraitTag.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeTagGroupMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeTagGroupService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTagGroupServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeTagGroupMapper.xml
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCategoryController.java
View file @
18abb72
...
@@ -30,7 +30,7 @@ public class WeCategoryController extends BaseController {
...
@@ -30,7 +30,7 @@ public class WeCategoryController extends BaseController {
/**
/**
* 类目树
* 类目树
*/
*/
@PreAuthorize
(
"@ss.hasPermi('wechat:category:list')"
)
//
@PreAuthorize("@ss.hasPermi('wechat:category:list')")
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
@ApiOperation
(
"类目树"
)
@ApiOperation
(
"类目树"
)
public
AjaxResult
list
(
@RequestParam
(
"mediaType"
)
String
mediaType
)
{
public
AjaxResult
list
(
@RequestParam
(
"mediaType"
)
String
mediaType
)
{
...
@@ -40,7 +40,7 @@ public class WeCategoryController extends BaseController {
...
@@ -40,7 +40,7 @@ public class WeCategoryController extends BaseController {
/**
/**
* 通过id查询类目详细信息
* 通过id查询类目详细信息
*/
*/
@PreAuthorize
(
"@ss.hasPermi('wechat:category:query')"
)
//
@PreAuthorize("@ss.hasPermi('wechat:category:query')")
@GetMapping
(
value
=
"/{id}"
)
@GetMapping
(
value
=
"/{id}"
)
@ApiOperation
(
"通过id查询类目详细信息"
)
@ApiOperation
(
"通过id查询类目详细信息"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
...
@@ -50,7 +50,7 @@ public class WeCategoryController extends BaseController {
...
@@ -50,7 +50,7 @@ public class WeCategoryController extends BaseController {
/**
/**
* 添加类目
* 添加类目
*/
*/
@PreAuthorize
(
"@ss.hasPermi('wechat:category:add')"
)
//
@PreAuthorize("@ss.hasPermi('wechat:category:add')")
@Log
(
title
=
"添加类目"
,
businessType
=
BusinessType
.
INSERT
)
@Log
(
title
=
"添加类目"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
@PostMapping
@ApiOperation
(
"添加类目"
)
@ApiOperation
(
"添加类目"
)
...
@@ -61,7 +61,7 @@ public class WeCategoryController extends BaseController {
...
@@ -61,7 +61,7 @@ public class WeCategoryController extends BaseController {
/**
/**
* 更新目录
* 更新目录
*/
*/
@PreAuthorize
(
"@ss.hasPermi('wechat:category:edit')"
)
//
@PreAuthorize("@ss.hasPermi('wechat:category:edit')")
@Log
(
title
=
"更新目录"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"更新目录"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
@ApiOperation
(
"更新目录"
)
@ApiOperation
(
"更新目录"
)
...
@@ -73,7 +73,7 @@ public class WeCategoryController extends BaseController {
...
@@ -73,7 +73,7 @@ public class WeCategoryController extends BaseController {
/**
/**
* 删除类目
* 删除类目
*/
*/
@PreAuthorize
(
"@ss.hasPermi('wechat:category:remove')"
)
//
@PreAuthorize("@ss.hasPermi('wechat:category:remove')")
@Log
(
title
=
"删除类目"
,
businessType
=
BusinessType
.
DELETE
)
@Log
(
title
=
"删除类目"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
@DeleteMapping
(
"/{ids}"
)
@ApiOperation
(
"删除类目"
)
@ApiOperation
(
"删除类目"
)
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatContactMappingController.java
View file @
18abb72
...
@@ -39,7 +39,7 @@ public class WeChatContactMappingController extends BaseController
...
@@ -39,7 +39,7 @@ public class WeChatContactMappingController extends BaseController
/**
/**
* 查询聊天关系映射列表
* 查询聊天关系映射列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('chat:mapping:list')"
)
//
@PreAuthorize("@ss.hasPermi('chat:mapping:list')")
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
WeChatContactMapping
weChatContactMapping
)
public
TableDataInfo
list
(
WeChatContactMapping
weChatContactMapping
)
{
{
...
@@ -51,7 +51,7 @@ public class WeChatContactMappingController extends BaseController
...
@@ -51,7 +51,7 @@ public class WeChatContactMappingController extends BaseController
/**
/**
* 按客户查询关系映射列表
* 按客户查询关系映射列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('chat:mapping:listByCustomer')"
)
//
@PreAuthorize("@ss.hasPermi('chat:mapping:listByCustomer')")
@GetMapping
(
"/listByCustomer"
)
@GetMapping
(
"/listByCustomer"
)
public
TableDataInfo
listByCustomer
()
public
TableDataInfo
listByCustomer
()
{
{
...
@@ -63,7 +63,7 @@ public class WeChatContactMappingController extends BaseController
...
@@ -63,7 +63,7 @@ public class WeChatContactMappingController extends BaseController
/**
/**
* 导出聊天关系映射列表
* 导出聊天关系映射列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('chat:mapping:export')"
)
//
@PreAuthorize("@ss.hasPermi('chat:mapping:export')")
@Log
(
title
=
"聊天关系映射"
,
businessType
=
BusinessType
.
EXPORT
)
@Log
(
title
=
"聊天关系映射"
,
businessType
=
BusinessType
.
EXPORT
)
@GetMapping
(
"/export"
)
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
WeChatContactMapping
weChatContactMapping
)
public
AjaxResult
export
(
WeChatContactMapping
weChatContactMapping
)
...
@@ -76,7 +76,7 @@ public class WeChatContactMappingController extends BaseController
...
@@ -76,7 +76,7 @@ public class WeChatContactMappingController extends BaseController
/**
/**
* 获取聊天关系映射详细信息
* 获取聊天关系映射详细信息
*/
*/
@PreAuthorize
(
"@ss.hasPermi('chat:mapping:query')"
)
//
@PreAuthorize("@ss.hasPermi('chat:mapping:query')")
@GetMapping
(
value
=
"/{id}"
)
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
{
...
@@ -86,7 +86,7 @@ public class WeChatContactMappingController extends BaseController
...
@@ -86,7 +86,7 @@ public class WeChatContactMappingController extends BaseController
/**
/**
* 新增聊天关系映射
* 新增聊天关系映射
*/
*/
@PreAuthorize
(
"@ss.hasPermi('chat:mapping:add')"
)
//
@PreAuthorize("@ss.hasPermi('chat:mapping:add')")
@Log
(
title
=
"聊天关系映射"
,
businessType
=
BusinessType
.
INSERT
)
@Log
(
title
=
"聊天关系映射"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
@PostMapping
public
AjaxResult
add
(
@RequestBody
WeChatContactMapping
weChatContactMapping
)
public
AjaxResult
add
(
@RequestBody
WeChatContactMapping
weChatContactMapping
)
...
@@ -97,7 +97,7 @@ public class WeChatContactMappingController extends BaseController
...
@@ -97,7 +97,7 @@ public class WeChatContactMappingController extends BaseController
/**
/**
* 修改聊天关系映射
* 修改聊天关系映射
*/
*/
@PreAuthorize
(
"@ss.hasPermi('chat:mapping:edit')"
)
//
@PreAuthorize("@ss.hasPermi('chat:mapping:edit')")
@Log
(
title
=
"聊天关系映射"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"聊天关系映射"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@RequestBody
WeChatContactMapping
weChatContactMapping
)
public
AjaxResult
edit
(
@RequestBody
WeChatContactMapping
weChatContactMapping
)
...
@@ -108,7 +108,7 @@ public class WeChatContactMappingController extends BaseController
...
@@ -108,7 +108,7 @@ public class WeChatContactMappingController extends BaseController
/**
/**
* 删除聊天关系映射
* 删除聊天关系映射
*/
*/
@PreAuthorize
(
"@ss.hasPermi('chat:mapping:remove')"
)
//
@PreAuthorize("@ss.hasPermi('chat:mapping:remove')")
@Log
(
title
=
"聊天关系映射"
,
businessType
=
BusinessType
.
DELETE
)
@Log
(
title
=
"聊天关系映射"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerPortraitController.java
View file @
18abb72
...
@@ -3,7 +3,9 @@ package com.linkwechat.web.controller.wecom;
...
@@ -3,7 +3,9 @@ package com.linkwechat.web.controller.wecom;
import
com.linkwechat.common.core.controller.BaseController
;
import
com.linkwechat.common.core.controller.BaseController
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.wecom.domain.WeCustomerPortrait
;
import
com.linkwechat.wecom.domain.WeCustomerPortrait
;
import
com.linkwechat.wecom.domain.WeTagGroup
;
import
com.linkwechat.wecom.service.IWeCustomerService
;
import
com.linkwechat.wecom.service.IWeCustomerService
;
import
com.linkwechat.wecom.service.IWeTagGroupService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -21,6 +23,10 @@ public class WeCustomerPortraitController extends BaseController {
...
@@ -21,6 +23,10 @@ public class WeCustomerPortraitController extends BaseController {
private
IWeCustomerService
iWeCustomerService
;
private
IWeCustomerService
iWeCustomerService
;
@Autowired
private
IWeTagGroupService
weTagGroupService
;
/**
/**
* 根据客户id和当前企业员工id获取员工详细信息
* 根据客户id和当前企业员工id获取员工详细信息
* @param externalUserid
* @param externalUserid
...
@@ -55,4 +61,22 @@ public class WeCustomerPortraitController extends BaseController {
...
@@ -55,4 +61,22 @@ public class WeCustomerPortraitController extends BaseController {
/**
* 获取当前系统所有可用标签
* @return
*/
@GetMapping
(
value
=
"/findAllTags"
)
public
AjaxResult
findAllTags
(){
return
AjaxResult
.
success
(
weTagGroupService
.
selectWeTagGroupList
(
WeTagGroup
.
builder
()
.
build
()
)
);
}
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerPortrait.java
View file @
18abb72
...
@@ -16,6 +16,8 @@ public class WeCustomerPortrait {
...
@@ -16,6 +16,8 @@ public class WeCustomerPortrait {
private
String
externalUserid
;
private
String
externalUserid
;
//企业员工id
//企业员工id
private
String
operUserid
;
private
String
operUserid
;
//客户与企业员工关系id
private
String
flowerCustomerRelId
;
//客户昵称
//客户昵称
private
String
name
;
private
String
name
;
//客户备注
//客户备注
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerPortraitTag.java
0 → 100644
View file @
18abb72
package
com
.
linkwechat
.
wecom
.
domain
;
import
lombok.Data
;
/**
* @description: 客户画像标签
* @author: HaoN
* @create: 2021-03-04 12:31
**/
@Data
public
class
WeCustomerPortraitTag
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeTagGroupMapper.java
View file @
18abb72
...
@@ -62,4 +62,16 @@ public interface WeTagGroupMapper extends BaseMapper<WeTagGroup>
...
@@ -62,4 +62,16 @@ public interface WeTagGroupMapper extends BaseMapper<WeTagGroup>
* @return
* @return
*/
*/
public
int
batchInsetWeTagGroup
(
@Param
(
"weTagGroups"
)
List
<
WeTagGroup
>
weTagGroups
);
public
int
batchInsetWeTagGroup
(
@Param
(
"weTagGroups"
)
List
<
WeTagGroup
>
weTagGroups
);
/**
* 根据企业员工与添加客户关系id给客户打标签
* @param flowerCustomerRelId
* @return
*/
public
List
<
WeTagGroup
>
findCustomerTagByFlowerCustomerRelId
(
@Param
(
"flowerCustomerRelId"
)
String
flowerCustomerRelId
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
View file @
18abb72
...
@@ -7,8 +7,6 @@ import com.linkwechat.wecom.domain.WeUser;
...
@@ -7,8 +7,6 @@ import com.linkwechat.wecom.domain.WeUser;
import
com.linkwechat.wecom.domain.dto.WeWelcomeMsg
;
import
com.linkwechat.wecom.domain.dto.WeWelcomeMsg
;
import
com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo
;
import
com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo
;
import
com.linkwechat.wecom.domain.vo.WeMakeCustomerTag
;
import
com.linkwechat.wecom.domain.vo.WeMakeCustomerTag
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
...
@@ -120,7 +118,7 @@ public interface IWeCustomerService extends IService<WeCustomer>
...
@@ -120,7 +118,7 @@ public interface IWeCustomerService extends IService<WeCustomer>
* @param operUserid
* @param operUserid
* @return
* @return
*/
*/
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"operUserid"
)
String
operUserid
);
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
String
externalUserid
,
String
operUserid
);
/**
/**
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeTagGroupService.java
View file @
18abb72
package
com
.
linkwechat
.
wecom
.
service
;
package
com
.
linkwechat
.
wecom
.
service
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeTagGroup
;
import
com.linkwechat.wecom.domain.WeTagGroup
;
import
com.linkwechat.wecom.domain.dto.tag.WeCropGroupTagDto
;
import
com.linkwechat.wecom.domain.dto.tag.WeCropGroupTagDto
;
import
java.util.List
;
/**
/**
* 标签组Service接口
* 标签组Service接口
*
*
...
@@ -69,4 +69,13 @@ public interface IWeTagGroupService extends IService<WeTagGroup>
...
@@ -69,4 +69,13 @@ public interface IWeTagGroupService extends IService<WeTagGroup>
void
deleteTagGroup
(
String
id
);
void
deleteTagGroup
(
String
id
);
void
updateTagGroup
(
String
id
);
void
updateTagGroup
(
String
id
);
/**
* 根据企业员工与添加客户关系id给客户打标签
* @param flowerCustomerRelId
* @return
*/
public
List
<
WeTagGroup
>
findCustomerTagByFlowerCustomerRelId
(
String
flowerCustomerRelId
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
View file @
18abb72
...
@@ -629,7 +629,20 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
...
@@ -629,7 +629,20 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
@Override
@Override
public
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
String
externalUserid
,
String
operUserid
)
{
public
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
String
externalUserid
,
String
operUserid
)
{
return
weCustomerMapper
.
findCustomerByOperUseridAndCustomerId
(
externalUserid
,
operUserid
);
WeCustomerPortrait
weCustomerPortrait
=
weCustomerMapper
.
findCustomerByOperUseridAndCustomerId
(
externalUserid
,
operUserid
);
if
(
null
!=
weCustomerPortrait
){
//获取当前客户拥有得标签
weCustomerPortrait
.
setWeTagGroupList
(
iWeTagGroupService
.
findCustomerTagByFlowerCustomerRelId
(
weCustomerPortrait
.
getFlowerCustomerRelId
()
)
);
}
return
weCustomerPortrait
;
}
}
@Override
@Override
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTagGroupServiceImpl.java
View file @
18abb72
...
@@ -337,5 +337,10 @@ public class WeTagGroupServiceImpl extends ServiceImpl<WeTagGroupMapper, WeTagGr
...
@@ -337,5 +337,10 @@ public class WeTagGroupServiceImpl extends ServiceImpl<WeTagGroupMapper, WeTagGr
}
}
}
}
@Override
public
List
<
WeTagGroup
>
findCustomerTagByFlowerCustomerRelId
(
String
flowerCustomerRelId
)
{
return
this
.
baseMapper
.
findCustomerTagByFlowerCustomerRelId
(
flowerCustomerRelId
);
}
}
}
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
View file @
18abb72
...
@@ -315,7 +315,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -315,7 +315,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wfcr.qq,
wfcr.qq,
wc.position,
wc.position,
wfcr.remark_corp_name,
wfcr.remark_corp_name,
wfcr.description
wfcr.description,
wfcr.id as flowerCustomerRelId
FROM
FROM
we_customer wc
we_customer wc
LEFT JOIN we_flower_customer_rel wfcr on wc.external_userid=wfcr.external_userid
LEFT JOIN we_flower_customer_rel wfcr on wc.external_userid=wfcr.external_userid
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeTagGroupMapper.xml
View file @
18abb72
...
@@ -102,4 +102,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -102,4 +102,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
</insert>
<select
id=
"findCustomerTagByFlowerCustomerRelId"
resultMap=
"WeTagGroupResult"
>
SELECT
wt.tag_id,
wt.`name`,
wtg.gourp_name,
wtg.group_id
FROM
we_flower_customer_tag_rel wfctr
INNER JOIN we_tag wt ON wfctr.tag_id = wt.tag_id
INNER JOIN we_tag_group wtg ON wt.group_id = wtg.group_id
WHERE wt.`status`=0 and wtg.`status`=0 and wfctr.flower_customer_rel_id=#{flowerCustomerRelId}
</select>
</mapper>
</mapper>
\ 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