Commit 3ab18d62 authored by gao's avatar gao

频次认证

parent 55f4f05a
......@@ -4,11 +4,10 @@ import com.legalPersonMonitor.config.ParameterConfig;
import com.legalPersonMonitor.connections.HttpClientPool;
import com.legalPersonMonitor.data.*;
import com.legalPersonMonitor.utils.FormatBytesUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
......@@ -53,7 +52,7 @@ public class ServiceStateMonitoring {
String correctRateQueryStr="";
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+"&customerNumber=gtyx01");
} catch (IOException e) {
e.printStackTrace();
}
......@@ -75,46 +74,41 @@ public class ServiceStateMonitoring {
}
public static String authFrequency(String startTime,String endTime){
String authFrequencyStr="";
JSONArray authFrequencyList=null;
String str="法人代理在";
String key1="";
String key2="";
String value="";
Object key1="";
Object key2="";
Object value="";
int count=1;
int i=1;
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) {
e.printStackTrace();
}
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());
return "法人代理频次请求失败";
}
i=correctRateQueryStrJson.size();
if(listKey.size()==1){
value = correctRateQueryStrJson.getString(listKey.get(count-1));
if(authFrequencyList.size()==1){
value = (JSONObject.fromObject(authFrequencyList.get(0)).get("count"));
str="<div>"+str+FormatBytesUtil.stampToDate(startTime)+"时至"+FormatBytesUtil.stampToDate(endTime)+"时 时间段内认证"+value+"次"+"</div>";
return str;
}
while(iterator.hasNext()){
if(i==correctRateQueryStrJson.size()){
key1 = listKey.get(count);
value = correctRateQueryStrJson.getString(listKey.get(count-1));
i=authFrequencyList.size();
for(int j=0;j<authFrequencyList.size();j++){
if(i==authFrequencyList.size()){
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>";
i--;
count++;
} else if (i!=1){
key2 = listKey.get(count);
value = correctRateQueryStrJson.getString(listKey.get(count-1));
key2 = (JSONObject.fromObject(authFrequencyList.get(count)).get("time"));
value = (JSONObject.fromObject(authFrequencyList.get(count-1)).get("count"));
str=str+"<div>在"+key1+"时至"+key2+"时 时间段内认证"+value+"次"+"</div>";
key1=key2;
count++;
i--;
}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>";
count++;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment