Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
仟微科技
Link Wechat
提交
a20ab7a9
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 搜索 >>
提交
a20ab7a9
编写于
9月 17, 2020
作者:
水
水库浪子
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加客户来源
上级
36913558
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
172 addition
and
158 deletion
+172
-158
linkwe-common/src/main/java/com/linkwechat/common/enums/CustomerSource.java
...main/java/com/linkwechat/common/enums/CustomerSource.java
+54
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
...src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
+28
-153
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeCustomerDto.java
...n/java/com/linkwechat/wecom/domain/dto/WeCustomerDto.java
+37
-1
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeFollowUserDto.java
...java/com/linkwechat/wecom/domain/dto/WeFollowUserDto.java
+1
-1
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeUserDto.java
.../main/java/com/linkwechat/wecom/domain/dto/WeUserDto.java
+1
-1
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
.../linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
+51
-2
未找到文件。
linkwe-common/src/main/java/com/linkwechat/common/enums/CustomerSource.java
0 → 100644
浏览文件 @
a20ab7a9
package
com.linkwechat.common.enums
;
public
enum
CustomerSource
{
// CUSTOMER_SOURCE_WZLY(0,""),
// CUSTOMER_SOURCE_SMEWM(0,),
// CUSTOMER_SOURCE_SSSJH(0,),
// CUSTOMER_SOURCE_MPFX(0,),
// CUSTOMER_SOURCE_QL(0,),
// CUSTOMER_SOURCE_SJTXL(0,),
// CUSTOMER_SOURCE_WXLXR(0,),
// CUSTOMER_SOURCE_TJHYSQ(0,),
// CUSTOMER_SOURCE_DSFRJTJ(0,),
// CUSTOMER_SOURCE_YXSS(0,),
// CUSTOMER_SOURCE_NBCYGX(0,),
// CUSTOMER_SOURCE_GLRYFP(0,)
// ;
//
// private Integer code;
//
// private String label;
//
// private CustomerSource(Integer code, String label){
// this.code = code;
// this.label = label;
// }
//
// public Integer getCode() {
// return code;
// }
//
// public OrderType setCode(Integer code) {
// this.code = code;
// return this;
// }
//
// public String getLabel() {
// return label;
// }
//
// public OrderType setLabel(String label) {
// this.label = label;
// return this;
// }
//
// public OrderType getOrderTypeByCode(Integer code){
// OrderType[] orderTypes = OrderType.values();
// for(OrderType orderType:orderTypes){
// if(orderType.getCode().equals(code)){
// return orderType;
// }
// }
// throw new RuntimeException("未知的订单类型");
// }
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
浏览文件 @
a20ab7a9
...
...
@@ -3,6 +3,11 @@ package com.linkwechat.wecom.domain;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
...
...
@@ -12,12 +17,16 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @author ruoyi
* @date 2020-09-13
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
WeCustomer
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** $column.columnComment */
private
Long
id
;
private
Long
id
=
SnowFlakeUtil
.
nextId
();
;
/** 外部联系人的userid */
private
String
externalUserid
;
...
...
@@ -29,10 +38,10 @@ public class WeCustomer extends BaseEntity
private
String
avatar
;
/** 外部联系人的类型,1表示该外部联系人是微信用户,2表示该外部联系人是企业微信用户 */
private
Long
type
;
private
Integer
type
;
/** 外部联系人性别 0-未知 1-男性 2-女性 */
private
Long
gender
;
private
Integer
gender
;
/** 外部联系人在微信开放平台的唯一身份标识,通过此字段企业可将外部联系人与公众号/小程序用户关联起来。 */
private
String
unionid
;
...
...
@@ -56,154 +65,20 @@ public class WeCustomer extends BaseEntity
/** 客户备注的手机号码 */
private
String
remarkMobiles
;
/** 客户备注的企业名称 */
private
String
remarkCorpName
;
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setExternalUserid
(
String
externalUserid
)
{
this
.
externalUserid
=
externalUserid
;
}
public
String
getExternalUserid
()
{
return
externalUserid
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
public
void
setAvatar
(
String
avatar
)
{
this
.
avatar
=
avatar
;
}
public
String
getAvatar
()
{
return
avatar
;
}
public
void
setType
(
Long
type
)
{
this
.
type
=
type
;
}
public
Long
getType
()
{
return
type
;
}
public
void
setGender
(
Long
gender
)
{
this
.
gender
=
gender
;
}
public
Long
getGender
()
{
return
gender
;
}
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
public
String
getUnionid
()
{
return
unionid
;
}
public
void
setBirthday
(
Date
birthday
)
{
this
.
birthday
=
birthday
;
}
public
Date
getBirthday
()
{
return
birthday
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setDepartmentName
(
String
departmentName
)
{
this
.
departmentName
=
departmentName
;
}
public
String
getDepartmentName
()
{
return
departmentName
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setRemarkMobiles
(
String
remarkMobiles
)
{
this
.
remarkMobiles
=
remarkMobiles
;
}
public
String
getRemarkMobiles
()
{
return
remarkMobiles
;
}
public
void
setRemarkCorpName
(
String
remarkCorpName
)
{
this
.
remarkCorpName
=
remarkCorpName
;
}
public
String
getRemarkCorpName
()
{
return
remarkCorpName
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"externalUserid"
,
getExternalUserid
())
.
append
(
"name"
,
getName
())
.
append
(
"avatar"
,
getAvatar
())
.
append
(
"type"
,
getType
())
.
append
(
"gender"
,
getGender
())
.
append
(
"unionid"
,
getUnionid
())
.
append
(
"birthday"
,
getBirthday
())
.
append
(
"userId"
,
getUserId
())
.
append
(
"userName"
,
getUserName
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"departmentName"
,
getDepartmentName
())
.
append
(
"description"
,
getDescription
())
.
append
(
"remarkMobiles"
,
getRemarkMobiles
())
.
append
(
"remarkCorpName"
,
getRemarkCorpName
())
.
toString
();
}
/** 客户企业简称 */
private
String
corpName
;
/** 客户企业全称 */
private
String
corpFullName
;
/** 职位 */
private
String
position
;
/** 客户来源 */
private
String
addWay
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeCustomerDto.java
浏览文件 @
a20ab7a9
package
com.linkwechat.wecom.domain.dto
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.common.utils.bean.BeanUtils
;
import
com.linkwechat.wecom.domain.WeCustomer
;
import
lombok.Data
;
import
java.util.List
;
...
...
@@ -24,7 +28,7 @@ public class WeCustomerDto extends WeResultDto{
@Data
class
ExternalContact
{
public
class
ExternalContact
{
/** 外部联系人userId */
private
String
external_userid
;
/** 外部联系人名称 */
...
...
@@ -58,4 +62,36 @@ public class WeCustomerDto extends WeResultDto{
}
public
WeCustomer
transformWeCustomer
(){
WeCustomer
weCustomer
=
new
WeCustomer
();
if
(
null
!=
external_contact
){
BeanUtils
.
copyPropertiesignoreOther
(
external_contact
,
weCustomer
);
}
if
(
CollectionUtil
.
isNotEmpty
(
follow_user
)){
WeFollowUserDto
weFollowUserDto
=
follow_user
.
get
(
0
);
weCustomer
.
setUserId
(
weFollowUserDto
.
getUserid
());
weCustomer
.
setDescription
(
weFollowUserDto
.
getDescription
());
weCustomer
.
setRemarkMobiles
(
StringUtils
.
join
(
weFollowUserDto
.
getRemark_mobiles
(),
","
));
// weCustomer.setAddWay();
//
// weFollowUserDto.getAdd_way();
// followUser.getUserid();
// followUser.getDescription();
// followUser.getRemark_mobiles();
// followUser.getAdd_way();
}
return
weCustomer
;
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeFollowUserDto.java
浏览文件 @
a20ab7a9
...
...
@@ -33,7 +33,7 @@ public class WeFollowUserDto extends WeResultDto{
private
String
remark_corp_name
;
/** 客户备注的手机号码 */
private
String
remark_mobiles
;
private
String
[]
remark_mobiles
;
/** 该成员添加此客户的来源 */
private
Integer
add_way
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/WeUserDto.java
浏览文件 @
a20ab7a9
...
...
@@ -8,7 +8,7 @@ import lombok.Data;
* @create: 2020-08-28 10:45
**/
@Data
public
class
WeUserDto
{
public
class
WeUserDto
extends
WeResultDto
{
//成员头像的mediaid,通过素材管理接口上传图片获得的mediaid
private
String
avatar_mediaid
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
浏览文件 @
a20ab7a9
...
...
@@ -8,8 +8,10 @@ import cn.hutool.core.util.ArrayUtil;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.common.utils.DateUtils
;
import
com.linkwechat.wecom.client.WeCustomerClient
;
import
com.linkwechat.wecom.client.WeUserClient
;
import
com.linkwechat.wecom.domain.dto.WeCustomerDto
;
import
com.linkwechat.wecom.domain.dto.WeFollowUserDto
;
import
com.linkwechat.wecom.domain.dto.WeUserDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.linkwechat.wecom.mapper.WeCustomerMapper
;
...
...
@@ -32,6 +34,10 @@ public class WeCustomerServiceImpl implements IWeCustomerService
@Autowired
private
WeCustomerClient
weFollowUserClient
;
@Autowired
private
WeUserClient
weUserClient
;
/**
* 查询企业微信客户
*
...
...
@@ -132,10 +138,53 @@ public class WeCustomerServiceImpl implements IWeCustomerService
//获取指定客户的详情
WeCustomerDto
externalContact
=
weFollowUserClient
.
get
(
v
);
if
(
WeConstans
.
WE_SUCCESS_CODE
.
equals
(
externalContact
.
getErrcode
())
&&
null
!=
externalContact
.
getExternal_contact
()){
if
(
WeConstans
.
WE_SUCCESS_CODE
.
equals
(
externalContact
.
getErrcode
())){
//分装成需要入库的数据格式
WeCustomerDto
.
ExternalContact
weExternalContact
=
externalContact
.
getExternal_contact
();
if
(
null
!=
weExternalContact
){
WeCustomer
.
builder
()
.
externalUserid
(
weExternalContact
.
getExternal_userid
())
.
name
(
weExternalContact
.
getName
())
.
avatar
(
weExternalContact
.
getAvatar
())
.
type
(
weExternalContact
.
getType
())
.
gender
(
weExternalContact
.
getGender
())
.
unionid
(
weExternalContact
.
getUnionid
())
// 自定义 .birthday()
// 添加人的id .userId(weExternalContact.getExternal_userid())
// 添加人的名称 .userName()
// 添加人所在部门 .departmentName()
// 添加人员描述 .description()
// 备注号码 .remarkMobiles()
.
corpName
(
weExternalContact
.
getCorp_name
())
.
corpFullName
(
weExternalContact
.
getCorp_full_name
())
.
position
(
weExternalContact
.
getPosition
());
// 客户来源 .addWay()
List
<
WeFollowUserDto
>
followUsers
=
externalContact
.
getFollow_user
();
if
(
CollectionUtil
.
isNotEmpty
(
followUsers
)){
WeFollowUserDto
followUser
=
followUsers
.
get
(
0
);
followUser
.
getUserid
();
followUser
.
getDescription
();
followUser
.
getRemark_mobiles
();
followUser
.
getAdd_way
();
WeUserDto
weUserDto
=
weUserClient
.
getUserByUserId
(
followUser
.
getUserid
());
if
(
WeConstans
.
WE_SUCCESS_CODE
.
equals
(
weUserDto
.
getErrcode
())){
weUserDto
.
getName
();
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录