Merge branch 'uat_保证金天擎调用' into 'uat_code'
增加中信请求沃支付http方法,请求头增加参数 See merge request eshop/biz_service_ebtp_extend!97
This commit is contained in:
@ -36,8 +36,9 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@ -191,7 +192,7 @@ public class CrypConfigureServiceImpl extends BaseServiceImpl<CrypConfigureMappe
|
||||
|
||||
json = getCiticUniBss(bean.getReqName(), map);
|
||||
|
||||
str = UniBssServiceImpl.uniBssHttpPost(bean.getUrl(), json);
|
||||
str = this.uniBssCiticHttpPost(bean.getUrl(), json);
|
||||
} catch (Exception e) {
|
||||
log.error("区块链调用失败!~-----------------",e);
|
||||
}
|
||||
@ -466,6 +467,48 @@ public class CrypConfigureServiceImpl extends BaseServiceImpl<CrypConfigureMappe
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 中信支付 请求头参数
|
||||
* "ClientId", "com.unicom.hq.bid"
|
||||
* "OperationCode", "com.unicom.fcp.uapService.registeredMembers.process"
|
||||
* @param path
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public static String uniBssCiticHttpPost(String path, String data) {
|
||||
String str = "";
|
||||
|
||||
try {
|
||||
URL url = new URL(path);
|
||||
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
|
||||
PrintWriter out = null;
|
||||
conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
|
||||
conn.setRequestProperty("Accept", "application/json");
|
||||
conn.setRequestProperty("Accept-Encoding", "");
|
||||
conn.setRequestProperty("ClientId", "com.unicom.hq.bid");
|
||||
conn.setRequestProperty("OperationCode", "com.unicom.fcp.uapService.registeredMembers.process");
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
conn.setRequestMethod("POST");
|
||||
out = new PrintWriter(conn.getOutputStream());
|
||||
out.print(data);
|
||||
out.flush();
|
||||
InputStream is = conn.getInputStream();
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(is));
|
||||
|
||||
for(String line = br.readLine(); line != null; line = br.readLine()) {
|
||||
str = new String(line.getBytes(), "UTF-8");
|
||||
System.out.println(str);
|
||||
}
|
||||
|
||||
is.close();
|
||||
conn.disconnect();
|
||||
} catch (Exception var9) {
|
||||
var9.printStackTrace();
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, UnsupportedEncodingException {
|
||||
//String json = "{\"RESULT_ID\":\"1\",\"TP_ID\":\"2\",\"SECTION_ID\":\"3\",\"REPORT_ID\":\"4\",\"RESULTDETAIL\":[{\"RESULT_DETAIL_ID\":\"51\",\"RESULT_ID\":\"52\",\"TENDERER_ID\":\"53\",\"WINNER_CANDIDATE\":\"54\",\"PRICE\":\"55\",\"PRICE_REVIEW\":\"56\",\"BUSINESS_SCORE\":\"57\",\"TECHNICAL_SCORE\":\"58\",\"SERVICE_SCORE\":\"59\",\"PRICE_SCORE\":\"60\",\"TOTAL_SCORE\":\"61\",\"CONTRACTED_MONEY\":\"62\",\"TAX_RATE_PRICE\":\"63\",\"SCOREDETAIL\":[{\"RESULT_DETAIL_ID\":\"71\",\"TENDERER_ID\":\"72\",\"USER_ID\":\"73\",\"BUSINESS_SCORE\":\"74\",\"TECHNICAL_SCORE\":\"75\",\"SERVICE_SCORE\":\"76\",\"PRICE_SCORE\":\"77\"}]}]}";
|
||||
|
Reference in New Issue
Block a user