Commit e5c908b0 authored by gao's avatar gao

修改频次认证

parent 67a9fc50
...@@ -11,16 +11,16 @@ ...@@ -11,16 +11,16 @@
<element id="library" level="project" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.2" /> <element id="library" level="project" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.2" />
<element id="library" level="project" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.2" /> <element id="library" level="project" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.2" />
<element id="library" level="project" name="Maven: commons-beanutils:commons-beanutils:1.8.0" /> <element id="library" level="project" name="Maven: commons-beanutils:commons-beanutils:1.8.0" />
<element id="library" level="project" name="Maven: commons-collections:commons-collections:3.2.1" />
<element id="library" level="project" name="Maven: commons-codec:commons-codec:1.9" /> <element id="library" level="project" name="Maven: commons-codec:commons-codec:1.9" />
<element id="library" level="project" name="Maven: commons-collections:commons-collections:3.2.1" />
<element id="library" level="project" name="Maven: commons-lang:commons-lang:2.5" /> <element id="library" level="project" name="Maven: commons-lang:commons-lang:2.5" />
<element id="library" level="project" name="Maven: commons-logging:commons-logging:1.1.1" /> <element id="library" level="project" name="Maven: commons-logging:commons-logging:1.1.1" />
<element id="library" level="project" name="Maven: org.springframework:spring-beans:4.3.10.RELEASE" />
<element id="library" level="project" name="Maven: net.sf.ezmorph:ezmorph:1.0.6" /> <element id="library" level="project" name="Maven: net.sf.ezmorph:ezmorph:1.0.6" />
<element id="library" level="project" name="Maven: net.sf.json-lib:json-lib:jdk15:2.4" /> <element id="library" level="project" name="Maven: net.sf.json-lib:json-lib:jdk15:2.4" />
<element id="library" level="project" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" /> <element id="library" level="project" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" />
<element id="library" level="project" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" /> <element id="library" level="project" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" />
<element id="library" level="project" name="Maven: org.springframework:spring-aop:4.3.10.RELEASE" /> <element id="library" level="project" name="Maven: org.springframework:spring-aop:4.3.10.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-beans:4.3.10.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-context-support:4.3.10.RELEASE" /> <element id="library" level="project" name="Maven: org.springframework:spring-context-support:4.3.10.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-context:4.3.10.RELEASE" /> <element id="library" level="project" name="Maven: org.springframework:spring-context:4.3.10.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-core:4.3.10.RELEASE" /> <element id="library" level="project" name="Maven: org.springframework:spring-core:4.3.10.RELEASE" />
......
Manifest-Version: 1.0
Class-Path: commons-beanutils-1.8.0.jar spring-beans-4.3.10.RELEASE.ja
r jackson-core-2.9.2.jar json-lib-2.4-jdk15.jar spring-context-4.3.10
.RELEASE.jar jackson-annotations-2.9.0.jar httpcore-4.4.6.jar spring-
context-support-4.3.10.RELEASE.jar commons-lang-2.5.jar spring-expres
sion-4.3.10.RELEASE.jar commons-collections-3.2.1.jar commons-httpcli
ent-3.1.jar commons-logging-1.1.1.jar jit-pkitool-2.3.0.25-beta2.jar
jit-pkivstk-jdk15-1.0.jar httpclient-4.5.3.jar jackson-databind-2.9.2
.jar commons-logging-1.1.1.jar ezmorph-1.0.6.jar spring-aop-4.3.10.RE
LEASE.jar spring-core-4.3.10.RELEASE.jar commons-codec-1.9.jar
Main-Class: com.legalPersonMonitor.server.StartUpTask
...@@ -49,12 +49,12 @@ public class ParameterConfig { ...@@ -49,12 +49,12 @@ public class ParameterConfig {
" \"cardReaderVersion\": \"v1.0.0.1\",\n" + " \"cardReaderVersion\": \"v1.0.0.1\",\n" +
" \"customerNumber\": \"gtyx01\",\n" + " \"customerNumber\": \"gtyx01\",\n" +
" \"liveDetectionControlVersion\": \"v1.0.0.1\",\n" + " \"liveDetectionControlVersion\": \"v1.0.0.1\",\n" +
" \"timeStamp\": \"140322323233325\"\n" + " \"timeStamp\": \"1516346177047\"\n" +
" }"; " }";
public static final String AUTH_JSONSTR="{\n" + public static final String AUTH_JSONSTR="{\n" +
" \"customerNumber\":\"gtyx01\",\n" + " \"customerNumber\":\"gtyx01\",\n" +
" \"appName\":\"国投盈信\",\n" + " \"appName\":\"国投盈信\",\n" +
" \"timeStamp\":\"1516341838068\",\n" + " \"timeStamp\":\"1516346177047\",\n" +
" \"businessSerialNumber\":\"413034243240499C2D\",\n" + " \"businessSerialNumber\":\"413034243240499C2D\",\n" +
" \"authMode\":\"0x4f\",\n" + " \"authMode\":\"0x4f\",\n" +
" \"authApplyRetainData\":\n" + " \"authApplyRetainData\":\n" +
......
...@@ -16,8 +16,8 @@ import java.util.Date; ...@@ -16,8 +16,8 @@ import java.util.Date;
* Created by gaoxiang on 2018/1/22. * Created by gaoxiang on 2018/1/22.
*/ */
public class SendToWeixin { public class SendToWeixin {
private static String startTime="1503123818000"; private static String startTime="1518328800000";
private static String endTime="1517305049000"; private static String endTime="";
public static void sendToWeixinMain(){ public static void sendToWeixinMain(){
endTime= FormatBytesUtil.getTimestamp(); endTime= FormatBytesUtil.getTimestamp();
......
...@@ -19,7 +19,7 @@ public class ServiceStateMonitoring { ...@@ -19,7 +19,7 @@ public class ServiceStateMonitoring {
private static PreAuthResponseBean preAuthResponseBean; private static PreAuthResponseBean preAuthResponseBean;
public static String serviceStateMonitoringServer(){ public static String serviceStateMonitoringServer(){
try { try {
String preAuthRespStr = HttpClientPool.postRequest("http://121.22.111.251:9002/legalPerson/v2.0/auth_app", ParameterConfig.PREAUTH_JSONSTR); String preAuthRespStr = HttpClientPool.postRequest("http://121.22.111.251:9002/legalPerson/api/v2.0/auth_app", ParameterConfig.PREAUTH_JSONSTR);
JSONObject preAuthApply = JSONObject.fromObject(preAuthRespStr); JSONObject preAuthApply = JSONObject.fromObject(preAuthRespStr);
preAuthResponseBean = (PreAuthResponseBean) JSONObject.toBean(preAuthApply, PreAuthResponseBean.class); preAuthResponseBean = (PreAuthResponseBean) JSONObject.toBean(preAuthApply, PreAuthResponseBean.class);
if (!preAuthResponseBean.getSuccess()) { if (!preAuthResponseBean.getSuccess()) {
...@@ -31,7 +31,7 @@ public class ServiceStateMonitoring { ...@@ -31,7 +31,7 @@ public class ServiceStateMonitoring {
AuthRequestBean authRequestBean= (AuthRequestBean) JSONObject.toBean(jsonObject, AuthRequestBean.class, config); AuthRequestBean authRequestBean= (AuthRequestBean) JSONObject.toBean(jsonObject, AuthRequestBean.class, config);
authRequestBean.setBusinessSerialNumber(preAuthResponseBean.getBusinessSerialNumber()); authRequestBean.setBusinessSerialNumber(preAuthResponseBean.getBusinessSerialNumber());
String authResStr=JSONObject.fromObject(authRequestBean).toString(); String authResStr=JSONObject.fromObject(authRequestBean).toString();
String authRespStr = HttpClientPool.postRequest("http://121.22.111.251:9002/legalPerson/v2.0/authen_req",authResStr); String authRespStr = HttpClientPool.postRequest("http://121.22.111.251:9002/legalPerson/api/v2.0/authen_req",authResStr);
JSONObject authApply = JSONObject.fromObject(authRespStr); JSONObject authApply = JSONObject.fromObject(authRespStr);
AuthResponseBean authResponseBean= (AuthResponseBean) JSONObject.toBean(authApply, AuthResponseBean.class); AuthResponseBean authResponseBean= (AuthResponseBean) JSONObject.toBean(authApply, AuthResponseBean.class);
if(!authResponseBean.getSuccess()){ if(!authResponseBean.getSuccess()){
...@@ -52,7 +52,7 @@ public class ServiceStateMonitoring { ...@@ -52,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+"&customerNumber=gtyx01"); correctRateQueryStr= HttpClientPool.getRequest("http://121.22.111.251:9002/legalPerson/api/v1.0/authSucStats?startTime="+startTime+"&endTime="+endTime+"&customerNumber=gtyx01");
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -63,7 +63,7 @@ public class ServiceStateMonitoring { ...@@ -63,7 +63,7 @@ public class ServiceStateMonitoring {
public static String authCount(String startTime,String endTime){ public static String authCount(String startTime,String endTime){
String authCountStr=""; String authCountStr="";
try { try {
authCountStr= HttpClientPool.getRequest("http://121.22.111.251:9002/legalPerson/v1.0/authQtyStats?startTime="+startTime+"&endTime="+endTime+"&customerNumber=gtyx01"); authCountStr= HttpClientPool.getRequest("http://121.22.111.251:9002/legalPerson/api/v1.0/authQtyStats?startTime="+startTime+"&endTime="+endTime+"&customerNumber=gtyx01");
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -80,9 +80,8 @@ public class ServiceStateMonitoring { ...@@ -80,9 +80,8 @@ public class ServiceStateMonitoring {
String value=""; String value="";
int i=1; int i=1;
try { try {
authFrequencyStr= HttpClientPool.getRequest("http://121.22.111.251:9003/legalPerson/v1.0/authFreqStats?startTime="+startTime+"&endTime="+endTime+"&customerNumber=gtyx01&units=Hour"); authFrequencyStr= HttpClientPool.getRequest("http://121.22.111.251:9002/legalPerson/api/v1.0/authFreqStats?startTime="+startTime+"&endTime="+endTime+"&customerNumber=gtyx01&units=Hour");
authFrequencyList = JSONArray.fromObject(authFrequencyStr); authFrequencyList = JSONArray.fromObject(authFrequencyStr);
System.out.println(authFrequencyList);
} catch (IOException e) { } catch (IOException e) {
return "法人代理频次请求失败"; return "法人代理频次请求失败";
} }
...@@ -91,9 +90,9 @@ public class ServiceStateMonitoring { ...@@ -91,9 +90,9 @@ public class ServiceStateMonitoring {
str="<div>"+str+FormatBytesUtil.stampToDate(startTime)+"时至"+FormatBytesUtil.stampToDate(endTime)+"时 时间段内没有认证"+"</div>"; str="<div>"+str+FormatBytesUtil.stampToDate(startTime)+"时至"+FormatBytesUtil.stampToDate(endTime)+"时 时间段内没有认证"+"</div>";
return str; return str;
} }
if(authFrequencyList.size()==1){ if(authFrequencyList.size()==1&&!value.equals("0")){
key = (JSONObject.fromObject(authFrequencyList.get(0)).get("time")).toString(); key = (JSONObject.fromObject(authFrequencyList.get(0)).get("time")).toString();
str="<div>"+str+key+"时至"+ FormatBytesUtil.dateAddOneHour( key)+"时 时间段内认证"+value+"</div>"; str="<div>"+str+key+"时至"+ FormatBytesUtil.dateAddOneHour( key)+"时 时间段内认证"+value+"</div>";
return str; return str;
} }
i=authFrequencyList.size(); i=authFrequencyList.size();
......
...@@ -72,7 +72,7 @@ public class FormatBytesUtil { ...@@ -72,7 +72,7 @@ public class FormatBytesUtil {
*/ */
public static String stampToDate(String s){ public static String stampToDate(String s){
String res; String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH");
long lt = new Long(s); long lt = new Long(s);
Date date = new Date(lt); Date date = new Date(lt);
res = simpleDateFormat.format(date); res = simpleDateFormat.format(date);
...@@ -106,7 +106,7 @@ public class FormatBytesUtil { ...@@ -106,7 +106,7 @@ public class FormatBytesUtil {
*/ */
public static String dateToStamp(String s) { public static String dateToStamp(String s) {
String res; String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH");
Date date = null; Date date = null;
try { try {
date = simpleDateFormat.parse(s); date = simpleDateFormat.parse(s);
......
...@@ -16,14 +16,10 @@ public class test { ...@@ -16,14 +16,10 @@ public class test {
private static String startTime="1503123818000"; private static String startTime="1503123818000";
private static String endTime="1517305049000"; private static String endTime="1517305049000";
public static void main(String[] args){ public static void main(String[] args){
String authFrequencyStr= ServiceStateMonitoring.authFrequency("1503123818000","1517305049000"); // String authFrequencyStr= ServiceStateMonitoring.authFrequency("1516581614000","1516585214000");
System.out.println(authFrequencyStr); // System.out.println(authFrequencyStr);
// String aa="2018-02-09 16:18:35";
// if(aa.substring(12,16).equals("2018-02-09 16:18")){
// System.out.println(111);
// }
// System.out.println( aa.substring(14,16));
// Object s = FormatBytesUtil.dateAddOneHour("2018-02-09 16"); // Object s = FormatBytesUtil.dateAddOneHour("2018-02-09 16");
// System.out.println(s); // System.out.println(s);
...@@ -31,8 +27,8 @@ public class test { ...@@ -31,8 +27,8 @@ public class test {
// Object s1 = FormatBytesUtil.stampToDate("1518163200000"); // Object s1 = FormatBytesUtil.stampToDate("1518163200000");
// System.out.println(s1); // System.out.println(s1);
// //
// Object s2 = FormatBytesUtil.dateToStamp("2018-02-09 17"); Object s2 = FormatBytesUtil.dateToStamp("2018-02-11 14");
// System.out.println("222 "+s2); System.out.println(s2);
/*微信推送频率*/ /*微信推送频率*/
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<bean id="checkXMLInput" class="com.legalPersonMonitor.monitor.SendToWeixin" /> <bean id="checkXMLInput" class="com.legalPersonMonitor.monitor.SendToWeixin" />
<task:scheduled-tasks> <task:scheduled-tasks>
<!--<task:scheduled ref="checkXMLInput" method="sendToWeixinMain" initial-delay="2000" fixed-delay="5000"/>-->
<task:scheduled ref="checkXMLInput" method="sendToWeixinMain" cron="0 00 8 ? * *"/> <task:scheduled ref="checkXMLInput" method="sendToWeixinMain" cron="0 00 8 ? * *"/>
<task:scheduled ref="checkXMLInput" method="sendToWeixinMain" cron="0 00 11 ? * *"/> <task:scheduled ref="checkXMLInput" method="sendToWeixinMain" cron="0 00 11 ? * *"/>
<task:scheduled ref="checkXMLInput" method="sendToWeixinMain" cron="0 00 14 ? * *"/> <task:scheduled ref="checkXMLInput" method="sendToWeixinMain" cron="0 00 14 ? * *"/>
......
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