mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 优化计算订单日报
This commit is contained in:
@@ -2086,24 +2086,37 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
BigDecimal totalVirtualAmount = BigDecimal.ZERO;
|
||||
BigDecimal totalSettleAmount = BigDecimal.ZERO;
|
||||
for (OrderListVO vo : orderListVOS) {
|
||||
BigDecimal chargingDegree = new BigDecimal(vo.getChargingDegree());
|
||||
// 统计orderAmount大于0的
|
||||
String orderAmount = vo.getOrderAmount();
|
||||
if (StringUtils.isBlank(orderAmount)) {
|
||||
// 没有订单消费金额,不统计
|
||||
continue;
|
||||
}
|
||||
// 用电度数
|
||||
BigDecimal chargingDegree = StringUtils.isBlank(vo.getChargingDegree())
|
||||
? BigDecimal.ZERO
|
||||
: new BigDecimal(vo.getChargingDegree());
|
||||
if (chargingDegree.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
// 只统计用电量大于0的
|
||||
continue;
|
||||
}
|
||||
// 充电度数
|
||||
// 充电度数累计
|
||||
useElectricity = useElectricity.add(chargingDegree);
|
||||
// 充电次数
|
||||
chargeNum += 1;
|
||||
// 充电时间
|
||||
long l = DateUtils.intervalTime(vo.getChargeStartTime(), vo.getChargeEndTime());
|
||||
chargeTime += l;
|
||||
|
||||
// 充电时间累计
|
||||
if (StringUtils.isNotBlank(vo.getChargeStartTime()) && StringUtils.isNotBlank(vo.getChargeEndTime())) {
|
||||
long l = DateUtils.intervalTime(vo.getChargeStartTime(), vo.getChargeEndTime());
|
||||
chargeTime += l;
|
||||
}
|
||||
|
||||
// 电费金额
|
||||
totalElectricityAmount = totalElectricityAmount.add(vo.getTotalElectricityAmount());
|
||||
// 服务费金额
|
||||
totalServiceAmount = totalServiceAmount.add(vo.getTotalServiceAmount());
|
||||
// 订单金额
|
||||
totalOrderAmount = totalOrderAmount.add(new BigDecimal(vo.getOrderAmount()));
|
||||
totalOrderAmount = totalOrderAmount.add(new BigDecimal(orderAmount));
|
||||
// 虚拟金额
|
||||
totalVirtualAmount = totalVirtualAmount.add(new BigDecimal(vo.getVirtualAmount()));
|
||||
// 结算金额
|
||||
|
||||
@@ -123,6 +123,11 @@ public class OrderListVO {
|
||||
@Excel(name = "支付状态", dictType = "pay_status")
|
||||
private String payStatus;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private String payTime;
|
||||
|
||||
/**
|
||||
* 起始soc
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user