mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-05 18:39:56 +08:00
云快充1.5.0 金额单位修正为元
This commit is contained in:
@@ -24,8 +24,8 @@ public class ProtoConverter {
|
||||
// 设置字段
|
||||
builder.setType(PricingModelType.valueOf(pricingModel.getType().name()));
|
||||
builder.setRule(PricingModelRule.valueOf(pricingModel.getRule().name()));
|
||||
builder.setStandardElec(pricingModel.getStandardElec());
|
||||
builder.setStandardServ(pricingModel.getStandardServ());
|
||||
builder.setStandardElec(pricingModel.getStandardElec().toPlainString());
|
||||
builder.setStandardServ(pricingModel.getStandardServ().toPlainString());
|
||||
|
||||
// 转换 flagPriceList
|
||||
for (Map.Entry<PricingModelFlag, FlagPrice> entry : pricingModel.getFlagPriceList().entrySet()) {
|
||||
@@ -34,8 +34,8 @@ public class ProtoConverter {
|
||||
|
||||
FlagPriceProto flagPriceProto = FlagPriceProto.newBuilder()
|
||||
.setFlag(PricingModelFlag.valueOf(flag.name())) // 枚举转换
|
||||
.setElec(flagPrice.getElec())
|
||||
.setServ(flagPrice.getServ())
|
||||
.setElec(flagPrice.getElec().toPlainString())
|
||||
.setServ(flagPrice.getServ().toPlainString())
|
||||
.build();
|
||||
|
||||
builder.putFlagPrice(flag.ordinal(), flagPriceProto); // 按 ordinal 值作为 key 存入
|
||||
|
||||
@@ -9,6 +9,7 @@ import sanbing.jcpp.proto.gen.ProtocolProto.PricingModelFlag;
|
||||
import sanbing.jcpp.proto.gen.ProtocolProto.PricingModelRule;
|
||||
import sanbing.jcpp.proto.gen.ProtocolProto.PricingModelType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -29,14 +30,14 @@ public class PricingModel {
|
||||
private PricingModelRule rule;
|
||||
|
||||
/**
|
||||
* 标准电价(单位分)
|
||||
* 标准电价(单位元)
|
||||
*/
|
||||
private int standardElec;
|
||||
private BigDecimal standardElec;
|
||||
|
||||
/**
|
||||
* 标准服务费(单位分)
|
||||
* 标准服务费(单位元)
|
||||
*/
|
||||
private int standardServ;
|
||||
private BigDecimal standardServ;
|
||||
|
||||
/**
|
||||
* 分时电价
|
||||
@@ -68,11 +69,11 @@ public class PricingModel {
|
||||
@NoArgsConstructor
|
||||
public static class FlagPrice {
|
||||
|
||||
// 分时电价,单位分
|
||||
private int elec;
|
||||
// 分时电价,单位元
|
||||
private BigDecimal elec;
|
||||
|
||||
// 分时服务费,单位分
|
||||
private int serv;
|
||||
// 分时服务费,单位元
|
||||
private BigDecimal serv;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user