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
0ea445fa
Commit
0ea445fa
authored
Mar 08, 2024
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
好办加好友统计
parent
c27dda31
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
13 deletions
+51
-13
QywxErrorLogService.java
...ic/haoban/manage/service/service/QywxErrorLogService.java
+11
-0
TabQywxErrorLogServiceImpl.java
...nage/service/service/impl/TabQywxErrorLogServiceImpl.java
+31
-0
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+8
-12
TabQywxErrorLogMapper.xml
...rvice/src/main/resources/mapper/TabQywxErrorLogMapper.xml
+1
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/QywxErrorLogService.java
View file @
0ea445fa
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.manage.api.dto.QywxErrorLogDTO
;
import
com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO
;
import
com.gic.haoban.manage.service.entity.TabQywxErrorLog
;
import
com.gic.haoban.manage.service.entity.TabQywxErrorLog
;
import
com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO
;
import
com.gic.haoban.manage.service.pojo.bo.TabQywxErrorLogBO
;
...
@@ -33,4 +34,14 @@ public interface QywxErrorLogService {
...
@@ -33,4 +34,14 @@ public interface QywxErrorLogService {
*/
*/
List
<
TabQywxErrorLog
>
queryListByPage
(
QywxErrorLogListQDTO
qywxErrorLogListQDTO
);
List
<
TabQywxErrorLog
>
queryListByPage
(
QywxErrorLogListQDTO
qywxErrorLogListQDTO
);
/**
*
* @param wxEnterpriseId
* @param msg
* @param type 4自建 5第三方
*/
void
addFriendErrLog
(
String
wxEnterpriseId
,
String
msg
,
int
type
)
;
public
void
putToMq
(
QywxErrorLogDTO
dto
)
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/TabQywxErrorLogServiceImpl.java
View file @
0ea445fa
...
@@ -3,7 +3,15 @@ package com.gic.haoban.manage.service.service.impl;
...
@@ -3,7 +3,15 @@ package com.gic.haoban.manage.service.service.impl;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.dubbo.entity.ProviderLocalTag
;
import
com.gic.haoban.manage.api.constants.Manage3Constants
;
import
com.gic.haoban.manage.api.dto.QywxErrorLogDTO
;
import
com.gic.mq.sdk.GicMQClient
;
import
org.apache.commons.lang3.StringUtils
;
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.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -23,10 +31,13 @@ import com.gic.haoban.manage.service.service.QywxErrorLogService;
...
@@ -23,10 +31,13 @@ import com.gic.haoban.manage.service.service.QywxErrorLogService;
*/
*/
@Service
@Service
public
class
TabQywxErrorLogServiceImpl
implements
QywxErrorLogService
{
public
class
TabQywxErrorLogServiceImpl
implements
QywxErrorLogService
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
QywxErrorLogService
.
class
);
@Autowired
@Autowired
private
TabQywxErrorLogMapper
tabQywxErrorLogMapper
;
private
TabQywxErrorLogMapper
tabQywxErrorLogMapper
;
private
static
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
@Override
@Override
public
TabQywxErrorLogBO
insert
(
TabQywxErrorLogBO
tabQywxErrorLogBO
)
{
public
TabQywxErrorLogBO
insert
(
TabQywxErrorLogBO
tabQywxErrorLogBO
)
{
String
wxEnterpriseId
=
tabQywxErrorLogBO
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
tabQywxErrorLogBO
.
getWxEnterpriseId
();
...
@@ -44,4 +55,24 @@ public class TabQywxErrorLogServiceImpl implements QywxErrorLogService {
...
@@ -44,4 +55,24 @@ public class TabQywxErrorLogServiceImpl implements QywxErrorLogService {
return
this
.
tabQywxErrorLogMapper
.
queryListByPage
(
qywxErrorLogListQDTO
);
return
this
.
tabQywxErrorLogMapper
.
queryListByPage
(
qywxErrorLogListQDTO
);
}
}
@Override
public
void
addFriendErrLog
(
String
wxEnterpriseId
,
String
msg
,
int
type
)
{
QywxErrorLogDTO
errLog
=
new
QywxErrorLogDTO
()
;
errLog
.
setWxEnterpriseId
(
wxEnterpriseId
);
errLog
.
setExternalUserId
(
"-1"
);
errLog
.
setTraceId
(
ProviderLocalTag
.
tag
.
get
().
traceId
);
errLog
.
setQywxErrorType
(
type
);
errLog
.
setScenario
(
"加好友"
);
errLog
.
setErrorContent
(
msg
);
this
.
putToMq
(
errLog
);
}
@Override
public
void
putToMq
(
QywxErrorLogDTO
errLog
)
{
try
{
clientInstance
.
sendMessage
(
Manage3Constants
.
QYWX_ERROR_MSG
,
JSON
.
toJSONString
(
errLog
));
}
catch
(
Exception
e
)
{
log
.
error
(
"发送消息失败:{}"
,
e
.
getMessage
(),
e
);
}
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
0ea445fa
...
@@ -4,6 +4,7 @@ import java.util.*;
...
@@ -4,6 +4,7 @@ import java.util.*;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.gic.haoban.manage.service.service.*
;
import
com.gic.haoban.manage.service.util.EventUtils
;
import
com.gic.haoban.manage.service.util.EventUtils
;
import
com.gic.haoban.manage.service.util.HBQwMonitorUtils
;
import
com.gic.haoban.manage.service.util.HBQwMonitorUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
...
@@ -74,18 +75,6 @@ import com.gic.haoban.manage.service.pojo.ExternalUserPojo;
...
@@ -74,18 +75,6 @@ import com.gic.haoban.manage.service.pojo.ExternalUserPojo;
import
com.gic.haoban.manage.service.pojo.QywxTagSyncInfoPojo
;
import
com.gic.haoban.manage.service.pojo.QywxTagSyncInfoPojo
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmLinkBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmLinkBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.KeyDataLinkBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.KeyDataLinkBO
;
import
com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService
;
import
com.gic.haoban.manage.service.service.ExternalClerkRelatedService
;
import
com.gic.haoban.manage.service.service.ExternalMemberService
;
import
com.gic.haoban.manage.service.service.KeyDataService
;
import
com.gic.haoban.manage.service.service.MemberUnionRelatedService
;
import
com.gic.haoban.manage.service.service.QywxSendService
;
import
com.gic.haoban.manage.service.service.SecretSettingService
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.WelcomeSendService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseRelatedService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.chat.GroupChatService
;
import
com.gic.haoban.manage.service.service.chat.GroupChatService
;
import
com.gic.haoban.manage.service.service.hm.HmLinkService
;
import
com.gic.haoban.manage.service.service.hm.HmLinkService
;
import
com.gic.haoban.manage.service.service.hm.WxUserAddLogService
;
import
com.gic.haoban.manage.service.service.hm.WxUserAddLogService
;
...
@@ -186,6 +175,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
...
@@ -186,6 +175,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
private
ExternalMemberService
externalMemberService
;
private
ExternalMemberService
externalMemberService
;
@Autowired
@Autowired
private
ClerkMainStoreRelatedApiService
clerkMainStoreRelatedApiService
;
private
ClerkMainStoreRelatedApiService
clerkMainStoreRelatedApiService
;
@Autowired
private
QywxErrorLogService
qywxErrorLogService
;
GicMQClient
instance
=
GICMQClientUtil
.
getClientInstance
();
GicMQClient
instance
=
GICMQClientUtil
.
getClientInstance
();
...
@@ -929,11 +920,15 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
...
@@ -929,11 +920,15 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
HBQwMonitorUtils
.
addForFriend
(
0
);
HBQwMonitorUtils
.
addForFriend
(
0
);
this
.
updateExternalStatus
(
dto
.
getExternalUserid
(),
dto
.
getStaffId
());
this
.
updateExternalStatus
(
dto
.
getExternalUserid
(),
dto
.
getStaffId
());
String
unionIdJson
=
qywxUserApiService
.
getCorpSelfExternalUseridInfo
(
qwDTO
.
getDkCorpid
(),
qwDTO
.
getSelfSecret
(),
dto
.
getExternalUserid
(),
qwDTO
.
getUrlHost
());
String
unionIdJson
=
qywxUserApiService
.
getCorpSelfExternalUseridInfo
(
qwDTO
.
getDkCorpid
(),
qwDTO
.
getSelfSecret
(),
dto
.
getExternalUserid
(),
qwDTO
.
getUrlHost
());
if
(
unionIdJson
.
contains
(
"徐高华"
))
{
this
.
qywxErrorLogService
.
addFriendErrLog
(
wxEnterpriseId
,
JSONObject
.
toJSONString
(
dto
),
4
);
}
if
(
StringUtils
.
isBlank
(
unionIdJson
))
{
if
(
StringUtils
.
isBlank
(
unionIdJson
))
{
log
.
info
(
"好友不存在"
);
log
.
info
(
"好友不存在"
);
return
null
;
return
null
;
}
else
if
(
"1"
.
equals
(
unionIdJson
))
{
}
else
if
(
"1"
.
equals
(
unionIdJson
))
{
log
.
info
(
"接口调用被限制"
);
log
.
info
(
"接口调用被限制"
);
this
.
qywxErrorLogService
.
addFriendErrLog
(
wxEnterpriseId
,
JSONObject
.
toJSONString
(
dto
),
4
);
HBQwMonitorUtils
.
addForFriend
(
1
);
HBQwMonitorUtils
.
addForFriend
(
1
);
throw
new
WxApiLimitException
(
"getCorpSelfExternalUseridInfo接口调用被限制"
);
throw
new
WxApiLimitException
(
"getCorpSelfExternalUseridInfo接口调用被限制"
);
}
}
...
@@ -1404,6 +1399,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
...
@@ -1404,6 +1399,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
else
if
(
"1"
.
equals
(
uJ
))
{
}
else
if
(
"1"
.
equals
(
uJ
))
{
log
.
info
(
"限制次数"
);
log
.
info
(
"限制次数"
);
if
(
from
==
0
)
{
if
(
from
==
0
)
{
this
.
qywxErrorLogService
.
addFriendErrLog
(
wxEnterpriseId
,
tabHaobanStaff
.
getStaffId
(),
5
);
HBQwMonitorUtils
.
addForFriend
(
1
);
HBQwMonitorUtils
.
addForFriend
(
1
);
}
}
throw
new
WxApiLimitException
(
"getExternalUseridInfo接口次数限制"
);
throw
new
WxApiLimitException
(
"getExternalUseridInfo接口次数限制"
);
...
...
haoban-manage3-service/src/main/resources/mapper/TabQywxErrorLogMapper.xml
View file @
0ea445fa
...
@@ -97,7 +97,7 @@
...
@@ -97,7 +97,7 @@
and ( member_id = #{scenario} or external_user_id = #{scenario} )
and ( member_id = #{scenario} or external_user_id = #{scenario} )
</if>
</if>
<if
test=
"qywxErrorType != null"
>
<if
test=
"qywxErrorType != null"
>
and qywx_error_type =
#{qywxErrorType}
and qywx_error_type =
1
</if>
</if>
<if
test=
"startDate != null"
>
<if
test=
"startDate != null"
>
and create_time
<![CDATA[ >= ]]>
#{startDate}
and create_time
<![CDATA[ >= ]]>
#{startDate}
...
...
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