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
34c73fa0
Commit
34c73fa0
authored
Oct 09, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
告警
parent
1a2bb6c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
QwFriendApiServiceImpl.java
...nage/service/service/out/impl/QwFriendApiServiceImpl.java
+17
-0
QwTimesUtils.java
...java/com/gic/haoban/manage/service/util/QwTimesUtils.java
+4
-3
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QwFriendApiServiceImpl.java
View file @
34c73fa0
...
...
@@ -7,16 +7,21 @@ import java.util.List;
import
java.util.Map
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.enterprise.api.constant.EnterpriseServiceEnum
;
import
com.gic.enterprise.api.dto.EnterpriseSettingDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.EnterpriseUseForbidService
;
import
com.gic.haoban.manage.api.dto.QwPendingIdDTO
;
import
com.gic.haoban.manage.api.dto.SecretSettingDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.service.QwFriendApiService
;
import
com.gic.haoban.manage.service.config.Config
;
...
...
@@ -44,6 +49,8 @@ public class QwFriendApiServiceImpl implements QwFriendApiService {
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Autowired
private
EnterpriseService
enterpriseService
;
@Autowired
private
Config
config
;
@Override
...
...
@@ -195,6 +202,16 @@ public class QwFriendApiServiceImpl implements QwFriendApiService {
// 非总部或不存在
return
ServiceResponse
.
failure
(
"2010"
,
"请确认商户是否有效且是总部"
);
}
EnterpriseSettingDTO
setting
=
this
.
enterpriseService
.
getEnterpriseSettingByEnterpriseId
(
enterpriseId
)
;
String
customSetting
=
setting
.
getCustomSetting
()
;
if
(
StringUtils
.
isNotBlank
(
customSetting
))
{
JSONObject
json
=
JSON
.
parseObject
(
customSetting
)
;
String
qw
=
json
.
getString
(
"qwPendingidFlag"
)
;
if
(
StringUtils
.
isNotBlank
(
qw
)
&&
"0"
.
equals
(
qw
))
{
log
.
info
(
"未配置unionid查询企微外部联系人接口调用"
);
return
ServiceResponse
.
failure
(
"2010"
,
"未配置unionid查询企微外部联系人接口调用"
);
}
}
Integer
code
=
this
.
enterpriseUseForbidService
.
selectPermissionStatus
(
enterpriseId
,
EnterpriseServiceEnum
.
HAO_BAN
.
getRightMenuCode
());
log
.
info
(
"好办是否到期停用={},{}"
,
enterpriseId
,
code
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/QwTimesUtils.java
View file @
34c73fa0
...
...
@@ -143,6 +143,7 @@ public class QwTimesUtils {
// 调用次数达上线
String
time
=
null
;
String
title
=
"已达上限"
;
String
alertKey
=
qwInterface
.
getName
()+
enterpriseId
+
"alert"
+
type
;
boolean
sendFlag
=
false
;
if
(
doneTimes
>=
setTimes
)
{
sendFlag
=
true
;
...
...
@@ -175,12 +176,12 @@ public class QwTimesUtils {
time
=
DateUtil
.
dateToStr
(
now
,
"yyyy年MM月dd日"
);
}
title
=
"即将达到可调用次数"
;
alertKey
+=
"_1"
;
}
}
String
alertKey
=
qwInterface
.
getName
()+
enterpriseId
+
"alert"
;
logger
.
info
(
"告警key={},value={}"
,
alertKey
,
RedisUtil
.
getCache
(
alertKey
));
if
(
sendFlag
&&
null
==
RedisUtil
.
getCache
(
alertKey
))
{
RedisUtil
.
setCache
(
alertKey
,
1
,
1000
*
60
*
60
*
24L
);
RedisUtil
.
setCache
(
alertKey
,
1
,
60
*
60
*
24L
);
EnterpriseDTO
enterpriseDTO
=
enterpriseService
.
getEnterpriseById
(
enterpriseId
);
String
brandName
=
enterpriseDTO
.
getBrandName
();
// 达到上限时文案
...
...
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