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 c15fe08f
authored
Nov 01, 2021
by
linkwechat8856@163.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
客户列表bug修复
1 parent
5bd95e70
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
53 deletions
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/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
View file @
c15fe08
...
@@ -371,9 +371,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
...
@@ -371,9 +371,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
@Override
@Override
public
List
<
WeUser
>
getCustomersByUserId
(
String
externalUserid
)
{
public
List
<
WeUser
>
getCustomersByUserId
(
String
externalUserid
)
{
String
userId
=
null
;
String
userId
=
null
;
if
(
Constants
.
USER_TYPE_WECOME
.
equals
(
SecurityUtils
.
getLoginUser
().
getUser
().
getUserType
())){
//
if(Constants.USER_TYPE_WECOME.equals(SecurityUtils.getLoginUser().getUser().getUserType())){
userId
=
SecurityUtils
.
getLoginUser
().
getUser
().
getWeUserId
();
//
userId=SecurityUtils.getLoginUser().getUser().getWeUserId();
}
//
}
return
this
.
baseMapper
.
getCustomersByUserId
(
externalUserid
,
userId
);
return
this
.
baseMapper
.
getCustomersByUserId
(
externalUserid
,
userId
);
}
}
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
View file @
c15fe08
...
@@ -129,23 +129,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -129,23 +129,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"userName"
column=
"user_name"
/>
<result
property=
"userName"
column=
"user_name"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"isOpenChat"
column=
"is_open_chat"
jdbcType=
"INTEGER"
/>
<result
property=
"isOpenChat"
column=
"is_open_chat"
jdbcType=
"INTEGER"
/>
<collection
property=
"weFlowerCustomerRels"
ofType=
"com.linkwechat.wecom.domain.WeFlowerCustomerRel"
>
<!-- <collection property="weFlowerCustomerRels" ofType="com.linkwechat.wecom.domain.WeFlowerCustomerRel">--
>
<result
property=
"id"
column=
"wfcrId"
/
>
<!-- <result property="id" column="wfcrId" />--
>
<result
property=
"userId"
column=
"user_id"
/
>
<!-- <result property="userId" column="user_id" />--
>
<result
property=
"remark"
column=
"remark"
/
>
<!-- <result property="remark" column="remark" />--
>
<result
property=
"description"
column=
"description"
/
>
<!-- <result property="description" column="description" />--
>
<result
property=
"createTime"
column=
"create_time"
/
>
<!-- <result property="createTime" column="create_time" />--
>
<result
property=
"remarkCorpName"
column=
"remark_corp_name"
/
>
<!-- <result property="remarkCorpName" column="remark_corp_name" />--
>
<result
property=
"operUserid"
column=
"oper_userid"
/
>
<!-- <result property="operUserid" column="oper_userid" />--
>
<result
property=
"addWay"
column=
"add_way"
/
>
<!-- <result property="addWay" column="add_way" />--
>
<result
property=
"state"
column=
"state"
/
>
<!-- <result property="state" column="state" />--
>
<result
property=
"status"
column=
"status"
/
>
<!-- <result property="status" column="status" />--
>
<result
property=
"userName"
column=
"user_name"
/
>
<!-- <result property="userName" column="user_name"/>--
>
<result
property=
"department"
column=
"department"
/
>
<!-- <result property="department" column="department"/>--
>
<collection
property=
"weFlowerCustomerTagRels"
javaType=
"ArrayList"
<!-- <collection property="weFlowerCustomerTagRels" javaType="ArrayList"-->
column=
"{id = wfcrId}"
select=
"selectWeCustomerTags"
>
<!-- column="{id = wfcrId}" select="selectWeCustomerTags">--
>
</collection
>
<!-- </collection>--
>
</collection
>
<!-- </collection>--
>
</resultMap>
</resultMap>
...
@@ -407,44 +407,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -407,44 +407,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"getCustomersByUserId"
resultMap=
"WeCustomerResult"
>
<select
id=
"getCustomersByUserId"
resultMap=
"WeCustomerResult"
>
SELECT
SELECT
wc.external_userid,
wc.external_userid,
wc.`name`,
wc.`name`,
wc.avatar,
wc.avatar,
wc.type,
wc.type,
wc.gender,
wc.gender,
wc.unionid,
wc.unionid,
wc.birthday,
wc.birthday,
wc.corp_name,
wc.corp_name,
wc.corp_full_name,
wc.corp_full_name,
wc.position,
wc.position,
wc.is_open_chat,
wc.is_open_chat,
wfcr.id as wfcrId,
wu.user_name,
wfcr.user_id,
wt.tag_id,
wfcr.remark,
wt.create_time,
wfcr.description,
wt.`name` as tagName,
wfcr.create_time,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
wfcr.remark_corp_name,
wfcr.oper_userid,
wfcr.add_way,
wfcr.state,
wu.user_name,
wfcrf.flower_customer_rel_id,
wt.tag_id,
wt.create_time,
wt.`name` as tagName,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
FROM
FROM
we_customer wc
we_customer wc
LEFT JOIN we_flower_customer_rel wfcr ON wc.first_user_id=wfcr.user_id
LEFT JOIN we_user wu ON wu.user_id=wc.first_user_id
LEFT JOIN we_user wu ON wu.user_id=wfcr.user_id
LEFT JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.user_id = wc.first_user_id
LEFT JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.flower_customer_rel_id = wfcr.id
LEFT JOIN we_tag wt ON wt.tag_id = wfcrf.tag_id
LEFT JOIN we_tag wt ON wt.tag_id = wfcrf.tag_id
WHERE wc.external_userid=#{externalUserid}
WHERE wc.external_userid=#{externalUserid}
<if
test=
"userId != null and userId !=''"
>
<if
test=
"userId != null and userId !=''"
>
AND w
fcr.
user_id=#{userId}
AND w
c.first_
user_id=#{userId}
</if>
</if>
ORDER BY w
fcr
.create_time ASC limit 1
ORDER BY w
c
.create_time ASC limit 1
</select>
</select>
...
...
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