|
@@ -440,6 +440,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
AtomicDouble brokerage = new AtomicDouble(0);
|
|
|
// 需要支付金额
|
|
|
AtomicDouble needPayAmount = new AtomicDouble(0);
|
|
|
+ // 不包含店铺满减的子订单应付
|
|
|
+ AtomicDouble realNeedPay = new AtomicDouble(0);
|
|
|
// 商品总金额
|
|
|
AtomicDouble shopAmount = new AtomicDouble(0);
|
|
|
// 付供应商 商品费
|
|
@@ -767,6 +769,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
brokerage.set(MathUtil.add(brokerage.get(), product.getCmFee()).doubleValue());
|
|
|
// 需要支付金额 shouldPayFee +运费
|
|
|
needPayAmount.set(MathUtil.add(needPayAmount.get(), product.getShouldPayFee()).doubleValue());
|
|
|
+ // 设值
|
|
|
+ realNeedPay.set(needPayAmount.get());
|
|
|
// 统计 总金额 包括税费
|
|
|
shopProductFee.set(MathUtil.add(shopProductFee.get(), product.getTotalFee()).doubleValue());
|
|
|
// 统计子订单内可参与店铺促销的商品总金额
|
|
@@ -847,6 +851,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
shopOrder.setProductAmount(shopAmount.get());
|
|
|
// 需要支付金额 shouldPayFee +运费
|
|
|
shopOrder.setNeedPayAmount(needPayAmount.get());
|
|
|
+ // 设值
|
|
|
+ shopOrder.setRealNeedPay(realNeedPay.get());
|
|
|
// 付供应商 商品费=成本价*(购买数量 + 赠品数量)
|
|
|
shopOrder.setShopProductAmount(shopProductAmount.get());
|
|
|
// 付给供应商税费
|
|
@@ -1094,17 +1100,19 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
List<OrderShopPo> shops = submitMapper.findShops(productIdList);
|
|
|
log.info("线上供应商splitcode----------->"+shops.toString());
|
|
|
//子订单分多子订单,满减分摊到原子订单分开的子订单,无满减重算佣金/应付
|
|
|
- //重组订单
|
|
|
+// if (shops.size() != shopOrderList.size()) {
|
|
|
+ //重组订单
|
|
|
shopOrderList= findSplitShopOrder(orderProductList, shopOrderList, shops, orderParamBo);
|
|
|
log.info("赋值后的shop------------------》"+shopOrderList.toString());
|
|
|
+// }
|
|
|
//线上支付分摊优惠总和到子订单
|
|
|
//经理折扣+优惠券+满减 提交订单的时候无经理折扣
|
|
|
double allDiscount = MathUtil.add(couponAmount, promotionFullReduction.get()).doubleValue();
|
|
|
// 分摊优惠前总佣金
|
|
|
AtomicDouble oldBrokerage = new AtomicDouble(0);
|
|
|
- //超级会员价/复购价/阶梯价/促销活动冲突,只能生效一个,促销活动满减计入优惠分摊,子订单售价=NeedPayAmount+promotionFullReduction
|
|
|
+ //超级会员价/复购价/阶梯价/促销活动冲突,只能生效一个,促销活动满减计入优惠分摊,子订单售价=realNeedPay+promotionFullReduction
|
|
|
shopOrderList.forEach(orderShopPo -> {
|
|
|
- orderShopPo.setOldPrice(orderShopPo.getNeedPayAmount());
|
|
|
+ orderShopPo.setOldPrice(orderShopPo.getRealNeedPay());
|
|
|
orderShopPo.setOldBrokerage(orderShopPo.getBrokerage());
|
|
|
oldBrokerage.set(MathUtil.add(oldBrokerage.get(), orderShopPo.getOldBrokerage()).doubleValue());
|
|
|
});
|
|
@@ -1142,7 +1150,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
} else {
|
|
|
//无优惠金额
|
|
|
shopOrderList.forEach(so -> {
|
|
|
- double realPay = so.getNeedPayAmount();
|
|
|
+ double realPay = so.getRealNeedPay();
|
|
|
so.setRealPay(realPay);
|
|
|
so.setEachDiscount(0d);
|
|
|
double charge = MathUtil.mul(realPay, 0.0065, 2).doubleValue() > 10 ? MathUtil.mul(realPay, 0.0065, 2).doubleValue() : 10;
|
|
@@ -1720,6 +1728,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
shopOrder.setOrderType(1);
|
|
|
}
|
|
|
orderShopPos.add(shopOrder);
|
|
|
+ //把原shoporderlist拆分的shop剔除,加入拆分后的shop
|
|
|
+// shopOrderList.removeIf(s -> s.getShopId().equals(shopOrder.getShopId()));
|
|
|
}
|
|
|
return orderShopPos;
|
|
|
}
|