Commit 9ad12350 authored by gao's avatar gao

频次认证

parent 9d1609e6
......@@ -20,7 +20,7 @@ public class SendToWeixin {
// private static String startTime="1517722200000";
private static String endTime="";
public void sendToWeixinMain(){
public static void sendToWeixinMain(){
endTime= FormatBytesUtil.getTimestamp();
String msgServiceState= "0X4F模式下的法人代理返回结果:"+ServiceStateMonitoring.serviceStateMonitoringServer();
String msgTrustedPlatformStatus= "0X4F模式下的可信平台返回结果:"+new TrustedPlatformStatusMonitoring().trustedPlatformStatusMonitoringServer();
......
......@@ -16,35 +16,35 @@ import java.util.*;
* 服务状态监控
*/
public class ServiceStateMonitoring {
private static String msgDescription="";
private static PreAuthResponseBean preAuthResponseBean;
public static String serviceStateMonitoringServer(){
try {
String preAuthRespStr = HttpClientPool.postRequest("http://121.22.111.251:9002/legalPerson/v2.0/auth_app", ParameterConfig.PREAUTH_JSONSTR);
JSONObject preAuthApply = JSONObject.fromObject(preAuthRespStr);
preAuthResponseBean = (PreAuthResponseBean) JSONObject.toBean(preAuthApply, PreAuthResponseBean.class);
if (!preAuthResponseBean.getSuccess()) {
msgDescription = preAuthResponseBean.getErrorDesc();
private static String msgDescription="";
private static PreAuthResponseBean preAuthResponseBean;
public static String serviceStateMonitoringServer(){
try {
String preAuthRespStr = HttpClientPool.postRequest("http://121.22.111.251:9002/legalPerson/v2.0/auth_app", ParameterConfig.PREAUTH_JSONSTR);
JSONObject preAuthApply = JSONObject.fromObject(preAuthRespStr);
preAuthResponseBean = (PreAuthResponseBean) JSONObject.toBean(preAuthApply, PreAuthResponseBean.class);
if (!preAuthResponseBean.getSuccess()) {
msgDescription = preAuthResponseBean.getErrorDesc();
}
JSONObject jsonObject = JSONObject.fromObject(ParameterConfig.AUTH_JSONSTR);
Map config = new HashMap();
config.put("authApplyRetainData", AuthApplyRetainBean.class);
AuthRequestBean authRequestBean= (AuthRequestBean) JSONObject.toBean(jsonObject, AuthRequestBean.class, config);
authRequestBean.setBusinessSerialNumber(preAuthResponseBean.getBusinessSerialNumber());
String authResStr=JSONObject.fromObject(authRequestBean).toString();
String authRespStr = HttpClientPool.postRequest("http://121.22.111.251:9002/legalPerson/v2.0/authen_req",authResStr);
JSONObject authApply = JSONObject.fromObject(authRespStr);
AuthResponseBean authResponseBean= (AuthResponseBean) JSONObject.toBean(authApply, AuthResponseBean.class);
if(!authResponseBean.getSuccess()){
msgDescription=authResponseBean.getErrorDesc();
}
msgDescription=authResponseBean.getAuthResult();
}catch (Exception e){
msgDescription="法人代理监控超时错误";
}
JSONObject jsonObject = JSONObject.fromObject(ParameterConfig.AUTH_JSONSTR);
Map config = new HashMap();
config.put("authApplyRetainData", AuthApplyRetainBean.class);
AuthRequestBean authRequestBean= (AuthRequestBean) JSONObject.toBean(jsonObject, AuthRequestBean.class, config);
authRequestBean.setBusinessSerialNumber(preAuthResponseBean.getBusinessSerialNumber());
String authResStr=JSONObject.fromObject(authRequestBean).toString();
String authRespStr = HttpClientPool.postRequest("http://121.22.111.251:9002/legalPerson/v2.0/authen_req",authResStr);
JSONObject authApply = JSONObject.fromObject(authRespStr);
AuthResponseBean authResponseBean= (AuthResponseBean) JSONObject.toBean(authApply, AuthResponseBean.class);
if(!authResponseBean.getSuccess()){
msgDescription=authResponseBean.getErrorDesc();
}
msgDescription=authResponseBean.getAuthResult();
}catch (Exception e){
msgDescription="法人代理监控超时错误";
}
return msgDescription;
return msgDescription;
}
}
/**
* 正确率查询
......@@ -59,12 +59,12 @@ public class ServiceStateMonitoring {
}
JSONObject correctRateQueryStrJson = JSONObject.fromObject(correctRateQueryStr);
String str="法人代理在"+ FormatBytesUtil.stampToDate(startTime)+"时 至"+FormatBytesUtil.stampToDate(endTime)+"时 时间段内认证认证成功率是"+correctRateQueryStrJson.get("correctRate");
return str;
return str;
}
public static String authCount(String startTime,String endTime){
String authCountStr="";
try {
authCountStr= HttpClientPool.getRequest("http://121.22.111.251:9002/legalPerson/v1.0/authQtyStats?startTime="+startTime+"&endTime="+endTime+"&customer=gtyx01");
authCountStr= HttpClientPool.getRequest("http://121.22.111.251:9002/legalPerson/v1.0/authQtyStats?startTime="+startTime+"&endTime="+endTime+"&customerNumber=gtyx01");
} catch (IOException e) {
e.printStackTrace();
}
......
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