Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
9bc5f3b4
Commit
9bc5f3b4
authored
Aug 06, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员标签同步-好友打标签同步
parent
f046bb7a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
7 deletions
+61
-7
ExternalClerkRelatedApiServiceImpl.java
.../service/out/impl/ExternalClerkRelatedApiServiceImpl.java
+32
-0
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+27
-6
QywxTagApiServiceImpl.java
...anage/service/service/out/impl/QywxTagApiServiceImpl.java
+2
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/ExternalClerkRelatedApiServiceImpl.java
View file @
9bc5f3b4
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.haoban.app.customer.enums.GicQywxSyncTypeEnum
;
import
com.gic.haoban.app.customer.enums.QywxSyncTaskTypeEnum
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.common.utils.PageUtil
;
...
...
@@ -13,6 +17,8 @@ import com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper
;
import
com.gic.haoban.manage.service.entity.MemberUnionidRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated
;
import
com.gic.haoban.manage.service.pojo.QywxTagSyncInfoPojo
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -133,9 +139,35 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
memberUnionidRelatedMapper
.
updateByPrimaryKeySelective
(
memberUnionidRelated
);
resp
.
setResult
(
EntityUtil
.
changeEntityNew
(
ExternalClerkRelatedDTO
.
class
,
externalClerkRelated
));
pushTagSync
(
memberId
,
externalClerkRelated
.
getWxEnterpriseId
(),
enterpriseId
);
return
resp
;
}
/**
* 刷新标签信息
*
* @param memberId
* @param wxEnterpriseId
* @param enterpriseId
*/
private
void
pushTagSync
(
String
memberId
,
String
wxEnterpriseId
,
String
enterpriseId
)
{
QywxTagSyncInfoPojo
pojo
=
new
QywxTagSyncInfoPojo
();
pojo
.
setDataId
(
memberId
);
pojo
.
setTaskId
(
"-1"
);
pojo
.
setTaskType
(
QywxSyncTaskTypeEnum
.
MEMBER_SYNC
.
getType
());
//单个会员同步
pojo
.
setSyncType
(
GicQywxSyncTypeEnum
.
SINGLE_WXENT_MEMNER_SYNC
.
getType
());
pojo
.
setWxEnterpriseId
(
wxEnterpriseId
);
pojo
.
setEnterpriseId
(
enterpriseId
);
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
clientInstance
.
sendMessage
(
"qywxTagSyncDeal"
,
JSONObject
.
toJSONString
(
pojo
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
info
(
"异常:{}"
,
e
);
}
}
@Override
public
ExternalClerkRelatedDTO
getClerkFriendByUnionid
(
String
enterpriseId
,
String
clerkId
,
String
unionid
)
{
TabHaobanExternalClerkRelated
externalClerkRelated
=
tabHaobanExternalClerkRelatedMapper
.
getClerkExternalByUnionId
(
enterpriseId
,
clerkId
,
unionid
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
9bc5f3b4
...
...
@@ -997,7 +997,11 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
log
.
info
(
"self不执行"
);
return
;
}
qywxTagApiService
.
syncQywxTagToGicByExternalUserId
(
wxEnterprise
.
getWxEnterpriseId
(),
dto
.
getExternalUserid
(),
dto
.
getWxUserId
());
pushTagSync
(
dto
.
getExternalUserid
(),
dto
.
getWxUserId
()
,
GicQywxSyncTypeEnum
.
FRIEND_TAG_SYNC
.
getType
(),
QywxSyncTaskTypeEnum
.
MEMBER_SYNC
.
getType
(),
wxEnterprise
.
getWxEnterpriseId
(),
null
);
// qywxTagApiService.syncQywxTagToGicByExternalUserId(wxEnterprise.getWxEnterpriseId(), dto.getExternalUserid(), dto.getWxUserId());
}
@Override
...
...
@@ -1567,13 +1571,19 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
return
""
;
}
private
void
pushTagSync
(
String
memberId
,
String
wxEnterpriseId
,
String
enterpriseId
)
{
/**
* 同步
*
* @param wxEnterpriseId
* @param enterpriseId
*/
private
void
pushTagSync
(
String
dataId
,
String
taskId
,
int
syncType
,
int
taskType
,
String
wxEnterpriseId
,
String
enterpriseId
)
{
QywxTagSyncInfoPojo
pojo
=
new
QywxTagSyncInfoPojo
();
pojo
.
setDataId
(
member
Id
);
pojo
.
setTaskId
(
"-1"
);
pojo
.
setTaskType
(
QywxSyncTaskTypeEnum
.
MEMBER_SYNC
.
getType
()
);
pojo
.
setDataId
(
data
Id
);
pojo
.
setTaskId
(
taskId
);
pojo
.
setTaskType
(
taskType
);
//单个会员同步
pojo
.
setSyncType
(
GicQywxSyncTypeEnum
.
SINGLE_WXENT_MEMNER_SYNC
.
getType
()
);
pojo
.
setSyncType
(
syncType
);
pojo
.
setWxEnterpriseId
(
wxEnterpriseId
);
pojo
.
setEnterpriseId
(
enterpriseId
);
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
...
...
@@ -1585,6 +1595,17 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
}
/**
* 同步
*
* @param memberId
* @param wxEnterpriseId
* @param enterpriseId
*/
private
void
pushTagSync
(
String
memberId
,
String
wxEnterpriseId
,
String
enterpriseId
)
{
this
.
pushTagSync
(
memberId
,
"-1"
,
GicQywxSyncTypeEnum
.
SINGLE_WXENT_MEMNER_SYNC
.
getType
(),
QywxSyncTaskTypeEnum
.
MEMBER_SYNC
.
getType
(),
wxEnterpriseId
,
enterpriseId
);
}
@Override
public
String
addFriendExternal
(
ExternalUserDTO
dto
)
{
String
wxUserId
=
dto
.
getWxUserId
();
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QywxTagApiServiceImpl.java
View file @
9bc5f3b4
...
...
@@ -649,7 +649,6 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
QywxSyncTagFormatPojo
syncTagFormatPojo
=
listSyncTagItems
(
wxEnterpriseId
);
if
(
syncTagFormatPojo
==
null
)
{
logger
.
info
(
"没有需要同步的标签,wxUserId:{},externalUserId:{},wxId:{}"
,
wxUserId
,
externalUserId
,
wxEnterpriseId
);
resp
.
setCode
(
2
);
resp
.
setMessage
(
"没有需要同步的标签"
);
return
resp
;
}
...
...
@@ -676,6 +675,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
Set
<
String
>
staffChangeTagKeys
=
externalTagMap
.
get
(
wxUserId
);
if
(
CollectionUtils
.
isEmpty
(
staffChangeTagKeys
))
{
logger
.
info
(
"该用户没有不存在好友关系,获取不到关联导购打的标签"
);
resp
.
setMessage
(
"该用户没有不存在好友关系,获取不到关联导购打的标签"
);
return
resp
;
}
Sets
.
SetView
<
String
>
staffHasSetTagKeys
=
Sets
.
intersection
(
staffChangeTagKeys
,
qywxTagKeys
);
...
...
@@ -684,6 +684,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
List
<
TabHaobanExternalClerkRelated
>
clerkRelateds
=
externalClerkRelatedService
.
listExternalByExternalUserid
(
wxEnterpriseId
,
externalUserId
);
if
(
CollectionUtils
.
isEmpty
(
clerkRelateds
))
{
logger
.
info
(
"该用户没关联对应的好友:{}"
);
resp
.
setMessage
(
"该用户没关联对应的好友"
);
return
resp
;
}
//企业下的企业微信标签对应关系
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment