Browse Source

feat(charging): 新增充电订单相关VO类

- 新增充电订单状态详情响应VO类 ChargeOrderDetailVO
- 新增充电订单状态响应VO类 ChargeOrderStatusVO
- 新增充电桩价格策略响应VO类 ChargingPricePolicyVO- 新增设备认证响应VO类 EquipmentAuthResponseVO- 新增充电订单停止响应VO类 StopChargeResponseVO
- 在 ConnectivityConstants 中添加充电相关请求URL常量
SheepHy 4 weeks ago
parent
commit
3c6ec6c0fa

+ 104 - 0
src/main/java/com/zsElectric/boot/charging/vo/ChargeOrderDetailVO.java

@@ -0,0 +1,104 @@
+package com.zsElectric.boot.charging.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+@Accessors(chain = true)
+@Schema(description = "充电订单状态详情响应VO")
+public class ChargeOrderDetailVO {
+
+    @Schema(description = "订单状态(1-启动中,2-启动成功,3-启动失败,4-结束)",
+            example = "2")
+    private Integer startChargeSeqStat;
+
+    @Schema(description = "充电订单号(格式:运营商ID+唯一编号)",
+            example = "123456789201712121131011234")
+    private String startChargeSeq;
+
+    @Schema(description = "充电设备接口编码",
+            example = "3702120244401_1")
+    private String connectorID;
+
+    @Schema(description = "设备接口状态(0-离网,1-空闲,2-占用(未充电),3-占用(充电中),4-占用(预约锁定),255-故障)",
+            example = "3")
+    private Integer connectorStatus;
+
+    @Schema(description = "A相电流", example = "78.1")
+    private BigDecimal currentA;
+
+    @Schema(description = "B相电流", example = "0.0")
+    private BigDecimal currentB;
+
+    @Schema(description = "C相电流", example = "0.0")
+    private BigDecimal currentC;
+
+    @Schema(description = "A相电压", example = "575.3")
+    private BigDecimal voltageA;
+
+    @Schema(description = "B相电压", example = "0.0")
+    private BigDecimal voltageB;
+
+    @Schema(description = "C相电压", example = "0.0")
+    private BigDecimal voltageC;
+
+    @Schema(description = "电池SOC(剩余电量百分比)", example = "5.0")
+    private BigDecimal soc;
+
+    @Schema(description = "充电开始时间", example = "2018-02-06 16:54:38")
+    private String startTime;
+
+    @Schema(description = "充电结束时间", example = "2018-02-06 17:25:00")
+    private String endTime;
+
+    @Schema(description = "累计充电电量(单位:kWh)", example = "3.5438")
+    private BigDecimal totalPower;
+
+    @Schema(description = "电费(单位:元)", example = "4.956")
+    private BigDecimal elecMoney;
+
+    @Schema(description = "服务费(单位:元)", example = "0.0")
+    private BigDecimal serviceMoney;
+
+    @Schema(description = "总金额(单位:元)", example = "4.956")
+    private BigDecimal totalMoney;
+
+    @Schema(description = "总时段数", example = "1")
+    private Integer sumPeriod;
+
+    @Schema(description = "充电明细列表")
+    private List<ChargeDetail> chargeDetails;
+
+    @Data
+    @Accessors(chain = true)
+    @Schema(description = "充电明细信息")
+    public static class ChargeDetail {
+
+        @Schema(description = "开始时间(yyyy-MM-dd HH:mm:ss格式)",
+                example = "2018-02-06 16:54:38")
+        private String detailStartTime;
+
+        @Schema(description = "结束时间(yyyy-MM-dd HH:mm:ss格式)",
+                example = "2018-02-06 17:25:00")
+        private String detailEndTime;
+
+        @Schema(description = "时段电价(小数点后2位)", example = "0.70")
+        private BigDecimal elecPrice;
+
+        @Schema(description = "时段服务费价格(小数点后2位)", example = "0.30")
+        private BigDecimal servicePrice;
+
+        @Schema(description = "时段充电量(单位:度,小数点后2位)", example = "3.54")
+        private BigDecimal detailPower;
+
+        @Schema(description = "时段电费(小数点后2位)", example = "2.48")
+        private BigDecimal detailElecMoney;
+
+        @Schema(description = "时段服务费(小数点后2位)", example = "1.06")
+        private BigDecimal detailServiceMoney;
+    }
+}

+ 37 - 0
src/main/java/com/zsElectric/boot/charging/vo/ChargeOrderStatusVO.java

@@ -0,0 +1,37 @@
+package com.zsElectric.boot.charging.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+@Data
+@Accessors(chain = true)
+@Schema(description = "充电订单状态响应VO")
+public class ChargeOrderStatusVO {
+
+    @Schema(description = "充电订单号(格式:运营商ID+唯一编号)",
+            example = "123456789201805141125123456")
+    private String startChargeSeq;
+
+    @Schema(description = "充电订单状态(1-启动中,2-充电中,3-停止中,4-已结束,5-未知)",
+            example = "1",
+            allowableValues = {"1", "2", "3", "4", "5"})
+    private Integer startChargeSeqStat;
+
+    @Schema(description = "充电设备接口编码",
+            example = "3702120244402_1")
+    private String connectorID;
+
+    @Schema(description = "操作结果(0-成功,1-失败)",
+            example = "0",
+            allowableValues = {"0", "1"})
+    private Integer succStat;
+
+    @Schema(description = "失败原因(0-无,1-此设备不存在,2-此设备离线,其它-自定义)",
+            example = "0")
+    private Integer failReason;
+
+    @Schema(description = "失败原因描述",
+            example = "无错误")
+    private String failReasonMsg;
+}

+ 50 - 0
src/main/java/com/zsElectric/boot/charging/vo/ChargingPricePolicyVO.java

@@ -0,0 +1,50 @@
+package com.zsElectric.boot.charging.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+@Accessors(chain = true)
+@Schema(description = "充电桩价格策略响应VO")
+public class ChargingPricePolicyVO {
+
+    @Schema(description = "设备业务序列号", example = "123456789123456789123456789")
+    private String equipBizSeq;
+
+    @Schema(description = "充电桩ID", example = "TEST0000901_1")
+    private String connectorID;
+
+    @Schema(description = "成功状态(0-成功,1-失败)", example = "0")
+    private Integer succStat;
+
+    @Schema(description = "失败原因(0-无错误)", example = "0")
+    private Integer failReason;
+
+    @Schema(description = "总时段数", example = "3")
+    private Integer sumPeriod;
+
+    @Schema(description = "价格策略信息列表")
+    private List<PolicyInfo> policyInfos;
+
+    @Data
+    @Accessors(chain = true)
+    @Schema(description = "价格策略信息")
+    public static class PolicyInfo {
+
+        @Schema(description = "时段开始时间(HHmmss格式)", example = "000000")
+        private String startTime;
+
+        @Schema(description = "电价(元/度)", example = "0.7")
+        private BigDecimal elecPrice;
+
+        @Schema(description = "服务费(元/度)", example = "1.0")
+        private BigDecimal servicePrice;
+
+        @Schema(description = "时段标志(平台扩展字段,1-尖,2-峰,3-平,4-谷)", example = "1")
+        private Integer periodFlag;
+    }
+}

+ 32 - 0
src/main/java/com/zsElectric/boot/charging/vo/EquipmentAuthResponseVO.java

@@ -0,0 +1,32 @@
+package com.zsElectric.boot.charging.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+@Data
+@Accessors(chain = true)
+@Schema(description = "设备认证响应VO")
+public class EquipmentAuthResponseVO {
+
+    @Schema(description = "设备认证流水号(格式:运营商ID+唯一编号)",
+            example = "123456789201805071630123456")
+    private String equipAuthSeq;
+
+    @Schema(description = "充电设备接口编码",
+            example = "3702120244102_1")
+    private String connectorID;
+
+    @Schema(description = "操作结果(0-成功,1-失败)",
+            example = "0",
+            allowableValues = {"0", "1"})
+    private Integer succStat;
+
+    @Schema(description = "失败原因(0-无,1-此设备尚未插枪,2-设备检测失败,其它-自定义)",
+            example = "0")
+    private Integer failReason;
+
+    @Schema(description = "失败原因描述",
+            example = "无错误")
+    private String failReasonMsg;
+}

+ 24 - 0
src/main/java/com/zsElectric/boot/charging/vo/StopChargeResponseVO.java

@@ -0,0 +1,24 @@
+package com.zsElectric.boot.charging.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+@Data
+@Accessors(chain = true)
+@Schema(description = "充电订单停止响应VO")
+public class StopChargeResponseVO {
+
+    @Schema(description = "充电订单号(格式:运营商ID+唯一编号)",
+            example = "123456789201805141125123456")
+    private String startChargeSeq;
+
+    @Schema(description = "操作结果(0:成功;1:失败)",
+            example = "0",
+            allowableValues = {"0", "1"})
+    private Integer succStat;
+
+    @Schema(description = "失败原因(0:无;1:接收失败)",
+            example = "0")
+    private Integer failReason;
+}

+ 56 - 0
src/main/java/com/zsElectric/boot/common/constant/ConnectivityConstants.java

@@ -32,4 +32,60 @@ public interface ConnectivityConstants {
      * 数据密钥向量
      */
     String DATA_SECRET_IV = "TQc8akFtf7bpdEuO";
+
+    /*------------------------------------------请求URL-----------------------------------------------*/
+
+    /**
+     * 平台测试域名
+     * */
+    String TEST_DOMAIN = "https://parking-test.gyzhtc.com/energy-interconnection/evcs/v1.1/1/MA6DP6BE7/";
+
+    /**
+     * 查询业务策略信息
+     * */
+    String QUERY_EQUIP_BUSINESS_POLICY = "/evcs/v1/query_equip_business_policy";
+
+    /**
+     * 请求设备认证
+     * */
+    String QUERY_EQUIP_AUTH = "/evcs/v1/query_equip_auth";
+
+    /**
+     * 请求启动充电
+     * */
+    String QUERY_START_CHARGE = "/evcs/v1/query_start_charge";
+
+    /**
+     * 推送启动充电结果
+     * */
+    String NOTIFICATION_START_CHARGE_RESULT = "/evcs/v1/notification_start_charge_result";
+
+    /**
+     * 查询充电状态
+     * */
+    String QUERY_EQUIP_CHARGE_STATUS = "/evcs/v1/query_equip_charge_status";
+
+    /**
+     * 推送充电状态
+     * */
+    String NOTIFICATION_EQUIP_CHARGE_STATUS = "/evcs/v1/notification_equip_charge_status";
+
+    /**
+     * 请求停止充电
+     * */
+    String QUERY_STOP_CHARGE = "/evcs/v1/query_stop_charge";
+
+    /**
+     * 推送停止充电结果
+     * */
+    String NOTIFICATION_STOP_CHARGE_RESULT = "/evcs/v1/notification_stop_charge_result";
+
+    /**
+     * 推送充电订单信息
+     * */
+    String NOTIFICATION_CHARGE_ORDER_INFO = "/evcs/v1/notification_charge_order_info";
+
+
+
+    /*------------------------------------------请求URL-----------------------------------------------*/
 }