| | |
| | | import java.net.URLEncoder;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.common.ImageInfo;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | |
| | |
|
| | | hongBaoInfo.setRate("最高40%");
|
| | |
|
| | | String hongbao = getGoodsHongBaoInfo(tb, new BigDecimal(proportion));
|
| | | String hongbao = getGoodsHongBaoInfo(tb, new BigDecimal(proportion), false);
|
| | | if (hongbao.contains("最高")) {
|
| | | hongBaoInfo.setType(1);
|
| | | hongBaoInfo.setHongbao(new BigDecimal(0));
|
| | |
| | | tg.setTaoBaoQuanInfo(quanInfo);
|
| | | }
|
| | |
|
| | | BigDecimal proportion = taoBaoUtil.manageService.getFanLiRate();
|
| | | BigDecimal proportion = taoBaoUtil.manageService.getFanLiRate(UserLevelEnum.daRen);
|
| | | TaoBaoHongBaoInfo hongBaoInfo = new TaoBaoHongBaoInfo();
|
| | | String tkMktStatus = tb.getTkMktStatus();
|
| | | if ("1".equals(tkMktStatus)) {
|
| | |
| | |
|
| | | hongBaoInfo.setRate("最高40%");
|
| | |
|
| | | String hongbao = getGoodsHongBaoInfo(tb, proportion);
|
| | | String hongbao = getGoodsHongBaoInfo(tb, proportion, false);
|
| | | if (!hongbao.contains("最高"))
|
| | | hongBaoInfo.setHongbao(new BigDecimal(hongbao.replace("¥", "")));
|
| | | else
|
| | |
| | | * 用户再次分成比例(0-100)
|
| | | * @return
|
| | | */
|
| | | public static String getGoodsHongBaoInfo(TaoBaoGoodsBrief goodsBrief, BigDecimal rate) {
|
| | | public static String getGoodsHongBaoInfo(TaoBaoGoodsBrief goodsBrief, BigDecimal rate, boolean share) {
|
| | | // if (goodsBrief != null && goodsBrief.getMaterialLibType() != null &&
|
| | | // goodsBrief.getMaterialLibType() == 0)
|
| | | // return "¥0.00";
|
| | | // else
|
| | | return "¥" + getGoodsHongBaoMoney(goodsBrief, rate).toString();
|
| | | return "¥" + getGoodsHongBaoMoney(goodsBrief, rate, share).toString();
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @param rate
|
| | | * @return
|
| | | */
|
| | | public static BigDecimal getGoodsHongBaoMoney(TaoBaoGoodsBrief goodsBrief, BigDecimal rate) {
|
| | | public static BigDecimal getGoodsHongBaoMoney(TaoBaoGoodsBrief goodsBrief, BigDecimal rate, boolean share) {
|
| | | BigDecimal money = null;
|
| | | if (StringUtil.isNullOrEmpty(goodsBrief.getCouponInfo())
|
| | | || goodsBrief.getCouponInfo().trim().equalsIgnoreCase("无")) {
|
| | |
| | | new BigDecimal("0.01")), MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | | }
|
| | | }
|
| | |
|
| | | if (share)
|
| | | money = TaoBaoUtil.getCanShareMoney(new Date(), money);
|
| | |
|
| | | return BigDecimalUtil.getWithNoZera(money);
|
| | | }
|
| | |
|
| | |
| | | */
|
| | |
|
| | | public static BigDecimal getShareGoodsHongBaoInfo(TaoBaoGoodsBrief goodsBrief, BigDecimal rate) {
|
| | | return getGoodsHongBaoMoney(goodsBrief, rate);
|
| | | return getGoodsHongBaoMoney(goodsBrief, rate, true);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | TaoBaoGoodsBrief taoBaoGoods = new TaoBaoGoodsBrief();
|
| | | taoBaoGoods.setAuctionId(detail.getGoodsId());
|
| | | taoBaoGoods.setBiz30day(detail.getMonthSales());
|
| | | // 券相关转换
|
| | | taoBaoGoods.setCouponAmount(detail.getCouponPrice());
|
| | | taoBaoGoods.setCouponInfo(String.format("满%s元减%s元", detail.getCouponConditions(),
|
| | | taoBaoGoods.setCouponInfo(String.format("满%s元减%s元", detail.getOriginalPrice(),
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getCouponPrice())));
|
| | | if (detail.getCouponTotalNum() != null && detail.getCouponReceiveNum() != null)
|
| | | taoBaoGoods.setCouponLeftCount(detail.getCouponTotalNum() - detail.getCouponReceiveNum());
|
| | | else
|
| | | taoBaoGoods.setCouponLeftCount(0);
|
| | | taoBaoGoods.setCouponStartFee(detail.getOriginalPrice());
|
| | | try {
|
| | | taoBaoGoods.setCouponStartFee(detail.getOriginalPrice());
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | | taoBaoGoods.setCouponTotalCount(detail.getCouponTotalNum());
|
| | | taoBaoGoods.setCouponLink(detail.getCouponLink());
|
| | | taoBaoGoods.setCouponEffectiveStartTime(TimeUtil.getGernalTime(
|
| | | TimeUtil.convertToTimeTemp(detail.getCouponStartTime(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd"));
|
| | | taoBaoGoods.setCouponEffectiveEndTime(TimeUtil.getGernalTime(
|
| | | TimeUtil.convertToTimeTemp(detail.getCouponEndTime(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd"));
|
| | |
|
| | | taoBaoGoods.setPictUrl(detail.getMainPic());
|
| | | taoBaoGoods.setPictUrlWhite(detail.getMainPic());
|
| | | if (taoBaoGoods.getPictUrl() != null && !taoBaoGoods.getPictUrl().startsWith("http"))
|
| | |
| | | if (elements.size() >= 0) {
|
| | | for (int i = 0; i < elements.size(); i++) {
|
| | | String content = elements.get(i).toString();
|
| | | if (content.contains("var _DATA_Mdskip")) {
|
| | | if (content.contains("var _DATA_Detail")) {
|
| | | content = content.replace("<script>", "");
|
| | | content = content.replace("</script>", "");
|
| | |
|
| | | if (content.contains("videoDetail")) {
|
| | | content += ";function getData(){ var json={title:_DATA_Mdskip.item.title,pictUrl:_DATA_Mdskip.item.videoDetail.videoThumbnailURL}; return JSON.stringify(json);}";
|
| | | content += ";function getData(){ var json={title:_DATA_Detail.item.title,pictUrl:_DATA_Detail.item.images[0]}; return JSON.stringify(json);}";
|
| | | } else {
|
| | | content += ";function getData(){ var json={title:_DATA_Mdskip.item.title,pictUrl:_DATA_Mdskip.item.videos[0].videoThumbnailURL}; return JSON.stringify(json);}";
|
| | | content += ";function getData(){ var json={title:_DATA_Detail.item.title,pictUrl:_DATA_Detail.item.images[0]}; return JSON.stringify(json);}";
|
| | | }
|
| | |
|
| | | ScriptEngineManager manager = new ScriptEngineManager();
|
| | |
| | | taoBaoGoodsBrief = new TaoBaoGoodsBrief();
|
| | | taoBaoGoodsBrief.setTitle(title.toString());
|
| | | taoBaoGoodsBrief.setPictUrl(pictUrl.toString());
|
| | | if (!pictUrl.toString().startsWith("http")) {
|
| | | taoBaoGoodsBrief.setPictUrl(TbImgUtil.getTBSize220Img("http:" + pictUrl.toString()));
|
| | | }
|
| | | }
|
| | |
|
| | | break;
|
| | |
| | | return urlList;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取能够分的钱
|
| | | * @Title: getCanShareMoney
|
| | | * @Description: |
| | | * @param estimate
|
| | | * @return |
| | | * BigDecimal 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static BigDecimal getCanShareMoney(Date createTime, BigDecimal estimate) {
|
| | | if (estimate == null)
|
| | | return null;
|
| | | if (createTime.getTime() < TimeUtil.convertToTimeTemp("2020-06-01 12:30:00", "yyyy-MM-dd HH:mm:ss")) {
|
| | | return estimate;
|
| | | }
|
| | | BigDecimal rate = new BigDecimal("0.9101");
|
| | | return MoneyBigDecimalUtil.mul(estimate, rate);
|
| | | }
|
| | |
|
| | | }
|