|
|
@@ -84,10 +84,10 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
|
|
|
.toList();
|
|
|
|
|
|
// 校验开票金额大于0
|
|
|
- var totalMoney = orders.stream().mapToInt(ChargeOrder::getTotalMoney).sum();
|
|
|
+ var totalPayAmount = orders.stream().mapToInt(ChargeOrder::getPayAmount).sum();
|
|
|
var elecMoney = orders.stream().mapToInt(ChargeOrder::getElecMoney).sum();
|
|
|
var serviceMoney = orders.stream().mapToInt(ChargeOrder::getServiceMoney).sum();
|
|
|
- if (!(totalMoney > 0 && elecMoney > 0 && serviceMoney > 0)) {
|
|
|
+ if (!(totalPayAmount > 0 && elecMoney > 0 && serviceMoney > 0)) {
|
|
|
throw new BusinessException("订单总金额或总电费或总服务费金额异常");
|
|
|
}
|
|
|
// 组装invoice
|
|
|
@@ -96,7 +96,7 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
|
|
|
.setOpenid(StpUtil.getSession().getString("openid"))
|
|
|
.setApplyId(OrderUtils.getOrderNo())
|
|
|
.setOrderDetails(orderDetails) // 订单信息
|
|
|
- .setInvoiceAmount(totalMoney) // 总金额
|
|
|
+ .setInvoiceAmount(totalPayAmount) // 总金额
|
|
|
.setElecMoney(elecMoney) // 电费
|
|
|
.setElecMoney(serviceMoney) // 服务费
|
|
|
.setTotalPower(orders.stream().mapToDouble(ChargeOrder::getTotalPower).sum()) // 总电量
|