Browse Source

联合丽格1.0.2

huangzhiguo 1 year ago
parent
commit
39f396f2f1

+ 4 - 4
src/main/java/com/caimei365/order/components/OrderCommonService.java

@@ -304,11 +304,11 @@ public class OrderCommonService {
                 if (0 == organizeId) {
                     taxFlag = (Integer.valueOf(0).equals(orderProduct.getIncludedTax()) && (Integer.valueOf(1).equals(orderProduct.getInvoiceType()) || Integer.valueOf(2).equals(orderProduct.getInvoiceType())));
                 }
-                if (taxFlag) {
+                /*if (taxFlag) {
                     Double valueTax = MathUtil.div(MathUtil.mul(orderProduct.getPrice(), orderProduct.getTaxRate()), 100).doubleValue();
                     orderProduct.setPrice(MathUtil.add(orderProduct.getPrice(), valueTax).doubleValue());
                     orderProduct.setDiscountPrice(MathUtil.add(orderProduct.getDiscountPrice(), orderProduct.getAddedValueTax()).doubleValue());
-                }
+                }*/
                 orderProduct.setImage(ImageUtil.getImageUrl("product", orderProduct.getImage(), domain));
                 // 查询订单下商品的促销活动
                 if (null != orderProduct.getOrderPromotionsId() && orderProduct.getOrderPromotionsId() > 0) {
@@ -365,7 +365,7 @@ public class OrderCommonService {
                     shopOrder.setPostageInfo("¥" + MathUtil.add(shopOrder.getShopPostFee(), shopOrder.getColdChina()).doubleValue() + open +(shopOrder.getIsColdChina()==1?"冷链费: ¥" + shopOrder.getColdChina().doubleValue():"") + (arrList.stream().allMatch(c -> c == 1)?"":" 其他: 包邮")+close);
                 } else {
                     // 有运费
-                    shopOrder.setPostageInfo("¥" + MathUtil.add(shopOrder.getShopPostFee(), shopOrder.getColdChina()).doubleValue() + open +(shopOrder.getIsColdChina()==1?"冷链费: ¥" + shopOrder.getColdChina().doubleValue():"") + (!arrList.stream().allMatch(c -> c == 1)?" 其他: ¥" + shopOrder.getShopPostFee():"") + close);
+                    shopOrder.setPostageInfo("¥" + MathUtil.add(shopOrder.getShopPostFee(), shopOrder.getColdChina()).doubleValue() + open +(shopOrder.getIsColdChina()==1?"冷链费: ¥" + shopOrder.getColdChina().doubleValue():"") + ((shopOrder.getShopPostFee() != null && shopOrder.getShopPostFee() != 0d)?" 其他: ¥" + shopOrder.getShopPostFee():"") + close);
                 }
             } else {
                 shopOrder.setPostageInfo(shopOrder.getShopPostFlag() == 2 ?"到付":shopOrder.getShopPostFlag() == 0?"包邮":"¥" + shopOrder.getShopPostFee());
@@ -485,7 +485,7 @@ public class OrderCommonService {
                 shopOrder.setPostageInfo("¥" + MathUtil.add(shopOrder.getShopPostFee(), shopOrder.getColdChina()).doubleValue() + open +(shopOrder.getIsColdChina()==1?"冷链费: ¥" + shopOrder.getColdChina().doubleValue():"") + (arrList.stream().allMatch(c -> c == 1)?"":" 其他: 包邮")+close);
             } else {
                 // 有运费
-                shopOrder.setPostageInfo("¥" + MathUtil.add(shopOrder.getShopPostFee(), shopOrder.getColdChina()).doubleValue() + open +(shopOrder.getIsColdChina()==1?"冷链费: ¥" + shopOrder.getColdChina().doubleValue():"") + (!arrList.stream().allMatch(c -> c == 1)?" 其他: ¥" + shopOrder.getShopPostFee():"") + close);
+                shopOrder.setPostageInfo("¥" + MathUtil.add(shopOrder.getShopPostFee(), shopOrder.getColdChina()).doubleValue() + open +(shopOrder.getIsColdChina()==1?"冷链费: ¥" + shopOrder.getColdChina().doubleValue():"") + ((shopOrder.getShopPostFee() != null && shopOrder.getShopPostFee() != 0d)?" 其他: ¥" + shopOrder.getShopPostFee():"") + close);
             }
         } else {
             shopOrder.setPostageInfo(shopOrder.getShopPostFlag() == 2?"到付":shopOrder.getShopPostFlag() == 0?"包邮":"¥" + shopOrder.getShopPostFee());

+ 2 - 2
src/main/java/com/caimei365/order/components/ProductService.java

@@ -426,9 +426,9 @@ public class ProductService {
             // 订单状态
             shopOrderVo.setReceiptStatus(shopOrder.getReceiptStatus());
             // 余额抵扣金额
-            shopOrderVo.setAccountAmount(MathUtil.add(shopOrderVo.getAccountAmount(), shopOrderPay).doubleValue());
+            shopOrderVo.setAccountAmount(shopOrderPay);
             // 用户已付金额
-            shopOrderVo.setReceiptAmount(MathUtil.add(shopOrderVo.getReceiptAmount(), shopOrderPay).doubleValue());
+            shopOrderVo.setReceiptAmount(shopOrderPay);
             // 余额抵扣状态
             shopOrderVo.setUseBalanceFlag(1);
             payOrderMapper.updateShopOrderBalancePay(shopOrderVo);

+ 7 - 0
src/main/java/com/caimei365/order/mapper/OrderCommonMapper.java

@@ -156,6 +156,13 @@ public interface OrderCommonMapper {
      * @param productId   商品Id
      */
     Integer countActualCancelNum(Integer shopOrderId, Integer productId);
+
+    /**
+     * 子订单退款状态
+     * @param shopOrderId
+     * @return
+     */
+    Integer getRefundStatus(@Param("shopOrderId") Integer shopOrderId );
     /**
      * 根据订单Id获取订单
      * @param orderId 订单Id

+ 7 - 0
src/main/java/com/caimei365/order/mapper/ShipMapper.java

@@ -34,6 +34,13 @@ public interface ShipMapper {
      */
     List<DiscernReceiptVo> getShopOrderRelation(@Param("shopOrderId") Integer shopOrderId);
 
+    /**
+     * 子订单退款记录
+     * @param shopOrderId
+     * @return
+     */
+    List<CmReturnedPurchase> getRefundPurchase(@Param("shopOrderId") Integer shopOrderId);
+
     /**
      * 子订单分帐记录
      * @param shopOrderId

+ 8 - 0
src/main/java/com/caimei365/order/model/po/OrderShopPo.java

@@ -101,6 +101,14 @@ public class OrderShopPo implements Serializable {
      * 佣金 =  应付采美
      */
     private Double brokerage;
+    /**
+     * 是否使用余额
+     */
+    private Integer useBalanceFlag;
+    /**
+     * 余额支付时使用的金额
+     */
+    private Double accountAmount;
     /**
      * 可退款金额 = 余额抵扣金额
      */

+ 4 - 0
src/main/java/com/caimei365/order/model/vo/ShopOrderVo.java

@@ -50,6 +50,10 @@ public class ShopOrderVo implements Serializable {
      * 订单号
      */
     private Integer orderId;
+    /**
+     * 普通订单 1 协销订单 0
+     */
+    private Integer orderType;
     /**
      * 组织Id
      */

+ 1 - 0
src/main/java/com/caimei365/order/service/impl/AddressServiceImpl.java

@@ -140,6 +140,7 @@ public class AddressServiceImpl implements AddressService {
         addressVo.setReceiver(addressDto.getReceiver());
         addressVo.setMobile(addressDto.getMobile());
         addressVo.setDefaultFlag(address.getDefaultFlag());
+        addressVo.setAddressId(address.getAddressId());
         return ResponseJson.success(addressVo);
     }
 

+ 20 - 26
src/main/java/com/caimei365/order/service/impl/CartClubServiceImpl.java

@@ -199,9 +199,6 @@ public class CartClubServiceImpl implements CartClubService {
                                             shopSvipReducedPrice.set(MathUtil.add(shopSvipReducedPrice, cartItemVo.getSvipTotalReducedPrice()).doubleValue());
                                         }
                                     } else {
-                                        //失效无库存不统计
-                                        totalCount.updateAndGet(v -> v - 1);
-                                        kindCount.updateAndGet(v -> v - 1);
                                         // 获取商品促销信息
                                         PromotionsVo promotions = null;
                                         // 没有店铺促销时,商品促销才有效
@@ -251,7 +248,8 @@ public class CartClubServiceImpl implements CartClubService {
                                             if (1 == cartItemVo.getLadderFlag()) {
                                                 // 设置阶梯价
                                                 productService.setCartLadderPrices(cartItemVo, taxFlag);
-                                            } else {
+                                            }
+                                            /*else {
                                                 // 复购价
                                                 Double repurchase = baseMapper.getRepurchasePrice(cartItemVo.getSkuId(), userId);
                                                 if (null != repurchase && repurchase > 0) {
@@ -262,7 +260,7 @@ public class CartClubServiceImpl implements CartClubService {
                                                         cartItemVo.setPrice(repurchase);
                                                     }
                                                 }
-                                            }
+                                            }*/
                                         }
                                     }
                                 // 该供应商下价格累加
@@ -280,6 +278,9 @@ public class CartClubServiceImpl implements CartClubService {
                                 // 购物车总数量 + 当前商品购买数量
                                 totalCount.updateAndGet(v -> v + cartItemVo.getNumber());
                             } else {
+                                //失效无库存不统计
+                                totalCount.updateAndGet(v -> v - 1);
+                                kindCount.updateAndGet(v -> v - 1);
                                 // 失效商品
                                 if (cartItemVo.getPriceFlag() == 1) {
                                     // 未公开价格
@@ -319,6 +320,8 @@ public class CartClubServiceImpl implements CartClubService {
                             productIterator.remove();
                         }
                     } else {
+                        // 设置商品图片及税费
+                        productService.setCartItemImgAndTax(cartItemVo);
                         if (cartItemVo.getValidFlag() == 2) {
                             // 设置商品有效
                             cartItemVo.setStatus(0);
@@ -1054,14 +1057,7 @@ public class CartClubServiceImpl implements CartClubService {
                                 }
                             }
                             // 设置商品图片及税费
-                            boolean taxFlag = false;
-                            if (0 == organizeId) {
-                                taxFlag = productService.setCartItemImgAndTax(cartItemVo);
-                            } else {
-                                // 图片路径
-                                String image = ImageUtil.getImageUrl("product", cartItemVo.getImage(), domain);
-                                cartItemVo.setImage(image);
-                            }
+                            boolean taxFlag = productService.setCartItemImgAndTax(cartItemVo);
                             // 是否充值商品
                             boolean recharge = productService.isRechargeProduct(cartItemVo.getProductId());
                             if (recharge) {
@@ -1130,7 +1126,8 @@ public class CartClubServiceImpl implements CartClubService {
                                         if (cartItemVo.getLadderFlag() == 1) {
                                             // 设置阶梯价
                                             productService.setCartLadderPrices(cartItemVo, taxFlag);
-                                        } else {
+                                        }
+                                        /*else {
                                             // 复购价
                                             Double repurchase = baseMapper.getRepurchasePrice(cartItemVo.getSkuId(), userId);
                                             if (null != repurchase && repurchase > 0) {
@@ -1141,7 +1138,7 @@ public class CartClubServiceImpl implements CartClubService {
                                                     cartItemVo.setPrice(repurchase);
                                                 }
                                             }
-                                        }
+                                        }*/
                                     }
                                 }
                             }
@@ -1573,7 +1570,8 @@ public class CartClubServiceImpl implements CartClubService {
                                     if (cartItemVo.getLadderFlag() == 1) {
                                         // 设置阶梯价
                                         productService.setCartLadderPrices(cartItemVo, taxFlag);
-                                    } else {
+                                    }
+                                    /*else {
                                         // 复购价
                                         Double repurchase = baseMapper.getRepurchasePrice(cartItemVo.getSkuId(), userId);
                                         if (null != repurchase && repurchase > 0) {
@@ -1584,7 +1582,7 @@ public class CartClubServiceImpl implements CartClubService {
                                                 cartItemVo.setPrice(repurchase);
                                             }
                                         }
-                                    }
+                                    }*/
                                 }
                             }
                             // 该供应商下价格累加
@@ -1865,13 +1863,8 @@ public class CartClubServiceImpl implements CartClubService {
         shopIds.add(shop.getShopId());
         List<CartShopVo> shopList = new ArrayList<>();
         // 设置商品图片及税费
-        boolean taxFlag = false;
-        if (0 == organizeId) {
-            taxFlag = productService.setCartItemImgAndTax(cartItemVo);
-        } else {
-            String image = ImageUtil.getImageUrl("product", cartItemVo.getImage(), domain);
-            cartItemVo.setImage(image);
-        }
+        boolean taxFlag = productService.setCartItemImgAndTax(cartItemVo);
+
         // 促销活动(总)
         List<PromotionsVo> totalPromotions = new ArrayList<>();
         // 统计商品总金额
@@ -1955,7 +1948,8 @@ public class CartClubServiceImpl implements CartClubService {
                     if (cartItemVo.getLadderFlag() == 1) {
                         // 设置阶梯价
                         productService.setCartLadderPrices(cartItemVo, taxFlag);
-                    } else {
+                    }
+                    /*else {
                         // 复购价
                         Double repurchase = baseMapper.getRepurchasePrice(cartItemVo.getSkuId(), cartDto.getUserId());
                         if (null != repurchase && repurchase > 0) {
@@ -1966,7 +1960,7 @@ public class CartClubServiceImpl implements CartClubService {
                                 cartItemVo.setPrice(repurchase);
                             }
                         }
-                    }
+                    }*/
                 }
             }
         }

+ 14 - 13
src/main/java/com/caimei365/order/service/impl/CartSellerServiceImpl.java

@@ -195,7 +195,8 @@ public class CartSellerServiceImpl implements CartSellerService {
                                 if (cartItemVo.getLadderFlag() == 1) {
                                     // 设置阶梯价
                                     productService.setCartLadderPrices(cartItemVo, taxFlag);
-                                } else {
+                                }
+                                /*else {
                                     // 复购价
                                     Double repurchase = baseMapper.getRepurchasePrice(cartItemVo.getSkuId(), clubUserId);
                                     if (null != repurchase && repurchase > 0) {
@@ -206,7 +207,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                                             cartItemVo.setPrice(repurchase);
                                         }
                                     }
-                                }
+                                }*/
                             }
                         }
                         // 再来一单的商品前端默认勾选
@@ -502,18 +503,17 @@ public class CartSellerServiceImpl implements CartSellerService {
                     shop.setDesignatedFlag((Integer) postageMap.get("designatedFlag"));
                 }
                 // 冷链费
-                Double coldChain = 0d;
+                AtomicDouble coldChain = new AtomicDouble(0);
                 if (null != productList && productList.size() > 0) {
                     for (CartItemVo cartItemVo : productList) {
                         if (7550 == cartItemVo.getProductId()) {
                             if (cartItemVo.getNumber() >= 100) {
-                                coldChain = 0d;
+                                coldChain.set(0);
                             } else {
-                                coldChain = 700d;
+                                coldChain.set(700);
                                 shop.setPostageFlag(1);
                             }
                         }
-                        shopPrice.set(MathUtil.add(shopPrice.get(), coldChain).doubleValue());
                         // 设置商品图片及税费
                         boolean taxFlag = productService.setCartItemImgAndTax(cartItemVo);
                         // 是否充值商品
@@ -584,7 +584,8 @@ public class CartSellerServiceImpl implements CartSellerService {
                                 if (cartItemVo.getLadderFlag() == 1) {
                                     // 设置阶梯价
                                     productService.setCartLadderPrices(cartItemVo, taxFlag);
-                                } else {
+                                }
+                                /*else {
                                     // 复购价
                                     Double repurchase = baseMapper.getRepurchasePrice(cartItemVo.getSkuId(), clubUserId);
                                     if (null != repurchase && repurchase > 0) {
@@ -595,7 +596,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                                             cartItemVo.setPrice(repurchase);
                                         }
                                     }
-                                }
+                                }*/
                             }
                         }
                         // 该供应商下价格累加
@@ -611,16 +612,16 @@ public class CartSellerServiceImpl implements CartSellerService {
                         totalCount.updateAndGet(v -> v + cartItemVo.getNumber());
                     }
 
-                    shop.setColdChain(coldChain);
-                    if (700 == coldChain) {
+                    shop.setColdChain(coldChain.get());
+                    if (700 == coldChain.get()) {
                         shop.setIsColdChina(true);
                     } else {
                         shop.setIsColdChina(false);
                     }
                     // 总运费
-                    shop.setAllPostage(MathUtil.add(shop.getPostage(),coldChain).doubleValue());
+                    shop.setAllPostage(MathUtil.add(shop.getPostage(),coldChain.get()).doubleValue());
                     // 供应商总金额
-                    shopPrice.set(MathUtil.add(shopPrice.get(), shop.getPostage()).doubleValue());
+                    shopPrice.set(MathUtil.add(shopPrice.get(), shop.getAllPostage()).doubleValue());
                     if (shopKindCount.get() > 0) {
                         // 店铺促销
                         if (null != shopPromotion) {
@@ -681,7 +682,7 @@ public class CartSellerServiceImpl implements CartSellerService {
                         // 供应商总超级会员优惠
                         shop.setSvipReducedPrice(shopSvipReducedPrice.get());
                         // 供应商划线价
-                        shop.setOriginalPrice(MathUtil.add(shopPrice.get(), shopReduction).doubleValue());
+                        shop.setOriginalPrice(MathUtil.sub(MathUtil.add(shopPrice.get(), shopReduction), shop.getAllPostage()).doubleValue());
 
                         // 添加供应商Id集合
                         shopIds.add(shop.getShopId());

+ 6 - 2
src/main/java/com/caimei365/order/service/impl/HeliPayServiceImpl.java

@@ -1206,8 +1206,8 @@ public class HeliPayServiceImpl implements HeliPayService {
                 boolean taxFlag = (Integer.valueOf(0).equals(orderProduct.getIncludedTax()) && (Integer.valueOf(1).equals(orderProduct.getInvoiceType()) || Integer.valueOf(2).equals(orderProduct.getInvoiceType())));
                 if (taxFlag) {
                     Double valueTax = MathUtil.div(MathUtil.mul(orderProduct.getPrice(), orderProduct.getTaxRate()), 100).doubleValue();
-                    orderProduct.setPrice(MathUtil.add(orderProduct.getPrice(), valueTax).doubleValue());
-                    orderProduct.setDiscountPrice(MathUtil.add(orderProduct.getDiscountPrice(), orderProduct.getAddedValueTax()).doubleValue());
+                    // orderProduct.setPrice(MathUtil.add(orderProduct.getPrice(), valueTax).doubleValue());
+                    // orderProduct.setDiscountPrice(MathUtil.add(orderProduct.getDiscountPrice(), orderProduct.getAddedValueTax()).doubleValue());
                 }
                 orderProduct.setImage(ImageUtil.getImageUrl("product", orderProduct.getImage(), domain));
                 // 查询订单下商品的促销活动
@@ -1283,6 +1283,10 @@ public class HeliPayServiceImpl implements HeliPayService {
             if (!reference.get()) {
                 onlinePay.set(2);
             }
+            // 余额抵扣只能下线
+            if (1 == shopOrder.getUseBalanceFlag()) {
+                onlinePay.set(2);
+            }
             shopOrder.setReceiptAmount(MathUtil.add(shopOrder.getReceiptAmount(), finalReceiptAmount.get()).doubleValue());
             shopOrder.setOnlinePay(onlinePay.get());
             orderCommonService.setPostageInfo(shopOrder);

+ 65 - 38
src/main/java/com/caimei365/order/service/impl/ShipServiceImpl.java

@@ -17,6 +17,7 @@ import com.caimei365.order.utils.MathUtil;
 import com.caimei365.order.utils.OSSUtils;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.google.common.util.concurrent.AtomicDouble;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.lang.RandomStringUtils;
@@ -125,50 +126,59 @@ public class ShipServiceImpl implements ShipService {
                 List<OrderProductVo> orderProductList = orderCommonMapper.getShopOrderProduct(settlement.getShopOrderId());
                 settlement.setOrderProductList(orderProductList);
             }
-            // 付款记录
-            List<DiscernReceiptVo> shopOrderRelation = shipMapper.getShopOrderRelation(settlement.getShopOrderId());
+            // 退款金额
+            AtomicDouble refund = new AtomicDouble(0);
             // 付款手续费
             double procedureFee = 0d;
-            for (DiscernReceiptVo discernReceipt:shopOrderRelation) {
+            // 付款记录
+            List<DiscernReceiptVo> shopOrderRelation = shipMapper.getShopOrderRelation(settlement.getShopOrderId());
+            for (DiscernReceiptVo discernReceipt : shopOrderRelation) {
                 // 本次支付金额,单位/元
                 double splitAmount = discernReceipt.getAssociateAmount();
                 double payAmount;
-                if (12 == discernReceipt.getPayType()) {
-                    // 网银支付
-                    payAmount = 10.00;
-                } else if (17 == discernReceipt.getPayType()) {
-                    //b2c网银
-                    //b2c 0.2%
-                    payAmount = MathUtil.mul(splitAmount, 0.002, 2).doubleValue();
-                    //b2c最低手续费0.1
-                    if (payAmount < 0.1) {
-                        payAmount = 0.1;
-                    }
-                } else if (8 == discernReceipt.getPayType() || 13 == discernReceipt.getPayType() || 15 == discernReceipt.getPayType()) {
-                    //微信0.65%手续费
-                    //微信0.65%
-                    payAmount = MathUtil.mul(splitAmount, 0.0065, 2).doubleValue();
-                } else if (29 == discernReceipt.getPayType()) {
-                    //快捷支付 借记卡支付29,
+                if (1 == discernReceipt.getPayWay()) {
+                    if (12 == discernReceipt.getPayType()) {
+                        // 网银支付
+                        payAmount = 10.00;
+                    } else if (17 == discernReceipt.getPayType()) {
+                        //b2c网银
+                        //b2c 0.2%
+                        payAmount = MathUtil.mul(splitAmount, 0.002, 2).doubleValue();
+                        //b2c最低手续费0.1
+                        if (payAmount < 0.1) {
+                            payAmount = 0.1;
+                        }
+                    } else if (8 == discernReceipt.getPayType() || 13 == discernReceipt.getPayType() || 15 == discernReceipt.getPayType()) {
+                        //微信0.65%手续费
+                        //微信0.65%
+                        payAmount = MathUtil.mul(splitAmount, 0.0065, 2).doubleValue();
+                    } else if (29 == discernReceipt.getPayType()) {
+                        //快捷支付 借记卡支付29,
 
-                    payAmount = MathUtil.mul(splitAmount, 0.003, 2).doubleValue();
-                    if (payAmount < 0.1) {
-                        payAmount = 0.1;
+                        payAmount = MathUtil.mul(splitAmount, 0.003, 2).doubleValue();
+                        if (payAmount < 0.1) {
+                            payAmount = 0.1;
+                        }
+                    } else if (30 == discernReceipt.getPayType()) {
+                        //快捷支付 贷记卡支付30
+                        payAmount = MathUtil.mul(splitAmount, 0.006, 2).doubleValue();
+                        if (payAmount < 0.1) {
+                            payAmount = 0.1;
+                        }
+                    } else {
+                        //手续费 其他0.25%
+                        payAmount = MathUtil.mul(splitAmount, 0.0025, 2).doubleValue();
                     }
-                }else if (30 == discernReceipt.getPayType()) {
-                    //快捷支付 贷记卡支付30
-                    payAmount = MathUtil.mul(splitAmount, 0.006, 2).doubleValue();
-                    if (payAmount < 0.1) {
-                        payAmount = 0.1;
+                    if (MathUtil.compare(payAmount, 0.01) <= 0) {
+                        payAmount = 0.01;
                     }
-                } else {
-                    //手续费 其他0.25%
-                    payAmount = MathUtil.mul(splitAmount, 0.0025, 2).doubleValue();
+                    procedureFee = MathUtil.add(procedureFee, payAmount).doubleValue();
                 }
-                if (MathUtil.compare(payAmount, 0.01) <= 0) {
-                    payAmount = 0.01;
-                }
-                procedureFee = MathUtil.add(procedureFee, payAmount).doubleValue();
+            }
+            // 退款记录
+            List<CmReturnedPurchase> refundPurchase = shipMapper.getRefundPurchase(settlement.getShopOrderId());
+            for (CmReturnedPurchase refundPur : refundPurchase) {
+                refund.set(MathUtil.add(refund.get(), refundPur.getReturnedPurchaseFee()).doubleValue());
             }
             // 支付手续费
             settlement.setPaymentCommission(procedureFee);
@@ -176,6 +186,8 @@ public class ShipServiceImpl implements ShipService {
             Double splitAccount = shipMapper.getSplitAccount(settlement.getShopOrderId());
             // 分帐手续费
             settlement.setProrateCommission(MathUtil.mul(splitAccount, 0.001).doubleValue());
+            // 总退款金额
+            settlement.setRefundAmount(refund.get());
         });
         PageInfo<SettlementVo> pageInfo = new PageInfo(settlementList);
         return ResponseJson.success(pageInfo);
@@ -202,10 +214,12 @@ public class ShipServiceImpl implements ShipService {
                 List<OrderProductVo> orderProductList = orderCommonMapper.getShopOrderProduct(settlement.getShopOrderId());
                 settlement.setOrderProductList(orderProductList);
             }
-            // 付款记录
-            List<DiscernReceiptVo> shopOrderRelation = shipMapper.getShopOrderRelation(settlement.getShopOrderId());
+            // 退款金额
+            AtomicDouble refund = new AtomicDouble(0);
             // 付款手续费
             double procedureFee = 0d;
+            // 付款记录
+            List<DiscernReceiptVo> shopOrderRelation = shipMapper.getShopOrderRelation(settlement.getShopOrderId());
             for (DiscernReceiptVo discernReceipt:shopOrderRelation) {
                 // 本次支付金额,单位/元
                 double splitAmount = discernReceipt.getAssociateAmount();
@@ -247,12 +261,19 @@ public class ShipServiceImpl implements ShipService {
                 }
                 procedureFee = MathUtil.add(procedureFee, payAmount).doubleValue();
             }
+            // 退款记录
+            List<CmReturnedPurchase> refundPurchase = shipMapper.getRefundPurchase(settlement.getShopOrderId());
+            for (CmReturnedPurchase refundPur : refundPurchase) {
+                refund.set(MathUtil.add(refund.get(), refundPur.getReturnedPurchaseFee()).doubleValue());
+            }
             // 支付手续费
             settlement.setPaymentCommission(procedureFee);
             // 分帐记录
             Double splitAccount = shipMapper.getSplitAccount(settlement.getShopOrderId());
             // 分帐手续费
             settlement.setProrateCommission(MathUtil.mul(splitAccount, 0.001).doubleValue());
+            // 总退款金额
+            settlement.setRefundAmount(refund.get());
             // 设置返回数据
             SettlementDto lementDto = new SettlementDto();
             lementDto.setShopOrderNo(settlement.getShopOrderNo());
@@ -731,8 +752,14 @@ public class ShipServiceImpl implements ShipService {
         // 已取消发货数量
         Integer actualCancelNum = orderCommonMapper.countActualCancelNum(orderProduct.getShopOrderId(), orderProduct.getProductId());
         actualCancelNum = null != actualCancelNum ? actualCancelNum : 0;
+        // 子订单退款状态
+        Integer refundStatus = orderCommonMapper.getRefundStatus(orderProduct.getShopOrderId());
+        // 有退款 未发货置为 0
+        if (3 == refundStatus) {
+            actualCancelNum = 0;
+        }
         // 未发货数量
-        recordVo.setNotShippedNum(orderProduct.getNotOutStore() - actualCancelNum);
+        recordVo.setNotShippedNum(recordVo.getBuyNum() - shipmentsNum + actualCancelNum);
     }
 
     /**

+ 70 - 30
src/main/java/com/caimei365/order/service/impl/SubmitServiceImpl.java

@@ -482,6 +482,11 @@ public class SubmitServiceImpl implements SubmitService {
         List<String> productIdList = new ArrayList<>();
         List<String> skuIdList = new ArrayList<>();
 
+        // 余额抵扣金额
+        AtomicReference<Double> balance = new AtomicReference(0);
+        if (1 == orderParamBo.getBalancePayFlag()) {
+            balance.set(orderParamBo.getAbleUserMoney());
+        }
         // 子订单订单列表
         List<OrderShopPo> shopOrderList = new ArrayList<>();
         JSONArray orderInfo = orderParamBo.getOrderInfo();
@@ -602,10 +607,8 @@ public class SubmitServiceImpl implements SubmitService {
                     secondHandOrderFlag = true;
                 }
                 // 是否添加税费,不含税商品 开票需添加税费
-                boolean taxFlag = false;
-                if (0 == organizeId) {
-                    taxFlag = (Integer.valueOf(0).equals(product.getIncludedTax()) && (Integer.valueOf(1).equals(product.getInvoiceType()) || Integer.valueOf(2).equals(product.getInvoiceType())));
-                }
+                boolean taxFlag = (Integer.valueOf(0).equals(product.getIncludedTax()) && (Integer.valueOf(1).equals(product.getInvoiceType()) || Integer.valueOf(2).equals(product.getInvoiceType())));
+
                 Double shopTax = 0d;
                 // 图片路径
                 String image = ImageUtil.getImageUrl("product", product.getImage(), domain);
@@ -715,14 +718,15 @@ public class SubmitServiceImpl implements SubmitService {
                             }
                             product.setLadderPrices(ladderPrices);
                             product.setActProduct(2);
-                        } else {
+                        }
+                        /*else {
                             // 复购价
                             Double repurchase = baseMapper.getRepurchasePrice(skuId, orderParamBo.getUserId());
                             if (null != repurchase && repurchase > 0) {
                                 discountPrice = repurchase;
                             }
                             product.setActProduct(0);
-                        }
+                        }*/
                     }
                     if (MathUtil.compare(discountPrice, BigDecimal.ZERO) == 0) {
                         return ResponseJson.error("商品购买价格不能为0!", null);
@@ -738,12 +742,23 @@ public class SubmitServiceImpl implements SubmitService {
                         // 不含税不可开票商品和未知商品,税率置为0
                         product.setTaxRate(0d);
                     }
+                    log.info("productTax==="+productTax);
                     // 商品价格
-                    product.setPrice(productPrice);
+                    if (Integer.valueOf(0).equals(product.getIncludedTax())) {
+                        if (null != product.getTaxRate() && product.getTaxRate() > 0d) {
+                            product.setPrice(MathUtil.add(productPrice, MathUtil.mul(productPrice, MathUtil.div(product.getTaxRate(), 100, 2))).doubleValue());
+                        }
+                    } else {
+                        product.setPrice(productPrice);
+                    }
                     // 商品税后价格
                     Double productTaxPrice = MathUtil.add(productPrice, productTax).doubleValue();
+                    log.info("productTaxPrice==="+productTaxPrice);
                     // 折后税后单价
+                    log.info("discountPrice==="+discountPrice);
+                    log.info("discountTax==="+discountTax);
                     Double discountTaxPrice = MathUtil.add(discountPrice, discountTax).doubleValue();
+                    log.info("discountTaxPrice===="+discountTaxPrice);
                     // 折扣率 = 折后单价/机构价
                     Double discountRate = MathUtil.mul(MathUtil.div(discountTaxPrice, productTaxPrice), 100).doubleValue();
                     // 单个商品的金额
@@ -811,7 +826,7 @@ public class SubmitServiceImpl implements SubmitService {
                         }
                     }
                     // 折后单价
-                    product.setDiscountPrice(discountPrice);
+                    product.setDiscountPrice(discountTaxPrice);
                     // 折扣率 = 折后单价/机构价
                     product.setDiscount(discountRate);
                     if (svipPriceFlag || (null != promotions && promotions.getType() == 1 && promotions.getMode() == 1)) {
@@ -835,22 +850,28 @@ public class SubmitServiceImpl implements SubmitService {
                 }
                 // 成本价
                 Double costPrice = null;
-                // 判断是否选中固定成本价
+
+                log.info("product.getDiscountPrice()===="+product.getDiscountPrice());
+                /**
+                 * 判断是否选中固定成本价
+                 * 版本不在使用税费,成本取消再加 机构税费
+                 */
                 if (null != product.getCostPrice() && 1 == product.getCostCheckFlag() && product.getCostPrice() >= 0d) {
                     costPrice = product.getCostPrice();
                 }
                 // 判断是否选中比例成本价
                 if (null != product.getCostProportional() && 2 == product.getCostCheckFlag() && product.getCostProportional() > 0d) {
                     // 通过售价*比例得到成本价
-                    double discountTax = 0d;
+                    /*double discountTax = 0d;
                     if (taxFlag) {
                         discountTax = MathUtil.div(MathUtil.mul(product.getDiscountPrice(), product.getTaxRate()), 100, 2).doubleValue();
-                    }
-                    costPrice = MathUtil.div(MathUtil.mul(MathUtil.add(product.getDiscountPrice(), discountTax), product.getCostProportional()), 100, 2).doubleValue();
+                    }*/
+                    costPrice = MathUtil.div(MathUtil.mul(product.getDiscountPrice(), product.getCostProportional()), 100, 2).doubleValue();
                 }
                 if (null == costPrice) {
                     return ResponseJson.error("订单商品成本异常!", null);
                 }
+                log.info("costPrice===="+costPrice);
                 product.setCostPrice(costPrice);
                 // 付供应商税费
                 if (null == product.getShopTaxRate() || product.getShopTaxRate() <= 0) {
@@ -867,12 +888,7 @@ public class SubmitServiceImpl implements SubmitService {
                 // 单个商品付供应商总税费
                 product.setShouldPayTotalTax(MathUtil.mul(shopTax, productNum).doubleValue());
                 // 付供应商 商品费=成本价*(购买数量  + 赠品数量)
-                Double costAmount = null;
-                if (0 == organizeId) {
-                    costAmount = MathUtil.mul(costPrice, MathUtil.add(productNum, presentNum)).doubleValue();
-                } else {
-                    costAmount = MathUtil.mul(product.getPrice(), MathUtil.add(productNum, presentNum)).doubleValue();
-                }
+                Double costAmount =  MathUtil.mul(costPrice, MathUtil.add(productNum, presentNum)).doubleValue();
                 product.setShopProductAmount(costAmount);
                 log.info("product.getShopProductAmount()***" + product.getShopProductAmount());
                 //应付供应商(单)=成本价+供应商税费(单)
@@ -932,6 +948,8 @@ public class SubmitServiceImpl implements SubmitService {
                     product.setShopPercent(organizeSkuInfo.getShopPercent());
                 }
                 // 加入订单商品列表
+                // 商品价格设置为 折后价格
+                product.setPrice(product.getDiscountPrice());
                 orderProductList.add(product);
                 productIdList.add(product.getProductId().toString());
                 skuIdList.add(product.getSkuId().toString());
@@ -945,9 +963,9 @@ public class SubmitServiceImpl implements SubmitService {
             needPayAmount.set(MathUtil.add(needPayAmount.get(), postage).doubleValue());
             log.info("postage=-***====" + postage);
             isColdChina.set(MathUtil.add(isColdChina.get(), shopIsColdChina.get()).doubleValue());
-            log.info("isColdChina.get()=------=-=-====" + isColdChina.get());
+            log.info("shopIsColdChina.get()=------=-=-====" + shopIsColdChina.get());
             // 需要支付金额 shouldPayFee + 冷链费
-            needPayAmount.set(MathUtil.add(needPayAmount.get(), isColdChina.get()).doubleValue());
+            needPayAmount.set(MathUtil.add(needPayAmount.get(), shopIsColdChina.get()).doubleValue());
             // 统计总运费
             postageFee.set(MathUtil.add(postageFee.get(), postage).doubleValue());
             log.info("统计总运费+--+-+-" + postageFee.get());
@@ -1010,7 +1028,7 @@ public class SubmitServiceImpl implements SubmitService {
             // 超级会员优惠金额
             shopOrder.setSvipShopReduction(svipShopReduction.get());
             // 总价(含税) = totalFee + 冷链费
-            shopOrder.setTotalAmount(MathUtil.add(MathUtil.add(shopProductFee.get(), postage).doubleValue(), isColdChina.get()).doubleValue());
+            shopOrder.setTotalAmount(MathUtil.add(MathUtil.add(shopProductFee.get(), postage).doubleValue(), shopIsColdChina.get()).doubleValue());
             // 总金额 = 订单商品totalAmount
             shopOrder.setProductAmount(shopAmount.get());
             // 需要支付金额 shouldPayFee +运费
@@ -1021,8 +1039,9 @@ public class SubmitServiceImpl implements SubmitService {
             shopOrder.setShopProductAmount(shopProductAmount.get());
             // 付给供应商税费
             shopOrder.setShopTaxFee(shopTaxFee.get());
-            // 付供应商 = 商品费 + 运费 + 税费 + 冷链费
-            shopOrder.setShouldPayShopAmount(MathUtil.add(MathUtil.add(shopProductAmount.get(), shopTaxFee.get()).doubleValue(), isColdChina.get()).doubleValue());
+            // 付供应商 = 商品费 + 运费  + 冷链费
+            // 版本不加 税费
+            shopOrder.setShouldPayShopAmount(MathUtil.add(MathUtil.add(shopProductAmount.get(), postageFee.get()).doubleValue(), shopIsColdChina.get()).doubleValue());
             // 付给供应商运费
             // shopOrder.setShopPostFee(0d);
             // 已付供应商金额
@@ -1036,6 +1055,27 @@ public class SubmitServiceImpl implements SubmitService {
                 // 普通订单
                 shopOrder.setOrderType(1);
             }
+            // 余额支付标识,0不使用,1使用
+            log.info("balance.get()====="+balance.get());
+            if (1 == orderParamBo.getBalancePayFlag() && 3 == orderParamBo.getCartType() && balance.get() > 0) {
+                // 使用余额支付
+                shopOrder.setUseBalanceFlag(1);
+                // 部分抵扣
+                if (MathUtil.compare(shopOrder.getNeedPayAmount(), balance.get()) > 0) {
+                    // 余额抵扣金额
+                    shopOrder.setAccountAmount(balance.get());
+                } else {
+                    // 余额抵扣金额
+                    shopOrder.setAccountAmount(shopOrder.getNeedPayAmount());
+                }
+                balance.updateAndGet( b -> balance.get() - shopOrder.getNeedPayAmount());
+            } else {
+                // 使用余额支付
+                shopOrder.setUseBalanceFlag(0);
+                // 余额抵扣金额
+                shopOrder.setAccountAmount(0d);
+            }
+            log.info("shopOrder.getAccountAmount()===="+shopOrder.getAccountAmount());
             // 运费标记
             shopOrder.setShopPostFlag(postageFlag);
             // 添加到子订单列表
@@ -1237,7 +1277,6 @@ public class SubmitServiceImpl implements SubmitService {
 
         log.info("订单总额" + payTotalFee.get());
         // 判断前端传入orderShouldPayFee订单应付金额,和后台计算应付金额对比
-        // orderParamBo.setOrderShouldPayFee(MathUtil.sub(orderParamBo.getOrderShouldPayFee(), isColdChina.get()).doubleValue());
         log.info("【提交订单】>>>>>后台计算payableAmount:" + payableAmount.get() + " ,前端传入orderShouldPayFee:" + orderParamBo.getOrderShouldPayFee());
         // compare return[-1:v1<v2, 0:v1=v2, 1:v1>v2]
         int compare = MathUtil.compare(orderParamBo.getOrderShouldPayFee(), payableAmount.get());
@@ -1246,8 +1285,6 @@ public class SubmitServiceImpl implements SubmitService {
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return ResponseJson.error("订单付款金额不正确!", null);
         }
-        // 加冷链费
-        // orderParamBo.setOrderShouldPayFee(MathUtil.add(orderParamBo.getOrderShouldPayFee(), isColdChina.get()).doubleValue());
         // 售后条款
         Integer clauseId = orderParamBo.getClauseId();
         String clauseName = null;
@@ -1402,7 +1439,6 @@ 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());
@@ -1447,7 +1483,6 @@ public class SubmitServiceImpl implements SubmitService {
             if (!shopFlag) {
                 shopOrder.setShopPostFee(0d);
             }*/
-            log.info("shopOrder.getIsColdChina()******" + shopOrder.getIsColdChina() + "=====shopOrder.getShopPostFee()" + shopOrder.getShopPostFee());
             /*
              * 保存子订单
              */
@@ -2050,8 +2085,9 @@ public class SubmitServiceImpl implements SubmitService {
             shopOrder.setShopProductAmount(shopProductAmount.get());
             // 付给供应商税费
             shopOrder.setShopTaxFee(shopTaxFee.get());
-            // 付供应商 = 商品费 + 运费 + 税费
-            shopOrder.setShouldPayShopAmount(MathUtil.add(MathUtil.add(shopProductAmount.get(), shopTaxFee.get()).doubleValue(), isColdChina.get()).doubleValue());
+            // 付供应商 = 商品费 + 运费 + 冷链费
+            // 暂时不加 税费
+            shopOrder.setShouldPayShopAmount(MathUtil.add(MathUtil.add(shopProductAmount.get(), oldShop.get(0).getShopPostFee()).doubleValue(), isColdChina.get()).doubleValue());
             // 付给供应商运费
             shopOrder.setShopPostFee(oldShop.get(0).getShopPostFee());
             // 运费类型
@@ -2067,6 +2103,10 @@ public class SubmitServiceImpl implements SubmitService {
                 // 普通订单
                 shopOrder.setOrderType(1);
             }
+            // 余额抵扣金额
+            shopOrder.setAccountAmount(oldShop.get(0).getAccountAmount());
+            // 是否使用余额抵扣
+            shopOrder.setUseBalanceFlag(oldShop.get(0).getUseBalanceFlag());
             orderShopPos.add(shopOrder);
         }
         return orderShopPos;

+ 5 - 3
src/main/resources/mapper/BaseMapper.xml

@@ -24,9 +24,9 @@
         LIMIT 1
     </select>
     <insert id="insertUserInvoiceByUserId" parameterType="com.caimei365.order.model.vo.InvoiceVo">
-        INSERT INTO cm_user_invoiceinfo (userId, invoiceTitle, corporationTaxNum, registeredAddress, registeredPhone,
+        INSERT INTO cm_user_invoiceinfo (userId, type, headingType, invoiceTitle, corporationTaxNum, registeredAddress, registeredPhone,
                                          bankAccountNo, openBank)
-        VALUES (#{userId}, #{invoiceTitle}, #{corporationTaxNum}, #{registeredAddress}, #{registeredPhone},
+        VALUES (#{userId}, #{type}, #{headingType}, #{invoiceTitle}, #{corporationTaxNum}, #{registeredAddress}, #{registeredPhone},
                 #{bankAccountNo}, #{openBank})
     </insert>
     <insert id="insertPurchasePrice" keyColumn="id" keyProperty="id"
@@ -45,7 +45,9 @@
     </insert>
     <update id="updateUserInvoiceByUserId" parameterType="com.caimei365.order.model.vo.InvoiceVo">
         UPDATE cm_user_invoiceinfo
-        SET invoiceTitle      = #{invoiceTitle},
+        SET type              = #{type},
+            headingType       = #{headingType},
+            invoiceTitle      = #{invoiceTitle},
             corporationTaxNum = #{corporationTaxNum},
             registeredAddress = #{registeredAddress},
             registeredPhone   = #{registeredPhone},

+ 2 - 0
src/main/resources/mapper/OrderClubMapper.xml

@@ -1055,7 +1055,9 @@
     <select id="getOrderInvoice" resultType="com.caimei365.order.model.po.InvoicePo">
         SELECT id,
                orderId,
+               type,
                invoiceTitle,
+               invoiceTitleType as headingType,
                corporationTaxNum,
                registeredAddress,
                registeredPhone,

+ 5 - 0
src/main/resources/mapper/OrderCommonMapper.xml

@@ -99,6 +99,8 @@
         cso.orderTime,
         cso.orderSubmitType,
         cso.splitFlag,
+        ifnull(cso.accountAmount,0) as accountAmount,
+        ifnull(cso.useBalanceFlag,0) as useBalanceFlag,
         ifnull(cso.sendOutStatus, 1) as sendOutStatus,
         s.name AS shopName,
         ifnull(s.payway, 0) AS payway,
@@ -470,6 +472,9 @@
           AND rp.status = '2'
           AND rp.delFlag = '0'
     </select>
+    <select id="getRefundStatus" resultType="java.lang.Integer">
+        select refundStatus from cm_shop_order where shopOrderId = #{shopOrderId}
+    </select>
     <select id="getOrderByOrderId" resultType="com.caimei365.order.model.vo.OrderVo">
         SELECT orderID      AS orderId,
                shopOrderIds,

+ 15 - 8
src/main/resources/mapper/ShipMapper.xml

@@ -107,6 +107,7 @@
             a.userID AS userId,
             a.clubID AS clubId,
             a.spID AS spId,
+            a.orderType,
             a.orderPromotionsId,
             a.promotionFullReduction,
             a.brokerage,
@@ -131,7 +132,8 @@
             ifnull(s.payway, 0) AS payway,
             a.shopStatus as status,
             a.splitFlag,
-            ifnull(a.useBalanceFlag, 0) as useBalanceFlag
+            ifnull(a.useBalanceFlag, 0) as useBalanceFlag,
+            ifnull(a.ReceiptAmount,0) as ReceiptAmount
         FROM cm_shop_order a
         LEFT JOIN bp_order_userinfo ou ON  ou.orderId=a.orderId
         LEFT JOIN cm_order o ON a.orderID=o.orderID
@@ -168,8 +170,8 @@
             <if test="receiver != null and receiver != ''">
                 AND ou.shouHuoRen like concat('%',#{receiver},'%')
             </if>
-            AND o.delFlag='0'
-            AND o.status NOT IN(0,6)
+            AND a.delFlag='0'
+            AND a.shopStatus not in (0, 4)
             AND a.delFlag='0'
             AND a.shopID=#{shopId}
         </where>
@@ -205,13 +207,13 @@
                 AND user.userName like concat('%',#{name},'%')
             </if>
             <if test="beginTime != null and beginTime != ''">
-                so.orderTime <![CDATA[ >= ]]> #{beginTime}
+                AND so.orderTime <![CDATA[ >= ]]> #{beginTime}
             </if>
             <if test="endTime != null and endTime != ''">
-                so.orderTime <![CDATA[ <= ]]> #{endTime}
+                AND so.orderTime <![CDATA[ <= ]]> #{endTime}
             </if>
             <if test="refundStatus != null">
-                so.refundStatus = #{refundStatus}
+                AND so.refundStatus = #{refundStatus}
             </if>
             AND so.shopID = #{shopId}
             AND so.delFlag='0'
@@ -224,6 +226,11 @@
         LEFT JOIN cm_receipt_order_relation cror ON (cror.receiptID = cdr.id AND cror.delFlag = '0')
         where cror.shopOrderId = #{shopOrderId}
     </select>
+    <select id="getRefundPurchase" resultType="com.caimei365.order.model.vo.CmReturnedPurchase">
+        SELECT returnedNo, returnedWay, shopOrderId, orderID, userID, returnedPurchaseFee
+        FROM cm_returned_purchase
+        WHERE shopOrderId = #{shopOrderId} AND status = 2
+    </select>
     <select id="getSplitAccount" resultType="java.lang.Double">
         SELECT SUM(splitAccount)
         FROM cm_split_account
@@ -232,7 +239,7 @@
     </select>
     <select id="getShopOrder" resultType="com.caimei365.order.model.vo.ShopOrderVo">
         SELECT
-            cso.receiptAmount,
+            ifnull(cso.receiptAmount,0) as ReceiptAmount,
             cso.shopOrderID AS shopOrderId,
             cso.shopOrderNo,
             cso.orderID AS orderId,
@@ -460,7 +467,7 @@
         SELECT ifnull((SELECT IFNULL(realPay, needPayAmount) - receiptAmount  FROM cm_shop_order WHERE shopOrderId = #{shopOrderId}) - ifnull(SUM(receiptAmount),0),0)
         FROM cm_discern_receipt cdr
                  LEFT JOIN cm_receipt_order_relation cror ON cdr.id = cror.receiptID
-        WHERE cror.shopOrderId = #{shopOrderId}
+        WHERE cror.shopOrderId = #{shopOrderId} AND cdr.payway != 3
     </select>
     <insert id="insertOrderReceipt" keyColumn="id" keyProperty="id"
             parameterType="com.caimei365.order.model.vo.ReceiptVo" useGeneratedKeys="true">

+ 2 - 2
src/main/resources/mapper/SubmitMapper.xml

@@ -34,7 +34,7 @@
         INSERT INTO cm_shop_order (onlinePayWays, shopOrderNo, orderID, orderNo, organizeID, isColdChina, shopID, note,
                                    userID, clubID, orderType,
                                    spID, orderPromotionsId, promotionFullReduction, svipShopReduction, brokerage,
-                                   canRefundAmount, itemCount, shopStatus,
+                                   canRefundAmount, itemCount, shopStatus, accountAmount, useBalanceFlag,
                                    totalAmount, productAmount, needPayAmount, shopProductAmount, shopPostFee,
                                    shopPostFlag,
                                    shopTaxFee,
@@ -43,7 +43,7 @@
         VALUES (#{onlinePayWays}, #{shopOrderNo}, #{orderId}, #{orderNo}, #{organizeId}, #{isColdChina}, #{shopId},
                 #{note}, #{userId}, #{clubId}, #{orderType},
                 #{spId}, #{orderPromotionsId}, #{promotionFullReduction}, #{svipShopReduction}, #{brokerage},
-                #{canRefundAmount}, #{itemCount}, #{shopStatus},
+                #{canRefundAmount}, #{itemCount}, #{shopStatus}, #{accountAmount}, #{useBalanceFlag},
                 #{totalAmount}, #{productAmount}, #{needPayAmount}, #{shopProductAmount}, #{shopPostFee},
                 #{shopPostFlag}, #{shopTaxFee},
                 #{shouldPayShopAmount}, #{orderTime}, #{orderSubmitType}, #{splitFlag}, #{payStatus},