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
b9114eb7
Commit
b9114eb7
authored
Aug 16, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员标签同步-告警
parent
8589e46e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
11 deletions
+37
-11
AlertTypeEnum.java
...n/java/com/gic/haoban/manage/api/enums/AlertTypeEnum.java
+24
-4
CheckQywxSettingApiServiceImpl.java
...vice/service/out/impl/CheckQywxSettingApiServiceImpl.java
+13
-7
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/enums/AlertTypeEnum.java
View file @
b9114eb7
...
@@ -4,15 +4,25 @@ package com.gic.haoban.manage.api.enums;
...
@@ -4,15 +4,25 @@ package com.gic.haoban.manage.api.enums;
* Created by hua on 2021/8/2.
* Created by hua on 2021/8/2.
*/
*/
public
enum
AlertTypeEnum
{
public
enum
AlertTypeEnum
{
QYWX_TAG_SYNC
(
1
,
"企微标签同步"
),
QYWX_TAG_SYNC
(
1
,
"企微标签同步"
,
null
),
QUNFA_MESSAGE
(
2
,
"企微群发"
),
QUNFA_MESSAGE
(
2
,
"企微群发"
,
null
),
FRIEND_ADD
(
3
,
"企微好友添加"
),;
FRIEND_ADD
(
3
,
"企微好友添加"
,
null
),;
private
Integer
type
;
private
Integer
type
;
private
String
name
;
private
String
name
;
private
String
dingUrl
;
AlertTypeEnum
(
Integer
type
,
String
name
)
{
AlertTypeEnum
(
Integer
type
,
String
name
,
String
dingUrl
)
{
this
.
type
=
type
;
this
.
type
=
type
;
this
.
name
=
name
;
this
.
name
=
name
;
this
.
dingUrl
=
dingUrl
;
}
public
String
getDingUrl
()
{
return
dingUrl
;
}
public
void
setDingUrl
(
String
dingUrl
)
{
this
.
dingUrl
=
dingUrl
;
}
}
public
Integer
getType
()
{
public
Integer
getType
()
{
...
@@ -30,4 +40,14 @@ public enum AlertTypeEnum {
...
@@ -30,4 +40,14 @@ public enum AlertTypeEnum {
public
void
setName
(
String
name
)
{
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
this
.
name
=
name
;
}
}
public
static
AlertTypeEnum
getEnum
(
int
type
)
{
AlertTypeEnum
[]
values
=
AlertTypeEnum
.
values
();
for
(
AlertTypeEnum
value
:
values
)
{
if
(
value
.
getType
()
==
type
)
{
return
value
;
}
}
return
null
;
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/CheckQywxSettingApiServiceImpl.java
View file @
b9114eb7
...
@@ -149,13 +149,19 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic
...
@@ -149,13 +149,19 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic
dingMap
.
put
(
"markdown"
,
markdownMap
);
dingMap
.
put
(
"markdown"
,
markdownMap
);
String
text
=
""
;
String
text
=
""
;
String
dingUrl
=
ALERT_URL
;
//企业微信标签同步
AlertTypeEnum
anEnum
=
AlertTypeEnum
.
getEnum
(
messageDTO
.
getAlertType
());
if
(
messageDTO
.
getAlertType
().
equals
(
AlertTypeEnum
.
QYWX_TAG_SYNC
.
getType
()))
{
if
(
anEnum
!=
null
)
{
markdownMap
.
put
(
"title"
,
AlertTypeEnum
.
QYWX_TAG_SYNC
.
getName
()
+
"-"
+
messageDTO
.
getAlertTitle
());
markdownMap
.
put
(
"title"
,
anEnum
.
getName
()
+
"-"
+
messageDTO
.
getAlertTitle
());
text
+=
"标题:"
+
AlertTypeEnum
.
QYWX_TAG_SYNC
.
getName
()
+
"-"
+
messageDTO
.
getAlertTitle
()
+
"\n\r"
;
text
+=
"标题:"
+
anEnum
.
getName
()
+
"-"
+
messageDTO
.
getAlertTitle
()
+
"\n\r"
;
if
(
anEnum
.
getDingUrl
()
!=
null
)
{
dingUrl
=
anEnum
.
getDingUrl
();
}
}
else
{
markdownMap
.
put
(
"title"
,
messageDTO
.
getAlertTitle
());
text
+=
"标题:"
+
messageDTO
.
getAlertTitle
()
+
"\n\r"
;
}
}
//企业信息
//企业信息
if
(
StringUtils
.
isNotBlank
(
messageDTO
.
getWxEnterpriseId
()))
{
if
(
StringUtils
.
isNotBlank
(
messageDTO
.
getWxEnterpriseId
()))
{
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
messageDTO
.
getWxEnterpriseId
());
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
messageDTO
.
getWxEnterpriseId
());
...
@@ -180,7 +186,7 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic
...
@@ -180,7 +186,7 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic
text
+=
"链路:["
+
messageDTO
.
getTraceId
()
+
"]("
+
traceUrl
+
")"
;
text
+=
"链路:["
+
messageDTO
.
getTraceId
()
+
"]("
+
traceUrl
+
")"
;
}
}
markdownMap
.
put
(
"text"
,
text
);
markdownMap
.
put
(
"text"
,
text
);
String
post
=
HttpUtil
.
post
(
ALERT_URL
,
JSONObject
.
toJSONString
(
dingMap
));
String
post
=
HttpUtil
.
post
(
dingUrl
,
JSONObject
.
toJSONString
(
dingMap
));
logger
.
info
(
"alert:{}"
,
post
);
logger
.
info
(
"alert:{}"
,
post
);
}
}
...
...
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