Quellcode durchsuchen

feat(export): 新增充电订单和用户支付订单导出DTO

- 创建ChargeOrderInfoExportDTO类,支持充电订单信息导出
- 创建UserOrderInfoExportDTO类,支持用户支付订单信息导出
- 使用Excel相关注解定义导出字段与格式
- 添加订单号、手机号、金额、状态等多种导出属性
- 支持时间格式化和列宽统一配置
wzq vor 3 Wochen
Ursprung
Commit
2a4904a8a9

+ 93 - 0
src/main/java/com/zsElectric/boot/business/model/dto/ChargeOrderInfoExportDTO.java

@@ -0,0 +1,93 @@
+package com.zsElectric.boot.business.model.dto;
+
+import cn.idev.excel.annotation.ExcelProperty;
+import cn.idev.excel.annotation.format.DateTimeFormat;
+import cn.idev.excel.annotation.write.style.ColumnWidth;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 充电订单信息导出DTO
+ *
+ * @author zsElectric
+ * @since 2025-01-07
+ */
+@Data
+@ColumnWidth(20)
+public class ChargeOrderInfoExportDTO {
+
+    @ExcelProperty(value = "订单号")
+    private String chargeOrderNo;
+
+    @ExcelProperty(value = "用户手机号")
+    private String phone;
+
+    @ExcelProperty(value = "订单类型")
+    private String orderTypeName;
+
+    @ExcelProperty(value = "充电站名称")
+    private String stationName;
+
+    @ExcelProperty(value = "充电设备接口名称")
+    private String connectorName;
+
+    @ExcelProperty(value = "充电桩编号")
+    private String equipmentId;
+
+    @ExcelProperty(value = "充电开始时间")
+    private String startTime;
+
+    @ExcelProperty(value = "充电结束时间")
+    private String endTime;
+
+    @ExcelProperty(value = "充电时长(秒)")
+    private Integer chargeTime;
+
+    @ExcelProperty(value = "订单状态")
+    private String statusName;
+
+    @ExcelProperty(value = "充电度数(kW/h)")
+    private BigDecimal totalCharge;
+
+    @ExcelProperty(value = "平台实际收取金额")
+    private BigDecimal realCost;
+
+    @ExcelProperty(value = "平台总服务费")
+    private BigDecimal realServiceCost;
+
+    @ExcelProperty(value = "第三方充电消费总额")
+    private BigDecimal thirdPartyTotalCost;
+
+    @ExcelProperty(value = "第三方充电服务费")
+    private BigDecimal thirdPartyServerfee;
+
+    @ExcelProperty(value = "第三方充电金额")
+    private BigDecimal thirdPartyElecfee;
+
+    @ExcelProperty(value = "预充值金额")
+    private BigDecimal preAmt;
+
+    @ExcelProperty(value = "优惠金额")
+    private BigDecimal discountMoney;
+
+    @ExcelProperty(value = "优惠描述")
+    private String discountDesc;
+
+    @ExcelProperty(value = "优惠券金额")
+    private BigDecimal couponPrice;
+
+    @ExcelProperty(value = "停止类型")
+    private String stopTypeName;
+
+    @ExcelProperty(value = "停止原因0:用户手动停止充电;1:客户归属地运营商平台停止充电;2:BMS停止充电;3:充电机设备故障;4:连接器断开;其它:自定义")
+    private String stopReason;
+
+    @ExcelProperty(value = "备注")
+    private String remark;
+
+    @ExcelProperty(value = "创建时间")
+    @DateTimeFormat("yyyy/MM/dd HH:mm:ss")
+    private LocalDateTime createTime;
+}

+ 62 - 0
src/main/java/com/zsElectric/boot/business/model/dto/UserOrderInfoExportDTO.java

@@ -0,0 +1,62 @@
+package com.zsElectric.boot.business.model.dto;
+
+import cn.idev.excel.annotation.ExcelProperty;
+import cn.idev.excel.annotation.format.DateTimeFormat;
+import cn.idev.excel.annotation.write.style.ColumnWidth;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 用户支付订单信息导出DTO
+ *
+ * @author zsElectric
+ * @since 2025-01-07
+ */
+@Data
+@ColumnWidth(20)
+public class UserOrderInfoExportDTO {
+
+    @ExcelProperty(value = "订单编号")
+    private String orderNo;
+
+    @ExcelProperty(value = "用户手机号")
+    private String phone;
+
+    @ExcelProperty(value = "订单金额")
+    private BigDecimal orderMoney;
+
+    @ExcelProperty(value = "订单剩余金额")
+    private BigDecimal lastMoney;
+
+    @ExcelProperty(value = "支付时间")
+    @DateTimeFormat("yyyy/MM/dd HH:mm:ss")
+    private LocalDateTime payTime;
+
+    @ExcelProperty(value = "订单状态")
+    private String orderStatusName;
+
+    @ExcelProperty(value = "订单类型")
+    private String orderTypeName;
+
+    @ExcelProperty(value = "第三方支付单号")
+    private String outTradeNo;
+
+    @ExcelProperty(value = "微信支付流水号")
+    private String transactionId;
+
+    @ExcelProperty(value = "退款金额")
+    private BigDecimal refundMoney;
+
+    @ExcelProperty(value = "退款时间")
+    @DateTimeFormat("yyyy/MM/dd HH:mm:ss")
+    private LocalDateTime refundTime;
+
+    @ExcelProperty(value = "备注")
+    private String remark;
+
+    @ExcelProperty(value = "创建时间")
+    @DateTimeFormat("yyyy/MM/dd HH:mm:ss")
+    private LocalDateTime createTime;
+}