| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.constance.SystemMessageCode; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.system.shopXcx.bean.ShopShoppingCart; |
| | | import com.matrix.system.shopXcx.bean.ShopSku; |
| | | import com.matrix.system.shopXcx.dao.ShopShoppingCartDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import com.matrix.system.shopXcx.api.service.ShoppingCartService; |
| | | import com.matrix.system.shopXcx.api.service.WxShopCouponService; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartBillVo; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartVo; |
| | | import com.matrix.system.shopXcx.bean.ShopShoppingCart; |
| | | import com.matrix.system.shopXcx.bean.ShopSku; |
| | | import com.matrix.system.shopXcx.dao.ShopShoppingCartDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import io.swagger.annotations.Api; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | |
| | | * @date 2019-06-12 19:15 |
| | | */ |
| | | @CrossOrigin(origins = "*", maxAge = 3600) |
| | | @Controller |
| | | @Api(tags = "购物车类") |
| | | @RestController |
| | | @RequestMapping(value = "wxapi/ShoppingCart") |
| | | public class WxShoppingCartAction { |
| | | @Autowired |
| | |
| | | * @param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/updateCartSelected") |
| | | @PostMapping("/updateCartSelected") |
| | | @ResponseBody |
| | | public AjaxResult updateCartSelected(@RequestBody ShopShoppingCart shoppingCart) { |
| | | Map<String, Object> modifyMap = new HashMap<>(); |
| | |
| | | * @param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/updateCartAllSelected/{shopId}/{isSelected}") |
| | | @PostMapping("/updateCartAllSelected/{shopId}/{isSelected}/{cartType}") |
| | | @ResponseBody |
| | | public AjaxResult updateCartAllSelected(@PathVariable("isSelected") Integer isSelected, |
| | | @PathVariable("shopId") Long shopId) { |
| | | @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); |
| | | shoppingCartDao.updateAllSelected(user.getOpenId(),shopId, isSelected,cartType); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功"); |
| | | } |
| | | } |