|
@@ -504,7 +504,11 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
}
|
|
|
log.info("postageFlag*****************" + postageFlag);
|
|
|
// 运费
|
|
|
- Double postage = Double.parseDouble(postageString);
|
|
|
+ Double postage = 0d;
|
|
|
+ // 在 运费类型为有运费时 运费生效
|
|
|
+ if (1 == postageFlag) {
|
|
|
+ postage = Double.parseDouble(postageString);
|
|
|
+ }
|
|
|
// 供应商名称
|
|
|
String shopName = baseMapper.getShopNameById(shopId);
|
|
|
/*
|
|
@@ -916,6 +920,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
log.info("shopProductAmount.get()" + shopProductAmount.get());
|
|
|
log.info("product.getShopProductAmount()" + product.getShopProductAmount());
|
|
|
shopProductAmount.set(MathUtil.add(shopProductAmount.get(), product.getShopProductAmount()).doubleValue());
|
|
|
+ // 付供应商 商品费=成本价*(购买数量 + 赠品数量) + 冷链费
|
|
|
+ shopOrder.setShopProductAmount(MathUtil.add(shopProductAmount.get(), isColdChina.get()).doubleValue());
|
|
|
// 付供应商税费
|
|
|
shopTaxFee.set(MathUtil.add(shopTaxFee.get(), product.getShouldPayTotalTax()).doubleValue());
|
|
|
if (0 != organizeId) {
|
|
@@ -1003,8 +1009,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
shopOrder.setItemCount(shopProductCount.get());
|
|
|
// 超级会员优惠金额
|
|
|
shopOrder.setSvipShopReduction(svipShopReduction.get());
|
|
|
- // 总价(含税) = totalFee
|
|
|
- shopOrder.setTotalAmount(MathUtil.add(shopProductFee.get(), postage).doubleValue());
|
|
|
+ // 总价(含税) = totalFee + 冷链费
|
|
|
+ shopOrder.setTotalAmount(MathUtil.add(MathUtil.add(shopProductFee.get(), postage).doubleValue(),isColdChina.get()).doubleValue());
|
|
|
// 总金额 = 订单商品totalAmount
|
|
|
shopOrder.setProductAmount(shopAmount.get());
|
|
|
// 需要支付金额 shouldPayFee +运费
|
|
@@ -1032,7 +1038,6 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
}
|
|
|
// 运费标记
|
|
|
shopOrder.setShopPostFlag(postageFlag);
|
|
|
- log.info("shopOrder.getShopPostFlag()*****************" + shopOrder.getShopPostFlag());
|
|
|
// 添加到子订单列表
|
|
|
shopOrderList.add(shopOrder);
|
|
|
// 统计商品总金额
|
|
@@ -1397,6 +1402,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
*/
|
|
|
AtomicReference<String> shopOrderIds = new AtomicReference<>();
|
|
|
AtomicInteger shopOrderIndex = new AtomicInteger(1);
|
|
|
+ log.info("shopOrderList===****====="+shopOrderList);
|
|
|
shopOrderList.forEach(shopOrder -> {
|
|
|
shopOrder.setOrderId(mainOrder.getOrderId());
|
|
|
shopOrder.setOrderNo(mainOrder.getOrderNo());
|
|
@@ -1961,6 +1967,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
*/
|
|
|
List<OrderShopPo> oldShop = shopOrderList.stream().filter(s -> s.getShopId().equals(shop.getShopId())).collect(Collectors.toList());
|
|
|
OrderShopPo shopOrder = new OrderShopPo();
|
|
|
+ shopOrder.setIsColdChina(oldShop.get(0).getIsColdChina());
|
|
|
shopOrder.setSplitCode(shop.getSplitCode());
|
|
|
shopOrder.setShopId(shop.getShopId());
|
|
|
shopOrder.setShopName(shopName);
|
|
@@ -2004,6 +2011,15 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
needPayAmount.set(MathUtil.add(needPayAmount.get(), product.getRealProductFee()).doubleValue());
|
|
|
// 统计 总金额 包括税费
|
|
|
shopProductFee.set(MathUtil.add(shopProductFee.get(), product.getRealProductFee()).doubleValue());
|
|
|
+ // 再勾选冷链费时
|
|
|
+ if (1 == oldShop.get(0).getIsColdChina() && product.getProductId() == 7536 ) {
|
|
|
+ // 需要支付金额 需支付金额 + 冷链费700
|
|
|
+ needPayAmount.set(MathUtil.add(needPayAmount.get(), 700).doubleValue());
|
|
|
+ // 总金额 + 冷链费700
|
|
|
+ shopProductFee.set(MathUtil.add(shopProductFee.get(), 700).doubleValue());
|
|
|
+ // 付供应商 + 冷链费700
|
|
|
+ shopProductAmount.set(MathUtil.add(shopProductAmount.get(), 700).doubleValue());
|
|
|
+ }
|
|
|
// 商品总金额
|
|
|
shopAmount.set(MathUtil.add(shopAmount.get(), product.getTotalAmount()).doubleValue());
|
|
|
// 付供应商 商品费
|
|
@@ -2011,7 +2027,10 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
// 付供应商税费
|
|
|
shopTaxFee.set(MathUtil.add(shopTaxFee.get(), product.getShouldPayTotalTax()).doubleValue());
|
|
|
}
|
|
|
-
|
|
|
+ // 需要支付金额 需支付金额 + 运费
|
|
|
+ needPayAmount.set(MathUtil.add(needPayAmount.get(), oldShop.get(0).getShopPostFee()).doubleValue());
|
|
|
+ // 总金额 + 运费
|
|
|
+ shopProductFee.set(MathUtil.add(shopProductFee.get(), oldShop.get(0).getShopPostFee()).doubleValue());
|
|
|
// 佣金 采美应收
|
|
|
shopOrder.setBrokerage(brokerage.get());
|
|
|
// 可退款金额 = 余额抵扣金额
|
|
@@ -2031,7 +2050,9 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
// 付供应商 = 商品费 + 运费 + 税费
|
|
|
shopOrder.setShouldPayShopAmount(MathUtil.add(shopProductAmount.get(), shopTaxFee.get()).doubleValue());
|
|
|
// 付给供应商运费
|
|
|
- // shopOrder.setShopPostFee(0d);
|
|
|
+ shopOrder.setShopPostFee(oldShop.get(0).getShopPostFee());
|
|
|
+ // 运费类型
|
|
|
+ shopOrder.setShopPostFlag(oldShop.get(0).getShopPostFlag());
|
|
|
// 已付供应商金额
|
|
|
shopOrder.setPayedShopAmount(0d);
|
|
|
// (付款供应商)付款状态:1待付款、2部分付款、3已付款
|