935090232@qq.com
2022-02-22 bbe0a2fd03063316e50cf141986bda984599bbda
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java
@@ -1,7 +1,7 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.system.common.init.UserCacheManager;
import com.matrix.core.constance.SystemErrorCode;
import com.matrix.core.constance.SystemMessageCode;
import com.matrix.core.exception.GlobleException;
@@ -41,7 +41,7 @@
    @Autowired
    private ShopShoppingCartDao shoppingCartDao;
    @Autowired
    private RedisUserLoginUtils redisUserLoginUtils;
    private UserCacheManager userCacheManager;
    @Autowired
    WxShopCouponService shopCouponService;
@@ -71,7 +71,7 @@
    @PostMapping("/findShoppingCart")
    @ResponseBody
    public AjaxResult getShoppingCartByUserId(@RequestBody ShopShoppingCart shoppingCart) {
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        SysVipInfo loginUser = userCacheManager.getLoginUser();
        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());
@@ -104,7 +104,7 @@
    public
    @ResponseBody
    AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId) {
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        SysVipInfo loginUser = userCacheManager.getLoginUser();
        Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getId());
        if (userCartCount == null) {
            userCartCount = 0;
@@ -130,7 +130,7 @@
        shoppingCart.setCartProductId(sku.getpId());
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        SysVipInfo loginUser = userCacheManager.getLoginUser();
        shoppingCart.setCreateBy(loginUser.getOpenId());
        shoppingCart.setUpdateBy(loginUser.getOpenId());
        shoppingCart.setCartUserId(loginUser.getId());
@@ -277,7 +277,7 @@
    @ResponseBody
    public AjaxResult updateCartAllSelected(@PathVariable("isSelected") Integer isSelected,
                                            @PathVariable("shopId") Long shopId) {
        SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        SysVipInfo user = userCacheManager.getLoginUser();
        shoppingCartDao.updateAllSelected(user.getOpenId(), shopId, isSelected);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功");
    }