From b4990fac3b5cd0a936369dc51f8b3593b6478730 Mon Sep 17 00:00:00 2001
From: jyy <935090232@qq.com>
Date: Thu, 18 Mar 2021 17:01:11 +0800
Subject: [PATCH] 积分商城4
---
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java | 33 ++++++++++++---------------------
1 files changed, 12 insertions(+), 21 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 e01efca..051afbe 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
@@ -17,6 +17,7 @@
import com.matrix.system.shopXcx.dao.ShopShoppingCartDao;
import com.matrix.system.shopXcx.dao.ShopSkuDao;
import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -50,12 +51,8 @@
ShopSkuDao skuDao;
- /**
- * 根据ID删除购物车
- *
- * @param
- * @return
- */
+
+ @ApiOperation(value = "根据ID删除购物车", notes = "")
@PostMapping("/deleteByCartId/{cartId}")
@ResponseBody
public AjaxResult deleteByCartId(@PathVariable("cartId") Integer cartId) {
@@ -66,12 +63,8 @@
return new AjaxResult(AjaxResult.STATUS_SUCCESS, "删除成功");
}
- /**
- * 根据用户ID查询购物车 没有分页
- *
- * @param
- * @return
- */
+
+ @ApiOperation(value = "根据用户ID查询购物车 没有分页", notes = "")
@PostMapping("/findShoppingCart")
@ResponseBody
public AjaxResult getShoppingCartByUserId(@RequestBody ShopShoppingCart shoppingCart) {
@@ -86,9 +79,8 @@
return result;
}
- /**
- * 批量删除
- */
+
+ @ApiOperation(value = "批量删除", notes = "")
@PostMapping(value = "/delShoppingCart/{keys}")
public
@ResponseBody
@@ -102,12 +94,13 @@
}
}
- @PostMapping(value = "/getUserCartCount/{shopId}")
+ @ApiOperation(value = "查询微商城购物车数量", notes = "")
+ @PostMapping(value = "/getUserCartCount/{shopId}/{cartType}")
public
@ResponseBody
- AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId) {
+ AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId,@PathVariable("cartType") Integer cartType) {
BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
- Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getOpenId());
+ Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getOpenId(),cartType);
if (userCartCount == null) {
userCartCount = 0;
}
@@ -136,7 +129,6 @@
shoppingCart.setCreateBy(loginUser.getOpenId());
shoppingCart.setUpdateBy(loginUser.getOpenId());
shoppingCart.setCartUserId(loginUser.getOpenId());
- shoppingCart.setCartType(ShopShoppingCart.CAR_TYPE_MICRO);
ShopShoppingCart shoppCartLimt = shoppingCartDao.selectBuyLimit(shoppingCart.getCartProductId(),
shoppingCart.getCartSkuId());
// Integer buyLimitNum = 0;
@@ -195,7 +187,7 @@
return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败");
}
int userCartCount = shoppingCartDao.selectUserCartCount(shoppingCart.getShopId(),
- loginUser.getOpenId());
+ loginUser.getOpenId(),shoppingCart.getCartType());
AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功");
result.putInMap("userCartCount", userCartCount);
return result;
@@ -279,7 +271,6 @@
@ResponseBody
public AjaxResult updateCartAllSelected(@PathVariable("isSelected") Integer isSelected,
@PathVariable("shopId") Long shopId,@PathVariable("cartType") Integer cartType) {
- Map<String, Object> modifyMap = new HashMap<>();
BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class);
shoppingCartDao.updateAllSelected(user.getOpenId(),shopId, isSelected,cartType);
return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功");
--
Gitblit v1.9.1