|
|
@@ -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())));
|
|
|
}
|