wangming 16 시간 전
부모
커밋
2f13f223c2

+ 0 - 3
yami-shop-api/src/main/java/com/yami/shop/api/controller/OrderRefundController.java

@@ -680,13 +680,10 @@ public class OrderRefundController {
     public ResponseEntity<ApiOrderRefundDto> info(String refundSn) {
         // 查询详情
         OrderRefundDto orderRefundDto = orderRefundService.getOrderRefundByRefundSn(refundSn);
-
         if (orderRefundDto == null) {
             throw new GlobalException("查看失败 该退款订单不存在");
         }
-
         ApiOrderRefundDto apiOrderRefundDto = mapperFacade.map(orderRefundDto, ApiOrderRefundDto.class);
-
         return ResponseEntity.ok(apiOrderRefundDto);
     }
 

+ 3 - 1
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderRefundServiceImpl.java

@@ -42,6 +42,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
 import java.util.*;
 
 import static com.yami.shop.common.util.HttpUtil.post;
@@ -309,7 +310,8 @@ public class OrderRefundServiceImpl extends ServiceImpl<OrderRefundMapper, Order
             orderRefundDto.setGoodsTotal(item.stream().map(OrderItem::getGoodsTotal).reduce(0.0, Double::sum));
             if (oldSum == newSum) {
                 //代表全部退,所以需要增加运费显示
-                orderRefundDto.setGoodsTotal(orderRefundDto.getGoodsTotal() + orderRefundDto.getFreightAmount());
+                double goodsTotal = Arith.add(BigDecimal.valueOf(orderRefundDto.getGoodsTotal()), BigDecimal.valueOf(orderRefundDto.getFreightAmount()));
+                orderRefundDto.setGoodsTotal(goodsTotal);
             }
             item.forEach(c-> c.setRefundCount(orderItemService.refundCount(c.getOrderItemId())));
         }