Helius
2021-07-02 fd5db46751d153ab8e4d9b025680428917b15f76
modify
1 files modified
4 ■■■ changed files
gc-shop/src/main/java/com/xzx/gc/shop/service/OrderService.java 4 ●●● patch | view | raw | blame | history
gc-shop/src/main/java/com/xzx/gc/shop/service/OrderService.java
@@ -181,13 +181,15 @@
        }
        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoByUserId(addGoodsOrderDto.getUserId());
        log.info("积分:{}", accountInfo.getCollectScore());
        if (accountInfo.getCollectScore() == null) {
            throw new RestException(-3, "积分不足");
        }
        BigDecimal totalPrice = sku.getPresentPrice().multiply(BigDecimal.valueOf(addGoodsOrderDto.getCnt()));
        BigDecimal score = new BigDecimal(accountInfo.getCollectScore());
        log.info("积分:{}", score);
        log.info("积分1:{}", totalPrice);
        if (score.compareTo(totalPrice) < 0) {
            throw new RestException(-3, "积分不足");
        }