| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.integral.IntegralExchangeException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | |
| | | 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;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.goods.OtherInfo;
|
| | | import com.yeshi.fanli.vo.integral.ExchangeTipVO;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.search.SearchKeyTOPVO;
|
| | | import com.yeshi.fanli.vo.search.SearchKeyVO;
|
| | | import com.yeshi.fanli.vo.tlj.ReduceHongBao;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | | |
| | | @Resource
|
| | | private DaTaoKeGoodsService daTaoKeGoodsService;
|
| | |
|
| | | /**
|
| | | * 新版推荐专题管理(1.5.3)
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | /**
|
| | | * 搜索发现列表
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param page
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getSearchDiscoveryTop", method = RequestMethod.POST)
|
| | | public void getSearchDiscoveryTop(AcceptData acceptData, Long uid, Integer page, PrintWriter out) {
|
| | | // try {
|
| | | // String keys = configService.getSearchDiscoveryKeys();
|
| | | // if (!StringUtil.isNullOrEmpty(keys)) {
|
| | | // JSONArray arrayKeys = JSONArray.fromObject(keys);
|
| | | // for (int i = (page-1) * 3; i < arrayKeys.size(); i++) {
|
| | | // String keys = arrayKeys.get(i).toString();
|
| | | // }
|
| | | // |
| | | // |
| | | // }
|
| | | // |
| | | int count = 0;
|
| | | List<SearchKeyTOPVO> list = new ArrayList<SearchKeyTOPVO>();
|
| | | |
| | | String keys = configService.getSearchDiscoveryKeys();
|
| | | if (!StringUtil.isNullOrEmpty(keys)) {
|
| | | JSONArray arrayKeys = JSONArray.fromObject(keys);
|
| | | if (arrayKeys != null && arrayKeys.size() > 0) {
|
| | | count = arrayKeys.size();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | |
| | | int j = 1;
|
| | | for (int i = (page-1) * 3; i < arrayKeys.size(); i++) {
|
| | | if (j > 3)
|
| | | break;
|
| | | |
| | | String words = arrayKeys.get(i).toString();
|
| | | List<GoodsDetailVO> listGoods = new ArrayList<GoodsDetailVO>();
|
| | | |
| | | List<DaTaoKeDetailV2> listTaoKe = daTaoKeGoodsService.getSearchDiscoveryGoods(words);
|
| | | if (listTaoKe != null && listTaoKe.size() > 0) {
|
| | | for (DaTaoKeDetailV2 daTaoKeDetailV2: listTaoKe) {
|
| | | listGoods.add(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(daTaoKeDetailV2), null, fanLiRate,
|
| | | shareRate));
|
| | | if (listGoods.size() >= 3)
|
| | | break;
|
| | | }
|
| | | }
|
| | | |
| | | SearchKeyTOPVO keyTOPVO = new SearchKeyTOPVO();
|
| | | keyTOPVO.setName(words);
|
| | | keyTOPVO.setListGoods(listGoods);
|
| | | list.add(keyTOPVO);
|
| | | |
| | | j++;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | |
| | | |
| | | //
|
| | | // GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | // Gson gson = gsonBuilder.create();
|
| | | // JSONObject data = new JSONObject();
|
| | | // data.put("result", gson.toJson(exchange));
|
| | | // out.print(JsonUtil.loadTrueResult(data));
|
| | | // } catch (IntegralExchangeException e) {
|
| | | // out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
|
| | | // }
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | Gson gson = gsonBuilder.create();
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | }
|