|
|
|
@ -4,7 +4,6 @@ import com.alibaba.fastjson2.annotation.JSONField; |
|
|
|
|
|
|
|
|
|
public class CarbonOrderNotify { |
|
|
|
|
|
|
|
|
|
private final double scale = 100.0; |
|
|
|
|
/** |
|
|
|
|
* 用户OpenID |
|
|
|
|
*/ |
|
|
|
@ -21,16 +20,21 @@ public class CarbonOrderNotify { |
|
|
|
|
private String carbonNo; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 用户低碳积分 单位(0.01g) |
|
|
|
|
* 用户低碳积分 |
|
|
|
|
*/ |
|
|
|
|
@JSONField(name = "carbon") |
|
|
|
|
private int carbon; |
|
|
|
|
|
|
|
|
|
@JSONField(name = "carbon_value") |
|
|
|
|
private String carbonValue; |
|
|
|
|
/** |
|
|
|
|
* 本次订单新增积分 单位(0.01g) |
|
|
|
|
* 本次订单新增积分 |
|
|
|
|
*/ |
|
|
|
|
@JSONField(name = "amount") |
|
|
|
|
private int amount; |
|
|
|
|
|
|
|
|
|
@JSONField(name = "amount_value") |
|
|
|
|
private String amountValue; |
|
|
|
|
/** |
|
|
|
|
* 订单时间 |
|
|
|
|
*/ |
|
|
|
@ -71,40 +75,49 @@ public class CarbonOrderNotify { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取用户的低碳值,单位(0.01g) |
|
|
|
|
* 获取用户的低碳值 |
|
|
|
|
* <p> |
|
|
|
|
* 该函数会丢失精度,使用 getCarbonValue 代理 |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Deprecated |
|
|
|
|
public int getCarbon() { |
|
|
|
|
return carbon; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取用户的低碳值,单位(g) |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public double getCarbonValue() { |
|
|
|
|
return carbon / scale; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 设置用户的低碳值 ,单位 (0.01g) |
|
|
|
|
* 设置用户的低碳值 |
|
|
|
|
* <p> |
|
|
|
|
* 该函数会丢失精度,使用 setCarbonValue 代替 |
|
|
|
|
* |
|
|
|
|
* @param carbon |
|
|
|
|
*/ |
|
|
|
|
@Deprecated |
|
|
|
|
public void setCarbon(int carbon) { |
|
|
|
|
this.carbon = carbon; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取本单低碳值 |
|
|
|
|
* <p> |
|
|
|
|
* 该函数会丢失精度,使用 getAmountValue代替 |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Deprecated |
|
|
|
|
public int getAmount() { |
|
|
|
|
return amount; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public double getAmountValue() { |
|
|
|
|
return amount / scale; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 设置本单低碳值 |
|
|
|
|
* <p> |
|
|
|
|
* 该函数会丢失精度,使用 setAmountValue代替 |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Deprecated |
|
|
|
|
public void setAmount(int amount) { |
|
|
|
|
this.amount = amount; |
|
|
|
|
} |
|
|
|
@ -132,4 +145,30 @@ public class CarbonOrderNotify { |
|
|
|
|
public void setType(String type) { |
|
|
|
|
this.type = type; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setCarbonValue(String carbonValue) { |
|
|
|
|
this.carbonValue = carbonValue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setAmountValue(String amountValue) { |
|
|
|
|
this.amountValue = amountValue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取用户低碳值余额,格式: 0.## ,单位 g |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public String getCarbonValue() { |
|
|
|
|
return carbonValue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取本订单低碳值,格式 0.##,单位g |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public String getAmountValue() { |
|
|
|
|
return amountValue; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|