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
1f328c23
Commit
1f328c23
authored
Oct 10, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log
parent
06cd8a31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
QwTimesUtils.java
...java/com/gic/haoban/manage/service/util/QwTimesUtils.java
+4
-4
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/QwTimesUtils.java
View file @
1f328c23
...
...
@@ -62,7 +62,7 @@ public class QwTimesUtils {
public
static
boolean
isLimit
(
String
wxEnterpriseId
,
String
enterpriseId
,
QwInterfaceLimitEnum
qwInterface
)
{
QwLimitTimesBO
setTimeBO
=
getSettingTimes
(
wxEnterpriseId
,
qwInterface
);
logger
.
info
(
"获取配置次数={},wxEnterpriseId={}
"
,
JSON
.
toJSONString
(
setTimeBO
),
wxE
nterpriseId
);
logger
.
info
(
"获取配置次数={},wxEnterpriseId={}
,{}"
,
JSON
.
toJSONString
(
setTimeBO
),
wxEnterpriseId
,
e
nterpriseId
);
// 先判断月
String
interfaceName
=
qwInterface
.
getName
();
Date
now
=
new
Date
();
...
...
@@ -70,21 +70,21 @@ public class QwTimesUtils {
String
keyMonth
=
getCacheKey
(
wxEnterpriseId
,
interfaceName
,
dateStr
.
substring
(
0
,
6
));
boolean
monthResult
=
timesCheck
(
1
,
keyMonth
,
qwInterface
,
wxEnterpriseId
,
enterpriseId
,
now
,
setTimeBO
);
if
(
monthResult
)
{
logger
.
info
(
"月达到限制={}
"
,
keyMonth
);
logger
.
info
(
"月达到限制={}
,{}"
,
keyMonth
,
enterpriseId
);
return
true
;
}
// 天
String
keyDay
=
getCacheKey
(
wxEnterpriseId
,
interfaceName
,
dateStr
.
substring
(
0
,
8
));
boolean
dayResult
=
timesCheck
(
2
,
keyDay
,
qwInterface
,
wxEnterpriseId
,
enterpriseId
,
now
,
setTimeBO
);
if
(
dayResult
)
{
logger
.
info
(
"天达到限制={}
"
,
keyDay
);
logger
.
info
(
"天达到限制={}
,{}"
,
keyDay
,
enterpriseId
);
return
true
;
}
// 小时
String
keyHour
=
getCacheKey
(
wxEnterpriseId
,
interfaceName
,
dateStr
.
substring
(
0
,
10
));
boolean
hourResult
=
timesCheck
(
3
,
keyHour
,
qwInterface
,
wxEnterpriseId
,
enterpriseId
,
now
,
setTimeBO
);
if
(
hourResult
)
{
logger
.
info
(
"小时达到限制={}
"
,
keyHour
);
logger
.
info
(
"小时达到限制={}
,{}"
,
keyHour
,
enterpriseId
);
return
true
;
}
return
false
;
...
...
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