| | |
| | | }
|
| | |
|
| | | public static TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods, DaTaoKeDetail detail) {
|
| | | if (detail != null) {
|
| | | if (detail != null && goods != null) {
|
| | | // 重新设置标题与券价格
|
| | | goods.setTitle(detail.getdTitle());
|
| | | 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(goods.getCouponAmount()).toString()));
|
| | | else
|
| | | goods.setCouponInfo(String.format("%s元无条件券", goods.getCouponAmount()));
|
| | | if (!StringUtil.isNullOrEmpty(detail.getPic()))
|
| | | goods.setPictUrlWhite(detail.getPic());
|
| | | }
|
| | | return goods;
|
| | | }
|
| | |
|
| | | public static TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods, DaTaoKeDetailV2 detail) {
|
| | | if (detail != null) {
|
| | | if (detail != null && goods != null) {
|
| | | // 重新设置标题与券价格
|
| | | goods.setTitle(detail.getDtitle());
|
| | | 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(goods.getCouponAmount()).toString()));
|
| | | else
|
| | | goods.setCouponInfo(String.format("%s元无条件券", goods.getCouponAmount()));
|
| | | if (!StringUtil.isNullOrEmpty(detail.getMainPic()))
|
| | | goods.setPictUrlWhite(detail.getMainPic());
|
| | | }
|
| | | return goods;
|
| | | }
|