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
42f44a17
Commit
42f44a17
authored
Mar 08, 2024
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
好办加好友统计
parent
a68f12e7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
22 deletions
+33
-22
TabQywxErrorLogServiceImpl.java
...nage/service/service/impl/TabQywxErrorLogServiceImpl.java
+9
-6
HBQwMonitorUtils.java
.../com/gic/haoban/manage/service/util/HBQwMonitorUtils.java
+23
-16
InfluxDbMonitorUtils.java
.../gic/haoban/manage/service/util/InfluxDbMonitorUtils.java
+1
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/TabQywxErrorLogServiceImpl.java
View file @
42f44a17
...
@@ -85,17 +85,20 @@ public class TabQywxErrorLogServiceImpl implements QywxErrorLogService {
...
@@ -85,17 +85,20 @@ public class TabQywxErrorLogServiceImpl implements QywxErrorLogService {
@Override
@Override
public
void
doFriendTimer
(
String
params
)
{
public
void
doFriendTimer
(
String
params
)
{
log
.
info
(
"加好友异常重试"
);
log
.
info
(
"加好友异常重试"
);
Date
start
=
DateUtil
.
getStartTimeOfDay
()
;
Date
yesterday
=
DateUtil
.
addDay
(
new
Date
()
,
-
1
)
;
Date
end
=
DateUtil
.
getEndTimeOfDay
()
;
Date
start
=
DateUtil
.
getStartTimeOfDay
(
yesterday
)
;
Date
end
=
DateUtil
.
getEndTimeOfDay
(
yesterday
)
;
List
<
TabQywxErrorLog
>
list
=
this
.
tabQywxErrorLogMapper
.
listErrorFriend
(
null
,
4
,
start
,
end
)
;
List
<
TabQywxErrorLog
>
list
=
this
.
tabQywxErrorLogMapper
.
listErrorFriend
(
null
,
4
,
start
,
end
)
;
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
String
mqName
=
"dealQywxExternalUserMq2"
;
String
mqName
=
"dealQywxExternalUserMq2"
;
for
(
TabQywxErrorLog
tab
:
list
)
{
for
(
TabQywxErrorLog
tab
:
list
)
{
DealQywxExternalUserPojo
dealQywxExternalUserPojo
=
new
DealQywxExternalUserPojo
();
dealQywxExternalUserPojo
.
setType
(
DealQywxExternalUserPojo
.
DealType
.
add
.
getType
());
dealQywxExternalUserPojo
.
setData
(
JSONObject
.
parseObject
(
tab
.
getErrorContent
(),
QwFrientNoticeDTO
.
class
));
try
{
try
{
clientInstance
.
sendMessage
(
mqName
,
JSONObject
.
toJSONString
(
dealQywxExternalUserPojo
));
DealQywxExternalUserPojo
dealQywxExternalUserPojo
=
new
DealQywxExternalUserPojo
();
dealQywxExternalUserPojo
.
setType
(
DealQywxExternalUserPojo
.
DealType
.
add
.
getType
());
if
(
StringUtils
.
isNotBlank
(
tab
.
getErrorContent
()))
{
dealQywxExternalUserPojo
.
setData
(
JSONObject
.
parseObject
(
tab
.
getErrorContent
(),
QwFrientNoticeDTO
.
class
));
clientInstance
.
sendMessage
(
mqName
,
JSONObject
.
toJSONString
(
dealQywxExternalUserPojo
));
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
"异步处理异常:{}"
,
e
);
log
.
info
(
"异步处理异常:{}"
,
e
);
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/HBQwMonitorUtils.java
View file @
42f44a17
package
com
.
gic
.
haoban
.
manage
.
service
.
util
;
package
com
.
gic
.
haoban
.
manage
.
service
.
util
;
import
com.gic.commons.util.IPUtil
;
import
com.gic.dubbo.util.DubboInvokeUtil
;
import
com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService
;
import
com.gic.haoban.manage.service.pojo.HBQwMonitorBO
;
import
com.gic.haoban.manage.service.pojo.HBQwMonitorBO
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
...
@@ -17,16 +20,17 @@ public class HBQwMonitorUtils {
...
@@ -17,16 +20,17 @@ public class HBQwMonitorUtils {
private
static
Logger
logger
=
LogManager
.
getLogger
(
HBQwMonitorUtils
.
class
);
private
static
Logger
logger
=
LogManager
.
getLogger
(
HBQwMonitorUtils
.
class
);
private
static
final
List
<
String
>
keyList
=
Arrays
.
asList
(
"hb
Datakey:qwFriendNotice"
,
"hbDataKey:addF
riendFail"
)
;
private
static
final
List
<
String
>
keyList
=
Arrays
.
asList
(
"hb
monitor:friendNotice"
,
"hbmonitor:f
riendFail"
)
;
/**
/**
* @param index 0加好友企微通知数量 1加好友查询企微接口限制数量
* @param index 0加好友企微通知数量 1加好友查询企微接口限制数量
*/
*/
public
static
void
addForFriend
(
int
index
)
{
public
static
void
addForFriend
(
int
index
)
{
logger
.
info
(
"addForFriend"
);
String
ip
=
IPUtil
.
getLocalIP
();
String
key
=
keyList
.
get
(
index
)
;
logger
.
info
(
"addForFriend={}"
,
ip
);
String
key
=
keyList
.
get
(
index
)+
ip
;
RAtomicLong
cache
=
RedisUtil
.
getRedisClient
().
getAtomicLong
(
key
);
RAtomicLong
cache
=
RedisUtil
.
getRedisClient
().
getAtomicLong
(
key
);
long
val
=
cache
.
addAndGet
(
1
);
cache
.
addAndGet
(
1
);
}
}
...
@@ -35,21 +39,24 @@ public class HBQwMonitorUtils {
...
@@ -35,21 +39,24 @@ public class HBQwMonitorUtils {
}
}
public
static
void
addByTimer
()
{
public
static
void
addByTimer
()
{
List
<
String
>
ipList
=
DubboInvokeUtil
.
getServiceHostList
(
MemberUnionidRelatedApiService
.
class
)
;
logger
.
info
(
"add timer"
);
logger
.
info
(
"add timer"
);
for
(
int
i
=
0
;
i
<
keyList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
keyList
.
size
();
i
++)
{
String
key
=
keyList
.
get
(
i
)
;
for
(
String
ip
:
ipList
)
{
int
count
=
0
;
String
key
=
keyList
.
get
(
i
)+
ip
;
Object
countObj
=
RedisUtil
.
getCache
(
key
)
;
int
count
=
0
;
if
(
null
!=
countObj
)
{
Object
countObj
=
RedisUtil
.
getCache
(
key
)
;
count
=
Integer
.
valueOf
(
countObj
.
toString
())
;
if
(
null
!=
countObj
)
{
count
=
Integer
.
valueOf
(
countObj
.
toString
())
;
}
RAtomicLong
cache
=
RedisUtil
.
getRedisClient
().
getAtomicLong
(
key
);
cache
.
addAndGet
(-
count
)
;
HBQwMonitorBO
bo
=
new
HBQwMonitorBO
()
;
bo
.
setHost
(
ip
);
bo
.
setType
(
""
+
i
);
bo
.
setNum
(
count
);
InfluxDbMonitorUtils
.
getInstance
().
friendAdd
(
bo
);
}
}
RAtomicLong
cache
=
RedisUtil
.
getRedisClient
().
getAtomicLong
(
key
);
cache
.
addAndGet
(-
count
)
;
HBQwMonitorBO
bo
=
new
HBQwMonitorBO
()
;
bo
.
setHost
(
"127.0.0.1"
);
bo
.
setType
(
""
+
i
);
bo
.
setNum
(
count
);
InfluxDbMonitorUtils
.
getInstance
().
friendAdd
(
bo
);
}
}
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/InfluxDbMonitorUtils.java
View file @
42f44a17
...
@@ -58,6 +58,7 @@ public class InfluxDbMonitorUtils {
...
@@ -58,6 +58,7 @@ public class InfluxDbMonitorUtils {
influxDB
.
write
(
Point
.
measurement
(
"hb_qw_friend_monitor"
)
influxDB
.
write
(
Point
.
measurement
(
"hb_qw_friend_monitor"
)
.
time
(
System
.
currentTimeMillis
(),
TimeUnit
.
MILLISECONDS
)
.
time
(
System
.
currentTimeMillis
(),
TimeUnit
.
MILLISECONDS
)
.
addField
(
"num"
,
bo
.
getNum
())
.
addField
(
"num"
,
bo
.
getNum
())
.
tag
(
"application"
,
"haoban-manage3"
)
.
tag
(
"host"
,
bo
.
getHost
())
.
tag
(
"host"
,
bo
.
getHost
())
.
tag
(
"type"
,
bo
.
getType
())
.
tag
(
"type"
,
bo
.
getType
())
.
build
());
.
build
());
...
...
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