From 790bad567e492ae1ad6882ed60fa39a7d2f18933 Mon Sep 17 00:00:00 2001 From: kk <1910333201@qq.com> Date: Wed, 13 Dec 2023 14:22:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E4=BA=91=E3=80=81=E8=85=BE?= =?UTF-8?q?=E8=AE=AF=E4=BA=91=E5=9C=B0=E5=9D=80=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 2 ++ .../src/main/resources/application-prod.yml | 2 ++ .../invoice/utils/elephant/ElephantUtils.java | 33 ++++++++++++++----- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/jianshui-admin/src/main/resources/application-dev.yml b/jianshui-admin/src/main/resources/application-dev.yml index 9f6f541..e912589 100644 --- a/jianshui-admin/src/main/resources/application-dev.yml +++ b/jianshui-admin/src/main/resources/application-dev.yml @@ -91,6 +91,8 @@ ele_check_url: https://openapi.zncspt.com/api/ elephant_entcode_check: 91370102MA3UD2FG21 # 文件下载地址 elephant_invoice_file: http://dev.goldentaxcloud.com/8081/invoice/fileUrl/ +# 大象V6数电平台地址 +ele_v6_url: https://js.ele12.com/order-api #logstash: # host: 43.138.58.64:14560 # indexname: jianshui-dev \ No newline at end of file diff --git a/jianshui-admin/src/main/resources/application-prod.yml b/jianshui-admin/src/main/resources/application-prod.yml index 9e20d41..0ae7e0c 100644 --- a/jianshui-admin/src/main/resources/application-prod.yml +++ b/jianshui-admin/src/main/resources/application-prod.yml @@ -85,6 +85,8 @@ ele_check_url: https://openapi.zncspt.com/api/ elephant_entcode_check: 91370102MA3UD2FG21 # 文件下载地址 elephant_invoice_file: http://dev.goldentaxcloud.com/8081/invoice/fileUrl/ +# 大象V6数电平台地址 +ele_v6_url: https://js.ele12.com/order-api #logstash: # host: 43.138.58.64:14560 # indexname: jianshui-prod \ No newline at end of file diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/utils/elephant/ElephantUtils.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/utils/elephant/ElephantUtils.java index 0dec72f..eb4be3b 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/utils/elephant/ElephantUtils.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/utils/elephant/ElephantUtils.java @@ -36,6 +36,7 @@ import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.RequestEntity; import org.apache.commons.httpclient.methods.StringRequestEntity; import org.apache.commons.httpclient.params.HttpMethodParams; +import org.springframework.core.env.Environment; import sun.misc.BASE64Encoder; import javax.crypto.Mac; @@ -59,6 +60,15 @@ import java.util.concurrent.TimeUnit; @Slf4j public class ElephantUtils { + // 大象V6地址 + private static String ELE_V6_URL; + + static { + Environment environment = SpringUtils.getBean(Environment.class); + ELE_V6_URL = environment.getProperty("ele_v6_url"); + } + + public static AjaxResult sendRequest(String uri, JSON data, Companyservice companyservice, Boolean useEleCloudUrl) { ISysConfigService configService = SpringUtils.getBean(ISysConfigService.class); @@ -283,10 +293,12 @@ public class ElephantUtils { // url = ElephantConstants.DEV_TOKEN_HOST; // } // TODO 20231109 地址改成了京东云 - String url = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; + /*String url = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; if (isDevMode) { url = ElephantConstants.DEV_HOST_LOCAL_V6_JingDongYun; - } + }*/ + + String url = ELE_V6_URL; JSONObject jsonObject = new JSONObject(); jsonObject.put("appKey", appkey); @@ -367,10 +379,12 @@ public class ElephantUtils { String str = JSONUtil.toJsonStr(data); boolean isDevMode = CommonUtils.isDevMode(); // 主机名(京东云地址) - String host = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; + /*String host = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; if (isDevMode) { host = ElephantConstants.DEV_HOST_LOCAL_V6_JingDongYun; - } + }*/ + + String host = ELE_V6_URL; // 最终接口地址 String url = host + uri; @@ -449,10 +463,12 @@ public class ElephantUtils { // } // TODO : 2023/11/09 大象接口迁京东云 - String host = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; + /*String host = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; if (isDevMode) { host = ElephantConstants.DEV_HOST_LOCAL_V6_JingDongYun; - } + }*/ + + String host = ELE_V6_URL; //kk TODO : 2023/9/5 大象接口迁京东云 //https://js.ele12.com/ @@ -666,10 +682,11 @@ public class ElephantUtils { String str = JSONUtil.toJsonStr(data); boolean isDevMode = CommonUtils.isDevMode(); // 主机名(京东云地址) - String host = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; + /*String host = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; if (isDevMode) { host = ElephantConstants.DEV_HOST_LOCAL_V6_JingDongYun; - } + }*/ + String host = ELE_V6_URL; // 最终接口地址 String url = host + uri;