|
@@ -634,6 +634,15 @@ public class DeliveryItemsServiceImpl extends ServiceImpl<DeliveryItemsMapper, D
|
|
|
// 应收费用金额
|
|
// 应收费用金额
|
|
|
BigDecimal ar = deliveryFeesList.stream().filter(e -> e.getFeesType() == 1).reduce(BigDecimal.ZERO, (x, y) -> x.add(y.getAmount()), BigDecimal::add);
|
|
BigDecimal ar = deliveryFeesList.stream().filter(e -> e.getFeesType() == 1).reduce(BigDecimal.ZERO, (x, y) -> x.add(y.getAmount()), BigDecimal::add);
|
|
|
gathering = gathering.subtract(ar);
|
|
gathering = gathering.subtract(ar);
|
|
|
|
|
+ // 返利
|
|
|
|
|
+ Order temp = new Order();
|
|
|
|
|
+ temp.setOrderNo(srcOrderNo);
|
|
|
|
|
+ Order order = orderDescClient.getByOrder(temp);
|
|
|
|
|
+ if (ObjectUtil.isEmpty(order)) {
|
|
|
|
|
+ throw new RuntimeException("获取原订单返利失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ BigDecimal usedProfit = order.getThisUsedProfit();
|
|
|
|
|
+ gathering = gathering.add(usedProfit);
|
|
|
|
|
|
|
|
// 原来的判断 条件 : if (gathering.subtract(newDelivery.add(oldDelivery)).compareTo(BigDecimal.ZERO) <= 0){
|
|
// 原来的判断 条件 : if (gathering.subtract(newDelivery.add(oldDelivery)).compareTo(BigDecimal.ZERO) <= 0){
|
|
|
if (gathering.subtract(newDelivery.add(oldDelivery)).compareTo(BigDecimal.ZERO) < 0) {
|
|
if (gathering.subtract(newDelivery.add(oldDelivery)).compareTo(BigDecimal.ZERO) < 0) {
|