|
@@ -22,6 +22,7 @@ import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
import org.apache.http.impl.client.HttpClients;
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
|
import org.apache.http.util.EntityUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
|
import java.io.*;
|
|
|
import java.net.HttpURLConnection;
|
|
@@ -35,6 +36,8 @@ import java.util.*;
|
|
|
|
|
|
public class EntityAnalyse {
|
|
|
|
|
|
+ @Value("${com.changyuntong.env}")
|
|
|
+ private static String ENV;
|
|
|
|
|
|
/**
|
|
|
* 获取交投系统token
|
|
@@ -44,7 +47,12 @@ public class EntityAnalyse {
|
|
|
*/
|
|
|
public static String GetJTToken() throws IOException {
|
|
|
String pwd = DigestUtils.sha1Hex("Ccj841968545");
|
|
|
- String url = "http://116.182.4.67:50065/platform/login/login";
|
|
|
+ String url = "";
|
|
|
+ if("3".equals(ENV)){
|
|
|
+ url = "http://116.182.4.67:50033/platform/login/login";
|
|
|
+ }else {
|
|
|
+ url = "http://116.182.4.67:50065/platform/login/login";
|
|
|
+ }
|
|
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
// 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
|
|
|
HttpPost httpPost = new HttpPost(url);
|
|
@@ -83,7 +91,12 @@ public class EntityAnalyse {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public static String uploadImage(File image, String token) throws IOException {
|
|
|
- String url = "http://116.182.4.67:50065/platform/file/uploadImage";
|
|
|
+ String url = "";
|
|
|
+ if("3".equals(ENV)){
|
|
|
+ url = "http://116.182.4.67:50033/platform/file/uploadImage";
|
|
|
+ }else {
|
|
|
+ url = "http://116.182.4.67:50065/platform/file/uploadImage";
|
|
|
+ }
|
|
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
// 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
|
|
|
HttpPost httpPost = new HttpPost(url);
|
|
@@ -133,7 +146,12 @@ public class EntityAnalyse {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public static String uploadDriverInfo(HyDriverInfo hyDriverInfo) throws IOException, ParseException {
|
|
|
- String url = "http://116.182.4.67:50065/platform/api/v1/driver";
|
|
|
+ String url = "";
|
|
|
+ if("3".equals(ENV)){
|
|
|
+ url = "http://116.182.4.67:50033/platform/api/v1/driver";
|
|
|
+ }else {
|
|
|
+ url = "http://116.182.4.67:50065/platform/api/v1/driver";
|
|
|
+ }
|
|
|
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
|
|
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
// 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
|
|
@@ -205,7 +223,12 @@ public class EntityAnalyse {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public static String uploadDriverCarInfo(HyDriverCarInfo hyDriverCarInfo) throws IOException {
|
|
|
- String url = "http://116.182.4.67:50065/platform/api/v1/vehicle";
|
|
|
+ String url = "";
|
|
|
+ if("3".equals(ENV)){
|
|
|
+ url = "http://116.182.4.67:50033/platform/api/v1/vehicle";
|
|
|
+ }else {
|
|
|
+ url = "http://116.182.4.67:50065/platform/api/v1/vehicle";
|
|
|
+ }
|
|
|
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
|
|
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
// 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
|
|
@@ -309,7 +332,12 @@ public class EntityAnalyse {
|
|
|
DecimalFormat df = new DecimalFormat("0");
|
|
|
DecimalFormat df1 = new DecimalFormat("0");
|
|
|
|
|
|
- String url = "http://116.182.4.67:50065/platform/api/v1/transport";
|
|
|
+ String url = "";
|
|
|
+ if("3".equals(ENV)){
|
|
|
+ url = "http://116.182.4.67:50033/platform/api/v1/transport";
|
|
|
+ }else {
|
|
|
+ url = "http://116.182.4.67:50065/platform/api/v1/transport";
|
|
|
+ }
|
|
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
// 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
|
|
|
HttpPost httpPost = new HttpPost(url);
|
|
@@ -441,7 +469,12 @@ public class EntityAnalyse {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public static String uploadFlowSheet(HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException {
|
|
|
- String url = "http://116.182.4.67:50065/platform/api/v1/money";
|
|
|
+ String url = "";
|
|
|
+ if("3".equals(ENV)){
|
|
|
+ url = "http://116.182.4.67:50033/platform/api/v1/money";
|
|
|
+ }else {
|
|
|
+ url = "http://116.182.4.67:50065/platform/api/v1/money";
|
|
|
+ }
|
|
|
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
|
|
|
DecimalFormat df1 = new DecimalFormat("0");
|
|
@@ -536,7 +569,12 @@ public class EntityAnalyse {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public static String driverInfoCheck(HyDriverInfo hyDriverInfo) throws IOException {
|
|
|
- String url = "http://116.182.4.67:50065/platform/api/v1/driver/validate";
|
|
|
+ String url = "";
|
|
|
+ if("3".equals(ENV)){
|
|
|
+ url = "http://116.182.4.67:50033/platform/api/v1/driver/validate";
|
|
|
+ }else {
|
|
|
+ url = "http://116.182.4.67:50065/platform/api/v1/driver/validate";
|
|
|
+ }
|
|
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
// 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
|
|
|
HttpPost httpPost = new HttpPost(url);
|
|
@@ -588,7 +626,12 @@ public class EntityAnalyse {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public static String driverCarInfoCheck(HyDriverCarInfo hyDriverCarInfo) throws IOException {
|
|
|
- String url = "http://116.182.4.67:50065/platform/api/v1/vehicle/validate";
|
|
|
+ String url = "";
|
|
|
+ if("3".equals(ENV)){
|
|
|
+ url = "http://116.182.4.67:50033/platform/api/v1/vehicle/validate";
|
|
|
+ }else {
|
|
|
+ url = "http://116.182.4.67:50065/platform/api/v1/vehicle/validate";
|
|
|
+ }
|
|
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
// 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
|
|
|
HttpPost httpPost = new HttpPost(url);
|
|
@@ -645,7 +688,12 @@ public class EntityAnalyse {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public static String waybillCheck(OrderInfo orderInfo) throws IOException {
|
|
|
- String url = "http://116.182.4.67:50065/platform/api/v1/driver/validate";
|
|
|
+ String url = "";
|
|
|
+ if("3".equals(ENV)){
|
|
|
+ url = "http://116.182.4.67:50033/platform/api/v1/transport/validate";
|
|
|
+ }else {
|
|
|
+ url = "http://116.182.4.67:50065/platform/api/v1/transport/validate";
|
|
|
+ }
|
|
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
|
|
// 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
|
|
|
HttpPost httpPost = new HttpPost(url);
|