| | |
| | |
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.goods.PullNewGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
| | | return goods;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 好单库商品转换
|
| | | * @param hdkGoods
|
| | | * @return
|
| | | */
|
| | | public static TaoBaoGoodsBrief create(PullNewGoods hdkGoods) {
|
| | | if (hdkGoods == null)
|
| | | return null;
|
| | |
|
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief();
|
| | | goods.setAuctionId(hdkGoods.getItemid());
|
| | | goods.setTitle(hdkGoods.getItemtitle());
|
| | | goods.setPictUrl(TbImgUtil.getTBSize320Img((hdkGoods.getItempic())));
|
| | | goods.setZkPrice(new BigDecimal(hdkGoods.getItemprice() + ""));
|
| | | goods.setBiz30day(hdkGoods.getItemsale());
|
| | | goods.setTkRate(BigDecimal.valueOf(hdkGoods.getTkrates()));
|
| | | goods.setState(0);
|
| | | |
| | | // 图片列表
|
| | | String taobao_image = hdkGoods.getTaobao_image();
|
| | | if (!StringUtil.isNullOrEmpty(taobao_image)) {
|
| | | goods.setImgList(Arrays.asList(taobao_image.split(",")));
|
| | | }
|
| | | |
| | | // 券信息
|
| | | if (hdkGoods.getCouponmoney() != null && hdkGoods.getCouponmoney() > 0) {
|
| | | goods.setCouponAmount(BigDecimal.valueOf(hdkGoods.getCouponmoney()));
|
| | | |
| | | if (hdkGoods.getCoupon_condition() != null) {
|
| | | BigDecimal couponCondition = new BigDecimal(hdkGoods.getCoupon_condition());
|
| | | goods.setCouponStartFee(couponCondition);
|
| | | if (couponCondition.compareTo(new BigDecimal(0)) > 0)
|
| | | goods.setCouponInfo(String.format("满%s元减%s元", MoneyBigDecimalUtil.getWithNoZera(couponCondition)+ "",
|
| | | MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount())+ ""));
|
| | | else
|
| | | goods.setCouponInfo(String.format("%s元无条件券", goods.getCouponAmount() + ""));
|
| | | |
| | | }
|
| | | goods.setCouponLink(hdkGoods.getCouponurl());
|
| | | goods.setCouponLeftCount(hdkGoods.getCouponsurplus());
|
| | | goods.setCouponTotalCount(hdkGoods.getCouponnum());
|
| | | }
|
| | | |
| | | // 店铺
|
| | | goods.setShopTitle(hdkGoods.getShopname());
|
| | | if ("B".equalsIgnoreCase(hdkGoods.getShoptype()))
|
| | | goods.setUserType(1); // 天猫
|
| | | else
|
| | | goods.setUserType(0); // 淘宝
|
| | | |
| | | return goods;
|
| | | }
|
| | | |
| | |
|
| | | }
|