【代码优化】商城:完善满减送的计算逻辑

This commit is contained in:
YunaiV 2024-09-15 20:27:46 +08:00
parent 222aa33f3e
commit 190c75f4ac
3 changed files with 7 additions and 2 deletions

View File

@ -234,7 +234,7 @@ public class RewardActivityServiceImpl implements RewardActivityService {
activityDTO.getRules().forEach(rule -> {
String description = "";
if (PromotionConditionTypeEnum.PRICE.getType().equals(activityDTO.getConditionType())) {
description += StrUtil.format("满 {} 元", rule.getLimit());
description += StrUtil.format("满 {} 元", MoneyUtils.fenToYuanStr(rule.getLimit()));
} else {
description += StrUtil.format("满 {} 件", rule.getLimit());
}

View File

@ -62,3 +62,8 @@ tenant-id: {{appTenentId}}
GET {{appApi}}/trade/order/get-express-track-list?id=70
Authorization: Bearer {{appToken}}
tenant-id: {{appTenentId}}
### /trade-order/settlement-product 获得商品结算信息
GET {{appApi}}/trade/order/settlement-product?spuIds=633
Authorization: Bearer {{appToken}}
tenant-id: {{appTenentId}}

View File

@ -125,7 +125,7 @@ public class TradePriceServiceImpl implements TradePriceService {
TradePriceCalculateRespBO.OrderItem orderItem = new TradePriceCalculateRespBO.OrderItem()
.setPayPrice(sku.getPrice()).setCount(1);
// 计算限时折扣的优惠价格
DiscountProductRespDTO discountProduct = skuIdAndDiscountMap.get(orderItem.getSkuId());
DiscountProductRespDTO discountProduct = skuIdAndDiscountMap.get(sku.getId());
Integer discountPrice = discountActivityPriceCalculator.calculateActivityPrice(discountProduct, orderItem);
// 计算 VIP 优惠金额
Integer vipPrice = discountActivityPriceCalculator.calculateVipPrice(level, orderItem);