| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.bus.search.HistorySearch; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | /** |
| | | * 热门搜索 |
| | | * |
| | | * @param acceptData |
| | | * @param goodsType |
| | | * @param out |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "search") |
| | | public void search(AcceptData acceptData, String kw, int page, String filter, String order, String startprice, |
| | | public void search(AcceptData acceptData, String kw, Long uid, int page, String filter, String order, String startprice, |
| | | String endprice, String fastFilter, PrintWriter out) { |
| | | String bid = getHistorySearchBid(acceptData); |
| | | historySearchService.addHistorySearch(kw, bid); |
| | | |
| | | ThreadUtil.run(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | HistorySearch search = new HistorySearch(); |
| | | search.setDevice(StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid()); |
| | | search.setKey(kw); |
| | | search.setSystem(acceptData.getSystem()); |
| | | search.setUid(uid); |
| | | historySearchService.addHistorySearch(search); |
| | | } |
| | | }); |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), |
| | | acceptData.getPackages(),acceptData.getSystem()); |
| | | if (system == null) { |
| | |
| | | * @param kw |
| | | * @param page |
| | | * @param filter |
| | | * @param order |
| | | * 销量由高到低:1 、 价格从高到低:2 、 价格从低到高:3 、 推广量高到低:4(综合默认)、返利比高到低:5 |
| | | * @param order 销量由高到低:1 、 价格从高到低:2 、 价格从低到高:3 、 推广量高到低:4(综合默认)、返利比高到低:5 |
| | | * 、返利比低到高:6 、推荐20 |
| | | * @param startprice |
| | | * @param endprice |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "searchgoods") |
| | | public void searchgoods(AcceptData acceptData, String kw, int page, String filter, String order, String startprice, |
| | | public void searchgoods(AcceptData acceptData, String kw, Long uid, int page, String filter, String order, String startprice, |
| | | String endprice, Double startTkRate, Double endTkRate, String fastFilter, PrintWriter out) { |
| | | |
| | | String bid = getHistorySearchBid(acceptData); |
| | | |
| | | historySearchService.addHistorySearch(kw, bid); |
| | | |
| | | // BusinessSystem system = |
| | | // businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), |
| | | // acceptData.getPackages()); |
| | | // if (system == null) { |
| | | // out.print(JsonUtil.loadFalseResult("系统不存在")); |
| | | // return; |
| | | // } |
| | | ThreadUtil.run(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | HistorySearch search = new HistorySearch(); |
| | | search.setDevice(StringUtil.isNullOrEmpty(acceptData.getUtdid()) ? acceptData.getDevice() : acceptData.getUtdid()); |
| | | search.setKey(kw); |
| | | search.setSystem(acceptData.getSystem()); |
| | | search.setUid(uid); |
| | | historySearchService.addHistorySearch(search); |
| | | } |
| | | }); |
| | | |
| | | if (!StringUtil.isNullOrEmpty(kw) && (kw.startsWith("http://") || kw.startsWith("https://"))) { |
| | | JSONObject data = new JSONObject(); |