|
@@ -625,6 +625,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
Double productAmount = MathUtil.mul(productTaxPrice, productNum).doubleValue();
|
|
|
// 单个商品的折后金额
|
|
|
Double productFee = MathUtil.mul(discountTaxPrice, productNum).doubleValue();
|
|
|
+ // 不包含单品满减的商品金额
|
|
|
+ Double realProductFee = productFee;
|
|
|
// 单个商品总税费
|
|
|
Double taxFee = MathUtil.mul(discountTax, productNum).doubleValue();
|
|
|
if (hasActProductFlag && null != promotions) {
|
|
@@ -694,6 +696,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
// 单个商品的折后金额
|
|
|
product.setTotalFee(productFee);
|
|
|
product.setShouldPayFee(productFee);
|
|
|
+ product.setRealProductFee(realProductFee);
|
|
|
// 税费
|
|
|
product.setAddedValueTax(discountTax);
|
|
|
product.setTotalAddedValueTax(taxFee);
|
|
@@ -769,8 +772,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());
|
|
|
+ // 不包含单品满减的子订单需付金额
|
|
|
+ realNeedPay.set(MathUtil.add(realNeedPay.get(),product.getRealProductFee()).doubleValue());
|
|
|
// 统计 总金额 包括税费
|
|
|
shopProductFee.set(MathUtil.add(shopProductFee.get(), product.getTotalFee()).doubleValue());
|
|
|
// 统计子订单内可参与店铺促销的商品总金额
|
|
@@ -1098,13 +1101,10 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
if (onlinePay.get()) {
|
|
|
//在店铺满减算完之后重新根据商品的splitCode排shopOrderList
|
|
|
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();
|
|
@@ -1112,7 +1112,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
AtomicDouble oldBrokerage = new AtomicDouble(0);
|
|
|
//超级会员价/复购价/阶梯价/促销活动冲突,只能生效一个,促销活动满减计入优惠分摊,子订单售价=realNeedPay+promotionFullReduction
|
|
|
shopOrderList.forEach(orderShopPo -> {
|
|
|
- orderShopPo.setOldPrice(orderShopPo.getRealNeedPay());
|
|
|
+ orderShopPo.setOldPrice(orderShopPo.getNeedPayAmount());
|
|
|
orderShopPo.setOldBrokerage(orderShopPo.getBrokerage());
|
|
|
oldBrokerage.set(MathUtil.add(oldBrokerage.get(), orderShopPo.getOldBrokerage()).doubleValue());
|
|
|
});
|
|
@@ -1636,6 +1636,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
//统计拆分的shop
|
|
|
//List<OrderShopPo> collect = shops.stream().filter(s -> shops.stream().filter(so -> so.getShopId().equals(s.getShopId())).count() > 1).collect(Collectors.toList());
|
|
|
//对拆分的shop重新计算子订单佣金,应付,不计入店铺满减
|
|
|
+ log.info("原shoporderlist--------------------》"+shopOrderList);
|
|
|
+ log.info("原orderproductlist--------------------》"+orderProductList);
|
|
|
ArrayList<OrderShopPo> orderShopPos = new ArrayList<>();
|
|
|
for (OrderShopPo shop : shops) {
|
|
|
// 供应商名称
|
|
@@ -1685,9 +1687,9 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
// 佣金 = 应付采美
|
|
|
brokerage.set(MathUtil.add(brokerage.get(), product.getCmFee()).doubleValue());
|
|
|
// 需要支付金额 shouldPayFee +运费
|
|
|
- needPayAmount.set(MathUtil.add(needPayAmount.get(), product.getShouldPayFee()).doubleValue());
|
|
|
+ needPayAmount.set(MathUtil.add(needPayAmount.get(), product.getRealProductFee()).doubleValue());
|
|
|
// 统计 总金额 包括税费
|
|
|
- shopProductFee.set(MathUtil.add(shopProductFee.get(), product.getTotalFee()).doubleValue());
|
|
|
+ shopProductFee.set(MathUtil.add(shopProductFee.get(), product.getRealProductFee()).doubleValue());
|
|
|
// 商品总金额
|
|
|
shopAmount.set(MathUtil.add(shopAmount.get(), product.getTotalAmount()).doubleValue());
|
|
|
// 付供应商 商品费
|
|
@@ -1728,9 +1730,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
shopOrder.setOrderType(1);
|
|
|
}
|
|
|
orderShopPos.add(shopOrder);
|
|
|
- //把原shoporderlist拆分的shop剔除,加入拆分后的shop
|
|
|
-// shopOrderList.removeIf(s -> s.getShopId().equals(shopOrder.getShopId()));
|
|
|
}
|
|
|
+ log.info("ordershops------------------->"+orderShopPos);
|
|
|
return orderShopPos;
|
|
|
}
|
|
|
|