Commit d844f06f5c2fb305a28c117f1a0721123426b937
1 parent
67426d72
fix(trade): 修复订单项价格计算逻辑,分摊比例修改成用子订单支付金额来计算
Showing
3 changed files
with
3 additions
and
3 deletions
yudao-module-mall/yudao-module-trade/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/aftersale/AfterSaleLogMapper.java
| ... | ... | @@ -13,7 +13,7 @@ public interface AfterSaleLogMapper extends BaseMapperX<AfterSaleLogDO> { |
| 13 | 13 | default List<AfterSaleLogDO> selectListByAfterSaleId(Long afterSaleId) { |
| 14 | 14 | return selectList(new LambdaQueryWrapper<AfterSaleLogDO>() |
| 15 | 15 | .eq(AfterSaleLogDO::getAfterSaleId, afterSaleId) |
| 16 | - .orderByDesc(AfterSaleLogDO::getCreateTime)); | |
| 16 | + .orderByDesc(AfterSaleLogDO::getId)); | |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | } | ... | ... |
yudao-module-mall/yudao-module-trade/src/main/java/cn/iocoder/yudao/module/trade/framework/aftersale/core/aop/AfterSaleLogAspect.java
| ... | ... | @@ -79,7 +79,7 @@ public class AfterSaleLogAspect { |
| 79 | 79 | Integer beforeStatus = BEFORE_STATUS.get(); |
| 80 | 80 | Integer afterStatus = AFTER_STATUS.get(); |
| 81 | 81 | Map<String, Object> exts = ObjectUtil.defaultIfNull(EXTS.get(), emptyMap()); |
| 82 | - String content = StrUtil.format(afterSaleLog.operateType().getContent(), exts); | |
| 82 | + String content = StrUtil.format(operateType.getContent(), exts); | |
| 83 | 83 | |
| 84 | 84 | // 2. 记录日志 |
| 85 | 85 | AfterSaleLogCreateReqBO createBO = new AfterSaleLogCreateReqBO() | ... | ... |
yudao-module-mall/yudao-module-trade/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradePriceCalculatorHelper.java
| ... | ... | @@ -258,7 +258,7 @@ public class TradePriceCalculatorHelper { |
| 258 | 258 | TradeOrderItemDO orderItem = items.get(i); |
| 259 | 259 | int partPrice; |
| 260 | 260 | if (i < items.size() - 1) { // 减一的原因,是因为拆分时,如果按照比例,可能会出现.所以最后一个,使用反减 |
| 261 | - partPrice = (int) (price * (1.0D * orderItem.getPrice() / total)); | |
| 261 | + partPrice = (int) (price * (1.0D * orderItem.getPayPrice() / total)); | |
| 262 | 262 | remainPrice -= partPrice; |
| 263 | 263 | } else { |
| 264 | 264 | partPrice = remainPrice; | ... | ... |