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 17ebedbf
authored
Mar 03, 2021
by
1539136324@qq.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交客户画像资料更新接口
1 parent
5f30d342
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
4 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/WeFlowerCustomerRel.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-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerPortraitController.java
View file @
17ebedb
...
...
@@ -2,11 +2,10 @@ 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.service.IWeCustomerService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
/**
* @description: 客户画像相关controller
...
...
@@ -31,12 +30,29 @@ public class WeCustomerPortraitController extends BaseController {
@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
();
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomerPortrait.java
View file @
17ebedb
...
...
@@ -12,6 +12,10 @@ import java.util.List;
**/
@Data
public
class
WeCustomerPortrait
{
//外部联系人id
private
String
externalUserid
;
//企业员工id
private
String
operUserid
;
//客户昵称
private
String
name
;
//客户备注
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeFlowerCustomerRel.java
View file @
17ebedb
...
...
@@ -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/service/IWeCustomerService.java
View file @
17ebedb
...
...
@@ -122,4 +122,11 @@ public interface IWeCustomerService extends IService<WeCustomer>
*/
WeCustomerPortrait
findCustomerByOperUseridAndCustomerId
(
@Param
(
"externalUserid"
)
String
externalUserid
,
@Param
(
"operUserid"
)
String
operUserid
);
/**
* 跟新客户画像
* @param weCustomerPortrait
*/
void
updateWeCustomerPortrait
(
WeCustomerPortrait
weCustomerPortrait
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
View file @
17ebedb
...
...
@@ -632,5 +632,26 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
return
weCustomerMapper
.
findCustomerByOperUseridAndCustomerId
(
externalUserid
,
operUserid
);
}
@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
()));
}
}
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