From c007868c62c7da5c9ce1bf0e77d9e5f8619826e4 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期三, 12 六月 2019 12:24:09 +0800 Subject: [PATCH] 查询默认有效调整 --- fanli/src/main/java/com/yeshi/fanli/util/taobao/DaTaoKeUtil.java | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/taobao/DaTaoKeUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/taobao/DaTaoKeUtil.java index d52d0f7..4c74dc1 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/taobao/DaTaoKeUtil.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/taobao/DaTaoKeUtil.java @@ -521,13 +521,15 @@ if (detail != null) { // 閲嶆柊璁剧疆鏍囬涓庡埜浠锋牸 goods.setTitle(detail.getdTitle()); - goods.setCouponAmount(detail.getQuanPrice()); + if (goods.getCouponAmount() != null && detail.getQuanPrice() != null + && goods.getCouponAmount().compareTo(detail.getQuanPrice()) < 0) + goods.setCouponAmount(detail.getQuanPrice()); goods.setZkPrice(detail.getOrgPrice()); if (new BigDecimal(detail.getQuanCondition()).compareTo(new BigDecimal(0)) > 0) goods.setCouponInfo(String.format("婊�%s鍏冨噺%s鍏�", detail.getQuanCondition(), - MoneyBigDecimalUtil.getWithNoZera(detail.getQuanPrice()).toString())); + MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString())); else - goods.setCouponInfo(String.format("%s鍏冩棤鏉′欢鍒�", detail.getQuanPrice())); + goods.setCouponInfo(String.format("%s鍏冩棤鏉′欢鍒�", goods.getCouponAmount())); } return goods; } @@ -536,13 +538,15 @@ if (detail != null) { // 閲嶆柊璁剧疆鏍囬涓庡埜浠锋牸 goods.setTitle(detail.getDtitle()); - goods.setCouponAmount(detail.getCouponPrice()); + if (goods.getCouponAmount() != null && detail.getCouponPrice() != null + && goods.getCouponAmount().compareTo(detail.getCouponPrice()) < 0) + goods.setCouponAmount(detail.getCouponPrice()); goods.setZkPrice(detail.getOriginalPrice()); if (new BigDecimal(detail.getCouponConditions()).compareTo(new BigDecimal(0)) > 0) goods.setCouponInfo(String.format("婊�%s鍏冨噺%s鍏�", detail.getCouponConditions(), - MoneyBigDecimalUtil.getWithNoZera(detail.getCouponPrice()).toString())); + MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString())); else - goods.setCouponInfo(String.format("%s鍏冩棤鏉′欢鍒�", detail.getCouponPrice())); + goods.setCouponInfo(String.format("%s鍏冩棤鏉′欢鍒�", goods.getCouponAmount())); } return goods; } -- Gitblit v1.8.0