From 241a49f9653aa83d1dcd9bf646208da3157df35a Mon Sep 17 00:00:00 2001
From: 935090232@qq.com <ak473600000>
Date: Mon, 05 Apr 2021 22:48:14 +0800
Subject: [PATCH] 合并BizUser表与SysVipInfo表 大部分逻辑已经修正 可能存在问题的 1、拼团秒杀 2、分享图 3、分销结算

---
 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java
index 4508e1c..3b17f08 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java
@@ -1,6 +1,6 @@
 package com.matrix.system.shopXcx.api.action;
 
-import com.matrix.biz.bean.BizUser;
+import com.matrix.system.hive.bean.SysVipInfo;
 import com.matrix.component.redis.RedisUserLoginUtils;
 import com.matrix.core.constance.SystemErrorCode;
 import com.matrix.core.constance.SystemMessageCode;
@@ -71,9 +71,8 @@
     @PostMapping("/findShoppingCart")
     @ResponseBody
     public AjaxResult getShoppingCartByUserId(@RequestBody ShopShoppingCart shoppingCart) {
-        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
-        String userId = loginUser.getOpenId();
-        List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shoppingCart.getShopId(),userId);
+        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
+        List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shoppingCart.getShopId(),loginUser.getId());
         List<ShopCartVo> shopCartVoList = shoppingCartService.buildShopCart(list);
         AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopCartVoList, shopCartVoList.size());
         ShopCartBillVo shopCartBill = shoppingCartService.buildShopCartBillVo(shopCartVoList);
@@ -105,8 +104,8 @@
     public
     @ResponseBody
     AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId) {
-        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
-        Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getOpenId());
+        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
+        Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getId());
         if (userCartCount == null) {
             userCartCount = 0;
         }
@@ -131,10 +130,10 @@
 
         shoppingCart.setCartProductId(sku.getpId());
 
-        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
+        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
         shoppingCart.setCreateBy(loginUser.getOpenId());
         shoppingCart.setUpdateBy(loginUser.getOpenId());
-        shoppingCart.setCartUserId(loginUser.getOpenId());
+        shoppingCart.setCartUserId(loginUser.getId());
         shoppingCart.setCompanyId(HostInterceptor.getCompanyId());
         ShopShoppingCart shoppCartLimt = shoppingCartDao.selectBuyLimit(shoppingCart.getCartProductId(),
                 shoppingCart.getCartSkuId());
@@ -161,7 +160,7 @@
         ShopShoppingCart shopShoppingCart = new ShopShoppingCart();
         shopShoppingCart.setCartProductId(cartProductId);
         shopShoppingCart.setCartSkuId(cartSkuId);
-        shopShoppingCart.setCartUserId(loginUser.getOpenId());
+        shopShoppingCart.setCartUserId(loginUser.getId());
         shopShoppingCart.setShopId(shoppingCart.getShopId());
         List<ShopShoppingCart> shopShoppingCarts = shoppingCartDao.selectByModel(shopShoppingCart);
         int i = 0;
@@ -194,7 +193,7 @@
             return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败");
         }
         int userCartCount = shoppingCartDao.selectUserCartCount(shoppingCart.getShopId(),
-                loginUser.getOpenId());
+                loginUser.getId());
         AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功");
         result.putInMap("userCartCount", userCartCount);
         return result;
@@ -278,7 +277,7 @@
     @ResponseBody
     public AjaxResult updateCartAllSelected(@PathVariable("isSelected") Integer isSelected,
                                             @PathVariable("shopId") Long shopId) {
-        BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class);
+        SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
         shoppingCartDao.updateAllSelected(user.getOpenId(), shopId, isSelected);
         return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功");
     }

--
Gitblit v1.9.1