2025-09-10 06:54:02 +00:00
|
|
|
|
package tqq9.lc123.cloud.app.plugin.trd;
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
import kd.bos.logging.Log;
|
|
|
|
|
|
import kd.bos.logging.LogFactory;
|
2025-09-11 02:27:02 +00:00
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
2025-09-10 06:54:02 +00:00
|
|
|
|
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
|
|
|
|
|
import tqq9.lc123.cloud.app.plugin.utils.HttpRequestUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 第三方接口调用
|
|
|
|
|
|
*/
|
|
|
|
|
|
public class TrdInterfaceImpl {
|
|
|
|
|
|
|
|
|
|
|
|
private static final Log logger = LogFactory.getLog(TrdInterfaceImpl.class);
|
|
|
|
|
|
|
|
|
|
|
|
//调用通天晓接口
|
|
|
|
|
|
public static JSONObject ttxImpl(String method, String param) throws IOException {
|
|
|
|
|
|
String ttx_customerId = ConfigUtils.getThirdConfigByNumber("Ttx_CustomerId");
|
|
|
|
|
|
String ttx_mainUrl = ConfigUtils.getThirdConfigByNumber("Ttx_MainURL");
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
|
|
|
headers.put("method", method);
|
|
|
|
|
|
headers.put("v", "2.0");
|
|
|
|
|
|
headers.put("format", "xml");
|
|
|
|
|
|
headers.put("customerId", ttx_customerId);
|
|
|
|
|
|
|
|
|
|
|
|
String response = HttpRequestUtils.postXml(ttx_mainUrl, param, headers);
|
|
|
|
|
|
logger.info("ttx-responseXML:" + response);
|
2025-09-11 02:27:02 +00:00
|
|
|
|
if(StringUtils.isNotBlank(response)){
|
|
|
|
|
|
JSONObject resJSON = HttpRequestUtils.xmlToJson(response);
|
|
|
|
|
|
logger.info("ttx-responseJSON:" + resJSON);
|
|
|
|
|
|
return resJSON;
|
|
|
|
|
|
}
|
|
|
|
|
|
return null;
|
2025-09-10 06:54:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|