|
@@ -34,6 +34,7 @@ import com.boman.web.core.service.czrk.CzrkServiceImpl;
|
|
import com.boman.web.core.service.czrk.ICzrkJzdzService;
|
|
import com.boman.web.core.service.czrk.ICzrkJzdzService;
|
|
import com.boman.web.core.service.ip.IpTimesService;
|
|
import com.boman.web.core.service.ip.IpTimesService;
|
|
import com.boman.web.core.service.toQianShan.ToQianshanPersonnerService;
|
|
import com.boman.web.core.service.toQianShan.ToQianshanPersonnerService;
|
|
|
|
+import com.boman.web.core.utils.AESUtil;
|
|
import com.boman.web.core.utils.AuthUtils;
|
|
import com.boman.web.core.utils.AuthUtils;
|
|
import com.boman.web.core.utils.HttpClientUtils;
|
|
import com.boman.web.core.utils.HttpClientUtils;
|
|
import lombok.SneakyThrows;
|
|
import lombok.SneakyThrows;
|
|
@@ -49,7 +50,12 @@ import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.io.BufferedReader;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.io.InputStreamReader;
|
|
|
|
+import java.io.Reader;
|
|
|
|
+import java.net.HttpURLConnection;
|
|
|
|
+import java.net.URL;
|
|
import java.sql.Timestamp;
|
|
import java.sql.Timestamp;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
@@ -1177,4 +1183,99 @@ public class TaskService {
|
|
System.out.println("---------------插入来宜人员数据耗时" + (end - start) + "---------------");
|
|
System.out.println("---------------插入来宜人员数据耗时" + (end - start) + "---------------");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public String test() {
|
|
|
|
+ Long gjzwfwpt_rtime = new Date().getTime();
|
|
|
|
+ System.out.println("时间戳------"+gjzwfwpt_rtime);
|
|
|
|
+ String gjzwfwpt_rid = "TE3400003400000001@f6eae674bdc840d2b0474dd3d736faf1";
|
|
|
|
+ String gjzwfwpt_sid = "s_X01201000200000000_4817";
|
|
|
|
+
|
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
|
+ sb.append(gjzwfwpt_sid).append(gjzwfwpt_rid).append(String.valueOf(gjzwfwpt_rtime));
|
|
|
|
+
|
|
|
|
+ // System.out.println(sign(sid+rid+rtime,"90f27130802db6f63edb783831bf5aff"));
|
|
|
|
+ System.out.println("加密------"+AESUtil.sign(sb.toString(),"e72f935d839db74e407ca9fa13cc78b7"));
|
|
|
|
+
|
|
|
|
+ String gjzwfwpt_sign = AESUtil.sign(sb.toString(),"e72f935d839db74e407ca9fa13cc78b7");
|
|
|
|
+
|
|
|
|
+ JSONObject paramMap = new JSONObject();
|
|
|
|
+ paramMap.put("gjzwfwpt_rid",gjzwfwpt_rid);
|
|
|
|
+ paramMap.put("gjzwfwpt_sid",gjzwfwpt_sid);
|
|
|
|
+ paramMap.put("gjzwfwpt_rtime",String.valueOf(gjzwfwpt_rtime));
|
|
|
|
+ paramMap.put("gjzwfwpt_sign",gjzwfwpt_sign);
|
|
|
|
+ String http = "http://59.255.22.70:8443/authz/authSystem/getAppSecret";
|
|
|
|
+ try {
|
|
|
|
+ String data = HttpClientUtils.send(http, paramMap,"utf-8");
|
|
|
|
+ System.out.println("/authSystem/getAppSecret返回值------"+data);
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
|
+ Map<String,Object> map = (Map<String, Object>) jsonObject.get("data");
|
|
|
|
+ System.out.println("secret------"+(String) map.get("secret"));
|
|
|
|
+ String my = AESUtil.AESDncode("e72f935d839db74e407ca9fa13cc78b7", (String) map.get("secret"));
|
|
|
|
+ System.out.println("解密------"+my);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //请求url
|
|
|
|
+ URL postUrl = new URL("http://59.255.22.70:8443/gateway/wsproxy");
|
|
|
|
+ //请求参数map
|
|
|
|
+ Map<String,String> postParams = new HashMap<String,String>();
|
|
|
|
+ //组装参数
|
|
|
|
+ //公共请求参数
|
|
|
|
+ postParams.put("access_key", "e72f935d839db74e407ca9fa13cc78b7");
|
|
|
|
+ postParams.put("format","json");
|
|
|
|
+ postParams.put("request_id","");
|
|
|
|
+ postParams.put("sign", my);
|
|
|
|
+ postParams.put("timestamp",String.valueOf(gjzwfwpt_rtime));
|
|
|
|
+ postParams.put("version","1.0");
|
|
|
|
+ //请求查询条件参数
|
|
|
|
+ Map<String,String> params = new HashMap<String, String>();
|
|
|
|
+ params.put("cert_num_man", "340826199601121171");
|
|
|
|
+ params.put("name_man", "叶飞翔");
|
|
|
|
+ StringBuilder biz_content = new StringBuilder("{");
|
|
|
|
+ for(String key : params.keySet()){
|
|
|
|
+ String value = params.get(key);
|
|
|
|
+ biz_content.append("\""+key+"\""+":"+"\""+value+"\",");
|
|
|
|
+ }
|
|
|
|
+ biz_content.deleteCharAt(biz_content.length() - 1);
|
|
|
|
+ biz_content.append("}");
|
|
|
|
+ postParams.put("biz_content", biz_content.toString());
|
|
|
|
+ StringBuilder postData = new StringBuilder();
|
|
|
|
+ for (Map.Entry<String,String> param : postParams.entrySet()) {
|
|
|
|
+ if (postData.length() != 0){
|
|
|
|
+ postData.append('&');
|
|
|
|
+ }
|
|
|
|
+ postData.append(param.getKey());
|
|
|
|
+ postData.append("=");
|
|
|
|
+ postData.append(param.getValue());
|
|
|
|
+ }
|
|
|
|
+ System.out.println("http://59.255.22.70:8443/gateway/wsproxy参数"+postData.toString());
|
|
|
|
+ byte[] postDataBytes = postData.toString().getBytes("UTF-8");
|
|
|
|
+ HttpURLConnection conn = (HttpURLConnection)postUrl.openConnection();
|
|
|
|
+ conn.setDoOutput(true);
|
|
|
|
+ conn.setDoInput(true);
|
|
|
|
+ conn.setUseCaches(false);
|
|
|
|
+ conn.setRequestMethod("POST");
|
|
|
|
+ conn.setRequestProperty("accept", "*/*");
|
|
|
|
+ conn.setRequestProperty("connection", "Keep-Alive");
|
|
|
|
+ conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
|
|
|
|
+ conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
|
|
|
|
+ conn.setRequestProperty("Content-Length",String.valueOf(postDataBytes.length));
|
|
|
|
+ conn.connect();
|
|
|
|
+ conn.getOutputStream().write(postDataBytes);
|
|
|
|
+ Reader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
|
|
|
|
+ StringBuilder sb1 = new StringBuilder();
|
|
|
|
+ for (int c; (c = in.read()) >= 0;){
|
|
|
|
+ sb1.append((char)c);
|
|
|
|
+ }
|
|
|
|
+ //获取查询结果,结果示例见第5条,
|
|
|
|
+ String response = sb1.toString();
|
|
|
|
+
|
|
|
|
+ System.out.println("结果------"+response);
|
|
|
|
+ return response;
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|