| | |
| | | |
| | | MallGoods mallGoods = mallGoodsMapper.selectById(sku.getGoodsId()); |
| | | // todo 纯积分商品一个账号限制购买一次 |
| | | // if (new BigDecimal(mallGoods.getPresentPrice()).compareTo(BigDecimal.ZERO) == 0) { |
| | | // List<MallOrderItem> items = mallOrderItemMapper.selectItemByGoodsIdUnCancel(mallGoods.getId(), member.getId()); |
| | | // if (CollUtil.isNotEmpty(items)) { |
| | | // throw new FebsException("积分商品一个账号只能购买一次"); |
| | | // } |
| | | // } |
| | | if (new BigDecimal(mallGoods.getPresentPrice()).compareTo(BigDecimal.ZERO) == 0) { |
| | | Integer cnt = item.getCnt(); |
| | | if(1 < cnt){ |
| | | throw new FebsException("积分商品限购一件"); |
| | | } |
| | | List<MallOrderItem> items = mallOrderItemMapper.selectItemByGoodsIdUnCancel(mallGoods.getId(), member.getId()); |
| | | if (CollUtil.isNotEmpty(items)) { |
| | | throw new FebsException("积分商品一个账号限购一次"); |
| | | } |
| | | } |
| | | |
| | | if (MallGoods.ISSALE_STATUS_DISABLED.equals(mallGoods.getIsSale())) { |
| | | throw new FebsException(mallGoods.getGoodsName() + "已下架"); |
| | |
| | | } |
| | | |
| | | BigDecimal amount = sku.getPresentPrice().multiply(BigDecimal.valueOf(item.getCnt())); |
| | | BigDecimal levelOnePrice = sku.getLevelOnePrice().multiply(BigDecimal.valueOf(item.getCnt())); |
| | | //是否使用优惠卷 |
| | | if(ObjectUtil.isNotEmpty(addOrderDto.getMemberCouponId())){ |
| | | Long memberCouponId = addOrderDto.getMemberCouponId(); |
| | |
| | | } |
| | | } |
| | | orderItem.setAmount(amount); |
| | | orderItem.setLevelOnePrice(levelOnePrice); |
| | | orderItem.setScoreAmount(scoreAmountMap.get(item.getSkuId())); |
| | | orderItem.setCnt(item.getCnt()); |
| | | orderItem.setOrderId(orderInfo.getId()); |