| | |
| | | return obj;
|
| | | }
|
| | |
|
| | | |
| | | private String getHttpServletParams(HttpServletRequest request) {
|
| | | if (request == null) {
|
| | | return "";
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.entity.taobao.TaobaoMeterial;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsClassService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaobaoMeterialService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
| | | private TaoBaoClassService taoBaoClassService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | /**
|
| | | *
|
| | |
| | | PrintWriter out) {
|
| | | try {
|
| | | key = StringUtil.isNullOrEmpty(key) ? "" : key;
|
| | | List<DaTaoKeDetail> list = daTaoKeGoodsDetailService.listSearchByTitleWithCid(key, cid, pageIndex,
|
| | | List<DaTaoKeDetailV2> list = daTaoKeGoodsDetailV2Service.listSearchByTitleWithCid(key, cid, pageIndex,
|
| | | pageSize);
|
| | | long count = daTaoKeGoodsDetailService.countSearchByTitleWithCid(key, cid);
|
| | | long count = daTaoKeGoodsDetailV2Service.countSearchByTitleWithCid(key, cid);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | for (DaTaoKeDetail detail : list) {
|
| | | for (DaTaoKeDetailV2 detail : list) {
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoHongBaoInfo;
|
| | | import com.yeshi.fanli.entity.taobao.TaobaoMeterial;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | |
| | | import com.yeshi.fanli.entity.brand.TaoBaoShopHistory;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassService;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | |
| | | @Resource
|
| | | private HongBaoManageService manageService;
|
| | |
|
| | | |
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsService daTaoKeGoodsService;
|
| | | |
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private BrandInfoRecordService brandInfoRecordService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 获取品牌分类
|
| | | *
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 添加足迹
|
| | | *
|
| | |
| | | out.print(JsonUtil.loadFalseResult("未选择数据"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | // 新版删除
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | taoBaoShopHistoryService.deleteHistory(Arrays.asList(ids.split(",")), uid, acceptData.getDevice());
|
| | | out.print(JsonUtil.loadTrueResult("删除成功"));
|
| | | } catch (Exception e) {
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 店铺足迹
|
| | | *
|
| | | * @param acceptData
|
| | | * @param type 精选1, 足迹列表2
|
| | | * @param type
|
| | | * 精选1, 足迹列表2
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHistory", method = RequestMethod.POST)
|
| | |
| | | if (page == null || page < 1) {
|
| | | page = 1;
|
| | | }
|
| | | |
| | |
|
| | | int pageSize;
|
| | | if (type == 1) {
|
| | | pageSize = 4;
|
| | |
| | | for (TaoBaoShopHistory history : listHistory) {
|
| | | TaoBaoShop taoBaoShop = history.getTaoBaoShop();
|
| | | if (taoBaoShop != null) {
|
| | | |
| | |
|
| | | String shopLink = taoBaoShop.getShopLink();
|
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | | taoBaoShop.setShopLink(TaoBaoUtil.getShopLink(taoBaoShop.getId()));
|
| | | }
|
| | | |
| | |
|
| | | String shopNameCustom = taoBaoShop.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | taoBaoShop.setShopName(shopNameCustom);
|
| | | }
|
| | | |
| | |
|
| | | String shopIconCustom = taoBaoShop.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | taoBaoShop.setShopIcon(shopIconCustom);
|
| | | }
|
| | | |
| | |
|
| | | list.add(taoBaoShop);
|
| | | }
|
| | | }
|
| | |
| | | out.print(JsonUtil.loadFalseResult("缺失店铺id"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (page == 1) {
|
| | | TaoBaoShop taoBaoShop = taoBaoShopService.selectByPrimaryKey(sid);
|
| | |
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | | taoBaoShop.setShopLink(TaoBaoUtil.getShopLink(taoBaoShop.getId()));
|
| | | }
|
| | | |
| | |
|
| | | String shopNameCustom = taoBaoShop.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | taoBaoShop.setShopName(shopNameCustom);
|
| | | }
|
| | | |
| | |
|
| | | String shopIconCustom = taoBaoShop.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | taoBaoShop.setShopIcon(shopIconCustom);
|
| | | }
|
| | | data.put("shop", JsonUtil.getApiCommonGson().toJson(taoBaoShop));
|
| | | |
| | | |
| | |
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | // 添加足迹
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | |
| | | // 商品列表信息
|
| | | int pageSize = 50;
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = new ArrayList<TaoBaoGoodsBrief>();
|
| | | |
| | |
|
| | | // 先查询大淘客数据
|
| | | List<DaTaoKeDetail> listDaTaoKe = daTaoKeGoodsService.listBySellerId(0, pageSize, sid);
|
| | | List<DaTaoKeDetailV2> listDaTaoKe = daTaoKeGoodsDetailV2Service.listBySellerId(0, pageSize, sid);
|
| | | if (listDaTaoKe != null && listDaTaoKe.size() > 0) {
|
| | | for (DaTaoKeDetail daTaoKe: listDaTaoKe) {
|
| | | for (DaTaoKeDetailV2 daTaoKe : listDaTaoKe) {
|
| | | listGoodsBrief.add(TaoBaoUtil.convert(daTaoKe));
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 不足50条数据、查询精选库
|
| | | if (listGoodsBrief.size() < pageSize) {
|
| | | int needCount = pageSize- listGoodsBrief.size();
|
| | | int needCount = pageSize - listGoodsBrief.size();
|
| | | List<TaoBaoGoodsBrief> listGoods = taoBaoGoodsBriefService.listByShopId(0, needCount, sid);
|
| | | if (listGoods != null && listGoods.size() > 0) {
|
| | | |
| | |
|
| | | if (listGoodsBrief.size() > 0) {
|
| | | for (int i = 0; i< listGoods.size(); i ++) {
|
| | | for (int i = 0; i < listGoods.size(); i++) {
|
| | | long id = listGoods.get(i).getAuctionId();
|
| | | boolean isRepeat = false;
|
| | | for (TaoBaoGoodsBrief goodsBrief: listGoodsBrief) {
|
| | | for (TaoBaoGoodsBrief goodsBrief : listGoodsBrief) {
|
| | | long auctionId = goodsBrief.getAuctionId();
|
| | | if (auctionId == id) {
|
| | | isRepeat = true;
|
| | | break;
|
| | | }
|
| | | }
|
| | | if(isRepeat) {
|
| | | if (isRepeat) {
|
| | | listGoods.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | listGoodsBrief.addAll(listGoods);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | if (listGoodsBrief.size() > 0) {
|
| | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | |
| | |
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
|
| | | boolean stateSale = false; // 默认停售
|
| | |
| | | continue;
|
| | | }
|
| | | }
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null)));
|
| | | array.add(gson.toJson(
|
| | | TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null)));
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | data.put("count", array.size());
|
| | | data.put("list", array);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | |
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | /**
|
| | | * 获取商品信息
|
| | |
| | |
|
| | | LogHelper.test("根据粘贴板推荐:" + text);
|
| | |
|
| | | |
| | |
|
| | | if (text.length() > 80) {
|
| | | out.print(JsonUtil.loadFalseResult("值过长"));
|
| | | return;
|
| | |
| | | }
|
| | |
|
| | | // 查询大淘客标题
|
| | | List<DaTaoKeDetail> list = daTaoKeGoodsDetailService.listByDtitle(text);
|
| | | List<DaTaoKeDetailV2> list = daTaoKeGoodsDetailV2Service.listByDtitle(text);
|
| | | if (list != null && list.size() > 0) {
|
| | | root.put("type", 2);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("title", list.get(0).getdTitle());
|
| | | data.put("title", list.get(0).getDtitle());
|
| | | root.put("data", data);
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | return;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
|
| | |
| | | private TaoBaoShopService taoBaoShopService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyExtraService userMoneyExtraService;
|
| | |
| | | // filter
|
| | | try {
|
| | |
|
| | | gList = daTaoKeGoodsDetailService.filterTaoBaoGoods(gList);
|
| | | gList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(gList);
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | |
| | |
|
| | | // 大淘客商品过滤
|
| | | try {
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | | goods = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goods);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchNav;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.user.HistorySearchService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.EhcacheUtil;
|
| | |
| | | private TaoBaoShopService taoBaoShopService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | |
|
| | | // 搜索大淘客
|
| | | List<DaTaoKeDetail> daTaoKeList = null;
|
| | | List<DaTaoKeDetailV2> daTaoKeList = null;
|
| | | if (page == 1)
|
| | | daTaoKeList = daTaoKeGoodsDetailService.listByDtitle(kw);
|
| | | daTaoKeList = daTaoKeGoodsDetailV2Service.listByDtitle(kw);
|
| | |
|
| | | TaoBaoSearchResult result = TaoBaoUtil.search(sf);
|
| | | if (result == null) {
|
| | |
| | | try {
|
| | | if (daTaoKeList != null && daTaoKeList.size() > 0) {
|
| | | Collections.reverse(daTaoKeList);
|
| | | for (DaTaoKeDetail detail : daTaoKeList) {
|
| | | for (DaTaoKeDetailV2 detail : daTaoKeList) {
|
| | | taoBaoGoodsBriefs.add(0, TaoBaoUtil.convert(detail));
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassService;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | |
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsService daTaoKeGoodsService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
| | | List<TaoBaoGoodsBrief> listGoodsBrief = new ArrayList<TaoBaoGoodsBrief>();
|
| | |
|
| | | // 先查询大淘客数据
|
| | | List<DaTaoKeDetail> listDaTaoKe = daTaoKeGoodsService.listBySellerId(0, pageSize, sid);
|
| | | List<DaTaoKeDetailV2> listDaTaoKe = daTaoKeGoodsDetailV2Service.listBySellerId(0, pageSize, sid);
|
| | | if (listDaTaoKe != null && listDaTaoKe.size() > 0) {
|
| | | for (DaTaoKeDetail daTaoKe : listDaTaoKe) {
|
| | | for (DaTaoKeDetailV2 daTaoKe : listDaTaoKe) {
|
| | | listGoodsBrief.add(TaoBaoUtil.convert(daTaoKe));
|
| | | }
|
| | | }
|
| | |
| | | List<TaoBaoGoodsBrief> listGoodsBrief = new ArrayList<TaoBaoGoodsBrief>();
|
| | |
|
| | | // 先查询大淘客数据
|
| | | List<DaTaoKeDetail> listDaTaoKe = daTaoKeGoodsService.listBySellerId(0, pageSize, id);
|
| | | List<DaTaoKeDetailV2> listDaTaoKe = daTaoKeGoodsDetailV2Service.listBySellerId(0, pageSize, id);
|
| | | if (listDaTaoKe != null && listDaTaoKe.size() > 0) {
|
| | | for (DaTaoKeDetail daTaoKe : listDaTaoKe) {
|
| | | for (DaTaoKeDetailV2 daTaoKe : listDaTaoKe) {
|
| | | listGoodsBrief.add(TaoBaoUtil.convert(daTaoKe));
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | |
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
| | |
|
| | | // 大淘客商品过滤
|
| | | try {
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | | goods = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goods);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.pdd.PDDGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | |
| | |
|
| | | @Resource
|
| | | private QualityFlashSaleService qualityFlashSaleService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @Resource
|
| | | private RecommendGoodsDeleteHistoryService recommendGoodsDeleteHistoryService;
|
| | |
| | |
|
| | | // filter
|
| | | try {
|
| | | gList = daTaoKeGoodsDetailService.filterTaoBaoGoods(gList);
|
| | | gList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(gList);
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.user.TokenRecordException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.user.HistorySearchService;
|
| | | import com.yeshi.fanli.service.inter.user.TokenRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
|
| | |
| | | private TaoBaoShopService taoBaoShopService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
| | | }
|
| | | // 去除前后空格
|
| | | text = text.trim();
|
| | | String originalText=text;
|
| | | String originalText = text;
|
| | |
|
| | | try {
|
| | | TokenVO tokenVO = tokenRecordService.discernToken(text, uid, acceptData);
|
| | |
| | | tb = TaoBaoUtil.isAlimama(id);
|
| | | if (tb == null) {
|
| | | type = 4;
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(id,originalText);
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(id, originalText);
|
| | | }
|
| | | } else if (text.contains("http://zmnxbc.com")) { // 手机端天猫APP分享
|
| | | tb = TaoBaoUtil.parsePhoneShareUrlByTM(text);
|
| | |
| | | tb = TaoBaoUtil.isAlimama(id);
|
| | | if (tb == null) {
|
| | | type = 4;
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(id,originalText);
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(id, originalText);
|
| | | }
|
| | | } else if (text.contains("v.douyin.com")) { // 抖音
|
| | | analysisDouYin(acceptData, text, out);
|
| | |
| | | if (tb == null) {
|
| | | String goodsId = TaoBaoUtil.getGoodsIdByPhoneShareUrl(text);
|
| | | if (!StringUtil.isNullOrEmpty(goodsId)) {
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(goodsId,originalText);
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(goodsId, originalText);
|
| | | if (tb != null)
|
| | | type = 4;
|
| | | }
|
| | |
| | | private TaoBaoGoodsBrief getTaoBaoGoodsBriefFromGoodsId(String goodsId, String text) {
|
| | | TaoBaoGoodsBrief tb = TaoBaoUtil.getTmallGoodsInfo(goodsId);
|
| | | if (tb == null && NumberUtil.isNumeric(goodsId)) {// 是数字
|
| | | // tb = TaoBaoUtil.getSimpleGoodsBrief(Long.parseLong(goodsId));
|
| | | // if (tb != null) {
|
| | | // tb.setPictUrl(TbImgUtil.getTBSize220Img(tb.getPictUrl()));
|
| | | // }
|
| | | // tb = TaoBaoUtil.getSimpleGoodsBrief(Long.parseLong(goodsId));
|
| | | // if (tb != null) {
|
| | | // tb.setPictUrl(TbImgUtil.getTBSize220Img(tb.getPictUrl()));
|
| | | // }
|
| | | if (tb == null) {
|
| | | tb = new TaoBaoGoodsBrief();
|
| | | if (text.trim().indexOf("【") == 0 && text.trim().indexOf("】") > 0) {
|
| | |
| | | }
|
| | |
|
| | | // 搜索大淘客
|
| | | List<DaTaoKeDetail> daTaoKeList = null;
|
| | | List<DaTaoKeDetailV2> daTaoKeList = null;
|
| | | if (page == 1) {
|
| | | daTaoKeList = daTaoKeGoodsDetailService.listByDtitle(key);
|
| | | daTaoKeList = daTaoKeGoodsDetailV2Service.listByDtitle(key);
|
| | | }
|
| | |
|
| | | // 淘宝api搜索商品
|
| | |
| | | if (daTaoKeList != null && daTaoKeList.size() > 0) {
|
| | | try {
|
| | | Collections.reverse(daTaoKeList);
|
| | | for (DaTaoKeDetail detail : daTaoKeList) {
|
| | | for (DaTaoKeDetailV2 detail : daTaoKeList) {
|
| | | taoBaoGoodsBriefs.add(0, TaoBaoUtil.convert(detail));
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
| | | public class ShareHotGoodsController {
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private ShareHotGoodsService shareHotGoodsService;
|
| | |
| | |
|
| | | if (TaoBaoUtil.canAddToTLJBuyGoods(goods)) {
|
| | | count++;
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | | goods = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goods);
|
| | | shareHotGoodsService.addShareHotGoods(new ShareHotGoods(null, day, new Date(), goods));
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
| | | private TLJBuyGoodsService tljBuyGoodsService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
| | | if (TaoBaoUtil.getAfterUseCouplePrice(goods).multiply(goods.getTkRate())
|
| | | .compareTo(new BigDecimal("143")) >= 0) {
|
| | | count++;
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | | goods = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goods);
|
| | | int totalHongBaoCount = 2000 + (int) (Math.random() * 8000);
|
| | | int leftHongBaoCount = 200 + (int) (Math.random() * 2000);
|
| | | tljBuyGoodsService.addTLJBuyGoods(
|
| | |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJFreeBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private TLJFreeBuyGoodsService tljFreeBuyGoodsService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
| | | package com.yeshi.fanli.controller.wxmp.v1;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.IPUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.WXMPAcceptData;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private DeviceActiveService deviceActiveService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | |
|
| | | /**
|
| | | * 获取系统配置信息
|
| | |
| | | da.setMac(null);
|
| | | deviceActiveService.addDeviceActive(da);
|
| | | }
|
| | |
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getUserConfig", method = RequestMethod.POST)
|
| | | public void getUserConfig(AcceptData acceptData, PrintWriter out) {
|
| | | try {
|
| | | // 用户协议链接
|
| | | String serviceProtocol = configService.get("service_protocol_link");
|
| | | // 隐私条款链接
|
| | | String privacyProtocol = configService.get("privacy_protocol_link");
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("serviceProtocolLink", serviceProtocol);
|
| | | data.put("privacyProtocolLink", privacyProtocol);
|
| | |
|
| | | // 我的界面banner
|
| | | List<SwiperPicture> banner = swiperPictureService.getByBannerCardAndVersion("my_interface_banner",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (banner == null)
|
| | | banner = new ArrayList<SwiperPicture>();
|
| | | data.put("banner", JsonUtil.getApiCommonGson().toJson(banner));
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("获取失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.controller.wxmp.v1;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.entity.wx.WXMPSessionInfo;
|
| | | import org.yeshi.utils.wx.WXXCXUtil;
|
| | |
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.WXMPAcceptData;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoModifyRecord.ModifyTypeEnum;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.exception.user.UserInfoException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.user.MaskKeyService;
|
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoModifyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.annotation.UserActive;
|
| | | import com.yeshi.fanli.vo.user.UserInfoExtraVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private MaskKeyService maskKeyService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInfoModifyRecordService userInfoModifyRecordService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | |
|
| | | @Resource
|
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | | @Resource
|
| | | private UserCustomSettingsService userCustomSettingsService;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | /**
|
| | | * 获取openId
|
| | |
| | | out.print(JsonUtil.loadFalseResult("openId获取失败"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @RequestMapping(value = "saveInfo")
|
| | | public void saveInfo(AcceptData acceptData, String nickName, String weiXin, Integer sex, Long uid,
|
| | | String inviteCode, MultipartFile qrCodeFile, HttpServletRequest request, PrintWriter out) {
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 二维码
|
| | | if (qrCodeFile != null) {
|
| | | userInfoExtraService.uploadERCode(qrCodeFile, uid);
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (UserInfoException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void outUserInfoHandle(UserInfo user) {
|
| | |
|
| | | // 红包处理
|
| | | user.setTotalHongBao(new BigDecimal(0));
|
| | | user.setNoOpenHongBao(new BigDecimal(0));
|
| | | user.setCanOpenHongBao(new BigDecimal(0));
|
| | |
|
| | | // 电话号码处理
|
| | | if (!StringUtil.isNullOrEmpty(user.getPhone())) {
|
| | | if (user.getPhone().length() > 5) {
|
| | | String phone = user.getPhone().substring(0, 3);
|
| | | phone += "******";
|
| | | phone += user.getPhone().substring(user.getPhone().length() - 2, user.getPhone().length());
|
| | | user.setPhone(phone);
|
| | | }
|
| | | }
|
| | |
|
| | | UserInfoExtraVO userInfoExtra = userInfoExtraService.getInfoExtraVOByUid(user.getId());
|
| | | if (userInfoExtra != null && userInfoExtra.getUserRank() != null) {
|
| | | String picture = userInfoExtra.getUserRank().getPicture();
|
| | | String icon = userInfoExtra.getUserRank().getIcon();
|
| | | user.setRankNamePicture(picture);
|
| | | user.setRankIcon(icon);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取用户信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param form
|
| | | * @param requst
|
| | | * @param out
|
| | | */
|
| | | @UserActive(uid = "#uid")
|
| | | @RequestMapping(value = "getUserInfo", method = RequestMethod.POST)
|
| | | public void getuserinfoNew(AcceptData acceptData, Long uid, HttpServletRequest requst, PrintWriter out) {
|
| | | try {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("请求参数为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo userInfo = userInfoService.getUserInfo(uid);
|
| | |
|
| | | // 添加用户活跃记录
|
| | | UserActiveLog userActiveLog = new UserActiveLog();
|
| | | userActiveLog.setChannel(acceptData.getChannel());
|
| | | userActiveLog.setIp(requst.getRemoteHost());
|
| | | userActiveLog.setUid(userInfo.getId());
|
| | | userActiveLog.setVersionCode(acceptData.getVersion());
|
| | | userActiveLog.setOsVersion(acceptData.getOsVersion());
|
| | | userActiveLog.setDeviceType(acceptData.getDeviceType());
|
| | | userActiveLog.setDevice(acceptData.getDevice());
|
| | | userActiveLogService.addUserActiveLog(userActiveLog);
|
| | |
|
| | | // 处理用户信息
|
| | | outUserInfoHandle(userInfo);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | JSONObject data = new JSONObject();
|
| | |
|
| | | boolean tailor = false;
|
| | | int welfareCenterNews = 0;
|
| | | String invitCode = null;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null) {
|
| | | if (userInfoExtra.getCouponNews() != null) {
|
| | | welfareCenterNews = userInfoExtra.getCouponNews();
|
| | | }
|
| | | // vip邀请码优先
|
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip())) {
|
| | | invitCode = userInfoExtra.getInviteCodeVip();
|
| | | } else if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tailor = true;
|
| | | invitCode = userInfoExtra.getInviteCode();
|
| | | }
|
| | |
|
| | | if (userInfoExtra.getUserRank() != null) {
|
| | | String picture = userInfoExtra.getUserRank().getPicture();
|
| | | String icon = userInfoExtra.getUserRank().getIcon();
|
| | | userInfo.setRankNamePicture(picture);
|
| | | userInfo.setRankIcon(icon);
|
| | | } else {
|
| | | userInfo.setRankNamePicture(null);
|
| | | userInfo.setRankIcon(null);
|
| | | }
|
| | |
|
| | | if (userInfoExtra.getSex() != null)
|
| | | userInfo.setSex(userInfoExtra.getSex());
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin()))
|
| | | userInfo.setWeiXin(userInfoExtra.getWeiXin());
|
| | |
|
| | | // 二维码
|
| | | userInfo.setErCode(userInfoExtra.getErCode());
|
| | | }
|
| | | // 显示邀请码特制入口
|
| | | data.put("tailor", tailor);
|
| | |
|
| | | // 1.6.5 之后返回 微信号提示
|
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | userInfo.setWeiXinTip("添加微信号后,你的邀请人和直接粉丝可以通过微信与你建立联系。");
|
| | |
|
| | | data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo));
|
| | | data.put("invitCode", invitCode); // 邀请码
|
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip()))
|
| | | data.put("invitCodeUpdated", true);// 邀请码是否已经修改过
|
| | | else
|
| | | data.put("invitCodeUpdated", false);
|
| | | data.put("vipLink", configService.get("vip_link"));// 超级会员升级链接
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(invitCode)) {
|
| | | String bossName = "";
|
| | | ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
|
| | | if (threeSale != null && threeSale.getBoss() != null) {
|
| | | bossName = threeSale.getBoss().getNickName();
|
| | | }
|
| | | data.put("bossName", bossName);
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | final UserInfo uuser = userInfo;
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | // 获取邀请码:若无邀请码且存在有效的队员关系 则自动生成邀请码
|
| | | userInfoExtraService.getInviteCodeByUid(uuser.getId());
|
| | |
|
| | | // 更新用户附加信息,老用户不存在的需要添加
|
| | | try {
|
| | | userInfoExtraService.updateUserRankByUid(uuser.getId());
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | } catch (UserInfoException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("获取失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | return mongoTemplate.count(query, getEntityClass());
|
| | | }
|
| | |
|
| | | /**
|
| | | * |
| | | * @Title: listBySellerId
|
| | | * @Description: 根据商家ID查询商品
|
| | | * @param start
|
| | | * @param count
|
| | | * @param sellerId
|
| | | * @return
|
| | | * List<DaTaoKeDetailV2> 返回类型
|
| | | * @throws
|
| | | */
|
| | | public List<DaTaoKeDetailV2> listBySellerId(int start, int count, Long sellerId) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("sellerId").is(sellerId));
|
| | | query.skip(start);
|
| | | query.limit(count);
|
| | | return mongoTemplate.find(query, DaTaoKeDetailV2.class);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJFreeBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinGiveRecordService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinReportService;
|
| | |
| | | private TLJBuyGoodsService tljBuyGoodsService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
| | | && TaoBaoUtil.getAfterUseCouplePrice(goods).multiply(goods.getTkRate())
|
| | | .compareTo(new BigDecimal("1430")) <= 0
|
| | | && goods.getUserType() == 1) {
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | | goods = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goods);
|
| | | int totalHongBaoCount = 2000 + (int) (Math.random() * 8000);
|
| | | int leftHongBaoCount = 200 + (int) (Math.random() * 2000);
|
| | | tljBuyGoodsService.addTLJBuyGoods(
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
|
| | | import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
| | | private QualityFactoryService qualityFactoryService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private ShareHotGoodsService shareHotGoodsService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | // 1个小时更新一次
|
| | | @Scheduled(cron = "0 0 0/1 * * ? ")
|
| | | public void doSyncJob() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | try {
|
| | | new Thread(new Runnable() {
|
| | |
|
| | | @Override
|
| | | public void run() {
|
| | | daTaoKeGoodsService.startSyncGoods();
|
| | | }
|
| | | }).start();
|
| | |
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | // 每天早晚同步一次
|
| | | @Scheduled(cron = "0 0 6,18 * * ? ")
|
| | |
| | | && goods.getCouponAmount().compareTo(new BigDecimal(0)) > 0) {
|
| | | if (TaoBaoUtil.canAddToTLJBuyGoods(goods)) {
|
| | | count++;
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | | goods = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goods);
|
| | | shareHotGoodsService.addShareHotGoods(new ShareHotGoods(null, day, new Date(), goods));
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityUserService;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.user.QrCodeService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
| | | private RedisManager redisManager;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsService daTaoKeGoodsService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | |
| | | count = 4;
|
| | | }
|
| | |
|
| | | List<DaTaoKeDetail> listDaTaoKe = daTaoKeGoodsService.getGoodsNotInList(subclassId, null, count);
|
| | | List<DaTaoKeDetailV2> listDaTaoKe = daTaoKeGoodsDetailV2Service.getGoodsNotInList(subclassId, null, count);
|
| | |
|
| | | DaTaoKeDetail daTaoKeDetail = null;
|
| | | DaTaoKeDetailV2 daTaoKeDetail = null;
|
| | | // 商品列表
|
| | | List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>();
|
| | | // 商品列表
|
| | |
| | | BigDecimal shareMoney = new BigDecimal(0);
|
| | |
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | for (DaTaoKeDetail daTaoKe : listDaTaoKe) {
|
| | | for (DaTaoKeDetailV2 daTaoKe : listDaTaoKe) {
|
| | | if (daTaoKeDetail == null) {
|
| | | daTaoKeDetail = daTaoKe;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | // 大淘客数据
|
| | | DaTaoKeDetail daTaoKe = daTaoKeGoodsService.getGoodsNotInList(subclassId, listId, 1).get(0);
|
| | | DaTaoKeDetailV2 daTaoKe = daTaoKeGoodsDetailV2Service.getGoodsNotInList(subclassId, listId, 1).get(0);
|
| | | if (daTaoKe == null) {
|
| | | return addSuccess;
|
| | | }
|
| | |
| | | TaoBaoGoodsBrief taoBaoGoodsBrief2 = TaoKeApiUtil.getSimpleGoodsInfo(daTaoKe.getGoodsId());
|
| | | List<String> imgList = taoBaoGoodsBrief2.getImgList();
|
| | | List<String> listimgs = new ArrayList<String>();
|
| | | String pic = daTaoKe.getPic();
|
| | | String pic = daTaoKe.getMainPic();
|
| | | listimgs.add(TbImgUtil.getTBSize320Img(pic));
|
| | | if (imgList != null && imgList.size() > 0) {
|
| | | for (String img : imgList) {
|
| | |
| | | * @param subclassId
|
| | | * @throws TaobaoGoodsDownException
|
| | | */
|
| | | public DynamicInfo getDynamicInfo(DaTaoKeDetail daTaoKe, Long classId, Long subclassId) {
|
| | | public DynamicInfo getDynamicInfo(DaTaoKeDetailV2 daTaoKe, Long classId, Long subclassId) {
|
| | | DynamicInfo dynamicInfo = new DynamicInfo();
|
| | | dynamicInfo.setId(UUID.randomUUID().toString().replace("-", ""));
|
| | | dynamicInfo.setClassId(classId);
|
| | |
| | | * @param daTaoKe
|
| | | * @return
|
| | | */
|
| | | public GoodsPicture getGoodsPicture(DaTaoKeDetail daTaoKe) {
|
| | | public GoodsPicture getGoodsPicture(DaTaoKeDetailV2 daTaoKe) {
|
| | | GoodsPicture goodsPicture = new GoodsPicture();
|
| | | goodsPicture.setH(100);
|
| | | goodsPicture.setW(100);
|
| | | goodsPicture.setUrl(TbImgUtil.getTBSize320Img(daTaoKe.getPic()));
|
| | | goodsPicture.setUrl(TbImgUtil.getTBSize320Img(daTaoKe.getMainPic()));
|
| | | goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
|
| | |
|
| | | String goodsId = daTaoKe.getGoodsId().toString();
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaobaoMeterialService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | |
| | |
|
| | | @Service
|
| | | public class CommonTemplateContentServiceImpl implements CommonTemplateContentService {
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
| | | private RecommendGoodsDeleteHistoryService recommendGoodsDeleteHistoryService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private EhCacheCacheManager ehCacheCacheManager;
|
| | |
| | | // 爆款商品库
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.getMaterialByMaterialId(14624, page, Constant.PAGE_SIZE);
|
| | | if (result != null) {
|
| | | list = daTaoKeGoodsDetailService.filterTaoBaoGoods(result.getTaoBaoGoodsBriefs());
|
| | | list = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(result.getTaoBaoGoodsBriefs());
|
| | | saveObjList(list, name, key);
|
| | | return list;
|
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | |
| | | private TaoBaoClassRelationMapper taoBaoClassRelationMapper;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | |
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "qualityCache", key = "'listQueryByCouponAmount-'+#start+'-'+#key+'-'+#endAmount+'-'+#startPropor")
|
| | |
| | | @Cacheable(value = "qualityCache", key = "'listQueryByClassId-'+#start+'-'+#cid")
|
| | | public List<QualityFactory> listQueryByClassId(long start, int count, Long cid) {
|
| | | List<QualityFactory> list = qualityFactoryMapper.listQuery(start, count, null, cid, null, null, 1);
|
| | | |
| | |
|
| | | if (list == null) {
|
| | | list = new ArrayList<QualityFactory>();
|
| | | }
|
| | | |
| | |
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | for (QualityFactory qf : list)
|
| | | goodsList.add(qf.getTaoBaoGoodsBrief());
|
| | | //过滤商品信息
|
| | | goodsList=taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList);
|
| | | goodsList = daTaoKeGoodsDetailService.filterTaoBaoGoods(goodsList);// 过滤大淘客标题
|
| | | // 过滤商品信息
|
| | | goodsList = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList);
|
| | | goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList);// 过滤大淘客标题
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | if (i < goodsList.size())
|
| | | list.get(i).setTaoBaoGoodsBrief(goodsList.get(i));
|
| | |
| | | return qualityFactoryMapper.listRecommendToIndex(start, count, proportion, commision, couponAmount, tkRate,
|
| | | couponRatio);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public long countRecommend(Double proportion, Integer commision, Integer couponAmount, double tkRate,
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | goodsList = daTaoKeGoodsDetailService.filterTaoBaoGoods(goodsList);
|
| | | goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList);
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | |
| | |
|
| | | return array;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 首页最底部@商品信息流
|
| | | */
|
| | | @Override
|
| | | @Cacheable(value = "qualityCache", key = "'getRecommendToIndexV2-'+#start+'-'+#platform+'-'+#version")
|
| | | public JSONArray getRecommendToIndexV2(long start, int count,String platform,String version) {
|
| | | public JSONArray getRecommendToIndexV2(long start, int count, String platform, String version) {
|
| | |
|
| | | // 返利金额2元以上;
|
| | | Integer commision = 2;
|
| | |
| | | if (fanLiRate != null) {
|
| | | pop = Double.parseDouble(fanLiRate.toString());
|
| | | }
|
| | | |
| | |
|
| | | List<QualityFactory> listQuery = listRecommend(start, count, pop, commision, couponAmount, tkRate, couponRatio);
|
| | |
|
| | | if (listQuery == null || listQuery.size() == 0) {
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | goodsList = daTaoKeGoodsDetailService.filterTaoBaoGoods(goodsList);
|
| | | goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList);
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | | ConfigParamsDTO paramsDTO =hongBaoManageService.getShowComputeRate(platform, version);
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(platform, version);
|
| | |
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief,paramsDTO);
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
|
| | | array.add(gson.toJson(detailVO));
|
| | | }
|
| | |
|
| | | return array;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | @Cacheable(value = "qualityCache", key = "'countRecommendToIndex-'+#proportion")
|
| | | public long countRecommendToIndex(String proportion) {
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
| | | // 过滤下线商品
|
| | | goodsList = taoBaoGoodsBriefService.filterOffLineGoods(goodsList);
|
| | | // 添加大淘客信息
|
| | | goodsList = daTaoKeGoodsDetailService.filterTaoBaoGoods(goodsList);
|
| | | goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList);
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>();
|
| | | if (goodsList != null)
|
| | | for (TaoBaoGoodsBrief g : goodsList)
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.cache.annotation.CacheEvict;
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.cache.ehcache.EhCacheCacheManager;
|
| | | import org.springframework.stereotype.Service;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @Resource
|
| | | private EhCacheCacheManager ehCacheCacheManager;
|
| | |
| | | // 过滤下线商品
|
| | | goodsList = taoBaoGoodsBriefService.filterOffLineGoods(goodsList);
|
| | | // 添加大淘客信息
|
| | | goodsList = daTaoKeGoodsDetailService.filterTaoBaoGoods(goodsList);
|
| | | goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList);
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>();
|
| | | if (goodsList != null)
|
| | | for (TaoBaoGoodsBrief g : goodsList)
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJFreeBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | |
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
| | | // 过滤下线商品
|
| | | goodsList = taoBaoGoodsBriefService.filterOffLineGoods(goodsList);
|
| | | // 添加大淘客信息
|
| | | goodsList = daTaoKeGoodsDetailService.filterTaoBaoGoods(goodsList);
|
| | | goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList);
|
| | |
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>();
|
| | | if (goodsList != null)
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetailV2> listByMaxPrice(Integer cid, BigDecimal maxPrice,String sortName, int page, int count) {
|
| | | public List<DaTaoKeDetailV2> listByMaxPrice(Integer cid, BigDecimal maxPrice, String sortName, int page,
|
| | | int count) {
|
| | |
|
| | | return daTaoKeGoodsDetailV2Dao.listByMaxPrice(cid, maxPrice,sortName, (page - 1) * count, count);
|
| | | return daTaoKeGoodsDetailV2Dao.listByMaxPrice(cid, maxPrice, sortName, (page - 1) * count, count);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | return (int) daTaoKeGoodsDetailV2Dao.countByMaxPrice(cid, maxPrice);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetailV2> listBySellerId(long start, int count, Long sellerId) {
|
| | | return daTaoKeGoodsDetailV2Dao.listBySellerId((int) start, count, sellerId);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.taobao.dataoke;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.dataoke.DaTaoKeDetailMapper;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
|
| | |
|
| | | @Service
|
| | | public class DaTaoKeGoodsServiceImpl implements DaTaoKeGoodsService {
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeDetailMapper daTaoKeDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | private List<DaTaoKeDetail> reSearchDetails(List<DaTaoKeDetail> list) {
|
| | | Map<Long, DaTaoKeDetail> map = new HashMap<>();
|
| | | List<Long> idList = new ArrayList<>();
|
| | | if (list != null) {
|
| | | for (DaTaoKeDetail detail : list) {
|
| | | idList.add(detail.getId());
|
| | | map.put(detail.getId(), detail);
|
| | | }
|
| | | List<DaTaoKeDetail> detailList = daTaoKeGoodsDetailService.listByIds(idList);
|
| | | if (detailList != null)
|
| | | for (DaTaoKeDetail dk : detailList) {
|
| | | dk.setUpdateTime(new Date());// 增加更新时间
|
| | | dk.setSalesNum(map.get(dk.getId()).getSalesNum());// 更改销量);
|
| | | }
|
| | | return detailList;
|
| | | } else
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetail> getCurrentSalesRankGoodsList(Integer cid) {
|
| | | // 缓存
|
| | | String key = "dataoke-goods-shishirexiao-" + cid;
|
| | | List<DaTaoKeDetail> list = redisManager.getObjList(DaTaoKeDetail.class, key);
|
| | | if ((list != null && list.size() > 0
|
| | | && System.currentTimeMillis() - list.get(0).getUpdateTime().getTime() > 1000 * 60 * 20) || list == null
|
| | | || list.size() == 0)// 超过20分钟未更新
|
| | | {
|
| | | list = DaTaoKeUtil.getCurrentSalesRank(cid);
|
| | | list = reSearchDetails(list);
|
| | | if (list != null && list.size() > 0)
|
| | | redisManager.saveObjList(list, key, null);// 长期缓存
|
| | | return list;
|
| | | } else
|
| | | return list;
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetail> getCurrentDaySalesRankGoodsList(Integer cid) {
|
| | |
|
| | | // 缓存
|
| | | String key = "dataoke-goods-jinrirexiao-" + cid;
|
| | | List<DaTaoKeDetail> list = redisManager.getObjList(DaTaoKeDetail.class, key);
|
| | | if ((list != null && list.size() > 0
|
| | | && System.currentTimeMillis() - list.get(0).getUpdateTime().getTime() > 1000 * 60 * 20) || list == null
|
| | | || list.size() == 0)// 超过20分钟未更新
|
| | | {
|
| | | list = DaTaoKeUtil.getCurrentDaySalesRank(cid);
|
| | | list = reSearchDetails(list);
|
| | | if (list != null && list.size() > 0)
|
| | | redisManager.saveObjList(list, key, null);// 长期缓存
|
| | | return list;
|
| | | } else
|
| | | return list;
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetail> getCurrentHotSalesRankGoodsList() {
|
| | | // 缓存
|
| | | String key = "dataoke-goods-rexiao";
|
| | | List<DaTaoKeDetail> list = redisManager.getObjList(DaTaoKeDetail.class, key);
|
| | | if ((list != null && list.size() > 0
|
| | | && System.currentTimeMillis() - list.get(0).getUpdateTime().getTime() > 1000 * 60 * 20) || list == null
|
| | | || list.size() == 0)// 超过20分钟未更新
|
| | | {
|
| | | list = DaTaoKeUtil.getCurrentHotSalesRank();
|
| | | LogHelper.test("热销数量:" + list.size());
|
| | | list = reSearchDetails(list);
|
| | | if (list != null && list.size() > 0)
|
| | | redisManager.saveObjList(list, key, null);// 长期缓存
|
| | | return list;
|
| | | } else
|
| | | return list;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetail> getGoodsNotInList(Long cid, List<Long> listId, int count) {
|
| | | return daTaoKeDetailMapper.getGoodsNotInList(cid, listId, count);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<DaTaoKeDetail> listBySellerId(long start, int count, Long sellerId){
|
| | | return daTaoKeDetailMapper.listBySellerId(start, count, sellerId);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<DaTaoKeDetailV2> getSearchDiscoveryGoods(String keyWords){
|
| | | String key = "dataoke-goods-searchdiscovery-"+ keyWords;
|
| | | public List<DaTaoKeDetailV2> getSearchDiscoveryGoods(String keyWords) {
|
| | | String key = "dataoke-goods-searchdiscovery-" + keyWords;
|
| | | List<DaTaoKeDetailV2> list = redisManager.getObjList(DaTaoKeDetailV2.class, key);
|
| | | if ( list == null || list.size() == 0) {
|
| | | if (list == null || list.size() == 0) {
|
| | | DaTaoKeGoodsResult search = DaTaoKeApiUtil.search(keyWords, null, null, null, 1, 10, 0);
|
| | | if (search != null) {
|
| | | list = search.getGoodsList();
|
| | |
| | | return 0;
|
| | | }
|
| | | };
|
| | | |
| | |
|
| | | Collections.sort(list, cm);
|
| | | |
| | | if (list.size() > 3) |
| | |
|
| | | if (list.size() > 3)
|
| | | list = list.subList(0, 3);
|
| | | |
| | |
|
| | | // 缓存 20分钟
|
| | | redisManager.saveObjList(list, key, 1000 * 60 * 20);
|
| | | }
|
| | | return list;
|
| | | }
|
| | | } |
| | | }
|
| | | return list;
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
| | | public int countByMaxPrice(Integer cid,BigDecimal maxPrice);
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * |
| | | * @Title: listBySellerId
|
| | | * @Description: 根据商家ID查询商品
|
| | | * @param start
|
| | | * @param count
|
| | | * @param sellerId
|
| | | * @return |
| | | * List<DaTaoKeDetailV2> 返回类型
|
| | | * @throws
|
| | | */
|
| | | public List<DaTaoKeDetailV2> listBySellerId(long start, int count, Long sellerId);
|
| | | }
|
| | |
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | |
|
| | | /**
|
| | |
| | | */
|
| | | public interface DaTaoKeGoodsService {
|
| | |
|
| | | public List<DaTaoKeDetail> getCurrentSalesRankGoodsList(Integer cid);
|
| | |
|
| | | /**
|
| | | * 全天销量榜
|
| | | * |
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public List<DaTaoKeDetail> getCurrentDaySalesRankGoodsList(Integer cid);
|
| | |
|
| | | /**
|
| | | * 获取热推榜
|
| | | * |
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public List<DaTaoKeDetail> getCurrentHotSalesRankGoodsList();
|
| | |
|
| | | |
| | | |
| | | public List<DaTaoKeDetail> getGoodsNotInList(Long cid, List<Long> listId, int count);
|
| | |
|
| | | |
| | | /**
|
| | | * 根据店铺id筛选
|
| | | * @param start
|
| | | * @param count
|
| | | * @param sellerId
|
| | | * @return
|
| | | */
|
| | | public List<DaTaoKeDetail> listBySellerId(long start, int count, Long sellerId);
|
| | | // public List<DaTaoKeDetail> getCurrentSalesRankGoodsList(Integer cid);
|
| | | //
|
| | | // /**
|
| | | // * 全天销量榜
|
| | | // * |
| | | // * @param cid
|
| | | // * @return
|
| | | // */
|
| | | // public List<DaTaoKeDetail> getCurrentDaySalesRankGoodsList(Integer cid);
|
| | | //
|
| | | // /**
|
| | | // * 获取热推榜
|
| | | // * |
| | | // * @param cid
|
| | | // * @return
|
| | | // */
|
| | | // public List<DaTaoKeDetail> getCurrentHotSalesRankGoodsList();
|
| | | //
|
| | | // |
| | | // |
| | | // public List<DaTaoKeDetail> getGoodsNotInList(Long cid, List<Long> listId, int count);
|
| | | //
|
| | | // |
| | | // /**
|
| | | // * 根据店铺id筛选
|
| | | // * @param start
|
| | | // * @param count
|
| | | // * @param sellerId
|
| | | // * @return
|
| | | // */
|
| | | // public List<DaTaoKeDetail> listBySellerId(long start, int count, Long sellerId);
|
| | |
|
| | | /**
|
| | | * 搜索发现商品
|
| | |
| | | import com.google.gson.FieldAttributes;
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeApiResult;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
|
| | | import com.yeshi.fanli.dto.taobao.TaoBaoShopDTO;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | return result;
|
| | | }
|
| | |
|
| | | public static DaTaoKeApiResult goodsList(int page) {
|
| | | List<DaTaoKeDetail> list = new ArrayList<>();
|
| | | String url = String.format("http://api.dataoke.com/index.php?r=Port/index&type=total&appkey=%s&v=2&page=%s",
|
| | | Math.random() > 0.5 ? API_KEY : API_KEY_2, page + "");
|
| | | String result = request(url);
|
| | |
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | System.out.println(resultJson);
|
| | | JSONArray array = resultJson.optJSONArray("result");
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | list.add(gson.fromJson(array.optJSONObject(i).toString(), DaTaoKeDetail.class));
|
| | | }
|
| | |
|
| | | for (DaTaoKeDetail dt : list)
|
| | | if (!dt.getPic().startsWith("http"))
|
| | | dt.setPic("https:" + dt.getPic());
|
| | |
|
| | | return new DaTaoKeApiResult(resultJson.optJSONObject("data").optInt("total_num"),
|
| | | resultJson.optJSONObject("data").optString("update_time"), list);
|
| | | }
|
| | |
|
| | | public static DaTaoKeDetail getGoodsDetailV1(Long id) {
|
| | | String url = String.format("http://api.dataoke.com/index.php?r=Port/index&type=total&appkey=%s&v=2&id=%s",
|
| | | Math.random() > 0.5 ? API_KEY : API_KEY_2, id + "");
|
| | | String result = request(url);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | return gson.fromJson(resultJson.optJSONArray("result").optJSONObject(0).toString(), DaTaoKeDetail.class);
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 获取大淘客品牌优选 品牌id
|
| | |
| | | }
|
| | | }
|
| | | return hotWords;
|
| | | }
|
| | |
|
| | | class DaTaoKeResult {
|
| | | Date updateTime;
|
| | | List<DaTaoKeDetail> dataList;
|
| | |
|
| | | public DaTaoKeResult(Date updateTime, List<DaTaoKeDetail> dataList) {
|
| | | this.updateTime = updateTime;
|
| | | this.dataList = dataList;
|
| | | }
|
| | |
|
| | | public DaTaoKeResult() {
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import java.net.URLEncoder;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoHead;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
| | | return couponList;
|
| | | }
|
| | |
|
| | | private static List<DaTaoKeDetail> parseCurrent(String url) {
|
| | | private static List<DaTaoKeDetailV2> parseCurrent(String url) {
|
| | |
|
| | | List<DaTaoKeDetail> list = new ArrayList<>();
|
| | | List<DaTaoKeDetailV2> list = new ArrayList<>();
|
| | | try {
|
| | | Document doc = Jsoup.connect(url)
|
| | | .userAgent(
|
| | |
| | | .getElementsByTag("b").get(0).text();
|
| | |
|
| | | System.out.println(id + "-" + currentSale);
|
| | | DaTaoKeDetail detail = new DaTaoKeDetail();
|
| | | DaTaoKeDetailV2 detail = new DaTaoKeDetailV2();
|
| | | detail.setId(id);
|
| | | detail.setSalesNum(Integer.parseInt(currentSale));
|
| | | detail.setMonthSales(Integer.parseInt(currentSale));
|
| | | list.add(detail);
|
| | |
|
| | | }
|
| | |
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public static List<DaTaoKeDetail> getCurrentSalesRank(Integer cid) {
|
| | | public static List<DaTaoKeDetailV2> getCurrentSalesRank(Integer cid) {
|
| | | String url = null;
|
| | | if (cid == null)
|
| | | url = "http://www.dataoke.com/top_sell";
|
| | |
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public static List<DaTaoKeDetail> getCurrentDaySalesRank(Integer cid) {
|
| | | public static List<DaTaoKeDetailV2> getCurrentDaySalesRank(Integer cid) {
|
| | | String url = null;
|
| | | if (cid == null)
|
| | | url = "http://www.dataoke.com/top_all";
|
| | |
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | public static List<DaTaoKeDetail> getCurrentHotSalesRank() {
|
| | | public static List<DaTaoKeDetailV2> getCurrentHotSalesRank() {
|
| | | String url = "http://www.dataoke.com/top_tui";
|
| | | return parseCurrent(url);
|
| | | }
|
| | |
| | | return commonEmojis[(int) (Math.random() * commonEmojis.length)];
|
| | | }
|
| | |
|
| | | public static String getDesc(DaTaoKeDetail detail) {
|
| | | public static String getDesc(DaTaoKeDetailV2 detail) {
|
| | |
|
| | | // 标题+券后价+包邮+描述
|
| | | String desc = detail.getdTitle();
|
| | | String desc = detail.getDtitle();
|
| | | desc += "\n";
|
| | | desc += String.format("券后价%s【%s元】包邮秒杀 ", Math.random() > 0.5 ? "💰" : "",
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getPrice()).toString())
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getActualPrice() ).toString())
|
| | | + (Math.random() > 0.5 ? getRandomCommonEmoji() : "");
|
| | | desc += "\n";
|
| | | // desc += detail.getIntroduce();
|
| | | String introduce = detail.getIntroduce().replace(",", ",").replace("。", ",").replace("!", ",").replace(",",
|
| | | String introduce = detail.getDesc().replace(",", ",").replace("。", ",").replace("!", ",").replace(",",
|
| | | ",");
|
| | | introduce = introduce.replace(",,,", ",").replace(",,", ",");
|
| | |
|
| | |
| | | return desc;
|
| | | }
|
| | |
|
| | | public static TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods, DaTaoKeDetail detail) {
|
| | | if (detail != null && goods != null) {
|
| | | // 重新设置标题与券价格
|
| | | goods.setTitle(detail.getdTitle());
|
| | | if (!StringUtil.isNullOrEmpty(detail.getPic()))
|
| | | goods.setPictUrlWhite(detail.getPic());
|
| | | }
|
| | | return goods;
|
| | | }
|
| | |
|
| | | public static TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods, DaTaoKeDetailV2 detail) {
|
| | | if (detail != null && goods != null) {
|
| | |
| | | return goods;
|
| | | }
|
| | |
|
| | | public static DaTaoKeDetail filterDaTaoKe(TaoBaoGoodsBrief goods, DaTaoKeDetail detail) {
|
| | | public static DaTaoKeDetailV2 filterDaTaoKe(TaoBaoGoodsBrief goods, DaTaoKeDetailV2 detail) {
|
| | | if (goods != null) {
|
| | | BigDecimal price = TaoBaoUtil.getAfterUseCouplePrice(goods);
|
| | | detail.setOrgPrice(goods.getZkPrice());
|
| | | detail.setPrice(price);
|
| | | detail.setOriginalPrice(goods.getZkPrice());
|
| | | detail.setActualPrice(price);
|
| | | if (goods.getCouponStartFee() != null)
|
| | | detail.setQuanCondition(goods.getCouponStartFee() + "");
|
| | | detail.setQuanId(goods.getCouponActivityId());
|
| | | detail.setQuanPrice(goods.getCouponAmount());
|
| | | detail.setCouponConditions(goods.getCouponStartFee() + "");
|
| | | detail.setCouponPrice(goods.getCouponAmount());
|
| | | return detail;
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | return taoBaoGoods;
|
| | | }
|
| | |
|
| | | public static TaoBaoGoodsBrief convert(DaTaoKeDetail detail) {
|
| | | TaoBaoGoodsBrief taoBaoGoods = new TaoBaoGoodsBrief();
|
| | | taoBaoGoods.setAuctionId(detail.getGoodsId());
|
| | | taoBaoGoods.setBiz30day(detail.getSalesNum());
|
| | | taoBaoGoods.setCouponAmount(detail.getQuanPrice());
|
| | | taoBaoGoods.setCouponInfo(String.format("满%s元减%s元", detail.getQuanCondition(),
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getQuanPrice())));
|
| | | taoBaoGoods.setCouponLeftCount(detail.getQuanSurplus());
|
| | | taoBaoGoods.setCouponStartFee(new BigDecimal(detail.getQuanCondition()));
|
| | | if (detail.getQuanReceive() != null)
|
| | | taoBaoGoods.setCouponTotalCount(detail.getQuanSurplus() + detail.getQuanReceive());
|
| | | taoBaoGoods.setPictUrl(detail.getPic());
|
| | | taoBaoGoods.setPictUrlWhite(detail.getPic());
|
| | | taoBaoGoods.setSellerId(detail.getSellerId());
|
| | | taoBaoGoods.setShopTitle("");
|
| | | taoBaoGoods.setTitle(detail.getdTitle());
|
| | | taoBaoGoods.setUserType(detail.getIsTmall());
|
| | | taoBaoGoods.setZkPrice(detail.getOrgPrice());
|
| | | taoBaoGoods.setTkRate(detail.getCommission());
|
| | | taoBaoGoods.setTkCommFee(new BigDecimal("0"));
|
| | | taoBaoGoods.setState(0);
|
| | | return taoBaoGoods;
|
| | | }
|
| | |
|
| | |
|
| | | public static TaoBaoGoodsBrief convert(DaTaoKeDetailV2 detail) {
|
| | | TaoBaoGoodsBrief taoBaoGoods = new TaoBaoGoodsBrief();
|