云快充1.5.0 金额单位修正为元

This commit is contained in:
三丙
2024-10-08 16:56:29 +08:00
committed by 三丙
parent b5370cee6c
commit 791039fabd
13 changed files with 74 additions and 75 deletions

View File

@@ -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 存入

View File

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

View File

@@ -96,8 +96,8 @@ message QueryPricingResponse {
message PricingModelProto {
PricingModelType type = 3;
PricingModelRule rule = 4;
int32 standardElec = 5;
int32 standardServ = 6;
string standardElec = 5;
string standardServ = 6;
map<int32, FlagPriceProto> flagPrice = 8;
repeated PeriodProto period = 9;
}
@@ -111,8 +111,8 @@ message PeriodProto {
message FlagPriceProto {
PricingModelFlag flag = 1;
int32 elec = 2;
int32 serv = 3;
string elec = 2;
string serv = 3;
}
enum PricingModelType {
@@ -160,12 +160,12 @@ message ChargingProgressProto {
string pileCode = 4;
string gunCode = 5;
string tradeNo = 6;
float outputVoltage = 7;
float outputCurrent = 8;
float soc = 9;
string outputVoltage = 7;
string outputCurrent = 8;
int32 soc = 9;
int32 totalChargingDurationMin = 10;
float totalChargingEnergyKWh = 11;
int64 totalChargingCostCent = 12;
string totalChargingEnergyKWh = 11;
string totalChargingCostYuan = 12;
optional string additionalInfo = 20;
}
@@ -185,7 +185,7 @@ message RemoteStartChargingRequest {
string pileCode = 4;
string gunCode = 5;
string tradeNo = 6;
int32 limitCent = 7;
int32 limitYuan = 7;
optional string additionalInfo = 20;
}
@@ -219,18 +219,18 @@ message TransactionRecord {
string tradeNo = 6;
int64 startTs = 51;
int64 endTs = 52;
float topEnergyKWh = 53;
int64 topAmountCent = 54;
float peakEnergyKWh = 55;
int64 peakAmountCent = 56;
float flatEnergyKWh = 57;
int64 flatAmountCent = 58;
float valleyEnergyKWh = 59;
int64 valleyAmountCent = 60;
float deepEnergyKWh = 61;
int64 deepAmountCent = 62;
float totalEnergyKWh = 63;
int64 totalAmountCent = 64;
string topEnergyKWh = 53;
string topAmountYuan = 54;
string peakEnergyKWh = 55;
string peakAmountYuan = 56;
string flatEnergyKWh = 57;
string flatAmountYuan = 58;
string valleyEnergyKWh = 59;
string valleyAmountYuan = 60;
string deepEnergyKWh = 61;
string deepAmountYuan = 62;
string totalEnergyKWh = 63;
string totalAmountYuan = 64;
int64 tradeTs = 65;
string stopReason = 66;
optional string additionalInfo = 20;