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
c3665785
Commit
c3665785
authored
Aug 11, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员标签同步-traceId
parent
e7339e82
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
15 deletions
+54
-15
AlertMessageDTO.java
...n/java/com/gic/haoban/manage/api/dto/AlertMessageDTO.java
+11
-0
QuartzEnum.java
...main/java/com/gic/haoban/manage/api/enums/QuartzEnum.java
+1
-1
CheckQywxSettingApiServiceImpl.java
...vice/service/out/impl/CheckQywxSettingApiServiceImpl.java
+10
-4
QywxTagApiServiceImpl.java
...anage/service/service/out/impl/QywxTagApiServiceImpl.java
+31
-10
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+1
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/AlertMessageDTO.java
View file @
c3665785
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
...
...
@@ -20,6 +21,8 @@ public class AlertMessageDTO implements Serializable {
private
String
alertTitle
;
private
Map
<
String
,
Object
>
contentMap
;
private
LinkedHashMap
<
String
,
Object
>
contentLinkMap
;
public
String
getKey
()
{
return
key
;
}
...
...
@@ -75,4 +78,12 @@ public class AlertMessageDTO implements Serializable {
public
void
setContentMap
(
Map
<
String
,
Object
>
contentMap
)
{
this
.
contentMap
=
contentMap
;
}
public
LinkedHashMap
<
String
,
Object
>
getContentLinkMap
()
{
return
contentLinkMap
;
}
public
void
setContentLinkMap
(
LinkedHashMap
<
String
,
Object
>
contentLinkMap
)
{
this
.
contentLinkMap
=
contentLinkMap
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/QuartzEnum.java
View file @
c3665785
...
...
@@ -10,7 +10,7 @@ public enum QuartzEnum {
* 企业微信
*/
HANDOVER_QYWX
(
"handover"
,
"com.gic.haoban.manage.api.service.HandoverOperationApiService"
,
"batchQywxHandoverTimeTask"
,
"0 0 0 * * *"
,
"-1"
),
TAG_QYWX
(
"qywxTagCheck"
,
"com.gic.haoban.manage.api.service.QywxTagApiService"
,
"checkQywxSync"
,
"0
5 17
* * *"
,
"-1"
);
TAG_QYWX
(
"qywxTagCheck"
,
"com.gic.haoban.manage.api.service.QywxTagApiService"
,
"checkQywxSync"
,
"0
30 10
* * *"
,
"-1"
);
private
String
key
;
private
String
serviceName
;
private
String
method
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/CheckQywxSettingApiServiceImpl.java
View file @
c3665785
...
...
@@ -19,10 +19,7 @@ import org.slf4j.Logger;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.UUID
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
...
...
@@ -170,6 +167,15 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic
text
+=
"商户:"
+
enterpriseDTO
.
getEnterpriseName
()
+
"("
+
enterpriseDTO
.
getBrandName
()
+
")\n\r"
;
}
LinkedHashMap
<
String
,
Object
>
contentLinkMap
=
messageDTO
.
getContentLinkMap
();
if
(
MapUtils
.
isNotEmpty
(
contentLinkMap
))
{
Set
<
String
>
keySet
=
contentLinkMap
.
keySet
();
for
(
String
k
:
keySet
)
{
Object
o
=
contentLinkMap
.
get
(
k
);
text
+=
k
+
":"
+
o
+
"\n\r"
;
}
}
Map
<
String
,
Object
>
contentMap
=
messageDTO
.
getContentMap
();
if
(
MapUtils
.
isNotEmpty
(
contentMap
))
{
Set
<
String
>
keySet
=
contentMap
.
keySet
();
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QywxTagApiServiceImpl.java
View file @
c3665785
...
...
@@ -23,6 +23,8 @@ import com.gic.haoban.manage.service.service.QywxTagService;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.member.api.dto.MemberTagDTO
;
import
com.gic.member.api.service.MemberTagService
;
import
com.gic.member.tag.api.dto.MemberTagItemDTO
;
import
com.gic.member.tag.api.service.MemberTagItemApiService
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.search.engine.api.service.dynamic.ESDataDynamicOperationApiService
;
import
com.gic.wechat.api.dto.qywx.QywxTagDTO
;
...
...
@@ -84,6 +86,9 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
@Autowired
private
QywxTagSyncApiService
qywxTagSyncApiService
;
@Autowired
private
MemberTagItemApiService
memberTagItemApiService
;
@Override
public
void
pullQywxTag
(
String
wxEnterpriseId
)
{
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
...
...
@@ -842,16 +847,14 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
List
<
TabQywxTagRelation
>
qywxTagRelations
=
tagRelations
.
stream
().
filter
(
dto
->
dto
.
getRelationType
()
==
QywxTagRelationTypeEnum
.
TAG_GROUP
.
getType
()).
collect
(
Collectors
.
toList
());
for
(
TabQywxTagRelation
qywxTagRelation
:
qywxTagRelations
)
{
Map
<
String
,
Object
>
map
=
checkQywxSyncByQywxTag
(
qywxTagRelation
,
wxEnterprise
,
pojo
);
LinkedHash
Map
<
String
,
Object
>
map
=
checkQywxSyncByQywxTag
(
qywxTagRelation
,
wxEnterprise
,
pojo
);
if
(
MapUtils
.
isNotEmpty
(
map
))
{
AlertMessageDTO
messageDTO
=
new
AlertMessageDTO
();
messageDTO
.
setAlertTitle
(
"企微与好办同步标签不相同"
);
messageDTO
.
setEnterpriseId
(
qywxTagRelation
.
getEnterpriseId
());
messageDTO
.
setAlertType
(
AlertTypeEnum
.
QYWX_TAG_SYNC
.
getType
());
messageDTO
.
setWxEnterpriseId
(
wxEnterprise
.
getWxEnterpriseId
());
messageDTO
.
setContentMap
(
map
);
messageDTO
.
setContentLinkMap
(
map
);
messageDTO
.
setTraceId
(
traceId
);
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
...
...
@@ -877,8 +880,8 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
* @param relation
* @param wxEnterprise
*/
private
Map
<
String
,
Object
>
checkQywxSyncByQywxTag
(
TabQywxTagRelation
relation
,
TabHaobanWxEnterprise
wxEnterprise
,
QywxSyncTagFormatPojo
pojo
)
{
Map
<
String
,
Object
>
ret
=
new
LinkedHashMap
<>();
private
LinkedHash
Map
<
String
,
Object
>
checkQywxSyncByQywxTag
(
TabQywxTagRelation
relation
,
TabHaobanWxEnterprise
wxEnterprise
,
QywxSyncTagFormatPojo
pojo
)
{
LinkedHash
Map
<
String
,
Object
>
ret
=
new
LinkedHashMap
<>();
boolean
flag
=
false
;
ret
.
put
(
"hb标签id"
,
relation
.
getQywxTagId
());
...
...
@@ -903,11 +906,14 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
ret
.
put
(
"描述"
,
"标签组不存在:"
+
tabQywxTag
.
getQywxGroupName
());
return
ret
;
}
//获取该标签已经绑定的标签项key
Map
<
String
,
String
>
qywxToGicTagItemIdMap
=
pojo
.
getQywxToGicTagItemIdMap
();
List
<
TabQywxTagItem
>
gicQywxTagItems
=
qywxTagService
.
listByQywxTagId
(
wxEnterprise
.
getWxEnterpriseId
(),
relation
.
getQywxTagId
());
Map
<
String
,
String
>
gicQywxTagNameMap
=
gicQywxTagItems
.
stream
().
filter
(
tab
->
qywxToGicTagItemIdMap
.
containsKey
(
tab
.
getQywxTagKey
())).
collect
(
Collectors
.
toMap
(
mid
->
mid
.
getQywxTagKey
(),
mid
->
mid
.
getQywxTagName
()));
if
(
CollectionUtils
.
isEmpty
(
gicQywxTagItems
))
{
List
<
TabQywxTagItem
>
gicQywxSyncTagItems
=
qywxTagService
.
listByQywxTagId
(
wxEnterprise
.
getWxEnterpriseId
(),
relation
.
getQywxTagId
());
Map
<
String
,
String
>
gicQywxTagNameMap
=
gicQywxSyncTagItems
.
stream
().
filter
(
tab
->
qywxToGicTagItemIdMap
.
containsKey
(
tab
.
getQywxTagKey
())).
collect
(
Collectors
.
toMap
(
mid
->
mid
.
getQywxTagKey
(),
mid
->
mid
.
getQywxTagName
()));
if
(
CollectionUtils
.
isEmpty
(
gicQywxSyncTagItems
))
{
logger
.
info
(
"gic同步企业微信标签异常"
);
ret
.
put
(
"描述"
,
"gic同步企业微信标签异常:"
+
tabQywxTag
.
getQywxGroupName
());
return
ret
;
...
...
@@ -921,19 +927,34 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
ret
.
put
(
"描述"
,
"企业微信标签项空:"
+
tabQywxTag
.
getQywxGroupName
());
return
ret
;
}
Map
<
String
,
QywxTagDTO
>
qywxTagDTOMap
=
tagItems
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getId
(),
dto
->
dto
));
Map
<
String
,
QywxTagDTO
>
qywxTagDTOMap
=
tagItems
.
stream
().
filter
(
dto
->
dto
.
isDeleted
()
==
false
).
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getId
(),
dto
->
dto
));
Set
<
String
>
qywxKeysSet
=
qywxTagDTOMap
.
keySet
();
//gic没有同步的标签项
Map
<
String
,
String
>
gicToQywxTagItemIdMap
=
pojo
.
getGicToQywxTagItemIdMap
();
List
<
MemberTagItemDTO
>
gicTagItems
=
memberTagItemApiService
.
getItemListByTagId
(
relation
.
getMemberTagId
());
Set
<
MemberTagItemDTO
>
noSyncTags
=
gicTagItems
.
stream
().
filter
(
dto
->
!
gicToQywxTagItemIdMap
.
containsKey
(
dto
.
getTagItemId
())).
collect
(
Collectors
.
toSet
());
//在gic存在 企业微信不存在
Sets
.
SetView
<
String
>
qywxUnHaves
=
Sets
.
difference
(
gicQywxKeysSet
,
qywxKeysSet
);
//企业微信存在 gic不存在
Sets
.
SetView
<
String
>
gicUnHaves
=
Sets
.
difference
(
qywxKeysSet
,
gicQywxKeysSet
);
ret
.
put
(
"企微标签项"
,
tagItems
.
stream
().
filter
(
dto
->
dto
.
isDeleted
()
==
false
).
map
(
dto
->
dto
.
getName
()).
collect
(
Collectors
.
joining
(
"],["
,
"["
,
"]"
)));
ret
.
put
(
"gic标签项"
,
gicTagItems
.
stream
().
map
(
dto
->
dto
.
getTagItemName
()).
collect
(
Collectors
.
joining
(
"],["
,
"["
,
"]"
)));
//企业微信缺少
if
(!
CollectionUtils
.
isEmpty
(
qywxUnHaves
))
{
flag
=
true
;
ret
.
put
(
"标签项缺少(企微)"
,
qywxUnHaves
.
stream
().
map
(
mid
->
gicQywxTagNameMap
.
get
(
mid
)).
collect
(
Collectors
.
joining
(
"],["
,
"["
,
"]"
)));
}
//未同步标签项
if
(!
CollectionUtils
.
isEmpty
(
noSyncTags
))
{
flag
=
true
;
ret
.
put
(
"标签项未同步"
,
noSyncTags
.
stream
().
map
(
mid
->
mid
.
getTagItemName
()).
collect
(
Collectors
.
joining
(
"],["
,
"["
,
"]"
)));
}
//gic缺少
if
(!
CollectionUtils
.
isEmpty
(
gicUnHaves
))
{
flag
=
true
;
...
...
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
c3665785
...
...
@@ -90,6 +90,7 @@
<dubbo:reference
interface=
"com.gic.member.api.service.MemberTagService"
id=
"memberTagService"
/>
<dubbo:reference
interface=
"com.gic.member.tag.api.service.MemberTagApiService"
id=
"memberTagApiService"
/>
<dubbo:reference
interface=
"com.gic.member.tag.api.service.MemberTagItemApiService"
id=
"memberTagItemApiService"
/>
<dubbo:reference
interface=
"com.gic.clerk.api.service.PowerService"
id=
"powerService"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.AuthorizeService"
id=
"authorizeService"
/>
...
...
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