|
@@ -42,7 +42,8 @@ public class MenuJob {
|
|
|
// @Scheduled(cron = "0/30 * * * * ?")
|
|
|
@Scheduled(cron = "0 0 10 1/7 * ?")
|
|
|
public void autoGetUrl() throws Exception {
|
|
|
- getPddUrl();
|
|
|
+ getPddPhoneUrl();
|
|
|
+ getPddTrainTicketsUrl();
|
|
|
getMeiUrl();
|
|
|
homePageDataInfoService.synchroData();
|
|
|
log.info("--------更新美团,拼多多URL完成!~---------------");
|
|
@@ -65,7 +66,7 @@ public class MenuJob {
|
|
|
return builder.toString();
|
|
|
}
|
|
|
|
|
|
- public void getPddUrl() throws Exception {
|
|
|
+ public void getPddPhoneUrl() throws Exception {
|
|
|
|
|
|
// String client_id = "fa0f2debb5b0444b9719919d7b8204d1";
|
|
|
// String client_secret = "3305b6bb37252495848e67fd991134651e308495";
|
|
@@ -113,10 +114,55 @@ public class MenuJob {
|
|
|
hp.setPictureName("话费充值");
|
|
|
hp.setJumpUrl("{\"appId\":\""+appId+"\",\"path\":\""+pagePath+"\"}");
|
|
|
homePageDataInfoService.updateHomePageDataByPictureName(hp);
|
|
|
- System.out.println(Thread.currentThread().getName()+"完成testTask1,完成时间:"+new Date());
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public void getPddTrainTicketsUrl() throws Exception {
|
|
|
+
|
|
|
+ long timeLong = System.currentTimeMillis();
|
|
|
+ String timestamp = String.valueOf(timeLong/1000);
|
|
|
+ Pdd pdd = new Pdd();
|
|
|
+ //公共请救参数
|
|
|
+ pdd.setType("pdd.ddk.resource.url.gen");
|
|
|
+ pdd.setClient_id(pddConfig.getClientId());
|
|
|
+ pdd.setTimestamp(timestamp);
|
|
|
+ //请求参数
|
|
|
+ pdd.setGenerate_we_app(true);
|
|
|
+ pdd.setPid(pddConfig.getPid());
|
|
|
+ // pdd.setResource_type(39996);
|
|
|
+ pdd.setResource_type(50005);
|
|
|
+ //sign 加密
|
|
|
+ Map<String,Object> param = new HashMap<String,Object>();
|
|
|
+ //公共参数
|
|
|
+ param.put("type",pdd.getType());
|
|
|
+ param.put("client_id",pdd.getClient_id());
|
|
|
+ param.put("timestamp",pdd.getTimestamp());
|
|
|
+ //请求参数
|
|
|
+ param.put("generate_we_app",pdd.getGenerate_we_app());
|
|
|
+ param.put("pid",pdd.getPid());
|
|
|
+ param.put("resource_type",pdd.getResource_type());
|
|
|
+ String sign = getSign(param,pddConfig.getClientSecret());
|
|
|
+ String md5 = MD5Utils.MD5Encode(sign).toUpperCase();
|
|
|
+ pdd.setSign(md5);
|
|
|
+
|
|
|
+ String result = pddService.getPdd(pdd);
|
|
|
+
|
|
|
+ JSONObject json = JSONObject.parseObject(result);
|
|
|
+ String resourceUrlResponseJson = json.get("resource_url_response").toString();
|
|
|
+ JSONObject json2 = JSONObject.parseObject(resourceUrlResponseJson);
|
|
|
+ String waAppInfo = json2.get("we_app_info").toString();
|
|
|
+
|
|
|
+ JSONObject waAppInfoJson = JSONObject.parseObject(waAppInfo);
|
|
|
+
|
|
|
+ String pagePath = waAppInfoJson.get("page_path").toString();
|
|
|
+ String appId = waAppInfoJson.get("app_id").toString();
|
|
|
+
|
|
|
+ HomePageDataInfoVo hp = new HomePageDataInfoVo();
|
|
|
+ hp.setPictureName("火车票");
|
|
|
+ hp.setJumpUrl("{\"appId\":\""+appId+"\",\"path\":\""+pagePath+"\"}");
|
|
|
+ homePageDataInfoService.updateHomePageDataByPictureName(hp);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public void getMeiUrl() throws Exception {
|
|
|
|