zoukankan      html  css  js  c++  java
  • 购物车全部数据,带商品信息

    @RequestMapping("cartListVo")
        public ResultEntity cartListVo(@RequestParam(name = "data", required = true) String data) {
            GoodsCart goodsCart;
            try {
                goodsCart = decodeByBase64(data, GoodsCart.class);
                System.out.println(goodsCart);
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                return error(ResultCode.PARAM_DECODE_ERROR);
            }
            Wrapper<GoodsCart> wrapper = new EntityWrapper<GoodsCart>().eq("user_id", goodsCart.getUserId());
            List<GoodsCart> selectList = goodsCartService.selectList(wrapper);
            
            ArrayList<GoodsCartVo> goodsCartVoList = Lists.newArrayList();
            
            if(selectList.size()!=0) {
                for(GoodsCart onlyObj:selectList) {
                    GoodsCartVo goodsCartVoLin = new GoodsCartVo();
                     BeanUtils.copyProperties(onlyObj, goodsCartVoLin);
                     goodsCartVoList.add(goodsCartVoLin);
                }
            }
            if(goodsCartVoList.size()!=0) {
                for(GoodsCartVo goodsCartVo2:goodsCartVoList) {
                    Wrapper<GoodsBaseInfo> wrapper2 = new EntityWrapper<GoodsBaseInfo>().eq("id", goodsCartVo2.getGoodsId());
                    GoodsBaseInfo selectOne = goodsBaseInfoService.selectOne(wrapper2);
                    goodsCartVo2.setGoodsBaseInfo(selectOne);
                }
            }
            return success(goodsCartVoList);
        }
  • 相关阅读:
    vim python extension
    aws msk
    Install python3
    sns
    inventory
    批量添加监听端口
    template screen
    DNS name
    add jar and proxy repo
    模型诊断论文心得
  • 原文地址:https://www.cnblogs.com/dianzan/p/12455523.html
Copyright © 2011-2022 走看看