| | |
| | | sf.setPage(1);
|
| | | sf.setPageSize(100);
|
| | | sf.setGoodsIdList(listIdPDD.toArray(ids));
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(sf);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(sf,"437032");
|
| | | if (result != null) {
|
| | | listPDD = result.getGoodsList();
|
| | | }
|
| | |
| | | Long[] strings = new Long[goodsIdList.size()];
|
| | | pddfilter.setGoodsIdList(goodsIdList.toArray(strings));
|
| | |
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter,Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | if (result != null) {
|
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | |
| | |
|
| | | /*-------- 拼多多商品 -------*/
|
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_PDD) {
|
| | | searchPDDGoods(acceptData, searchkey, page, filter, order, ap, out);
|
| | | searchPDDGoods(acceptData,uid, searchkey, page, filter, order, ap, out);
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | * @param ap
|
| | | * @param out
|
| | | */
|
| | | private void searchPDDGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order,
|
| | | private void searchPDDGoods(AcceptData acceptData,Long uid, String key, Integer page, String filter, Integer order,
|
| | | AppPageNotification ap, PrintWriter out) {
|
| | | PDDSearchFilter pddfilter = new PDDSearchFilter();
|
| | | pddfilter.setKw(SearchFilterUtil.filterSearchContent(key));
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | JSONArray array = new JSONArray();
|
| | |
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter,uid+"");
|
| | | if (result != null) {
|
| | | count = result.getTotalCount();
|
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | |
| | | Long[] strings = new Long[goodsIdList.size()];
|
| | | pddfilter.setGoodsIdList(goodsIdList.toArray(strings));
|
| | |
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter,Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | if (result != null) {
|
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | JSONArray array = new JSONArray();
|
| | |
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter,"437032");
|
| | | if (result != null) {
|
| | | count = result.getTotalCount();
|
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | |
| | | pddfilter.setRangeList(rangeList);
|
| | | for (int page = 1; page < 1000; page++) {
|
| | | pddfilter.setPage(page);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter,Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | if (result == null) {
|
| | | break;
|
| | | }
|
| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.brand.BrandGoodsCaheDao;
|
| | |
| | | pddfilter.setPage(1);
|
| | | pddfilter.setPageSize(100);
|
| | | pddfilter.setSortType(6);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter, Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | |
|
| | | int count = 0;
|
| | |
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.brand.BrandShopCaheDao;
|
| | |
| | | pddfilter.setSortType(6);
|
| | | pddfilter.setMerchantType(3);
|
| | |
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter, Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | if (result != null && result.getGoodsList() != null && result.getGoodsList().size() > 0) {
|
| | | boolean addShop = true;
|
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList();
|
| | |
| | | if (cid == 1) {
|
| | | pddfilter.setPage(page);
|
| | | pddfilter.setPageSize(Constant.PAGE_SIZE);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter,Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | if (result == null) {
|
| | | return null;
|
| | | } else {
|
| | |
| | | pddfilter.setPage(page);
|
| | | pddfilter.setPageSize(Constant.PAGE_SIZE);
|
| | | pddfilter.setOptId(Long.parseLong(pddcid));
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter,Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | if (result == null) {
|
| | | return null;
|
| | | } else {
|
| | |
| | | pddfilter.setPage(page);
|
| | | pddfilter.setPageSize(10);
|
| | | pddfilter.setOptId(Long.parseLong(arrayId[i]));
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter,Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | if (result != null) {
|
| | | List<PDDGoodsDetail> listGoods = result.getGoodsList();
|
| | | if (listGoods != null && listGoods.size() > 0) {
|
| | |
| | |
|
| | | public static ConstantConfig constantConfig;
|
| | |
|
| | | public static String PDD_SEARCH_CUSTOMER_PARAMS="437032";
|
| | |
|
| | | /**
|
| | | * 淘宝商品红包
|
| | | */
|
| | |
| | | * @param sf
|
| | | * @return
|
| | | */
|
| | | public static PDDGoodsResult searchGoods(PDDSearchFilter sf) {
|
| | | public static PDDGoodsResult searchGoods(PDDSearchFilter sf, String customerParamters) {
|
| | | Gson gson = new GsonBuilder().disableHtmlEscaping().create();
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.goods.search");
|
| | | map.put("custom_parameters", customerParamters);
|
| | | if (sf.getOptId() != null)
|
| | | map.put("opt_id", sf.getOptId() + "");
|
| | | if (sf.getPage() != null)
|
| | |
| | |
|
| | | map.put("pid", PID_FANLI);
|
| | | String result = baseRequest(map);
|
| | | System.out.println(result);
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject root = json.optJSONObject("goods_search_response");
|
| | | if (root == null) {
|
| | |
| | | Long[] ids = new Long[goodsIds.size()];
|
| | | goodsIds.toArray(ids);
|
| | | filter.setGoodsIdList(ids);
|
| | | PDDGoodsResult result = searchGoods(filter);
|
| | | PDDGoodsResult result = searchGoods(filter,Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | if (result != null)
|
| | | return result.getGoodsList();
|
| | | return null;
|
| | |
| | | * @return
|
| | | */
|
| | | public static String getPromotionUrl(Long goodsId, String pid, String customParams) {
|
| | | PDDPromotionUrl promotion = convert(goodsId, pid, customParams,false);
|
| | | PDDPromotionUrl promotion = convert(goodsId, pid, customParams, false);
|
| | | if (promotion != null) {
|
| | | return promotion.getShortUrl();
|
| | | }
|
New file |
| | |
| | | package com.yeshi.utils; |
| | | |
| | | import org.yeshi.utils.LinuxRemoteCommandUtil; |
| | | |
| | | public class Test { |
| | | |
| | | public static void main(String[] args) { |
| | | String solrIP = "203.195.196.115"; |
| | | String serverAccount = "root"; |
| | | String serverPwd = "Yeshi2016@"; |
| | | try { |
| | | LinuxRemoteCommandUtil.execute(solrIP, serverAccount, serverPwd, "/solr/solr-7.5.0/solr_restart.sh"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |