| | |
| | | goodsInfo.setBaoyou(true);
|
| | | }
|
| | |
|
| | | List<ClientTextStyleVO> labels = goodsInfo.getLabels();
|
| | | // 自营
|
| | | String owner = otherDTO.getOwner();
|
| | | if (!StringUtil.isNullOrEmpty(owner) && "g".equalsIgnoreCase(owner)) {
|
| | | List<ClientTextStyleVO> labels = new ArrayList<ClientTextStyleVO>();
|
| | | if (labels == null) {
|
| | | labels = new ArrayList<ClientTextStyleVO>();
|
| | | }
|
| | | ClientTextStyleVO textStyleVO = new ClientTextStyleVO();
|
| | | textStyleVO.setContent("京东自营");
|
| | | textStyleVO.setColor("#E42219");
|
| | | labels.add(textStyleVO);
|
| | | goodsInfo.setLabels(labels);
|
| | | }
|
| | | // 拼团价
|
| | | JDPingouInfo pinGouInfo = otherDTO.getPinGouInfo();
|
| | | if (pinGouInfo != null) {
|
| | | goods.setPrice(pinGouInfo.getPingouPrice());
|
| | | goodsInfo.setPriceName("拼购价");
|
| | | |
| | | if (labels == null) {
|
| | | labels = new ArrayList<ClientTextStyleVO>();
|
| | | }
|
| | | ClientTextStyleVO textStyleVO = new ClientTextStyleVO();
|
| | | textStyleVO.setContent("拼购");
|
| | | textStyleVO.setColor("#E42219");
|
| | | labels.add(textStyleVO);
|
| | | } else {
|
| | | goodsInfo.setPriceName("京东价");
|
| | | }
|
| | | goodsInfo.setLabels(labels);
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) {
|
| | | goodsInfo.setSalesType(4); // 总销量
|
| | | goodsInfo.setPriceName("拼团价");
|
| | |
| | |
|
| | | goodsInfo.setGoodsType(goodsType);
|
| | | goodsInfo.setZkPrice(goods.getPrice());
|
| | | goodsInfo.setState(goods.getState());
|
| | | Integer state = goods.getState();
|
| | | if (state == null) {
|
| | | goodsInfo.setState(0);
|
| | | } else {
|
| | | goodsInfo.setState(goods.getState());
|
| | | }
|
| | | goodsInfo.setSalesCount(TaoBaoUtil.getSaleCount(goods.getSales()));
|
| | |
|
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | |
| | |
|
| | | goodsInfo.setSalesCount(TaoBaoUtil.getSaleCount(goods.getBiz30day()));
|
| | |
|
| | | //白底图可能有错误 https://img.alicdn.com/bao/uploaded/TB1LVqmVZbpK1RjSZFyXXX_qFXa.png
|
| | | if (!StringUtil.isNullOrEmpty(goods.getPictUrlWhite())) {
|
| | | goodsInfo.setPicUrl(TbImgUtil.getTBSize320Img(goods.getPictUrlWhite()));
|
| | | } else {
|
| | |
| | | * @param fanLiRate 返利比例
|
| | | * @return
|
| | | */
|
| | | public static GoodsDetailVO convertJDGoods(JDGoods goods, String pid, BigDecimal fanLiRate, BigDecimal shareRate) {
|
| | | public static GoodsDetailVO convertJDGoods(JDGoods goods, BigDecimal fanLiRate, BigDecimal shareRate) {
|
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO();
|
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_JD);
|
| | | goodsInfo.setGoodsId(goods.getSkuId());
|
| | |
| | | }
|
| | | goodsInfo.setSalesCount(salesCountMidea);
|
| | |
|
| | | JDPingouInfo pinGouInfo = goods.getPinGouInfo();
|
| | | if (pinGouInfo != null) {
|
| | | goodsInfo.setZkPrice(pinGouInfo.getPingouPrice());
|
| | | goodsInfo.setPriceName("拼购价");
|
| | | } else {
|
| | | goodsInfo.setZkPrice(goods.getPrice());
|
| | | goodsInfo.setPriceName("京东价");
|
| | | }
|
| | |
|
| | | // 资金信息
|
| | | MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
|
| | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
|
| | | CouponInfoVO coupon = new CouponInfoVO();
|
| | | coupon.setAmount(discount);
|
| | |
|
| | | coupon.setLink(couponInfo.getLink());
|
| | | coupon.setStartFee(couponInfo.getQuota());
|
| | | |
| | | if (couponInfo.getGetStartTime() != null) {
|
| | | coupon.setStartTime(sdf.format(new Date(couponInfo.getGetStartTime())));
|
| | | }
|
| | |
| | | if (couponInfo.getGetEndTime() != null) {
|
| | | coupon.setEndTime(sdf.format(new Date(couponInfo.getGetEndTime())));
|
| | | }
|
| | |
|
| | | coupon.setLink(couponInfo.getLink());
|
| | | coupon.setStartFee(couponInfo.getQuota());
|
| | |
|
| | | |
| | | |
| | | goodsInfo.setHasCoupon(true);
|
| | | goodsInfo.setCouponInfo(coupon);
|
| | | }
|
| | |
|
| | | List<ClientTextStyleVO> labels = goodsInfo.getLabels();
|
| | | // 京东自营标签
|
| | | String owner = goods.getOwner();
|
| | | if (!StringUtil.isNullOrEmpty(owner) && "g".equalsIgnoreCase(owner)) {
|
| | | List<ClientTextStyleVO> labels = new ArrayList<ClientTextStyleVO>();
|
| | | goodsInfo.setShopType(21); // 京东自营
|
| | | if (labels == null) {
|
| | | labels = new ArrayList<ClientTextStyleVO>();
|
| | | }
|
| | | ClientTextStyleVO textStyleVO = new ClientTextStyleVO();
|
| | | textStyleVO.setContent("京东自营");
|
| | | textStyleVO.setColor("#E42219");
|
| | | labels.add(textStyleVO);
|
| | | goodsInfo.setLabels(labels);
|
| | | goodsInfo.setShopType(21); // 京东自营
|
| | | } else {
|
| | | goodsInfo.setShopType(20); // 京东
|
| | | }
|
| | |
|
| | | |
| | | JDPingouInfo pinGouInfo = goods.getPinGouInfo();
|
| | | if (pinGouInfo != null) {
|
| | | goodsInfo.setZkPrice(pinGouInfo.getPingouPrice());
|
| | | goodsInfo.setPriceName("拼购价");
|
| | | |
| | | if (labels == null) {
|
| | | labels = new ArrayList<ClientTextStyleVO>();
|
| | | }
|
| | | ClientTextStyleVO textStyleVO = new ClientTextStyleVO();
|
| | | textStyleVO.setContent("拼购");
|
| | | textStyleVO.setColor("#E42219");
|
| | | labels.add(textStyleVO);
|
| | | } else {
|
| | | goodsInfo.setZkPrice(goods.getPrice());
|
| | | goodsInfo.setPriceName("京东价");
|
| | | }
|
| | | goodsInfo.setLabels(labels);
|
| | | |
| | | // 店铺信息
|
| | | JDShopInfo shopInfo = goods.getShopInfo();
|
| | | if (shopInfo != null && !StringUtil.isNullOrEmpty(shopInfo.getShopName())) {
|
| | |
| | | * @param fanLiRate 返利比例
|
| | | * @return
|
| | | */
|
| | | public static GoodsDetailVO convertPDDGoods(PDDGoodsDetail goods, String pid, BigDecimal fanLiRate,
|
| | | BigDecimal shareRate) {
|
| | | public static GoodsDetailVO convertPDDGoods(PDDGoodsDetail goods, BigDecimal fanLiRate, BigDecimal shareRate) {
|
| | | GoodsDetailVO goodsInfo = new GoodsDetailVO();
|
| | | goodsInfo.setBaoyou(true);
|
| | | goodsInfo.setGoodsType(Constant.SOURCE_TYPE_PDD);
|
| | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
|
| | | CouponInfoVO coupon = new CouponInfoVO();
|
| | | coupon.setAmount(amount);
|
| | |
|
| | | coupon.setStartFee(startFree);
|
| | | |
| | | if (goods.getCouponStartTime() != null) {
|
| | | coupon.setStartTime(sdf.format(new Date(goods.getCouponStartTime() * 1000)));
|
| | | }
|
| | |
| | | if (goods.getCouponEndTime() != null) {
|
| | | coupon.setEndTime(sdf.format(new Date(goods.getCouponEndTime() * 1000)));
|
| | | }
|
| | |
|
| | | coupon.setLink(null);
|
| | | coupon.setStartFee(startFree);
|
| | |
|
| | | |
| | | if (goods.getCouponTotalQuantity() != null)
|
| | | coupon.setTotalCount(Integer.parseInt(goods.getCouponTotalQuantity().toString()));
|
| | |
|