mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-29 07:25:05 +08:00
计算启动金额
This commit is contained in:
@@ -3049,12 +3049,27 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
if (billingTemplateVO != null) {
|
||||
pileRemoteService.publishPileBillingTemplate(pileSn, billingTemplateVO);
|
||||
}
|
||||
// 获取启动金额
|
||||
BigDecimal chargeAmount = computeChargeAmount(orderInfo.getMerchantId(), orderInfo.getStationId(), orderInfo.getMemberId(), orderInfo.getPayAmount());
|
||||
// 发送启动指令
|
||||
pileRemoteService.remoteStartCharging(pileSn, orderInfo.getConnectorCode(), orderInfo.getTransactionCode(), orderInfo.getPayAmount());
|
||||
pileRemoteService.remoteStartCharging(pileSn, orderInfo.getConnectorCode(), orderInfo.getTransactionCode(), chargeAmount);
|
||||
logger.info("订单:{}支付成功, 发送启动指令", dto.getOrderCode());
|
||||
}
|
||||
}
|
||||
|
||||
// 计算启动金额
|
||||
private BigDecimal computeChargeAmount(String merchantId, String stationId, String memberId, BigDecimal payAmount) {
|
||||
// 默认折扣100%
|
||||
BigDecimal discount = BigDecimal.ONE;
|
||||
|
||||
// TODO 如果member享受会员价,则获取到该会员在此站点的折扣
|
||||
|
||||
// 启动金额 = 支付金额 ➗ 折扣 保留两位小数
|
||||
BigDecimal chargeAmount = payAmount.divide(discount, 2, RoundingMode.DOWN);
|
||||
|
||||
return chargeAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单推款记录
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user