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") @JSONField(name = "order_no")
private String orderNo; private String orderNo;
private double mileage; private String mileage;
@JSONField(name = "order_time") @JSONField(name = "order_time")
private String orderTime; private String orderTime;
@JSONField(name = "order_state") @JSONField(name = "order_state")
@ -26,7 +26,7 @@ public class CarbonOrderPayload extends RequestPayload implements IApiRequest {
private String completeTime = ""; private String completeTime = "";
@JSONField(name = "order_pay") @JSONField(name = "order_pay")
private double orderPay = 0; private String orderPay;
private String behavior = ""; private String behavior = "";
@ -46,13 +46,6 @@ public class CarbonOrderPayload extends RequestPayload implements IApiRequest {
this.orderNo = orderNo; this.orderNo = orderNo;
} }
public double getMileage() {
return mileage;
}
public void setMileage(double mileage) {
this.mileage = mileage;
}
public String getOrderTime() { public String getOrderTime() {
return orderTime; return orderTime;
@ -95,14 +88,33 @@ public class CarbonOrderPayload extends RequestPayload implements IApiRequest {
this.completeTime = completeTime; 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; return orderPay;
} }
public void setOrderPay(double orderPay) { public void setOrderPay(String orderPay) {
this.orderPay = orderPay; this.orderPay = orderPay;
} }
/**
* @param orderPay
*/
public void setOrderPay(double orderPay) {
this.setOrderPay(String.valueOf(orderPay));
}
public String getBehavior() { public String getBehavior() {
return behavior; return behavior;
} }

@ -48,13 +48,13 @@ public class RSASecure implements ISecure {
Object v = j.get(key); Object v = j.get(key);
String vx; String vx;
if (v instanceof Double) { if (v instanceof Double) {
vx = String.format("%s", BigDecimal.valueOf((Double) v).stripTrailingZeros()); vx = String.format("%s", v);
} else if (v instanceof Float) { } else if (v instanceof Float) {
vx = String.format("%s", BigDecimal.valueOf((Float) v).stripTrailingZeros()); vx = String.format("%s", v);
} else if (v instanceof Boolean) { } else if (v instanceof Boolean) {
vx = String.format("%s", v); vx = String.format("%s", v);
} else if (v instanceof BigDecimal) { } else if (v instanceof BigDecimal) {
vx = String.format("%s", ((BigDecimal) v).stripTrailingZeros()); vx = String.format("%s", v);
} else { } else {
vx = String.valueOf(v); vx = String.valueOf(v);
} }

Loading…
Cancel
Save