diff --git a/src/main/java/com/tsl3060/open/extend/core/payload/CarbonOrderPayload.java b/src/main/java/com/tsl3060/open/extend/core/payload/CarbonOrderPayload.java index 6b093bf..c65f489 100644 --- a/src/main/java/com/tsl3060/open/extend/core/payload/CarbonOrderPayload.java +++ b/src/main/java/com/tsl3060/open/extend/core/payload/CarbonOrderPayload.java @@ -13,7 +13,7 @@ public class CarbonOrderPayload extends RequestPayload implements IApiRequest { @JSONField(name = "order_no") private String orderNo; - private double mileage; + private String mileage; @JSONField(name = "order_time") private String orderTime; @JSONField(name = "order_state") @@ -26,7 +26,7 @@ public class CarbonOrderPayload extends RequestPayload implements IApiRequest { private String completeTime = ""; @JSONField(name = "order_pay") - private double orderPay = 0; + private String orderPay; private String behavior = ""; @@ -46,13 +46,6 @@ public class CarbonOrderPayload extends RequestPayload implements IApiRequest { this.orderNo = orderNo; } - public double getMileage() { - return mileage; - } - - public void setMileage(double mileage) { - this.mileage = mileage; - } public String getOrderTime() { return orderTime; @@ -95,14 +88,33 @@ public class CarbonOrderPayload extends RequestPayload implements IApiRequest { this.completeTime = completeTime; } - public double getOrderPay() { + public String getMileage() { + return mileage; + } + + public void setMileage(String mileage) { + this.mileage = mileage; + } + + public void setMileage(double mileage) { + this.setMileage(String.valueOf(mileage)); + } + + public String getOrderPay() { return orderPay; } - public void setOrderPay(double orderPay) { + public void setOrderPay(String orderPay) { this.orderPay = orderPay; } + /** + * @param orderPay + */ + public void setOrderPay(double orderPay) { + this.setOrderPay(String.valueOf(orderPay)); + } + public String getBehavior() { return behavior; } diff --git a/src/main/java/com/tsl3060/open/extend/core/secure/RSASecure.java b/src/main/java/com/tsl3060/open/extend/core/secure/RSASecure.java index 88065ff..6f711cb 100644 --- a/src/main/java/com/tsl3060/open/extend/core/secure/RSASecure.java +++ b/src/main/java/com/tsl3060/open/extend/core/secure/RSASecure.java @@ -48,13 +48,13 @@ public class RSASecure implements ISecure { Object v = j.get(key); String vx; if (v instanceof Double) { - vx = String.format("%s", BigDecimal.valueOf((Double) v).stripTrailingZeros()); + vx = String.format("%s", v); } else if (v instanceof Float) { - vx = String.format("%s", BigDecimal.valueOf((Float) v).stripTrailingZeros()); + vx = String.format("%s", v); } else if (v instanceof Boolean) { vx = String.format("%s", v); } else if (v instanceof BigDecimal) { - vx = String.format("%s", ((BigDecimal) v).stripTrailingZeros()); + vx = String.format("%s", v); } else { vx = String.valueOf(v); }