| | |
| | | import com.yeshi.fanli.dto.vip.VIPSearchResult;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.help.AppPageNotification;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
|
| | | import com.yeshi.fanli.service.inter.help.AppPageNotificationService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
|
| | | import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
|
| | |
| | |
|
| | | @Resource
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | |
|
| | | @Resource
|
| | | private AppPageNotificationService appPageNotificationService;
|
| | |
|
| | | /**
|
| | | * 粘贴板信息推荐
|
| | |
| | | */
|
| | | @RequestMapping(value = "searchGoods")
|
| | | public void searchGoods(AcceptData acceptData, Integer goodsType, String key, Integer page, String filter,
|
| | | Integer order, Long uid, HttpSession session, PrintWriter out) {
|
| | | Integer order, Long uid, String notifyType, HttpSession session, PrintWriter out) {
|
| | |
|
| | | if (goodsType == null || goodsType < 1 || goodsType > 5) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请传递正确平台参数"));
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | | AppPageNotification ap = null;
|
| | | if (page == 1) {
|
| | | ap = appPageNotificationService.getValidNotificationByTypeCache(notifyType, acceptData.getPlatform(),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | // 没有通知
|
| | | if (ap == null || !ap.getShow()) {
|
| | | ap = null;
|
| | | }
|
| | |
|
| | | // else {// 有通知
|
| | | // Gson gson = new
|
| | | // GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
| | | // out.print(JsonUtil.loadTrueResult(gson.toJson(ap)));
|
| | | // }
|
| | | }
|
| | |
|
| | | /*--------- 京东商品 -------*/
|
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_JD) {
|
| | | searchJDGoods(acceptData, searchkey, page, filter, order, out);
|
| | | searchJDGoods(acceptData, searchkey, page, filter, order, ap, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | /*-------- 拼多多商品 -------*/
|
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_PDD) {
|
| | | searchPDDGoods(acceptData, searchkey, page, filter, order, out);
|
| | | searchPDDGoods(acceptData, searchkey, page, filter, order, ap, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | /*-------- 唯品会商品 ------*/
|
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_VIP) {
|
| | | searchVIPGoods(acceptData, searchkey, page, filter, order, out);
|
| | | searchVIPGoods(acceptData, searchkey, page, filter, order, ap, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | /*-------- 苏宁商品 ------*/
|
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_SUNING) {
|
| | | searchSuningGoods(acceptData, searchkey, page, filter, order, out);
|
| | | searchSuningGoods(acceptData, searchkey, page, filter, order, ap, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | /*-------- 淘宝商品 -------*/
|
| | | searchTaoBaoGoods(acceptData, searchkey, page, filter, order, out);
|
| | | searchTaoBaoGoods(acceptData, searchkey, page, filter, order, ap, out);
|
| | |
|
| | | }
|
| | |
|
| | |
| | | * @return
|
| | | */
|
| | | private void searchTaoBaoGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order,
|
| | | PrintWriter out) {
|
| | | AppPageNotification ap, PrintWriter out) {
|
| | | SearchFilter sf = new SearchFilter();
|
| | | sf.setKey(SearchFilterUtil.filterSearchContent(key));
|
| | | sf.setPage(page);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | out.print(JsonUtil.loadTrueResult(buildSearchResult(data, ap)));
|
| | | }
|
| | |
|
| | | private JSONObject buildSearchResult(JSONObject data, AppPageNotification ap) {
|
| | | if (ap != null && data != null) {
|
| | | Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
| | | data.put("notification", gson.toJson(ap));
|
| | | }
|
| | | return data;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | */
|
| | | private void searchJDGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order,
|
| | | PrintWriter out) {
|
| | | AppPageNotification ap, PrintWriter out) {
|
| | |
|
| | | JDSearchResult result = null;
|
| | | boolean hasCoupon = false;
|
| | |
| | |
|
| | | data.put("result", array);
|
| | | data.put("count", count);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | out.print(JsonUtil.loadTrueResult(buildSearchResult(data, ap)));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | */
|
| | | private void searchPDDGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order,
|
| | | PrintWriter out) {
|
| | | AppPageNotification ap, PrintWriter out) {
|
| | | PDDSearchFilter pddfilter = new PDDSearchFilter();
|
| | | pddfilter.setKw(SearchFilterUtil.filterSearchContent(key));
|
| | | pddfilter.setPage(page);
|
| | |
| | |
|
| | | data.put("result", array);
|
| | | data.put("count", count);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | out.print(JsonUtil.loadTrueResult(buildSearchResult(data, ap)));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @throws
|
| | | */
|
| | | private void searchVIPGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order,
|
| | | PrintWriter out) {
|
| | | AppPageNotification ap, PrintWriter out) {
|
| | | VIPSearchFilter searchFilter = new VIPSearchFilter();
|
| | | searchFilter.setKeyword(key);
|
| | | searchFilter.setPage(page);
|
| | |
| | |
|
| | | data.put("result", array);
|
| | | data.put("count", count);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | out.print(JsonUtil.loadTrueResult(buildSearchResult(data, ap)));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @throws
|
| | | */
|
| | | private void searchSuningGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order,
|
| | | PrintWriter out) {
|
| | | AppPageNotification ap, PrintWriter out) {
|
| | | SuningQueryModel searchFilter = new SuningQueryModel();
|
| | | searchFilter.setKeyword(key);
|
| | | searchFilter.setPageIndex(page);
|
| | |
| | |
|
| | | data.put("result", array);
|
| | | data.put("count", 1000);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | out.print(JsonUtil.loadTrueResult(buildSearchResult(data, ap)));
|
| | | }
|
| | |
|
| | | }
|