seatonwan9
2025-08-28 e5d17ab1bc9e0779b325c53bf23d61ae4a15432e
src/main/java/com/webmanage/service/impl/ProductPricingServiceImpl.java
@@ -48,10 +48,16 @@
            if (!StringUtils.hasText(productPricing.getPriceType())) {
                throw new BusinessException("价格设置不能为空");
            }
            if (productPricing.getPointsPrice() == null || productPricing.getPointsPrice().doubleValue() < 0) {
            if (productPricing.getPriceType().indexOf(PriceTypeEnum.POINTS.getName()) > -1
                    && productPricing.getPointsPrice() == null ||
                    productPricing.getPriceType().indexOf(PriceTypeEnum.POINTS.getName()) > -1
                            &&productPricing.getPointsPrice().doubleValue() < 0) {
                throw new BusinessException("积分价格值不能为空且不能为负数");
            }
            if (productPricing.getCurrencyPrice()== null || productPricing.getCurrencyPrice().doubleValue() < 0) {
            if (productPricing.getPriceType().indexOf(PriceTypeEnum.CURRENCY.getName()) > -1
                    && productPricing.getCurrencyPrice()== null ||
                    productPricing.getPriceType().indexOf(PriceTypeEnum.CURRENCY.getName()) > -1
                            && productPricing.getCurrencyPrice().doubleValue() < 0){
                throw new BusinessException("货币价格值不能为空且不能为负数");
            }
            if (productPricing.getProductId() == null) {
@@ -156,11 +162,8 @@
    }
    @Override
    public List<ProductPricing> getPricingByProductId(Long productId) {
    public List<ProductPricing> getPricingByProductId(String productId) {
        try {
            if (productId == null) {
                throw new BusinessException("产品ID不能为空");
            }
            return baseMapper.selectByProductId(productId);
        } catch (Exception e) {
            log.error("根据产品ID查询定价失败: ", e);