Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
仟微科技
Link Wechat
提交
7cb3470d
Link Wechat
项目概览
仟微科技
/
Link Wechat
通知
48
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Link Wechat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7cb3470d
编写于
3月 04, 2021
作者:
S
sunxiwang
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/back_end_dev' into back_end_dev
上级
924ba743
18abb724
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
307 addition
and
15 deletion
+307
-15
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCategoryController.java
...linkwechat/web/controller/wecom/WeCategoryController.java
+5
-5
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatContactMappingController.java
.../web/controller/wecom/WeChatContactMappingController.java
+7
-7
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerPortraitController.java
...at/web/controller/wecom/WeCustomerPortraitController.java
+82
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerPortrait.java
.../java/com/linkwechat/wecom/domain/WeCustomerPortrait.java
+45
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerPortraitTag.java
...va/com/linkwechat/wecom/domain/WeCustomerPortraitTag.java
+12
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeFlowerCustomerRel.java
...java/com/linkwechat/wecom/domain/WeFlowerCustomerRel.java
+19
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMapper.java
...in/java/com/linkwechat/wecom/mapper/WeCustomerMapper.java
+14
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeTagGroupMapper.java
...in/java/com/linkwechat/wecom/mapper/WeTagGroupMapper.java
+12
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
...java/com/linkwechat/wecom/service/IWeCustomerService.java
+19
-1
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeTagGroupService.java
...java/com/linkwechat/wecom/service/IWeTagGroupService.java
+11
-2
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
.../linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
+41
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTagGroupServiceImpl.java
.../linkwechat/wecom/service/impl/WeTagGroupServiceImpl.java
+5
-0
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
...ecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
+21
-0
linkwe-wecom/src/main/resources/mapper/wecom/WeTagGroupMapper.xml
...ecom/src/main/resources/mapper/wecom/WeTagGroupMapper.xml
+14
-0
未找到文件。
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCategoryController.java
浏览文件 @
7cb3470d
...
...
@@ -30,7 +30,7 @@ public class WeCategoryController extends BaseController {
/**
* 类目树
*/
@PreAuthorize
(
"@ss.hasPermi('wechat:category:list')"
)
//
@PreAuthorize("@ss.hasPermi('wechat:category:list')")
@GetMapping
(
"/list"
)
@ApiOperation
(
"类目树"
)
public
AjaxResult
list
(
@RequestParam
(
"mediaType"
)
String
mediaType
)
{
...
...
@@ -40,7 +40,7 @@ public class WeCategoryController extends BaseController {
/**
* 通过id查询类目详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('wechat:category:query')"
)
//
@PreAuthorize("@ss.hasPermi('wechat:category:query')")
@GetMapping
(
value
=
"/{id}"
)
@ApiOperation
(
"通过id查询类目详细信息"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
@@ -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
)
@PostMapping
@ApiOperation
(
"添加类目"
)
...
...
@@ -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
)
@PutMapping
@ApiOperation
(
"更新目录"
)
...
...
@@ -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
)
@DeleteMapping
(
"/{ids}"
)
@ApiOperation
(
"删除类目"
)
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatContactMappingController.java
浏览文件 @
7cb3470d
...
...
@@ -39,7 +39,7 @@ public class WeChatContactMappingController extends BaseController
/**
* 查询聊天关系映射列表
*/
@PreAuthorize
(
"@ss.hasPermi('chat:mapping:list')"
)
//
@PreAuthorize("@ss.hasPermi('chat:mapping:list')")
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
WeChatContactMapping
weChatContactMapping
)
{
...
...
@@ -51,7 +51,7 @@ public class WeChatContactMappingController extends BaseController
/**
* 按客户查询关系映射列表
*/
@PreAuthorize
(
"@ss.hasPermi('chat:mapping:listByCustomer')"
)
//
@PreAuthorize("@ss.hasPermi('chat:mapping:listByCustomer')")
@GetMapping
(
"/listByCustomer"
)
public
TableDataInfo
listByCustomer
()
{
...
...
@@ -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
)
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
WeChatContactMapping
weChatContactMapping
)
...
...
@@ -76,7 +76,7 @@ public class WeChatContactMappingController extends BaseController
/**
* 获取聊天关系映射详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('chat:mapping:query')"
)
//
@PreAuthorize("@ss.hasPermi('chat:mapping:query')")
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
@@ -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
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
WeChatContactMapping
weChatContactMapping
)
...
...
@@ -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
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
WeChatContactMapping
weChatContactMapping
)
...
...
@@ -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
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerPortraitController.java
0 → 100644
浏览文件 @
7cb3470d
package
com.linkwechat.web.controller.wecom
;
import
com.linkwechat.common.core.controller.BaseController
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.wecom.domain.WeCustomerPortrait
;
import
com.linkwechat.wecom.domain.WeTagGroup
;
import
com.linkwechat.wecom.service.IWeCustomerService
;
import
com.linkwechat.wecom.service.IWeTagGroupService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* @description: 客户画像相关controller
* @author: HaoN
* @create: 2021-03-03 15:10
**/
@RestController
@RequestMapping
(
"/wecom/portrait"
)
public
class
WeCustomerPortraitController
extends
BaseController
{
@Autowired
private
IWeCustomerService
iWeCustomerService
;
@Autowired
private
IWeTagGroupService
weTagGroupService
;
/**
* 根据客户id和当前企业员工id获取员工详细信息
* @param externalUserid
* @param operUserid
* @return
*/
@GetMapping
(
value
=
"/findWeCustomerInfo"
)
public
AjaxResult
findWeCustomerInfo
(
String
externalUserid
,
String
operUserid
){
return
AjaxResult
.
success
(
iWeCustomerService
.
findCustomerByOperUseridAndCustomerId
(
externalUserid
,
operUserid
)
);
}
/**
* 客户画像资料更新
* @param weCustomerPortrait
* @return
*/
@PostMapping
(
value
=
"/updateWeCustomerInfo"
)
public
AjaxResult
updateWeCustomerInfo
(
@RequestBody
WeCustomerPortrait
weCustomerPortrait
){
iWeCustomerService
.
updateWeCustomerPortrait
(
weCustomerPortrait
);
return
AjaxResult
.
success
();
}
/**
* 获取当前系统所有可用标签
* @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
0 → 100644
浏览文件 @
7cb3470d
package
com.linkwechat.wecom.domain
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
/**
* @description: 客户画像实体VO
* @author: HaoN
* @create: 2021-03-03 11:49
**/
@Data
public
class
WeCustomerPortrait
{
//外部联系人id
private
String
externalUserid
;
//企业员工id
private
String
operUserid
;
//客户与企业员工关系id
private
String
flowerCustomerRelId
;
//客户昵称
private
String
name
;
//客户备注
private
String
remark
;
//备注客户手机号
private
String
remarkMobiles
;
//客户生日
private
Date
birthday
;
//邮箱
private
String
email
;
//地址
private
String
address
;
//qq
private
String
qq
;
//职业
private
String
position
;
//公司
private
String
remarkCorpName
;
//描述
private
String
description
;
//客户标签
private
List
<
WeTagGroup
>
weTagGroupList
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerPortraitTag.java
0 → 100644
浏览文件 @
7cb3470d
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/domain/WeFlowerCustomerRel.java
浏览文件 @
7cb3470d
...
...
@@ -89,4 +89,23 @@ public class WeFlowerCustomerRel
@TableField
(
exist
=
false
)
private
String
endTime
;
/** 备注 */
private
String
remark
;
/** 邮件 */
private
String
email
;
/** qq */
private
String
qq
;
/**地址*/
private
String
address
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMapper.java
浏览文件 @
7cb3470d
...
...
@@ -4,6 +4,7 @@ import java.util.List;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
com.linkwechat.wecom.domain.WeCustomerPortrait
;
import
com.linkwechat.wecom.domain.WeUser
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -77,4 +78,17 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
* @return
*/
List
<
WeUser
>
getCustomerByTag
(
List
<
String
>
ids
);
/**
* 根据外部联系人ID和企业员工ID获取当前客户信息
* @param externalUserid
* @param operUserid
* @return
*/
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"operUserid"
)
String
operUserid
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeTagGroupMapper.java
浏览文件 @
7cb3470d
...
...
@@ -62,4 +62,16 @@ public interface WeTagGroupMapper extends BaseMapper<WeTagGroup>
* @return
*/
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
浏览文件 @
7cb3470d
...
...
@@ -2,12 +2,12 @@ package com.linkwechat.wecom.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
com.linkwechat.wecom.domain.WeCustomerPortrait
;
import
com.linkwechat.wecom.domain.WeUser
;
import
com.linkwechat.wecom.domain.dto.WeWelcomeMsg
;
import
com.linkwechat.wecom.domain.vo.WeLeaveUserInfoAllocateVo
;
import
com.linkwechat.wecom.domain.vo.WeMakeCustomerTag
;
import
java.util.List
;
/**
...
...
@@ -109,4 +109,22 @@ public interface IWeCustomerService extends IService<WeCustomer>
* @return
*/
public
List
<
WeUser
>
getCustomerByTag
(
List
<
String
>
ids
);
/**
* 根据外部联系人ID和企业员工ID获取当前客户信息
* @param externalUserid
* @param operUserid
* @return
*/
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
String
externalUserid
,
String
operUserid
);
/**
* 跟新客户画像
* @param weCustomerPortrait
*/
void
updateWeCustomerPortrait
(
WeCustomerPortrait
weCustomerPortrait
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeTagGroupService.java
浏览文件 @
7cb3470d
package
com.linkwechat.wecom.service
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeTagGroup
;
import
com.linkwechat.wecom.domain.dto.tag.WeCropGroupTagDto
;
import
java.util.List
;
/**
* 标签组Service接口
*
...
...
@@ -69,4 +69,13 @@ public interface IWeTagGroupService extends IService<WeTagGroup>
void
deleteTagGroup
(
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
浏览文件 @
7cb3470d
...
...
@@ -626,4 +626,45 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
}
@Override
public
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
String
externalUserid
,
String
operUserid
)
{
WeCustomerPortrait
weCustomerPortrait
=
weCustomerMapper
.
findCustomerByOperUseridAndCustomerId
(
externalUserid
,
operUserid
);
if
(
null
!=
weCustomerPortrait
){
//获取当前客户拥有得标签
weCustomerPortrait
.
setWeTagGroupList
(
iWeTagGroupService
.
findCustomerTagByFlowerCustomerRelId
(
weCustomerPortrait
.
getFlowerCustomerRelId
()
)
);
}
return
weCustomerPortrait
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateWeCustomerPortrait
(
WeCustomerPortrait
weCustomerPortrait
)
{
WeCustomer
weCustomer
=
WeCustomer
.
builder
().
build
();
BeanUtils
.
copyBeanProp
(
weCustomer
,
weCustomerPortrait
);
//更新用户基本信息表
this
.
updateById
(
weCustomer
);
WeFlowerCustomerRel
weFlowerCustomerRel
=
WeFlowerCustomerRel
.
builder
().
build
();
BeanUtils
.
copyBeanProp
(
weFlowerCustomerRel
,
weCustomerPortrait
);
//更新企业添加人表
iWeFlowerCustomerRelService
.
update
(
weFlowerCustomerRel
,
new
LambdaQueryWrapper
<
WeFlowerCustomerRel
>()
.
eq
(
WeFlowerCustomerRel:
:
getExternalUserid
,
weCustomerPortrait
.
getExternalUserid
())
.
eq
(
WeFlowerCustomerRel:
:
getOperUserid
,
weCustomerPortrait
.
getOperUserid
()));
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTagGroupServiceImpl.java
浏览文件 @
7cb3470d
...
...
@@ -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
浏览文件 @
7cb3470d
...
...
@@ -303,4 +303,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select
id=
"findCustomerByOperUseridAndCustomerId"
resultType=
"com.linkwechat.wecom.domain.WeCustomerPortrait"
>
SELECT
wc.`name`,
wfcr.remark,
wfcr.remark_mobiles,
wc.birthday,
wfcr.email,
wfcr.address,
wfcr.qq,
wc.position,
wfcr.remark_corp_name,
wfcr.description,
wfcr.id as flowerCustomerRelId
FROM
we_customer wc
LEFT JOIN we_flower_customer_rel wfcr on wc.external_userid=wfcr.external_userid
WHERE wc.external_userid=#{externalUserid} and wfcr.oper_userid=#{operUserid}
</select>
</mapper>
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeTagGroupMapper.xml
浏览文件 @
7cb3470d
...
...
@@ -101,5 +101,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</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>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录