xin
3 days ago 8c182b3ba68aa74befe624697cb842e1b53034eb
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderServiceImpl.java
@@ -212,6 +212,7 @@
        }
        List<ProductInfo> products = new ArrayList<>();
        BigDecimal amount = BigDecimal.ZERO;
        int count = 0;
        for (ProductOrder productOrder : criteria.getProducts()) {
            Product product = productService.getById(productOrder.getProductId());
            if (product == null) {
@@ -236,6 +237,7 @@
            info.setCount(productOrder.getCount());
            products.add(info);
            amount = BigDecimalUtils.add(amount, BigDecimalUtils.multiply(product.getPrice(), productOrder.getCount()));
            count += productOrder.getCount();
        }
        if (!(amount.compareTo(store.getDeliveryMinimum()) >= 0)) {
            throw new BadRequestException("起送金额:" + store.getDeliveryMinimum());
@@ -246,6 +248,8 @@
        info.setAmount(amount);
        info.setPayAmount(amount);
        info.setPromotionAmount(BigDecimal.ZERO);
        info.setDeliveryPrice(store.getDeliveryFee());
        info.setPackagingPrice(BigDecimalUtils.multiply(store.getPackagingFee(), count));
        info.setUserAddresses(userAddressService.queryUserAddress(store.getLongitude(), store.getLatitude()));
        return info;
    }