| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsClassService;
|
| | | import com.yeshi.fanli.service.inter.goods.HonestService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.user.HistorySearchService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Resource
|
| | | private HongBaoManageService manageService;
|
| | |
|
| | | @Resource
|
| | | private HonestService honestService;
|
| | |
|
| | | @Resource
|
| | | private GoodsClassService goodsClassService;
|
| | |
| | | * out.print(JsonUtil.loadFalseResult(XcxMiniControllerUtil.NOSYSTEM));
|
| | | * return; }
|
| | | */
|
| | | List<SuperHotSearch> superHotSearchList = superHotSearchSerivce.getSuperHotSearchBySystemId(4); // 返利券app
|
| | | List<SuperHotSearch> superHotSearchList = superHotSearchSerivce.getSuperHotSearchBySystemId(4, null); // 返利券app
|
| | | if (superHotSearchList == null || superHotSearchList.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(XcxMiniControllerUtil.NODATA));
|
| | | return;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String kw = goodsClassService.getKwById(id);
|
| | | String kw = goodsClassService.getKeysById(id);
|
| | | filter = "[{\"type\": \"quantype\"}]";
|
| | | JSONObject data = search(kw, pagesize, filter, order, startprice, endprice);
|
| | | // if (StringUtil.isNullOrEmpty(kw)) {
|
| | |
| | | List<TaoBaoGoodsBriefExtra> re = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | | List<TaoBaoGoodsBrief> taoBaoGoodsBriefs = result.getTaoBaoGoodsBriefs();
|
| | |
|
| | | Map<String, String> map = manageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | BigDecimal proportion =manageService.getFanLiRate();
|
| | |
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra;
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : taoBaoGoodsBriefs) {
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, "");
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), "");
|
| | | re.add(taoBaoGoodsBriefExtra);
|
| | | }
|
| | |
|
| | |
| | | List<TaoBaoGoodsBrief> taoBaoGoodsBriefs = result.getTaoBaoGoodsBriefs();
|
| | |
|
| | | Map<String, String> map = manageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | BigDecimal proportion =manageService.getFanLiRate();
|
| | |
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra;
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : taoBaoGoodsBriefs) {
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, "");
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), "");
|
| | | re.add(taoBaoGoodsBriefExtra);
|
| | | }
|
| | |
|
| | |
| | | int fh = sf.getHongbao();
|
| | | boolean ft = sf.isTmall();
|
| | | Map<String, String> map = manageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | BigDecimal proportion =manageService.getFanLiRate();
|
| | | if (fq == 0 && fh == 0 && !ft) {
|
| | | for (TaoBaoGoodsBrief bf : result.getTaoBaoGoodsBriefs()) {
|
| | | re.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(bf, proportion, fcRate, ""));
|
| | | re.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(bf, proportion.toString(), ""));
|
| | | }
|
| | | } else {
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra;
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : taoBaoGoodsBriefs) {
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, "");
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), "");
|
| | | re.add(taoBaoGoodsBriefExtra);
|
| | | }
|
| | | }
|
| | |
| | | data.put("result", gson2.toJson(re));
|
| | | data.put("count", result.getTaoBaoHead().getDocsfound());
|
| | | return data;
|
| | | }
|
| | |
|
| | | /**
|
| | | * |
| | | * 方法说明: 历史搜索
|
| | | * |
| | | * @author mawurui createTime 2018年4月25日 下午3:04:06
|
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "gethistorysearch", method = RequestMethod.POST)
|
| | | public void getHistorySearch(AcceptData acceptData, PrintWriter out) {
|
| | | String bid = getHistorySearchBid(acceptData);
|
| | | List<HistorySearch> historySearchList = historySearchService.getHistorySearch(bid);
|
| | | if (historySearchList == null || historySearchList.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(XcxMiniControllerUtil.NODATA));
|
| | | return;
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", historySearchList.size());
|
| | | Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
| | | data.put("historySearchList", gson.toJson(historySearchList));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
|
| | | /**
|
| | | * |
| | | * 方法说明: 清空历史搜索
|
| | | * |
| | | * @author mawurui createTime 2018年4月25日 下午3:04:23
|
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "clearhistorysearch", method = RequestMethod.POST)
|
| | | public void clearHistorySearch(AcceptData acceptData, PrintWriter out) {
|
| | | String bid = getHistorySearchBid(acceptData);
|
| | | long count = historySearchService.clearHistorySearch(bid);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
|
| | | /**
|