‘linchangsheng’ 1 week ago
parent
commit
b0ee5b9564

+ 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);