6
0
Fork 0

去除Double的处理

master
nishengli 2 years ago
parent 4f973880c5
commit 7056f911f7
  1. 34
      src/main/java/com/tsl3060/open/extend/core/payload/CarbonOrderPayload.java
  2. 6
      src/main/java/com/tsl3060/open/extend/core/secure/RSASecure.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;
}

@ -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);
}

Loading…
Cancel
Save