Commit 0383ca92 authored by 胡建龙's avatar 胡建龙

[fix]维护工具类中参数取值方式

parent 5ca40de5
package com.hand.app.pingAn.utils; package com.hand.app.pingAn.utils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hand.app.cmb.service.impl.HclcCmbPolyServiceImpl;
import com.hand.app.cmb.util.Utils;
import com.pingan.openbank.api.sdk.client.ApiClient; import com.pingan.openbank.api.sdk.client.ApiClient;
import com.pingan.openbank.api.sdk.common.http.HttpResult; import com.pingan.openbank.api.sdk.common.http.HttpResult;
import com.pingan.openbank.api.sdk.entity.*; import com.pingan.openbank.api.sdk.entity.*;
import org.slf4j.LoggerFactory;
import java.io.File; import java.io.File;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Properties;
public class ApiUtils { public class ApiUtils {
private static ApiClient apiClient = ApiClient.getInstance("pingAn.properties"); private static ApiClient apiClient = ApiClient.getInstance("pingAn.properties");
private static JSONObject baseReqBody = new JSONObject(); private static JSONObject baseReqBody = new JSONObject();
private static Calendar cal = null; private static Calendar cal = null;
private static SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmssSSS"); private static SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmssSSS");
private static String MrchCode = "0090108040000KTAR000"; private static Properties pro = null;
public static String AcctNo = "15000101414037"; private static String MrchCode;
public static String AcctNo;
static{ static{
String path = Thread.currentThread().getContextClassLoader().getResource("").getPath().substring(1);
pro = Utils.loadProp(path + "pingAn.properties");
if (Objects.isNull(pro)) {
LoggerFactory.getLogger(HclcCmbPolyServiceImpl.class).error("配置文件初始化异常");
}
// todo 设置通用的请求参数,比如主账号,流水号,企业银企直连标准代码等 // todo 设置通用的请求参数,比如主账号,流水号,企业银企直连标准代码等
MrchCode = pro.getProperty("MrchCode");
AcctNo = pro.getProperty("AcctNo");
baseReqBody.put("MrchCode",MrchCode); baseReqBody.put("MrchCode",MrchCode);
baseReqBody.put("MainAccount",AcctNo); baseReqBody.put("MainAccount",AcctNo);
} }
......
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