‘linchangsheng’ 1 周之前
父節點
當前提交
b0ee5b9564
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      src/main/java/com/gree/mall/miniapp/logic/order/ShoppingCartLogic.java

+ 7 - 3
src/main/java/com/gree/mall/miniapp/logic/order/ShoppingCartLogic.java

@@ -195,13 +195,17 @@ public class ShoppingCartLogic {
             if(user.getType().equals(UserTypeEnum.GENERAL.toString())) {
                 bean.setWxSceneId(buyGood.getWxSceneId());
             }
+            bean.setCompanyId(user.getCompanyId());
+            bean.setCompanyName(user.getCompanyName());
+            bean.setWebsitId(user.getWebsitId());
+            bean.setWebsitName(user.getWebsitName());
+            bean.insert();
+        }else{
+            shoppingCart.setNum(shoppingCart.getNum()+buyGood.getNum());
             shoppingCart.setCompanyId(user.getCompanyId());
             shoppingCart.setCompanyName(user.getCompanyName());
             shoppingCart.setWebsitId(user.getWebsitId());
             shoppingCart.setWebsitName(user.getWebsitName());
-            bean.insert();
-        }else{
-            shoppingCart.setNum(shoppingCart.getNum()+buyGood.getNum());
             shoppingCart.updateById();
         }
         return this.queryShoppingCart(userId);