|  |  | 
 |  |  |  | 
 |  |  |         //获取折扣----- | 
 |  |  |         Double zk = zk = 1.0; | 
 |  |  |         //验证商品是否只购买了一次 | 
 |  |  |         checkBuyOnce(car, info.getId()); | 
 |  |  |  | 
 |  |  |         SysOrder order = new SysOrder(); | 
 |  |  |         SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); | 
 |  |  | 
 |  |  |         int count = 0; | 
 |  |  |         // 设置订单条目 | 
 |  |  |         for (ShoppingCarItem carItem : car.getCarItems()) { | 
 |  |  |             // 检测最大销售数量 | 
 |  |  |             checkIsArrivedMax(carItem); | 
 |  |  |  | 
 |  |  |             SysOrderItem orderItem = new SysOrderItem(); | 
 |  |  |             orderItem.setOrderId(order.getId()); | 
 |  |  |             orderItem.setCount(carItem.getCount()); | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 验证商品是否购买过一次 | 
 |  |  |      * | 
 |  |  |      * @Title: checkBuyOnce  @author:jyy @param car void 返回类型 @date | 
 |  |  |      * 2016年9月22日 上午10:05:33 @throws | 
 |  |  |      */ | 
 |  |  |     private void checkBuyOnce(ShoppingCarItemsVo car, Long vipId) { | 
 |  |  |         for (ShoppingCarItem carItem : car.getCarItems()) { | 
 |  |  |             if (shoppingGoodsDao.selectBuyCount(carItem.getGoodsId(), vipId) > 0) { | 
 |  |  |                 ShoppingGoods goods = shoppingGoodsDao.selectById(carItem.getGoodsId()); | 
 |  |  |                 throw new GlobleException(goods.getName() + "只能购买一次!"); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * jyy 收款 |