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 7edc2ecb
authored
Mar 04, 2021
by
1539136324@qq.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交客户画像标签获取,标签更新;客户社交关系相关接口;
1 parent
7546bc13
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
119 additions
and
1 deletions
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/WeCustomerSocialConn.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerPortraitController.java
View file @
7edc2ec
...
@@ -3,12 +3,16 @@ package com.linkwechat.web.controller.wecom;
...
@@ -3,12 +3,16 @@ 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.WeFlowerCustomerTagRel
;
import
com.linkwechat.wecom.domain.WeTagGroup
;
import
com.linkwechat.wecom.domain.WeTagGroup
;
import
com.linkwechat.wecom.domain.vo.WeMakeCustomerTag
;
import
com.linkwechat.wecom.service.IWeCustomerService
;
import
com.linkwechat.wecom.service.IWeCustomerService
;
import
com.linkwechat.wecom.service.IWeTagGroupService
;
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.*
;
import
java.util.List
;
/**
/**
* @description: 客户画像相关controller
* @description: 客户画像相关controller
* @author: HaoN
* @author: HaoN
...
@@ -78,5 +82,51 @@ public class WeCustomerPortraitController extends BaseController {
...
@@ -78,5 +82,51 @@ public class WeCustomerPortraitController extends BaseController {
}
}
/**
* 更新客户画像标签
* @param weMakeCustomerTag
* @return
*/
@PostMapping
(
value
=
"/updateWeCustomerPorTraitTag"
)
public
AjaxResult
updateWeCustomerPorTraitTag
(
@RequestBody
WeMakeCustomerTag
weMakeCustomerTag
){
iWeCustomerService
.
makeLabel
(
weMakeCustomerTag
);
return
AjaxResult
.
success
();
}
/**
* 查看客户添加的员工
* @param externalUserid
* @return
*/
@GetMapping
(
value
=
"/findAddaddEmployes/{externalUserid}"
)
public
AjaxResult
findaddEmployes
(
@PathVariable
String
externalUserid
){
return
AjaxResult
.
success
();
}
/**
* 获取用户添加的群
* @param externalUserid
* @param operUserid
* @return
*/
@GetMapping
(
value
=
"/findAddGroupNum"
)
public
AjaxResult
findAddGroupNum
(
String
externalUserid
,
String
operUserid
){
return
AjaxResult
.
success
();
}
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerPortrait.java
View file @
7edc2ec
...
@@ -42,4 +42,7 @@ public class WeCustomerPortrait {
...
@@ -42,4 +42,7 @@ public class WeCustomerPortrait {
//客户标签
//客户标签
private
List
<
WeTagGroup
>
weTagGroupList
;
private
List
<
WeTagGroup
>
weTagGroupList
;
//客户社交关系
private
WeCustomerSocialConn
socialConn
;
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerSocialConn.java
0 → 100644
View file @
7edc2ec
package
com
.
linkwechat
.
wecom
.
domain
;
import
lombok.Data
;
/**
* 客户社交关系
*/
@Data
public
class
WeCustomerSocialConn
{
/**添加员工数*/
private
Integer
addEmployeNum
;
/**添加群聊数*/
private
Integer
addGroupNum
;
/**共同群聊数*/
private
Integer
commonGroupNum
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMapper.java
View file @
7edc2ec
...
@@ -5,6 +5,7 @@ import java.util.List;
...
@@ -5,6 +5,7 @@ import java.util.List;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
com.linkwechat.wecom.domain.WeCustomerPortrait
;
import
com.linkwechat.wecom.domain.WeCustomerPortrait
;
import
com.linkwechat.wecom.domain.WeCustomerSocialConn
;
import
com.linkwechat.wecom.domain.WeUser
;
import
com.linkwechat.wecom.domain.WeUser
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -89,6 +90,13 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
...
@@ -89,6 +90,13 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"operUserid"
)
String
operUserid
);
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"operUserid"
)
String
operUserid
);
/**
* 统计客户社交关系
* @param externalUserid 客户id
* @param operUserid 员工id
* @return
*/
WeCustomerSocialConn
countSocialConn
(
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"operUserid"
)
String
operUserid
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
View file @
7edc2ec
...
@@ -127,4 +127,8 @@ public interface IWeCustomerService extends IService<WeCustomer>
...
@@ -127,4 +127,8 @@ public interface IWeCustomerService extends IService<WeCustomer>
*/
*/
void
updateWeCustomerPortrait
(
WeCustomerPortrait
weCustomerPortrait
);
void
updateWeCustomerPortrait
(
WeCustomerPortrait
weCustomerPortrait
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
View file @
7edc2ec
...
@@ -8,7 +8,6 @@ import com.linkwechat.common.constant.WeConstans;
...
@@ -8,7 +8,6 @@ import com.linkwechat.common.constant.WeConstans;
import
com.linkwechat.common.utils.SecurityUtils
;
import
com.linkwechat.common.utils.SecurityUtils
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.common.utils.Threads
;
import
com.linkwechat.common.utils.bean.BeanUtils
;
import
com.linkwechat.common.utils.bean.BeanUtils
;
import
com.linkwechat.wecom.client.WeCropTagClient
;
import
com.linkwechat.wecom.client.WeCropTagClient
;
import
com.linkwechat.wecom.client.WeCustomerClient
;
import
com.linkwechat.wecom.client.WeCustomerClient
;
...
@@ -639,6 +638,12 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
...
@@ -639,6 +638,12 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
weCustomerPortrait
.
getFlowerCustomerRelId
()
weCustomerPortrait
.
getFlowerCustomerRelId
()
)
)
);
);
//客户社交关系
weCustomerPortrait
.
setSocialConn
(
this
.
baseMapper
.
countSocialConn
(
externalUserid
,
operUserid
)
);
}
}
...
@@ -667,4 +672,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
...
@@ -667,4 +672,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
}
}
}
}
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
View file @
7edc2ec
...
@@ -323,5 +323,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -323,5 +323,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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
WHERE wc.external_userid=#{externalUserid} and wfcr.oper_userid=#{operUserid}
WHERE wc.external_userid=#{externalUserid} and wfcr.oper_userid=#{operUserid}
</select>
</select>
<select
id=
"countSocialConn"
resultType=
"com.linkwechat.wecom.domain.WeCustomerSocialConn"
>
SELECT
(
SELECT
count(*)
FROM
we_flower_customer_rel wfcr WHERE wfcr.external_userid=wc.external_userid
) AS addEmployeNum,
(
SELECT
COUNT(*)
FROM
we_group_member wgm where wgm.union_id=wc.external_userid
) AS addGroupNum,
(
SELECT
COUNT(*)
FROM we_group_member where chat_id in (
SELECT
chat_id
FROM
`we_group_member` where union_id=wc.external_userid
) and user_id=#{operUserid}
) AS commonGroupNum
FROM we_customer wc WHERE wc.external_userid=#{externalUserid}
</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