mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 11:49:49 +08:00
打印日志
This commit is contained in:
@@ -727,7 +727,7 @@ public class TempController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单折扣接口
|
* 查询订单折扣接口
|
||||||
* http://localhost:8080/order/queryOrderDiscount
|
* http://localhost:8080/temp/queryOrderDiscount
|
||||||
*/
|
*/
|
||||||
@PostMapping("/queryOrderDiscount")
|
@PostMapping("/queryOrderDiscount")
|
||||||
public RestApiResponse<?> queryOrderDiscount(@RequestBody QueryOrderDTO dto) {
|
public RestApiResponse<?> queryOrderDiscount(@RequestBody QueryOrderDTO dto) {
|
||||||
|
|||||||
@@ -728,13 +728,14 @@ public class TempService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void calculateOrderDiscountsV2(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail) {
|
public void calculateOrderDiscountsV2(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail) {
|
||||||
|
String orderCode = orderBasicInfo.getOrderCode();
|
||||||
|
String transactionCode = orderBasicInfo.getTransactionCode();
|
||||||
String memberId = orderBasicInfo.getMemberId(); // 会员id
|
String memberId = orderBasicInfo.getMemberId(); // 会员id
|
||||||
String stationId = orderBasicInfo.getStationId(); // 站点id
|
String stationId = orderBasicInfo.getStationId(); // 站点id
|
||||||
String merchantId = orderBasicInfo.getMerchantId(); // 运营商id
|
String merchantId = orderBasicInfo.getMerchantId(); // 运营商id
|
||||||
|
|
||||||
if (orderDetail == null) {
|
if (orderDetail == null) {
|
||||||
logger.info("计算订单折扣V2, OrderDetail为空(orderCode:{}, transactionCode:{}), 直接返回!",
|
logger.info("计算订单折扣V2, OrderDetail为空(orderCode:{}, transactionCode:{}), 直接返回!", orderCode, transactionCode);
|
||||||
orderBasicInfo.getOrderCode(), orderBasicInfo.getTransactionCode());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -742,6 +743,7 @@ public class TempService {
|
|||||||
BigDecimal originalTotalElectricityAmount = orderDetail.getTotalElectricityAmount();
|
BigDecimal originalTotalElectricityAmount = orderDetail.getTotalElectricityAmount();
|
||||||
// 原始服务费金额
|
// 原始服务费金额
|
||||||
BigDecimal originalTotalServiceAmount = orderDetail.getTotalServiceAmount();
|
BigDecimal originalTotalServiceAmount = orderDetail.getTotalServiceAmount();
|
||||||
|
logger.info("计算订单折扣V2, orderCode:{}, 原始电费金额:{}, 原始服务费金额:{}", orderCode, originalTotalElectricityAmount, originalTotalServiceAmount);
|
||||||
// 电费折扣金额 初始值为0
|
// 电费折扣金额 初始值为0
|
||||||
BigDecimal electricityAmountDiscount = BigDecimal.ZERO;
|
BigDecimal electricityAmountDiscount = BigDecimal.ZERO;
|
||||||
// 服务费折扣金额 初始值为0
|
// 服务费折扣金额 初始值为0
|
||||||
@@ -779,6 +781,8 @@ public class TempService {
|
|||||||
// 汇总
|
// 汇总
|
||||||
afterDiscountElectricityAmount = afterDiscountElectricityAmount.add(sharpElectricityAmount);
|
afterDiscountElectricityAmount = afterDiscountElectricityAmount.add(sharpElectricityAmount);
|
||||||
afterDiscountServiceAmount = afterDiscountServiceAmount.add(sharpServiceAmount);
|
afterDiscountServiceAmount = afterDiscountServiceAmount.add(sharpServiceAmount);
|
||||||
|
logger.info("计算订单折扣V2, orderCode:{}, 尖时段用电量:{}, 电费单价:{}, 电费金额:{}, 服务费单价:{}, 服务费金额:{}", sharpUsedElectricity, orderCode,
|
||||||
|
billingTemplateVO.getSharpElectricityPrice(), sharpElectricityAmount, billingTemplateVO.getSharpServicePrice(), sharpServiceAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 峰时段用电量
|
// 峰时段用电量
|
||||||
@@ -796,6 +800,8 @@ public class TempService {
|
|||||||
// 汇总
|
// 汇总
|
||||||
afterDiscountElectricityAmount = afterDiscountElectricityAmount.add(peakElectricityAmount);
|
afterDiscountElectricityAmount = afterDiscountElectricityAmount.add(peakElectricityAmount);
|
||||||
afterDiscountServiceAmount = afterDiscountServiceAmount.add(peakServiceAmount);
|
afterDiscountServiceAmount = afterDiscountServiceAmount.add(peakServiceAmount);
|
||||||
|
logger.info("计算订单折扣V2, orderCode:{}, 峰时段用电量:{}, 电费单价:{}, 电费金额:{}, 服务费单价:{}, 服务费金额:{}", peakUsedElectricity, orderCode,
|
||||||
|
billingTemplateVO.getPeakElectricityPrice(), peakElectricityAmount, billingTemplateVO.getPeakServicePrice(), peakServiceAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 平时段用电量
|
// 平时段用电量
|
||||||
@@ -813,6 +819,8 @@ public class TempService {
|
|||||||
// 汇总
|
// 汇总
|
||||||
afterDiscountElectricityAmount = afterDiscountElectricityAmount.add(flatElectricityAmount);
|
afterDiscountElectricityAmount = afterDiscountElectricityAmount.add(flatElectricityAmount);
|
||||||
afterDiscountServiceAmount = afterDiscountServiceAmount.add(flatServiceAmount);
|
afterDiscountServiceAmount = afterDiscountServiceAmount.add(flatServiceAmount);
|
||||||
|
logger.info("计算订单折扣V2, orderCode:{}, 平时段用电量:{}, 电费单价:{}, 电费金额:{}, 服务费单价:{}, 服务费金额:{}", flatUsedElectricity, orderCode,
|
||||||
|
billingTemplateVO.getFlatElectricityPrice(), flatElectricityAmount, billingTemplateVO.getFlatServicePrice(), flatServiceAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 谷时段用电量
|
// 谷时段用电量
|
||||||
@@ -830,6 +838,8 @@ public class TempService {
|
|||||||
// 汇总
|
// 汇总
|
||||||
afterDiscountElectricityAmount = afterDiscountElectricityAmount.add(valleyElectricityAmount);
|
afterDiscountElectricityAmount = afterDiscountElectricityAmount.add(valleyElectricityAmount);
|
||||||
afterDiscountServiceAmount = afterDiscountServiceAmount.add(valleyServiceAmount);
|
afterDiscountServiceAmount = afterDiscountServiceAmount.add(valleyServiceAmount);
|
||||||
|
logger.info("计算订单折扣V2, orderCode:{}, 谷时段用电量:{}, 电费单价:{}, 电费金额:{}, 服务费单价:{}, 服务费金额:{}", valleyUsedElectricity, orderCode,
|
||||||
|
billingTemplateVO.getValleyElectricityPrice(), valleyElectricityAmount, billingTemplateVO.getValleyServicePrice(), valleyServiceAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算优惠了多少钱
|
// 计算优惠了多少钱
|
||||||
@@ -865,7 +875,7 @@ public class TempService {
|
|||||||
// 服务费折扣金额(服务费便宜了多少钱)
|
// 服务费折扣金额(服务费便宜了多少钱)
|
||||||
orderDetail.setDiscountServiceAmount(serviceAmountDiscount);
|
orderDetail.setDiscountServiceAmount(serviceAmountDiscount);
|
||||||
logger.info("计算订单折扣, orderCode:{}, memberId:{}, 订单折扣金额:{}, 电费折扣金额:{}, 服务费折扣金额:{}, 优惠后总消费金额:{}",
|
logger.info("计算订单折扣, orderCode:{}, memberId:{}, 订单折扣金额:{}, 电费折扣金额:{}, 服务费折扣金额:{}, 优惠后总消费金额:{}",
|
||||||
orderBasicInfo.getOrderCode(), memberId, discountAmount, electricityAmountDiscount, serviceAmountDiscount, totalConsumeAmount);
|
orderCode, memberId, discountAmount, electricityAmountDiscount, serviceAmountDiscount, totalConsumeAmount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user