ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/vo/ChargingOrderVO.java
@@ -46,8 +46,18 @@ private Boolean authRecord = true; @ApiModelProperty(value = "刷卡开卡号") private String cardNo; @ApiModelProperty(value = "时段数") private Integer count; @ApiModelProperty(value = "充电结束原因") private Integer endMode; @ApiModelProperty(value = "充电电流") private BigDecimal chargeCurrent; @ApiModelProperty(value = "充电电压") private BigDecimal chargeVoltage; @ApiModelProperty(value = "实时功率") private BigDecimal chargePower; @ApiModelProperty(value = "1明星充电 2快电 3新电途") private Integer orderSource; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/export/CardChargingOrderExport.java
@@ -16,14 +16,8 @@ @Excel(name = "订单编号", width = 26) private String code; @Excel(name = "充电卡号", width = 20) @Excel(name = "刷卡开卡号", width = 20) private String cardNo; @Excel(name = "状态", width = 16, replace = {"未知_0", "等待中/已插枪_1", "启动中_2", "充电中_3", "停止中_4", "已结束_5"}) private Integer status; @Excel(name = "订单分类", width = 12) private Integer orderClassification; @Excel(name = "站点名称", width = 24) private String siteName; @@ -31,17 +25,20 @@ @Excel(name = "充电终端名称", width = 24) private String terminalName; @Excel(name = "站点ID", width = 12) private Integer siteId; @Excel(name = "状态", width = 16, replace = {"未知_0", "等待中/已插枪_1", "启动中_2", "充电中_3", "停止中_4", "已结束_5"}) private Integer status; @Excel(name = "充电桩ID", width = 12) private Integer chargingPileId; @Excel(name = "充电枪ID", width = 12) private Integer chargingGunId; @Excel(name = "充电时长(秒)", width = 14) @Excel(name = "充电时长(秒)", width = 16) private Long chargingSecond; @Excel(name = "实付", width = 12, numFormat = "0.00") private BigDecimal paymentAmount; @Excel(name = "平台收入", width = 12, numFormat = "0.00") private BigDecimal platformIncome; @Excel(name = "合作商收入", width = 12, numFormat = "0.00") private BigDecimal partnerIncome; @Excel(name = "开始时间", width = 22) private String startTime; @@ -49,24 +46,27 @@ @Excel(name = "最后时间", width = 22) private String endTime; @Excel(name = "充电量", width = 12) @Excel(name = "累计充电量", width = 14, numFormat = "0.0000") private BigDecimal chargingCapacity; @Excel(name = "电费", width = 12) @Excel(name = "累计电费", width = 14, numFormat = "0.0000") private BigDecimal electrovalence; @Excel(name = "服务费", width = 12) @Excel(name = "累计服务费", width = 14, numFormat = "0.0000") private BigDecimal serviceCharge; @Excel(name = "订单金额", width = 12) private BigDecimal orderAmount; @Excel(name = "结束原因", width = 16, replace = {"异常终止_0", "主动终止_1", "满电终止_2", "费用不足终止_3"}) private Integer endMode; @Excel(name = "实付", width = 12) private BigDecimal paymentAmount; @Excel(name = "时段数", width = 12) private Integer count; @Excel(name = "平台收入", width = 12) private BigDecimal platformIncome; @Excel(name = "充电电流", width = 12, numFormat = "0.0") private BigDecimal chargeCurrent; @Excel(name = "合作商收入", width = 12) private BigDecimal partnerIncome; @Excel(name = "充电电压", width = 12, numFormat = "0.0") private BigDecimal chargeVoltage; @Excel(name = "实时功率", width = 12, numFormat = "0.0") private BigDecimal chargePower; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TCardChargingOrderServiceImpl.java
@@ -14,6 +14,8 @@ import com.ruoyi.order.mapper.TCardChargingOrderMapper; import com.ruoyi.order.service.TCardChargingOrderService; import com.ruoyi.chargingPile.api.model.Site; import com.ruoyi.integration.api.model.UploadRealTimeMonitoringData; import com.ruoyi.order.util.mongodb.service.UploadRealTimeMonitoringDataService; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -40,6 +42,8 @@ private ChargingPileClient chargingPileClient; @Resource private ChargingGunClient chargingGunClient; @Resource private UploadRealTimeMonitoringDataService uploadRealTimeMonitoringDataService; @Override public PageInfo<ChargingOrderVO> pageList(CardChargingOrderQuery query) { @@ -139,6 +143,12 @@ if (item.getStartTime() != null && item.getEndTime() != null) { item.setChargingSecond(ChronoUnit.SECONDS.between(item.getStartTime(), item.getEndTime())); } UploadRealTimeMonitoringData monitoringData = uploadRealTimeMonitoringDataService.getLastDataById(item.getCode()); if (monitoringData != null) { item.setChargeCurrent(monitoringData.getOutput_current()); item.setChargeVoltage(monitoringData.getOutput_voltage()); item.setChargePower(monitoringData.getPower()); } item.setPlatformIncome(BigDecimal.ZERO); item.setPartnerIncome(BigDecimal.ZERO); } ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TCardChargingOrderMapper.xml
@@ -55,7 +55,7 @@ <select id="summary" resultType="java.util.LinkedHashMap"> SELECT COUNT(1) AS orderCount, IFNULL(SUM(o.charging_capacity), 0) AS total, IFNULL(SUM(TIMESTAMPDIFF(SECOND, o.start_time, o.end_time)), 0) AS time, IFNULL(SUM(UNIX_TIMESTAMP(o.end_time) - UNIX_TIMESTAMP(o.start_time)), 0) AS time, IFNULL(SUM(o.electrovalence), 0) AS electronicMoney, IFNULL(SUM(o.service_charge), 0) AS serviceMoney, IFNULL(SUM(o.electrovalence), 0) + IFNULL(SUM(o.service_charge), 0) AS income,