From 8937604ec04fea41663fc7b6a5be05c501c80344 Mon Sep 17 00:00:00 2001 From: wangshuai Date: Thu, 1 Aug 2024 08:39:14 +0800 Subject: [PATCH] =?UTF-8?q?1=EF=BC=9B=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/service/impl/AiServiceImpl.java | 53 +++---- .../service/impl/MeituanServiceImpl.java | 138 +++++------------- 2 files changed, 62 insertions(+), 129 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/AiServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/AiServiceImpl.java index 5a5755a..8420d9e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/AiServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/AiServiceImpl.java @@ -10,6 +10,7 @@ import com.ruoyi.common.config.BusTencentProperties; import com.ruoyi.common.utils.HttpClientUtilT; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.mapper.SysDictDataMapper; +import lombok.extern.slf4j.Slf4j; import org.apache.rocketmq.client.exception.MQBrokerException; import org.apache.rocketmq.client.exception.MQClientException; import org.apache.rocketmq.client.producer.MQProducer; @@ -35,6 +36,7 @@ import java.util.stream.Collectors; * @author ruoyi * @date 2024-07-03 */ +@Slf4j @Service public class AiServiceImpl implements IAiService { @Autowired @@ -79,11 +81,11 @@ public class AiServiceImpl implements IAiService { long apiKeyExpire = Long.valueOf(data.getString("api_key_expire")); String userSn = data.getString("user_sn"); String projectSn = data.getString("project_sn"); - System.out.println("login 返回:===========apikey,userSn,projectSn=============" + apiKey + "," + userSn + "," + projectSn); + log.error("login 返回:===========apikey,userSn,projectSn=============" + apiKey + "," + userSn + "," + projectSn); redisTemplate.opsForValue().set("apiKey", apiKey); return apiKey; } else { - System.out.println("login接口返回错误: " + jsonObject.toString()); + log.error("login接口返回错误: " + jsonObject.toString()); } return null; } @@ -105,7 +107,7 @@ public class AiServiceImpl implements IAiService { String taskMainId = data1.getString("dial_task_main_id"); String taskMainSn = data1.getString("dial_task_main_sn"); - System.out.println("追加任务返回: ============taskMainId,taskMainSn===========" + taskMainId + "," + taskMainSn); + log.error("追加任务返回: ============taskMainId,taskMainSn===========" + taskMainId + "," + taskMainSn); //定时任务15天之前的删除记录 todo // BusFifteenInfo fifteenInfo = new BusFifteenInfo(); @@ -114,12 +116,12 @@ public class AiServiceImpl implements IAiService { // fifteenInfoService.insertBusFifteenInfo(fifteenInfo); } else if ("20005".equals(jo.getString("code")) || "20006".equals(jo.getString("code"))) { - System.out.println("建立任务接口返回错误: " + jo.toString()); + log.error("建立任务接口返回错误: " + jo.toString()); redisTemplate.delete("apiKey"); sendAiTask(content, busOrderInfo); } else { // TODO: 2024/7/10 失败原因判断 是否继续循环 - System.out.println("建立任务接口返回错误: " + jo.toString()); + log.error("建立任务接口返回错误: " + jo.toString()); } } @@ -139,7 +141,7 @@ public class AiServiceImpl implements IAiService { String apiKey = data.getString("api_key"); String userSn = data.getString("user_sn"); String projectSn = data.getString("project_sn"); - System.out.println("login 返回:===========apikey,userSn,projectSn=============" + apiKey + "," + userSn + "," + projectSn); + log.error("login 返回:===========apikey,userSn,projectSn=============" + apiKey + "," + userSn + "," + projectSn); int pageIndex = 0; int pageSize = 200; @@ -177,14 +179,14 @@ public class AiServiceImpl implements IAiService { aiInfoService.insertBusAiInfo(aiInfo); reduceIntegral(aiInfo); } catch (Exception e) { - System.out.println(id + "duplicate"); + log.error(id + "duplicate"); } } } else { - System.out.println("crmList返回错误: " + result1); + log.error("crmList返回错误: " + result1); } } else { - System.out.println("login返回错误: " + loginResult); + log.error("login返回错误: " + loginResult); } } @@ -213,7 +215,7 @@ public class AiServiceImpl implements IAiService { addAiTaskTest(apiKey, content, busOrderInfo); } } catch (Exception e) { - System.out.println("建立接口返回错误: " + e.getMessage()); + log.error("建立接口返回错误: " + e.getMessage()); } } @@ -222,7 +224,7 @@ public class AiServiceImpl implements IAiService { @Override public void sendToAi() { - System.out.println("开始==="); + log.error("开始==="); DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); LocalDateTime now = LocalDateTime.now(); @@ -236,7 +238,7 @@ public class AiServiceImpl implements IAiService { for (BusStoreInfo busStoreInfo : storeInfoList) { try { if ("2".equals(busStoreInfo.getReturnVisitStatus())) { - System.out.println("未开启营销的跳出"); + log.error("未开启营销的跳出"); continue;// 未开启营销的跳出 } // 配置规则 @@ -246,10 +248,10 @@ public class AiServiceImpl implements IAiService { List list = new ArrayList<>(); if ("1".equals(busStoreInfo.getSelfDeliveryStatus())) { - System.out.println("自动营销"); + log.error("自动营销"); list = orderInfoService.selectBusOrderInfoListToAi(busStoreInfo.getStoreCode(), t1, t2); } else if ("2".equals(busStoreInfo.getSelfDeliveryStatus())) { - System.out.println("自配送营销"); + log.error("自配送营销"); LocalDateTime tN = now.minusMinutes(busStoreConfigInfo.getSelfDeliveryDuration()); String time = tN.format(dateTimeFormatter); // 自配送前推时间处理 @@ -266,7 +268,7 @@ public class AiServiceImpl implements IAiService { int cha = agentInfo.getAiDurationBalance(); if (cha < list.size()&&(cha - 1)>0) { list.subList(0, cha - 1); - System.out.println("积分不足截取部分订单营销"); + log.error("积分不足截取部分订单营销"); agentInfo.setAiRealTimeNum(agentInfo.getAiDurationBalance()); } else if(cha < 0){ continue; @@ -285,7 +287,7 @@ public class AiServiceImpl implements IAiService { continue; } } - System.out.println("结束==="); + log.error("结束==="); } @Override @@ -295,12 +297,12 @@ public class AiServiceImpl implements IAiService { String phoneNo = busOrderInfo.getPrivcyPhone().split(",")[0];//#分机号# content = content.replaceAll("分机号",busOrderInfo.getPrivcyPhone().split(",")[1]); com.alibaba.fastjson.JSONObject jsonObject = busTencentProperties.smsCredential(phoneNo, content); - System.out.println(jsonObject); +// log.error(jsonObject.toJSONString()); if("00".equals(jsonObject.getString("status"))){ //定时任务15天之前的删除记录 todo - System.out.println("发送成功========"); + log.error("发送成功========"); }else{ - System.out.println("发送失败========"); + log.error("发送失败========"); } } @@ -312,7 +314,7 @@ public class AiServiceImpl implements IAiService { // String ss = "{\"taskId\":\"202203170025799000001\",\"message\":\"success\",\"timestamp\":1647481716818,\"status\":\"00\",\"tag\":\"\"}"; // com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSON.parseObject(ss); com.alibaba.fastjson.JSONObject jsonObject = busTencentProperties.smsCredential(phoneNo, content); - System.out.println(jsonObject); +// log.error(jsonObject); if("00".equals(jsonObject.getString("status"))){ //定时任务15天之前的删除记录 todo // BusFifteenInfo fifteenInfo = new BusFifteenInfo(); @@ -320,10 +322,9 @@ public class AiServiceImpl implements IAiService { // fifteenInfo.setLastVisitTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); // fifteenInfoService.insertBusFifteenInfo(fifteenInfo); } - System.out.println("建立sendSmsTask成功: "); + log.error("建立sendSmsTask成功: "); } catch (Exception e) { - System.out.println("建立sendSmsTask错误: " + busOrderInfo.toString()); - e.printStackTrace(); + log.error("建立sendSmsTask错误: " + busOrderInfo.toString(),e.getMessage()); } } @@ -344,7 +345,7 @@ public class AiServiceImpl implements IAiService { String taskMainId = data1.getString("dial_task_main_id"); String taskMainSn = data1.getString("dial_task_main_sn"); - System.out.println("建立任务返回: ============taskMainId,taskMainSn===========" + taskMainId + "," + taskMainSn); + log.error("建立任务返回: ============taskMainId,taskMainSn===========" + taskMainId + "," + taskMainSn); redisTemplate.opsForValue().set("dialTaskMainSn", taskMainSn); @@ -359,7 +360,7 @@ public class AiServiceImpl implements IAiService { sendAiTask(content, busOrderInfo); } else { // TODO: 2024/7/10 失败原因判断 是否继续循环 - System.out.println("建立任务接口返回错误: " + jo.toString()); + log.error("建立任务接口返回错误: " + jo.toString()); } } @@ -379,7 +380,7 @@ public class AiServiceImpl implements IAiService { try { returnVisitInfo.setFinishTime(format.parse(aiInfo.getDisconnectedAt())); }catch (Exception e){ - System.out.println("DisconnectedAt异常结果:"+aiInfo.getEndreason()); + log.error("DisconnectedAt异常结果:"+aiInfo.getEndreason()); } busReturnVisitInfoMapper.updateBusReturnVisitInfo(returnVisitInfo); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java index 79cb2b9..7d0f70a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/MeituanServiceImpl.java @@ -13,6 +13,7 @@ import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SplitListUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.mapper.SysDictDataMapper; +import lombok.extern.slf4j.Slf4j; import org.apache.http.HttpEntity; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; @@ -56,6 +57,7 @@ import java.util.stream.Collectors; /** * 采集美团数据service */ +@Slf4j @Service public class MeituanServiceImpl implements IMeituanService { @@ -224,19 +226,19 @@ public class MeituanServiceImpl implements IMeituanService { for (BusStoreInfo store : busStoreInfoList) { Boolean flag1 = getScoreOne(store); if (!flag1) { - System.out.println("获取评分信息返回错误..."); + log.error("获取评分信息返回错误..."); } Boolean flag2 = getCommentsOne(store); if (!flag2) { - System.out.println("获取好评信息返回错误..."); + log.error("获取好评信息返回错误..."); } Boolean flag3 = yesterdayCountOne(store); if (!flag3) { - System.out.println("获取昨日单量信息返回错误..."); + log.error("获取昨日单量信息返回错误..."); } Boolean flag4 = updateDayInfo(store); if (!flag4) { - System.out.println("获取昨日营销信息返回错误..."); + log.error("获取昨日营销信息返回错误..."); } } return "ok"; @@ -253,15 +255,15 @@ public class MeituanServiceImpl implements IMeituanService { BusStoreInfo store = busStoreInfoMapper.selectBusStoreInfoById(id); Boolean flag1 = getScoreOne(store); if (!flag1) { - System.out.println("获取评分信息返回错误..."); + log.error("获取评分信息返回错误..."); } Boolean flag2 = getCommentsOne(store); if (!flag2) { - System.out.println("获取好评信息返回错误..."); + log.error("获取好评信息返回错误..."); } Boolean flag3 = yesterdayCountOne(store); if (!flag3) { - System.out.println("获取昨日统计信息返回错误..."); + log.error("获取昨日统计信息返回错误..."); } return "ok"; } @@ -289,17 +291,11 @@ public class MeituanServiceImpl implements IMeituanService { try { countDownLatch.await(); //保证之前的所有的线程都执行完成,才会走下面的; long endTime = System.currentTimeMillis(); //结束时间 - System.out.println(("一共耗时time: " + (endTime - startTime) / 1000 + " s")); + log.error(("一共耗时time: " + (endTime - startTime) / 1000 + " s")); // 这样就可以在下面拿到所有线程执行完的集合结果 } catch (Exception e) { - System.out.println("阻塞异常:"+e.getMessage()); + log.error("阻塞异常:"+e.getMessage()); } -// for (BusStoreInfo store : busStoreInfoList) { -// R flag = orderInfo(store.getStoreCode(),now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")),store.getStoreCookie()); -// if (flag.getCode() != 200) { -// System.out.println("获取订单信息返回错误..."); -// } -// } return "ok"; } @@ -333,7 +329,7 @@ public class MeituanServiceImpl implements IMeituanService { try { result = EntityUtils.toString(httpClient.execute(request).getEntity()); } catch (Exception e) { - System.out.println(e.getMessage()); + log.error("昨日订单量异常跳出",e.getMessage()); return false; } if (result != null) { @@ -343,7 +339,7 @@ public class MeituanServiceImpl implements IMeituanService { JSONArray array = jsonObject.getJSONArray("data"); JSONObject one = array.getJSONObject(3); String total = one.getString("base"); - System.out.println(total); + log.error("昨日订单量总数",total); BusStoreInfo store = new BusStoreInfo(); store.setStoreCode(wmPoiId); List list = busStoreInfoService.selectBusStoreInfoList(store); @@ -367,7 +363,6 @@ public class MeituanServiceImpl implements IMeituanService { busStoreInfoService.updateBusStoreInfo(storeInfo); } } -// System.out.println(jsonObject); return true; } @@ -384,11 +379,11 @@ public class MeituanServiceImpl implements IMeituanService { public R orderInfo(String wmPoiId, String date, String cookie) { try { LocalDate localDate = LocalDate.parse(date); - LocalDate prevDay = localDate.minusDays(1); - String oldKey = wmPoiId + prevDay.toString(); - if (redisTemplate.opsForValue().get(oldKey) != null){ - redisTemplate.delete(oldKey); - } +// LocalDate prevDay = localDate.minusDays(1); +// String oldKey = wmPoiId + prevDay.toString(); +// if (redisTemplate.opsForValue().get(oldKey) != null){ +// redisTemplate.delete(oldKey); +// } int pageNum = 1; String getUrl = proxyProperties.gettpsUrl(); @@ -480,7 +475,7 @@ public class MeituanServiceImpl implements IMeituanService { try { orderInfo.setOrderTime(format.parse(orderTimeFmt)); } catch (ParseException e) { - System.out.println(e.getMessage()); + log.error("订单时间解析异常不跳出"+e.getMessage()); } orderInfo.setIsPhf(businessType); }catch (Exception e){ @@ -508,7 +503,7 @@ public class MeituanServiceImpl implements IMeituanService { storeInfo1.setGrantStatus("2"); busStoreInfoMapper.updateBusStoreInfo(storeInfo1); - System.out.println(jo.getString("msg")); + log.error("掉线",jo.getString("msg")); return R.fail(jo.getString("msg")); } } @@ -522,7 +517,7 @@ public class MeituanServiceImpl implements IMeituanService { } return R.fail(jsonObject.getString("msg")); }catch (Exception e){ - System.out.println("================拉取订单出错:==============="+e.getMessage()); + log.error("================拉取订单出错:==============="+e.getMessage()); // return orderInfo(wmPoiId, date, cookie); return R.fail("拉取订单出错"); } @@ -583,7 +578,7 @@ public class MeituanServiceImpl implements IMeituanService { jsonObject = JSONObject.parseObject(resp); code = jsonObject.getString(("code")); } catch (Exception e) { - System.out.println("===============订单解析号码出错:================"+e.getMessage()); + log.error("===============订单解析号码出错:================"+e.getMessage()); client = localHttpClient(); try { @@ -593,7 +588,7 @@ public class MeituanServiceImpl implements IMeituanService { jsonObject = JSONObject.parseObject(resp); code = jsonObject.getString(("code")); }catch (Exception e1){ - System.out.println("===============本地订单解析号码出错:================"+e1.getMessage()); + log.error("===============本地订单解析号码出错:================"+e1.getMessage()); } } if ("0".equals(code)) { @@ -608,7 +603,7 @@ public class MeituanServiceImpl implements IMeituanService { orderInfo.setRecipientPhone(recipientPhone); orderInfo.setRecipientBindedPhone(recipientBindedPhone); - System.out.println("****************订单解析成功:****************"+JSON.toJSONString(orderInfo)); + log.error("****************订单解析成功:****************"+JSON.toJSONString(orderInfo)); lsList.add(orderInfo); @@ -624,10 +619,11 @@ public class MeituanServiceImpl implements IMeituanService { e.printStackTrace(); continue; } - lss.add(returnVisitInfo); } } + log.error(ls.get(0).getStoreCode()+"********************************"+lsList.size()); + log.error("********************************"+lss.size()); if (lsList.size() > 0) { busOrderInfoMapper.batchInsertOrder(lsList); } @@ -659,7 +655,7 @@ public class MeituanServiceImpl implements IMeituanService { try { result = EntityUtils.toString(httpClient.execute(request).getEntity()); } catch (Exception e) { - System.out.println(e.getMessage()); + log.error("拼好饭订单数拉取失败",e.getMessage()); } JSONObject json = JSONObject.parseObject(result); String code = json.getString("code"); @@ -707,7 +703,7 @@ public class MeituanServiceImpl implements IMeituanService { resp = EntityUtils.toString(responseEntity); jsonObject = JSONObject.parseObject(resp); } catch (Exception e) { - System.out.println(e.getMessage()); + log.error("分页拉取订单",e.getMessage()); // jsonObject.put("code","403"); } return jsonObject; @@ -774,7 +770,7 @@ public class MeituanServiceImpl implements IMeituanService { } } } catch (Exception e) { - System.out.println(e.getMessage()); + log.error("店铺名拉取失败"+e.getMessage()); } return null; } @@ -807,7 +803,7 @@ public class MeituanServiceImpl implements IMeituanService { } } } catch (Exception e) { - System.out.println(e.getMessage()); + log.error("店铺名2拉取失败"+e.getMessage()); } return null; } @@ -829,13 +825,7 @@ public class MeituanServiceImpl implements IMeituanService { httpPost.setHeader("Content-Type", "application/json"); Map subUrlParams = new LinkedHashMap<>(); -// subUrlParams.put("url", "https://e.waimai.meituan.com/v2/order/history/r/search/ajax?"); -// subUrlParams.put("searchItem", orderId); -// subUrlParams.put("region_id", regionId); -// subUrlParams.put("region_version", regionVersion); -// subUrlParams.put("yodaReady", "h5"); -// subUrlParams.put("csecplatform", 4); -// subUrlParams.put("csecversion", "2.4.0"); + JSONObject jsonObject = new JSONObject(); jsonObject.put("url","https://e.waimai.meituan.com/v2/order/history/r/search/ajax?searchItem="+orderId+"®ion_id="+regionId+"®ion_version="+regionVersion+"&yodaReady=h5&csecplatform=4&csecversion=2.4.0"); jsonObject.put("data",""); @@ -843,16 +833,7 @@ public class MeituanServiceImpl implements IMeituanService { jsonObject.put("method","GET"); StringEntity entity = new StringEntity(JSONObject.toJSONString(jsonObject), "utf-8"); -// subUrlParams.put("data", ""); -// subUrlParams.put("dfpid", dfpid.split("-")[0]); -// subUrlParams.put("method", "post"); -// -// String urlParam = ""; -// for (Map.Entry stringObjectEntry : subUrlParams.entrySet()) { -// urlParam = urlParam + stringObjectEntry.getKey() + "=" + stringObjectEntry.getValue() + "&"; -// } String result = null; -// StringEntity params = new StringEntity(urlParam.substring(0, urlParam.length() - 1)); try { httpPost.setEntity(entity); CloseableHttpResponse response = httpClient.execute(httpPost); @@ -955,7 +936,7 @@ public class MeituanServiceImpl implements IMeituanService { try { result = EntityUtils.toString(httpClient.execute(request).getEntity()); } catch (Exception e) { - System.out.println(e.getMessage()); + log.error("获取评分失败"+e.getMessage()); return false; } if (result != null) { @@ -1021,13 +1002,13 @@ public class MeituanServiceImpl implements IMeituanService { CloseableHttpClient httpClient = proxyHttpClient(); result = EntityUtils.toString(httpClient.execute(request).getEntity()); if (StringUtils.isEmpty(result)) { - System.out.println(result); + log.error("获取好评数五星数失败"+result); return false; } JSONObject jsonObject = JSONObject.parseObject(result); String code = jsonObject.getString(("code")); if ("1001".equals(code)) { - System.out.println(result); + log.error("掉线"+result); store.setGrantStatus("2"); busStoreInfoService.updateBusStoreInfo(store); return false; @@ -1045,12 +1026,10 @@ public class MeituanServiceImpl implements IMeituanService { busStoreDayInfo1.setCreateTime(Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant())); busStoreDayInfoService.updateBusStoreDayInfo(busStoreDayInfo1); } -// System.out.println(jsonObject);//落库 return true; } catch (Exception e) { - System.out.println(e.getMessage()); + log.error("获取好评数五星数失败",e.getMessage()); return false; -// e.printStackTrace(); } } @@ -1086,42 +1065,7 @@ public class MeituanServiceImpl implements IMeituanService { .setDefaultRequestConfig(config) .setDefaultCredentialsProvider(credsProvider) .build(); -// CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(config).build(); return httpClient; - -// String ipPort = proxyProperties.getUrl(); - // JDK 8u111版本后,目标页面为HTTPS协议,启用proxy用户密码鉴权 -// System.setProperty("jdk.http.auth.tunneling.disabledSchemes", ""); -// -// String ip = ipPort.split(":")[0]; -// int port = Integer.valueOf(ipPort.split(":")[1]); -// HttpHost proxy = new HttpHost(ip, port); -// CredentialsProvider credsProvider = new BasicCredentialsProvider(); -// credsProvider.setCredentials(new AuthScope(ip, port), -// new UsernamePasswordCredentials(proxyProperties.getAccountSM(), proxyProperties.getPwdSM())); -// RequestConfig config = RequestConfig.custom().setProxy(proxy).build(); -// CloseableHttpClient httpclient = HttpClients.custom().setDefaultCredentialsProvider(credsProvider).setDefaultRequestConfig(config).build(); -// return httpclient; -// try { -// URL url = new URL(pageUrl); -// HttpHost target = new HttpHost(url.getHost(), url.getDefaultPort(), url.getProtocol()); -// HttpHost proxy = new HttpHost(proxyIp, proxyPort); -// -// RequestConfig config = RequestConfig.custom().setProxy(proxy).build(); -// HttpGet httpget = new HttpGet(url.getPath()); -// httpget.setConfig(config); -// httpget.addHeader("Accept-Encoding", "gzip"); // 使用gzip压缩传输数据让访问更快 -// httpget.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"); -// CloseableHttpResponse response = httpclient.execute(target, httpget); -// try { -// System.out.println(response.getStatusLine()); -// System.out.println(EntityUtils.toString(response.getEntity())); -// } finally { -// response.close(); -// } -// } finally { -// httpclient.close(); -// } } private CloseableHttpClient proxyHttpClient() { String proxyHost = proxyProperties.getProxyAddr(); @@ -1145,21 +1089,9 @@ public class MeituanServiceImpl implements IMeituanService { private CloseableHttpClient localHttpClient() { // JDK 8u111版本后,目标页面为HTTPS协议,启用proxy用户密码鉴权 System.setProperty("jdk.http.auth.tunneling.disabledSchemes", ""); -// String proxyHost = proxyProperties.getProxyAddr(); -// int proxyPort = proxyProperties.getProxyPort(); -// String username = proxyProperties.getAccount(); -// String password = proxyProperties.getPwd(); -// HttpHost proxy = new HttpHost(proxyHost, proxyPort); -// CredentialsProvider credsProvider = new BasicCredentialsProvider(); -// credsProvider.setCredentials(new AuthScope(proxyHost, proxyPort), -// new UsernamePasswordCredentials(username, password)); -// RequestConfig config = RequestConfig.custom().setProxy(proxy).build(); CloseableHttpClient httpClient = HttpClients .custom() -// .setDefaultRequestConfig(config) -// .setDefaultCredentialsProvider(credsProvider) .build(); -// CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(config).build(); return httpClient; }