| | |
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.ShareManageService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserGoodsStorageService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | |
| | | @Resource
|
| | | private CommonGoodsService commonGoodsService;
|
| | |
|
| | | @Resource
|
| | | private UserGoodsStorageService userGoodsStorageService;
|
| | |
|
| | | @RequestMapping(value = "getrecommendsection")
|
| | | public void getRecommendSection(AcceptData acceptData, int index, PrintWriter out) {
|
| | |
|
| | |
| | | JSONObject validData = null;
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | Map<String, String> convertMap = hongBaoManageService.convertMap();
|
| | | String proportion = convertMap.get("hongbao_goods_proportion");
|
| | | String fcRate = convertMap.get("hongbao_fc_ratio");
|
| | |
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | Map<Long, List<RecommendSectionGoods>> map = recommendSectionGoodsService.getAllSectionGoodsMap();
|
| | | for (int i = 0; i < size; i++) {
|
| | | validData = new JSONObject();
|
| | |
| | | JSONObject obj = JSONObject.fromObject(gson2.toJson(rss));
|
| | | String json = gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(
|
| | | gson2.fromJson(obj.optJSONObject("taoBaoGoodsBrief").toString(), TaoBaoGoodsBrief.class),
|
| | | proportion, fcRate, ""));
|
| | | proportion.toString(), ""));
|
| | | obj.put("taoBaoGoodsBrief", json);
|
| | | array.add(obj);
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | Map<String, String> map = manageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | JSONArray array = new JSONArray();
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra;
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
|
| | |
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : taoBaoGoodsBriefs) {
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, "");
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), "");
|
| | | array.add(gson.toJson(taoBaoGoodsBriefExtra));
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | goods.put("price", tb.getReservePrice().toString());
|
| | | goods.put("zkPrice", tb.getZkPrice().toString());
|
| | |
|
| | | String rateStr = hongBaoManageService.get("hongbao_goods_proportion");
|
| | | String hongBao = TaoBaoUtil.getGoodsHongBaoInfo(tb, new BigDecimal(rateStr));
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | String hongBao = TaoBaoUtil.getGoodsHongBaoInfo(tb, proportion);
|
| | | goods.put("hongBao", hongBao);
|
| | |
|
| | | // 30天销量
|
| | |
| | |
|
| | | List<TaoBaoGoodsBriefExtra> re = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | |
|
| | | Map<String, String> map = hongBaoManageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | if (recommendGoodsList != null)
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : recommendGoodsList) {
|
| | | if (taoBaoGoodsBrief == null)
|
| | | continue;
|
| | |
|
| | | re.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, ""));
|
| | | re.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), ""));
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getApiCommonGson().toJson(re)));
|
| | | }
|
| | |
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | | if (list != null) {
|
| | | Map<String, String> map = hongBaoManageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | for (ScanHistoryV2 sh : list) {
|
| | | TaoBaoGoodsBrief goods = TaoBaoUtil.convert(sh.getCommonGoods());
|
| | | goods.setId(sh.getId());
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, proportion, fcRate, "")));
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, proportion.toString(), "")));
|
| | | }
|
| | | }
|
| | | data.put("data", array);
|
| | |
| | | if (page <= 1) {
|
| | | array.clear();
|
| | | Map<String, String> map = hongBaoManageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | if (!StringUtil.isNullOrEmpty(imei) || !StringUtil.isNullOrEmpty(idfa)) {
|
| | | long startTime = java.lang.System.currentTimeMillis();
|
| | |
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(page, 50, imei, idfa);
|
| | |
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) {
|
| | |
| | | Collections.shuffle(goodsList);
|
| | | goodsList = goodsList.size() > 20 ? goodsList.subList(0, 20) : goodsList;
|
| | | for (TaoBaoGoodsBrief goods : goodsList) {
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, proportion, fcRate, "")));
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, proportion.toString(), "")));
|
| | | }
|
| | | } else {
|
| | | try {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | JSONArray localArray = qualityGoodsService.getRecommendToIndex((page - 1) * pageSize, pageSize, proportion,
|
| | | fcRate);
|
| | | JSONArray localArray = qualityGoodsService.getRecommendToIndex((page - 1) * pageSize, pageSize,
|
| | | proportion.toString());
|
| | | array.addAll(localArray);
|
| | | } else {// 从精选库来
|
| | | Map<String, String> map = hongBaoManageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | array = qualityGoodsService.getRecommendToIndex((page - 1) * pageSize, pageSize, proportion, fcRate);
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | array = qualityGoodsService.getRecommendToIndex((page - 1) * pageSize, pageSize, proportion.toString());
|
| | | if (array == null) {
|
| | | out.print(JsonUtil.loadFalseResult("没有更多了"));
|
| | | return;
|
| | | }
|
| | | long count = qualityGoodsService.countRecommendToIndex(proportion);
|
| | | long count = qualityGoodsService.countRecommendToIndex(proportion.toString());
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | goods.put("zkPrice", tb.getZkPrice().toString());
|
| | |
|
| | | // 红包
|
| | | String rateStr = hongBaoManageService.get("hongbao_goods_proportion");
|
| | | String hongBao = TaoBaoUtil.getGoodsHongBaoInfo(tb, new BigDecimal(rateStr));
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | String hongBao = TaoBaoUtil.getGoodsHongBaoInfo(tb, proportion);
|
| | | goods.put("hongBao", hongBao);
|
| | | // 30天销量
|
| | | goods.put("saleCount", TaoBaoUtil.getSaleCount(tb.getBiz30day()));
|
| | |
| | | // 分享路径
|
| | | String shareUrl = String.format("%s?id=" + tb.getAuctionId(), Constant.systemCommonConfig.getAppShareInfoUrl());
|
| | |
|
| | | // 是否加入选品库: 0未加入 1 已加入
|
| | | boolean storageState = false;
|
| | | if (uid != null && uid.trim().length() > 0) {
|
| | | storageState = userGoodsStorageService.isExistStorage(Long.parseLong(uid), Long.parseLong(id));
|
| | | }
|
| | |
|
| | | data.put("storageState", storageState);
|
| | | data.put("shareUrl", shareUrl);
|
| | | data.put("goods", goods);
|
| | | data.put("shareUsers", listShareUser);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | Map<String, String> map = hongBaoManageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | |
|
| | | List<TaoBaoGoodsBriefExtra> listExtra = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | |
|
| | |
| | | }
|
| | |
|
| | | if (taoBaoGoodsBrief != null) {
|
| | | listExtra.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, ""));
|
| | | listExtra.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), ""));
|
| | | }
|
| | |
|
| | | });
|
| | |
| | | taoBaoGoodsBrief.setPictUrl(TbImgUtil.getTBSize320Img(pictUrl));
|
| | | }
|
| | |
|
| | | listQuality.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, null));
|
| | | listQuality.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null));
|
| | | }
|
| | | }
|
| | | } catch (Exception e2) {
|