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 a541fbf5
authored
Nov 04, 2021
by
linkwechat8856@163.com
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' into back_end_dev
2 parents
d11dc7ea
1f8f5258
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
13 deletions
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WePresTagGroupTaskServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeFlowerCustomerRelMapper.xml
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
View file @
a541fbf
...
@@ -197,4 +197,7 @@ public class WeCustomer extends BaseEntity {
...
@@ -197,4 +197,7 @@ public class WeCustomer extends BaseEntity {
*/
*/
@TableLogic
@TableLogic
private
Integer
delFlag
;
private
Integer
delFlag
;
//添加方式
private
Integer
addMethod
;
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeCustomerMapper.java
View file @
a541fbf
...
@@ -21,7 +21,7 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
...
@@ -21,7 +21,7 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
* @param externalUserId 企业微信客户ID
* @param externalUserId 企业微信客户ID
* @return 企业微信客户
* @return 企业微信客户
*/
*/
public
WeCustomer
selectWeCustomerById
(
String
externalU
serId
);
public
WeCustomer
selectWeCustomerById
(
@Param
(
"externalUserId"
)
String
externalUserId
,
@Param
(
"userId"
)
String
u
serId
);
/**
/**
* 查询企业微信客户列表
* 查询企业微信客户列表
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
View file @
a541fbf
...
@@ -165,6 +165,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
...
@@ -165,6 +165,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
Optional
.
ofNullable
(
userDetail
.
getFollow_info
()).
ifPresent
(
followInfo
->
{
Optional
.
ofNullable
(
userDetail
.
getFollow_info
()).
ifPresent
(
followInfo
->
{
weCustomer
.
setFirstUserId
(
followInfo
.
getUserid
());
weCustomer
.
setFirstUserId
(
followInfo
.
getUserid
());
weCustomer
.
setFirstAddTime
(
new
Date
(
followInfo
.
getCreatetime
()
*
1000L
));
weCustomer
.
setFirstAddTime
(
new
Date
(
followInfo
.
getCreatetime
()
*
1000L
));
weCustomer
.
setAddMethod
(
followInfo
.
getAdd_way
());
weCustomerList
.
add
(
weCustomer
);
weCustomerList
.
add
(
weCustomer
);
List
<
String
>
tags
=
Stream
.
of
(
followInfo
.
getTag_id
()).
collect
(
Collectors
.
toList
());
List
<
String
>
tags
=
Stream
.
of
(
followInfo
.
getTag_id
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
tags
))
{
if
(
CollectionUtil
.
isNotEmpty
(
tags
))
{
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WePresTagGroupTaskServiceImpl.java
View file @
a541fbf
...
@@ -256,7 +256,7 @@ public class WePresTagGroupTaskServiceImpl extends ServiceImpl<WePresTagGroupTas
...
@@ -256,7 +256,7 @@ public class WePresTagGroupTaskServiceImpl extends ServiceImpl<WePresTagGroupTas
if
(
StringUtils
.
isNotEmpty
(
resultDto
.
getDetail_list
()))
{
if
(
StringUtils
.
isNotEmpty
(
resultDto
.
getDetail_list
()))
{
for
(
DetailMessageStatusResultDto
detail
:
resultDto
.
getDetail_list
())
{
for
(
DetailMessageStatusResultDto
detail
:
resultDto
.
getDetail_list
())
{
WePresTagGroupTaskStatVo
statVo
=
new
WePresTagGroupTaskStatVo
();
WePresTagGroupTaskStatVo
statVo
=
new
WePresTagGroupTaskStatVo
();
WeCustomer
customer
=
customerMapper
.
selectWeCustomerById
(
detail
.
getExternal_userid
());
WeCustomer
customer
=
customerMapper
.
selectWeCustomerById
(
detail
.
getExternal_userid
()
,
detail
.
getUserid
()
);
statVo
.
setCustomerName
(
customer
.
getName
());
statVo
.
setCustomerName
(
customer
.
getName
());
statVo
.
setStatus
(
detail
.
getStatus
());
statVo
.
setStatus
(
detail
.
getStatus
());
statVo
.
setInGroup
(
externalIdList
.
contains
(
detail
.
getExternal_userid
()));
statVo
.
setInGroup
(
externalIdList
.
contains
(
detail
.
getExternal_userid
()));
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
View file @
a541fbf
...
@@ -323,7 +323,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -323,7 +323,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectWeCustomerById"
parameterType=
"String"
resultType=
"WeCustomer"
>
<select
id=
"selectWeCustomerById"
parameterType=
"String"
resultType=
"WeCustomer"
>
<include
refid=
"selectWeCustomerVo"
/>
<include
refid=
"selectWeCustomerVo"
/>
where external_userid = #{externalUserId}
where external_userid = #{externalUserId}
and first_user_id=#{userId}
</select>
</select>
<insert
id=
"insertWeCustomer"
parameterType=
"WeCustomer"
>
<insert
id=
"insertWeCustomer"
parameterType=
"WeCustomer"
>
...
@@ -589,12 +589,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -589,12 +589,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qq,
qq,
email,
email,
address,
address,
phone
phone,
add_method
) values
) values
<foreach
collection=
"weCustomers"
item=
"item"
index=
"index"
separator=
","
>
<foreach
collection=
"weCustomers"
item=
"item"
index=
"index"
separator=
","
>
(#{item.externalUserid},#{item.name},#{item.avatar},#{item.type},#{item.gender}, #{item.unionid},#{item.birthday},
(#{item.externalUserid},#{item.name},#{item.avatar},#{item.type},#{item.gender}, #{item.unionid},#{item.birthday},
#{item.corpName},#{item.corpFullName},#{item.position},#{item.isOpenChat}, #{item.createTime},
#{item.corpName},#{item.corpFullName},#{item.position},#{item.isOpenChat}, #{item.createTime},
#{item.createBy},#{item.firstUserId},#{item.firstAddTime},#{item.qq},#{item.email},#{item.address},#{item.phone}
#{item.createBy},#{item.firstUserId},#{item.firstAddTime},#{item.qq},#{item.email},#{item.address},#{item.phone}
,#{item.addMethod}
)
)
</foreach>
</foreach>
ON DUPLICATE KEY UPDATE
ON DUPLICATE KEY UPDATE
...
@@ -613,7 +614,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -613,7 +614,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qq=IF(we_customer.qq != null, VALUES(qq), we_customer.qq),
qq=IF(we_customer.qq != null, VALUES(qq), we_customer.qq),
email=IF(we_customer.email != null, VALUES(email), we_customer.email),
email=IF(we_customer.email != null, VALUES(email), we_customer.email),
address=IF(we_customer.address != null, VALUES(address), we_customer.address),
address=IF(we_customer.address != null, VALUES(address), we_customer.address),
phone=IF(we_customer.phone != null, VALUES(phone), we_customer.phone);
phone=IF(we_customer.phone != null, VALUES(phone), we_customer.phone),
add_method=IF(we_customer.add_method != null, VALUES(add_method), we_customer.add_method);
</insert>
</insert>
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeFlowerCustomerRelMapper.xml
View file @
a541fbf
...
@@ -120,20 +120,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -120,20 +120,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"getUserAddCustomerStat"
parameterType=
"WeFlowerCustomerRel"
resultType=
"java.util.HashMap"
>
<select
id=
"getUserAddCustomerStat"
parameterType=
"WeFlowerCustomerRel"
resultType=
"java.util.HashMap"
>
select
select
left(wfcr.create
_time,10) as createTime , count(1) as total
left(wfcr.first_add
_time,10) as createTime , count(1) as total
from
from
we_flower_customer_rel
wfcr
we_customer
wfcr
<where>
<where>
<if
test=
"userId != null and userId != ''"
>
and wfcr.
user_id = #{userId}
</if>
<if
test=
"userId != null and userId != ''"
>
and wfcr.first_
user_id = #{userId}
</if>
<if
test=
"addWay != null and addWay != ''"
>
and wfcr.add_way
= #{addWay}
</if>
<if
test=
"addWay != null and addWay != ''"
>
and wfcr.add_method
= #{addWay}
</if>
<if
test=
"beginTime != null and beginTime != ''"
>
<!-- 开始时间检索 -->
<if
test=
"beginTime != null and beginTime != ''"
>
<!-- 开始时间检索 -->
AND date_format(wfcr.create
_time,'%y%m%d')
>
= date_format(#{beginTime},'%y%m%d')
AND date_format(wfcr.first_add
_time,'%y%m%d')
>
= date_format(#{beginTime},'%y%m%d')
</if>
</if>
<if
test=
"endTime != null and endTime != ''"
>
<!-- 结束时间检索 -->
<if
test=
"endTime != null and endTime != ''"
>
<!-- 结束时间检索 -->
AND date_format(wfcr.create
_time,'%y%m%d')
<
= date_format(#{endTime},'%y%m%d')
AND date_format(wfcr.first_add
_time,'%y%m%d')
<
= date_format(#{endTime},'%y%m%d')
</if>
</if>
</where>
</where>
group by
group by
left(wfcr.create
_time,10)
left(wfcr.first_add
_time,10)
</select>
</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