Просмотр исходного кода

Merge remote-tracking branch 'origin/develop' into develop

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
2f39132e09
1 измененных файлов: 54 добавлений и 3 удалений
  1. +54
    -3
      mallinkService/src/main/java/com/iformall/utils/ETCPUtil.java

+ 54
- 3
mallinkService/src/main/java/com/iformall/utils/ETCPUtil.java Просмотреть файл

@@ -319,6 +319,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + userSigninUrl.replaceAll("\\{version}", version), data, sign, String respStr = doPost(baseUrl + userSigninUrl.replaceAll("\\{version}", version), data, sign,
timeStamp, merchantNo); timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -354,6 +357,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + bindCarUrl.replaceAll("\\{version}", version), String respStr = doPost(baseUrl + bindCarUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -384,6 +390,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + unbindCarUrl.replaceAll("\\{version}", version), String respStr = doPost(baseUrl + unbindCarUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -419,6 +428,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + carAuthUrl.replaceAll("\\{version}", version), String respStr = doPost(baseUrl + carAuthUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -456,6 +468,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + carRetrieveUrl.replaceAll("\\{version}", version), String respStr = doPost(baseUrl + carRetrieveUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -490,6 +505,9 @@ public class ETCPUtil {


String respStr = doGet(baseUrl + carNumUrl.replaceAll("\\{version}", version), String respStr = doGet(baseUrl + carNumUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -521,6 +539,9 @@ public class ETCPUtil {


String respStr = doGet(baseUrl + orderUnpayUrl.replaceAll("\\{version}", version), String respStr = doGet(baseUrl + orderUnpayUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -551,6 +572,9 @@ public class ETCPUtil {


String respStr = doGet(baseUrl + couponListUrl.replaceAll("\\{version}", version), String respStr = doGet(baseUrl + couponListUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -575,6 +599,9 @@ public class ETCPUtil {


String respStr = doGet(baseUrl + orderHistoryUrl.replaceAll("\\{version}", version), String respStr = doGet(baseUrl + orderHistoryUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -611,6 +638,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + orderpayUrl.replaceAll("\\{version}", version), String respStr = doPost(baseUrl + orderpayUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -651,6 +681,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + orderPaidUrl.replaceAll("\\{version}", version), String respStr = doPost(baseUrl + orderPaidUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -678,6 +711,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + parkingInfoUrl.replaceAll("\\{version}", version), String respStr = doPost(baseUrl + parkingInfoUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -731,6 +767,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + parkingStatusUrl.replaceAll("\\{version}", version), String respStr = doPost(baseUrl + parkingStatusUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -761,6 +800,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + parkingStatusUrl.replaceAll("\\{version}", version), String respStr = doPost(baseUrl + parkingStatusUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -785,6 +827,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + bCouponListUrl.replaceAll("\\{version}", version), String respStr = doPost(baseUrl + bCouponListUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -814,6 +859,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + bCouponRecordUrl.replaceAll("\\{version}", version), String respStr = doPost(baseUrl + bCouponRecordUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -839,6 +887,9 @@ public class ETCPUtil {


String respStr = doPost(baseUrl + bCarSimulationUrl.replaceAll("\\{version}", version), String respStr = doPost(baseUrl + bCarSimulationUrl.replaceAll("\\{version}", version),
data, sign, timeStamp, merchantNo); data, sign, timeStamp, merchantNo);
if(respStr == null) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
}
if(respStr.startsWith("<html>")) { if(respStr.startsWith("<html>")) {
throw new MallinkException(ErrorCode.ETCP_CMD_FAIL); throw new MallinkException(ErrorCode.ETCP_CMD_FAIL);
} }
@@ -856,7 +907,7 @@ public class ETCPUtil {
logger.info("post接口响应信息为:{}", responseStr); logger.info("post接口响应信息为:{}", responseStr);
return responseStr; return responseStr;
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace();
logger.error(e.getMessage());
} }
return null; return null;
} }
@@ -873,7 +924,7 @@ public class ETCPUtil {
logger.info("get请求接口响应信息为:{}", responseStr); logger.info("get请求接口响应信息为:{}", responseStr);
return responseStr; return responseStr;
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace();
logger.error(e.getMessage());
} }
return null; return null;
} }
@@ -901,7 +952,7 @@ public class ETCPUtil {
sb.append(Integer.toHexString(val)); sb.append(Integer.toHexString(val));
} }
} catch (Exception ex) { } catch (Exception ex) {
logger.error(ex.getMessage());
} }
return sb.toString().toUpperCase(); return sb.toString().toUpperCase();
} }


Загрузка…
Отмена
Сохранить