update 优化计算订单日报

This commit is contained in:
2023-07-14 11:38:37 +08:00
parent 000d62a1c9
commit db34c09a05
3 changed files with 25 additions and 6 deletions

View File

@@ -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()));
// 结算金额

View File

@@ -123,6 +123,11 @@ public class OrderListVO {
@Excel(name = "支付状态", dictType = "pay_status")
private String payStatus;
/**
* 支付时间
*/
private String payTime;
/**
* 起始soc
*/