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 d334129b
authored
Nov 04, 2021
by
linkwechat8856@163.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
活码统计BUG修复
1 parent
87ea2787
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
18 deletions
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCustomer.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.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 @
d334129
...
@@ -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/service/impl/WeCustomerServiceImpl.java
View file @
d334129
...
@@ -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/resources/mapper/wecom/WeCustomerMapper.xml
View file @
d334129
...
@@ -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 @
d334129
...
@@ -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