Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
LegalPersonMonitor
Project
Project
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
xiachenqi
LegalPersonMonitor
Commits
3ab18d62
Commit
3ab18d62
authored
Feb 09, 2018
by
gao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
频次认证
parent
55f4f05a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
25 deletions
+19
-25
ServiceStateMonitoring.java
...om/legalPersonMonitor/monitor/ServiceStateMonitoring.java
+19
-25
No files found.
src/main/java/com/legalPersonMonitor/monitor/ServiceStateMonitoring.java
View file @
3ab18d62
...
@@ -4,11 +4,10 @@ import com.legalPersonMonitor.config.ParameterConfig;
...
@@ -4,11 +4,10 @@ import com.legalPersonMonitor.config.ParameterConfig;
import
com.legalPersonMonitor.connections.HttpClientPool
;
import
com.legalPersonMonitor.connections.HttpClientPool
;
import
com.legalPersonMonitor.data.*
;
import
com.legalPersonMonitor.data.*
;
import
com.legalPersonMonitor.utils.FormatBytesUtil
;
import
com.legalPersonMonitor.utils.FormatBytesUtil
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
/**
/**
...
@@ -53,7 +52,7 @@ public class ServiceStateMonitoring {
...
@@ -53,7 +52,7 @@ public class ServiceStateMonitoring {
String
correctRateQueryStr
=
""
;
String
correctRateQueryStr
=
""
;
try
{
try
{
correctRateQueryStr
=
HttpClientPool
.
getRequest
(
"http://121.22.111.251:9002/legalPerson/v1.0/authSucStats?startTime="
+
startTime
+
"&endTime="
+
endTime
+
"&customer=gtyx01"
);
correctRateQueryStr
=
HttpClientPool
.
getRequest
(
"http://121.22.111.251:9002/legalPerson/v1.0/authSucStats?startTime="
+
startTime
+
"&endTime="
+
endTime
+
"&customer
Number
=gtyx01"
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -75,46 +74,41 @@ public class ServiceStateMonitoring {
...
@@ -75,46 +74,41 @@ public class ServiceStateMonitoring {
}
}
public
static
String
authFrequency
(
String
startTime
,
String
endTime
){
public
static
String
authFrequency
(
String
startTime
,
String
endTime
){
String
authFrequencyStr
=
""
;
String
authFrequencyStr
=
""
;
JSONArray
authFrequencyList
=
null
;
String
str
=
"法人代理在"
;
String
str
=
"法人代理在"
;
String
key1
=
""
;
Object
key1
=
""
;
String
key2
=
""
;
Object
key2
=
""
;
String
value
=
""
;
Object
value
=
""
;
int
count
=
1
;
int
count
=
1
;
int
i
=
1
;
int
i
=
1
;
try
{
try
{
authFrequencyStr
=
HttpClientPool
.
getRequest
(
"http://121.22.111.251:9002/legalPerson/v1.0/authFreqStats?startTime="
+
startTime
+
"&endTime="
+
endTime
+
"&customerNumber=gtyx01&units=Hour"
);
authFrequencyStr
=
HttpClientPool
.
getRequest
(
"http://121.22.111.251:9003/legalPerson/v1.0/authFreqStats?startTime="
+
startTime
+
"&endTime="
+
endTime
+
"&customerNumber=gtyx01&units=Hour"
);
authFrequencyList
=
JSONArray
.
fromObject
(
authFrequencyStr
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
return
"法人代理频次请求失败"
;
}
JSONObject
correctRateQueryStrJson
=
JSONObject
.
fromObject
(
authFrequencyStr
);
Iterator
iterator
=
correctRateQueryStrJson
.
keys
();
Iterator
iterator1
=
correctRateQueryStrJson
.
keys
();
List
<
String
>
listKey
=
new
ArrayList
();
while
(
iterator1
.
hasNext
()){
listKey
.
add
((
String
)
iterator1
.
next
());
}
}
i
=
correctRateQueryStrJson
.
size
();
if
(
authFrequencyList
.
size
()==
1
){
if
(
listKey
.
size
()==
1
){
value
=
(
JSONObject
.
fromObject
(
authFrequencyList
.
get
(
0
)).
get
(
"count"
));
value
=
correctRateQueryStrJson
.
getString
(
listKey
.
get
(
count
-
1
));
str
=
"<div>"
+
str
+
FormatBytesUtil
.
stampToDate
(
startTime
)+
"时至"
+
FormatBytesUtil
.
stampToDate
(
endTime
)+
"时 时间段内认证"
+
value
+
"次"
+
"</div>"
;
str
=
"<div>"
+
str
+
FormatBytesUtil
.
stampToDate
(
startTime
)+
"时至"
+
FormatBytesUtil
.
stampToDate
(
endTime
)+
"时 时间段内认证"
+
value
+
"次"
+
"</div>"
;
return
str
;
return
str
;
}
}
while
(
iterator
.
hasNext
()){
i
=
authFrequencyList
.
size
();
if
(
i
==
correctRateQueryStrJson
.
size
()){
for
(
int
j
=
0
;
j
<
authFrequencyList
.
size
();
j
++){
key1
=
listKey
.
get
(
count
);
if
(
i
==
authFrequencyList
.
size
()){
value
=
correctRateQueryStrJson
.
getString
(
listKey
.
get
(
count
-
1
));
key1
=
(
JSONObject
.
fromObject
(
authFrequencyList
.
get
(
count
)).
get
(
"time"
));
value
=
(
JSONObject
.
fromObject
(
authFrequencyList
.
get
(
count
-
1
)).
get
(
"count"
));
str
=
"<div>"
+
str
+
FormatBytesUtil
.
stampToDate
(
startTime
)+
"时至"
+
key1
+
"时 时间段内认证"
+
value
+
"次"
+
"</div>"
;
str
=
"<div>"
+
str
+
FormatBytesUtil
.
stampToDate
(
startTime
)+
"时至"
+
key1
+
"时 时间段内认证"
+
value
+
"次"
+
"</div>"
;
i
--;
i
--;
count
++;
count
++;
}
else
if
(
i
!=
1
){
}
else
if
(
i
!=
1
){
key2
=
listKey
.
get
(
count
);
key2
=
(
JSONObject
.
fromObject
(
authFrequencyList
.
get
(
count
)).
get
(
"time"
)
);
value
=
correctRateQueryStrJson
.
getString
(
listKey
.
get
(
count
-
1
));
value
=
(
JSONObject
.
fromObject
(
authFrequencyList
.
get
(
count
-
1
)).
get
(
"count"
));
str
=
str
+
"<div>在"
+
key1
+
"时至"
+
key2
+
"时 时间段内认证"
+
value
+
"次"
+
"</div>"
;
str
=
str
+
"<div>在"
+
key1
+
"时至"
+
key2
+
"时 时间段内认证"
+
value
+
"次"
+
"</div>"
;
key1
=
key2
;
key1
=
key2
;
count
++;
count
++;
i
--;
i
--;
}
else
{
}
else
{
value
=
correctRateQueryStrJson
.
getString
(
listKey
.
get
(
count
-
1
));
value
=
(
JSONObject
.
fromObject
(
authFrequencyList
.
get
(
count
-
1
)).
get
(
"count"
));
str
=
str
+
"<div>在"
+
key1
+
"时至"
+
FormatBytesUtil
.
stampToDate
(
endTime
)+
"时 时间段内认证"
+
value
+
"次"
+
"</div>"
;
str
=
str
+
"<div>在"
+
key1
+
"时至"
+
FormatBytesUtil
.
stampToDate
(
endTime
)+
"时 时间段内认证"
+
value
+
"次"
+
"</div>"
;
count
++;
count
++;
break
;
break
;
...
...
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