|
|
@@ -52,6 +52,12 @@ public class RequestSTKServiceImpl implements RequestSTKService {
|
|
|
@Value("${STK.save_or_update_url}")
|
|
|
private String SAVE_OR_UPDATE_URL;
|
|
|
|
|
|
+ /**
|
|
|
+ * 复杂查询接口请求地址
|
|
|
+ * */
|
|
|
+ @Value("${STK.complexity_query_url}")
|
|
|
+ private String COMPLEXITY_QUERY_URL;
|
|
|
+
|
|
|
/** 自动化查询接口地址 */
|
|
|
@Value("${STK.query_url}")
|
|
|
private String QUERY_URL;
|
|
|
@@ -60,6 +66,12 @@ public class RequestSTKServiceImpl implements RequestSTKService {
|
|
|
@Value("${STK.s_org_code}")
|
|
|
private String S_ORG_CODE;
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取客商信息接口编码
|
|
|
+ * */
|
|
|
+ @Value("${STK.get_travelling_merchant}")
|
|
|
+ private String GET_TRAVELLING_MERCHANT;
|
|
|
+
|
|
|
/** 新增修改客商信息接口请求编码 */
|
|
|
@Value("${STK.save_or_update_request_code}")
|
|
|
private String SAVE_OR_UPDATE_REQUEST_CODE ;
|
|
|
@@ -385,6 +397,66 @@ public class RequestSTKServiceImpl implements RequestSTKService {
|
|
|
return custvendDTO;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public TravellingMerchantVo queryTravelingMerchantList(QueryTravellingMerchantDto dto) throws Exception {
|
|
|
+
|
|
|
+ //时间戳
|
|
|
+ String timestamp = Long.toString(System.currentTimeMillis());
|
|
|
+
|
|
|
+ //加签方法的重要参数
|
|
|
+ //若该接口需要传入一些参数 如:name、age等等
|
|
|
+ //则直接在这个位置put即可
|
|
|
+ JSONObject request=new JSONObject(4);
|
|
|
+ request.put("code",GET_TRAVELLING_MERCHANT);
|
|
|
+ request.put("s_orgcode",S_ORG_CODE);//119030009
|
|
|
+ //request.put("start_time","2022-11-02 09:38:23");
|
|
|
+ //request.put("end_time","2025-01-06 22:04:47");
|
|
|
+ //request.put("jslx","合并口径");
|
|
|
+ //request.put("dwmc","担保集团");
|
|
|
+ request.put("page",dto.getPage());
|
|
|
+ request.put("size",dto.getSize());
|
|
|
+
|
|
|
+
|
|
|
+ String content = request.toString();
|
|
|
+
|
|
|
+ //加签方法第一个参数
|
|
|
+ StringBuilder signBuilder = new StringBuilder("appid").append("=").append(STK_APP_ID).append("&")
|
|
|
+ .append(content).append("&")
|
|
|
+ .append("timestamp").append("=").append(timestamp).append("&")
|
|
|
+ .append("key").append("=").append(STK_APP_KEY);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //加签
|
|
|
+ String sign = STKSignUtil.HMACSHA256(signBuilder.toString(),STK_APP_KEY);
|
|
|
+
|
|
|
+ System.out.println("原始:"+signBuilder);
|
|
|
+ System.out.println("签名:"+sign);
|
|
|
+ System.out.println("content:"+content);
|
|
|
+
|
|
|
+ //请求数据 (接口地址根据测试环境与正式环境变更)
|
|
|
+ String body = HttpRequest.post(COMPLEXITY_QUERY_URL)
|
|
|
+ .header("appid",STK_APP_ID) //请求头
|
|
|
+ .header("timestamp", timestamp)
|
|
|
+ .header("sign", sign)
|
|
|
+ .header("Content-Type", "application/json")
|
|
|
+ .body(content) //请求参数
|
|
|
+ .timeout(20000) //超时时间
|
|
|
+ .execute().body();
|
|
|
+
|
|
|
+ //JSONObject jsonObject = JSON.parseObject(body);
|
|
|
+
|
|
|
+ //JSONObject dataObject = jsonObject.getJSONObject("data");
|
|
|
+
|
|
|
+ //JSONArray listArray = dataObject.getJSONArray("list");
|
|
|
+
|
|
|
+ System.out.println("返回结果:"+body);
|
|
|
+
|
|
|
+ //System.out.println("返回结果:"+listArray.size());
|
|
|
+ return JSONObject.parseObject(body,TravellingMerchantVo.class); //返回结果
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* POST请求头部参数封装
|
|
|
* */
|