Merge branch 'baidu-tp' of http://git.yoho.cn/yoho30/yohobuy-union into baidu-tp
Showing
7 changed files
with
82 additions
and
88 deletions
@@ -32,8 +32,8 @@ public class ChannelGroupRest { | @@ -32,8 +32,8 @@ public class ChannelGroupRest { | ||
32 | @Autowired | 32 | @Autowired |
33 | private IChannelGroupService channelGroupService; | 33 | private IChannelGroupService channelGroupService; |
34 | 34 | ||
35 | -// @Autowired | ||
36 | -// private HttpSession session; | 35 | + @Autowired |
36 | + private HttpSession session; | ||
37 | 37 | ||
38 | 38 | ||
39 | @RequestMapping("/queryChannelGroupList") | 39 | @RequestMapping("/queryChannelGroupList") |
@@ -123,10 +123,10 @@ public class ChannelGroupRest { | @@ -123,10 +123,10 @@ public class ChannelGroupRest { | ||
123 | public ApiResponse addGroup(@RequestBody ChannelUserRequest request) { | 123 | public ApiResponse addGroup(@RequestBody ChannelUserRequest request) { |
124 | 124 | ||
125 | // 设置系统管理员 ID | 125 | // 设置系统管理员 ID |
126 | -// UserInfoBO userInfo = (UserInfoBO) session.getAttribute("userSession"); | ||
127 | -// checkNotNull(userInfo, "获取当前用户信息失败,请刷新当前页面"); | 126 | + UserInfoBO userInfo = (UserInfoBO) session.getAttribute("userSession"); |
127 | + checkNotNull(userInfo, "获取当前用户信息失败,请刷新当前页面"); | ||
128 | 128 | ||
129 | -// channelGroupService.saveGroup(request, userInfo); | 129 | + channelGroupService.saveGroup(request, userInfo); |
130 | return new ApiResponse.ApiResponseBuilder().build(); | 130 | return new ApiResponse.ApiResponseBuilder().build(); |
131 | } | 131 | } |
132 | 132 |
@@ -163,13 +163,13 @@ public class ClickUnionRest { | @@ -163,13 +163,13 @@ public class ClickUnionRest { | ||
163 | log.info("addUnion4Special version={}", version); | 163 | log.info("addUnion4Special version={}", version); |
164 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 164 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
165 | bo.setClient_type("ios"); | 165 | bo.setClient_type("ios"); |
166 | - bo.setAppid("1048984814"); | 166 | + bo.setAppid("490655927"); |
167 | log.info("addUnion4Special request={}", bo); | 167 | log.info("addUnion4Special request={}", bo); |
168 | unionService.clickUnion(bo); | 168 | unionService.clickUnion(bo); |
169 | log.info("addUnion4Special with result is {}, and request is {}", response, bo); | 169 | log.info("addUnion4Special with result is {}, and request is {}", response, bo); |
170 | clickUnion.info("addUnion4Special request is {}", bo); | 170 | clickUnion.info("addUnion4Special request is {}", bo); |
171 | response.setStatus(301); | 171 | response.setStatus(301); |
172 | - response.sendRedirect("https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"); | 172 | + response.sendRedirect("https://itunes.apple.com/us/app/id490655927?ls=1&mt=8"); |
173 | } catch (IOException e) { | 173 | } catch (IOException e) { |
174 | log.error("addUnion4Special error with request={}", bo, e); | 174 | log.error("addUnion4Special error with request={}", bo, e); |
175 | } | 175 | } |
@@ -215,8 +215,8 @@ public class ClickUnionRest { | @@ -215,8 +215,8 @@ public class ClickUnionRest { | ||
215 | String version = agent.substring(agent.indexOf(" os ") + 4, agent.indexOf(" like")); | 215 | String version = agent.substring(agent.indexOf(" os ") + 4, agent.indexOf(" like")); |
216 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 216 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
217 | bo.setClient_type("ios"); | 217 | bo.setClient_type("ios"); |
218 | - bo.setAppid("1048984814"); | ||
219 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 218 | + bo.setAppid("490655927"); |
219 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
220 | } | 220 | } |
221 | //youku;5.4;ios;10.2;iphone6,1 ---这种情况比较多 | 221 | //youku;5.4;ios;10.2;iphone6,1 ---这种情况比较多 |
222 | else if(agent.contains("youku")){ | 222 | else if(agent.contains("youku")){ |
@@ -227,8 +227,8 @@ public class ClickUnionRest { | @@ -227,8 +227,8 @@ public class ClickUnionRest { | ||
227 | version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";")); | 227 | version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";")); |
228 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 228 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
229 | bo.setClient_type("ios"); | 229 | bo.setClient_type("ios"); |
230 | - bo.setAppid("1048984814"); | ||
231 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 230 | + bo.setAppid("490655927"); |
231 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
232 | } //youku;5.4.1;iphone os;8.4.1;iphone6,2 | 232 | } //youku;5.4.1;iphone os;8.4.1;iphone6,2 |
233 | else if(agent.contains("os")){ | 233 | else if(agent.contains("os")){ |
234 | int first = agent.indexOf("os;") + 3; | 234 | int first = agent.indexOf("os;") + 3; |
@@ -236,8 +236,8 @@ public class ClickUnionRest { | @@ -236,8 +236,8 @@ public class ClickUnionRest { | ||
236 | version = version1.substring(version1.indexOf(" ") + 1, version1.indexOf(";")); | 236 | version = version1.substring(version1.indexOf(" ") + 1, version1.indexOf(";")); |
237 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 237 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
238 | bo.setClient_type("ios"); | 238 | bo.setClient_type("ios"); |
239 | - bo.setAppid("1048984814"); | ||
240 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 239 | + bo.setAppid("490655927"); |
240 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
241 | } | 241 | } |
242 | } | 242 | } |
243 | //momochat/7.5.6 ios/664 (iphone 6; ios 10.2; zh_cn; iphone7,2; s1) | 243 | //momochat/7.5.6 ios/664 (iphone 6; ios 10.2; zh_cn; iphone7,2; s1) |
@@ -249,8 +249,8 @@ public class ClickUnionRest { | @@ -249,8 +249,8 @@ public class ClickUnionRest { | ||
249 | version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";")); | 249 | version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";")); |
250 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 250 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
251 | bo.setClient_type("ios"); | 251 | bo.setClient_type("ios"); |
252 | - bo.setAppid("1048984814"); | ||
253 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 252 | + bo.setAppid("490655927"); |
253 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
254 | } | 254 | } |
255 | else if(agent.contains("ios")){ | 255 | else if(agent.contains("ios")){ |
256 | int first = agent.indexOf(" ios ")+4; | 256 | int first = agent.indexOf(" ios ")+4; |
@@ -258,8 +258,8 @@ public class ClickUnionRest { | @@ -258,8 +258,8 @@ public class ClickUnionRest { | ||
258 | version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";")); | 258 | version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";")); |
259 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 259 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
260 | bo.setClient_type("ios"); | 260 | bo.setClient_type("ios"); |
261 | - bo.setAppid("1048984814"); | ||
262 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 261 | + bo.setAppid("490655927"); |
262 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
263 | } //momochat/7.5.6 ios/664 (iphone 6s; iphone os 9.2; zh_cn; iphone8,1; s1) | 263 | } //momochat/7.5.6 ios/664 (iphone 6s; iphone os 9.2; zh_cn; iphone8,1; s1) |
264 | else if(agent.contains("os")){ | 264 | else if(agent.contains("os")){ |
265 | int first = agent.indexOf(" os ")+3; | 265 | int first = agent.indexOf(" os ")+3; |
@@ -267,8 +267,8 @@ public class ClickUnionRest { | @@ -267,8 +267,8 @@ public class ClickUnionRest { | ||
267 | version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";")); | 267 | version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";")); |
268 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 268 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
269 | bo.setClient_type("ios"); | 269 | bo.setClient_type("ios"); |
270 | - bo.setAppid("1048984814"); | ||
271 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 270 | + bo.setAppid("490655927"); |
271 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
272 | } | 272 | } |
273 | } | 273 | } |
274 | else if(agent.contains("ios/")){ | 274 | else if(agent.contains("ios/")){ |
@@ -281,14 +281,14 @@ public class ClickUnionRest { | @@ -281,14 +281,14 @@ public class ClickUnionRest { | ||
281 | version = version1.substring(version1.lastIndexOf("/") + 1, version1.length()); | 281 | version = version1.substring(version1.lastIndexOf("/") + 1, version1.length()); |
282 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 282 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
283 | bo.setClient_type("ios"); | 283 | bo.setClient_type("ios"); |
284 | - bo.setAppid("1048984814"); | ||
285 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 284 | + bo.setAppid("490655927"); |
285 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
286 | }else{ //ios/6.6 com.jugg.doctor ipad5,3/8.3/768x1024/2.0 /1---这个应该就是ios_6.6 | 286 | }else{ //ios/6.6 com.jugg.doctor ipad5,3/8.3/768x1024/2.0 /1---这个应该就是ios_6.6 |
287 | version = agent.substring(agent.indexOf("ios/")+4,agent.indexOf(" ")); | 287 | version = agent.substring(agent.indexOf("ios/")+4,agent.indexOf(" ")); |
288 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 288 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
289 | bo.setClient_type("ios"); | 289 | bo.setClient_type("ios"); |
290 | - bo.setAppid("1048984814"); | ||
291 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 290 | + bo.setAppid("490655927"); |
291 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
292 | } | 292 | } |
293 | } | 293 | } |
294 | //365jia news client/cn.ahurls.news/3.5.0_300500.209/ios(7.1|0|iphone)/59c2ed8b88175124c539e0c7a96a18d4eedb3d6c(none|none)/640x1136@2 | 294 | //365jia news client/cn.ahurls.news/3.5.0_300500.209/ios(7.1|0|iphone)/59c2ed8b88175124c539e0c7a96a18d4eedb3d6c(none|none)/640x1136@2 |
@@ -298,8 +298,8 @@ public class ClickUnionRest { | @@ -298,8 +298,8 @@ public class ClickUnionRest { | ||
298 | String version = version1.substring(0,version1.indexOf("|")); | 298 | String version = version1.substring(0,version1.indexOf("|")); |
299 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 299 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
300 | bo.setClient_type("ios"); | 300 | bo.setClient_type("ios"); |
301 | - bo.setAppid("1048984814"); | ||
302 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 301 | + bo.setAppid("490655927"); |
302 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
303 | } | 303 | } |
304 | else if (agent.contains("ios")){ | 304 | else if (agent.contains("ios")){ |
305 | String version = ""; | 305 | String version = ""; |
@@ -310,8 +310,8 @@ public class ClickUnionRest { | @@ -310,8 +310,8 @@ public class ClickUnionRest { | ||
310 | version = agent.substring(version1.lastIndexOf(";")+1,lastIndex); | 310 | version = agent.substring(version1.lastIndexOf(";")+1,lastIndex); |
311 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 311 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
312 | bo.setClient_type("ios"); | 312 | bo.setClient_type("ios"); |
313 | - bo.setAppid("1048984814"); | ||
314 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 313 | + bo.setAppid("490655927"); |
314 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
315 | }else if(agent.contains("jxsg")) { //jxsg_ios-1.2.5/0.0.2 (iphone7,2; ios 10.2.1) | 315 | }else if(agent.contains("jxsg")) { //jxsg_ios-1.2.5/0.0.2 (iphone7,2; ios 10.2.1) |
316 | int first = agent.lastIndexOf("ios ") + 4; | 316 | int first = agent.lastIndexOf("ios ") + 4; |
317 | String version1 = agent.substring(first); | 317 | String version1 = agent.substring(first); |
@@ -319,8 +319,8 @@ public class ClickUnionRest { | @@ -319,8 +319,8 @@ public class ClickUnionRest { | ||
319 | version = version1.substring(version1.indexOf(" ") + 1, lastIndex); | 319 | version = version1.substring(version1.indexOf(" ") + 1, lastIndex); |
320 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 320 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
321 | bo.setClient_type("ios"); | 321 | bo.setClient_type("ios"); |
322 | - bo.setAppid("1048984814"); | ||
323 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 322 | + bo.setAppid("490655927"); |
323 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
324 | }else{ | 324 | }else{ |
325 | int first = agent.lastIndexOf("ios ") + 4; | 325 | int first = agent.lastIndexOf("ios ") + 4; |
326 | String version1 = agent.substring(first); | 326 | String version1 = agent.substring(first); |
@@ -328,8 +328,8 @@ public class ClickUnionRest { | @@ -328,8 +328,8 @@ public class ClickUnionRest { | ||
328 | version = version1.substring(0, lastIndex); | 328 | version = version1.substring(0, lastIndex); |
329 | bo.setTd("ios_" + version.replaceAll("_", ".")); | 329 | bo.setTd("ios_" + version.replaceAll("_", ".")); |
330 | bo.setClient_type("ios"); | 330 | bo.setClient_type("ios"); |
331 | - bo.setAppid("1048984814"); | ||
332 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 331 | + bo.setAppid("490655927"); |
332 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; | ||
333 | } | 333 | } |
334 | } | 334 | } |
335 | 335 | ||
@@ -374,7 +374,7 @@ public class ClickUnionRest { | @@ -374,7 +374,7 @@ public class ClickUnionRest { | ||
374 | //response.setHeader("Location",url); | 374 | //response.setHeader("Location",url); |
375 | //如果不需要直接下载, 配置参数downloadDirect=N, 跳转应用宝下载 | 375 | //如果不需要直接下载, 配置参数downloadDirect=N, 跳转应用宝下载 |
376 | if(null != downloadDirect && "ios".equals(downloadDirect.trim())){ | 376 | if(null != downloadDirect && "ios".equals(downloadDirect.trim())){ |
377 | - url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8"; | 377 | + url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8"; |
378 | }else if(null != downloadDirect && "android".equals(downloadDirect.trim())){ | 378 | }else if(null != downloadDirect && "android".equals(downloadDirect.trim())){ |
379 | url = "http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445"; | 379 | url = "http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445"; |
380 | } | 380 | } |
@@ -85,6 +85,8 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | @@ -85,6 +85,8 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | ||
85 | @Value("${exclude.union.type:100000000000349}") | 85 | @Value("${exclude.union.type:100000000000349}") |
86 | private String EXCLUDE_UNION_TYPE; | 86 | private String EXCLUDE_UNION_TYPE; |
87 | 87 | ||
88 | + private final static String NO_NEED_CHECK_ACTIVE_UNION = "100000000005441"; | ||
89 | + | ||
88 | @Resource | 90 | @Resource |
89 | IUnionLogsDAO unionLogsDAO; | 91 | IUnionLogsDAO unionLogsDAO; |
90 | 92 | ||
@@ -203,26 +205,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | @@ -203,26 +205,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | ||
203 | key += "_" + request.getAppkey(); | 205 | key += "_" + request.getAppkey(); |
204 | } | 206 | } |
205 | } | 207 | } |
206 | -// String value = yhValueOperations.get(key); | ||
207 | -// log.info("clickUnion get key={}, value={}", key, value); | ||
208 | -// //如果redis中已经存在该用户点击信息,则不再重复保存 | ||
209 | -// if (StringUtils.isNotEmpty(value)) { | ||
210 | -// log.warn("clickUnion error click info is exists with param is {}", request); | ||
211 | -// return new UnionResponse(202, "click info is exists"); | ||
212 | -// } | ||
213 | - | ||
214 | -// //查询该用户是否已经激活过 | ||
215 | -// | ||
216 | -// UnionLogs union = unionLogsDAO.selectByTd(request.getTd()); | ||
217 | -// log.info("clickUnion in selectByTd result is {}", union); | ||
218 | -// if (union != null && union.getIsActivate() != null && union.getIsActivate().byteValue() == 1) { | ||
219 | -// //如果90天之内有过激活日志,则不允许重复激活 | ||
220 | -// log.warn("clickUnion error because 90 days has activate info with param is {}", request); | ||
221 | -// return new UnionResponse(203, "have activite in 90 days"); | ||
222 | -// } | ||
223 | - | ||
224 | - //保存到缓存中,根据不同的厂商,设置不同的有效期,3: | ||
225 | -// log.info("clickUnion set redis with key={}, value={}", key, JSON.toJSONString(request)); | 208 | + |
226 | clickUnion.info("clickUnion set redis with key={}, value={}", key, JSON.toJSONString(request)); | 209 | clickUnion.info("clickUnion set redis with key={}, value={}", key, JSON.toJSONString(request)); |
227 | 210 | ||
228 | String invalidTime = "activeTime"+"_"+request.getUnion_type(); | 211 | String invalidTime = "activeTime"+"_"+request.getUnion_type(); |
@@ -373,8 +356,14 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | @@ -373,8 +356,14 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | ||
373 | noCheckActive.info("Active record without any check. client is {}, udid is {}, idfa is {}, imei is {}", request.getClient_type(), request.getUdid(), request.getIdfa(), request.getImei()); | 356 | noCheckActive.info("Active record without any check. client is {}, udid is {}, idfa is {}, imei is {}", request.getClient_type(), request.getUdid(), request.getIdfa(), request.getImei()); |
374 | // 把存储的字符串变为对象 | 357 | // 把存储的字符串变为对象 |
375 | ClickUnionRequestBO click = JSON.parseObject(value, ClickUnionRequestBO.class); | 358 | ClickUnionRequestBO click = JSON.parseObject(value, ClickUnionRequestBO.class); |
359 | + | ||
360 | + //判断是否需要判断激活,90天活跃 | ||
361 | + boolean isNeedCheckActive = true; | ||
362 | + if(NO_NEED_CHECK_ACTIVE_UNION.equals(click.getUnion_type())){ | ||
363 | + isNeedCheckActive = false; | ||
364 | + } | ||
376 | // 查询该td在90天内是否已经激活过 | 365 | // 查询该td在90天内是否已经激活过 |
377 | - UnionLogs union = unionLogsDAO.selectByClientType(request.getClient_type(), request.getIdfa(), request.getImei(), request.getAppkey()); | 366 | + UnionLogs union = unionLogsDAO.selectByClientType(request.getClient_type(), request.getIdfa(), request.getImei(), request.getAppkey());; |
378 | log.info("activateUnion in selectByClientType result is {}", union); | 367 | log.info("activateUnion in selectByClientType result is {}", union); |
379 | 368 | ||
380 | //删除redis中的点击记录 | 369 | //删除redis中的点击记录 |
@@ -395,9 +384,8 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | @@ -395,9 +384,8 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | ||
395 | mktMarketingUrl = mktMarketingUrlDAO.selectByPrimaryKey(Long.valueOf(click.getUnion_type())); | 384 | mktMarketingUrl = mktMarketingUrlDAO.selectByPrimaryKey(Long.valueOf(click.getUnion_type())); |
396 | redisValueCache.set(unionTypekey, mktMarketingUrl, 1, TimeUnit.HOURS); | 385 | redisValueCache.set(unionTypekey, mktMarketingUrl, 1, TimeUnit.HOURS); |
397 | } | 386 | } |
398 | - | 387 | + //激活落地页配置. |
399 | JSONObject result = new JSONObject(); | 388 | JSONObject result = new JSONObject(); |
400 | - result.put("landing_page_url",StringUtils.isEmpty(mktMarketingUrl.getLandingPageUrl()) ? "" : mktMarketingUrl.getLandingPageUrl()); | ||
401 | 389 | ||
402 | UnionTypeModel u = new UnionTypeModel(); | 390 | UnionTypeModel u = new UnionTypeModel(); |
403 | u.setName(mktMarketingUrl.getName()); | 391 | u.setName(mktMarketingUrl.getName()); |
@@ -414,18 +402,16 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | @@ -414,18 +402,16 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | ||
414 | } else if ("mars".equals(appkey)) { | 402 | } else if ("mars".equals(appkey)) { |
415 | app_key = "yohomars_ios"; | 403 | app_key = "yohomars_ios"; |
416 | } | 404 | } |
417 | -// List<AppActivateIdfaList> _90DayIdfaList = appActivateIdfaListDAO.selectByUdidAndDate(new AppActivateIdfaList(Long.valueOf(yesterday), request.getUdid(), app_key)); | ||
418 | -// activeUnion.info("check ios active info in 90 days. udid is {} and app_key is {},yesterday is {} and result is {}", request.getUdid(), app_key, yesterday, (null == _90DayIdfaList || _90DayIdfaList.size() == 0)? "null": _90DayIdfaList.get(0)); | ||
419 | 405 | ||
420 | - BaseUserActiveDay baseUserActiveDay = baseUserActiveDayMapper.selectByUdidAndAppKey(request.getUdid(),app_key); | 406 | + BaseUserActiveDay baseUserActiveDay = isNeedCheckActive ? baseUserActiveDayMapper.selectByUdidAndAppKey(request.getUdid(),app_key) : null; |
421 | activeUnion.info("check ios active info in 90 days. udid is {} and app_key is {}, result is {}", request.getUdid(), app_key,baseUserActiveDay); | 407 | activeUnion.info("check ios active info in 90 days. udid is {} and app_key is {}, result is {}", request.getUdid(), app_key,baseUserActiveDay); |
422 | - List<AppActivateIdfaList> _15DayIdfaList = appActivateIdfaListDAO.select15DaysByIdfaAndDate(new AppActivateIdfaList(Long.valueOf(yesterday), request.getIdfa(), app_key, null)); | 408 | + List<AppActivateIdfaList> _15DayIdfaList = isNeedCheckActive ? appActivateIdfaListDAO.select15DaysByIdfaAndDate(new AppActivateIdfaList(Long.valueOf(yesterday), request.getIdfa(), app_key, null)) : null; |
423 | 409 | ||
424 | activeUnion.info("check ios active info in 15 days. udid is {} and app_key is {},yesterday is {} and result is {}", request.getUdid(), app_key, yesterday, (null == _15DayIdfaList || _15DayIdfaList.size() == 0)? "null": _15DayIdfaList.get(0)); | 410 | activeUnion.info("check ios active info in 15 days. udid is {} and app_key is {},yesterday is {} and result is {}", request.getUdid(), app_key, yesterday, (null == _15DayIdfaList || _15DayIdfaList.size() == 0)? "null": _15DayIdfaList.get(0)); |
425 | 411 | ||
426 | //判断90天内是否在大数据有记录 | 412 | //判断90天内是否在大数据有记录 |
427 | if (baseUserActiveDay!=null) { | 413 | if (baseUserActiveDay!=null) { |
428 | -// log.warn("ios activateUnion error because 90 days has activate in bigdata database info with param is {}", request); | 414 | + log.warn("ios activateUnion error because 90 days has activate in bigdata database info with param is {}", request); |
429 | String time = DateUtil.getcurrentTime(); | 415 | String time = DateUtil.getcurrentTime(); |
430 | udidPool.info("Has action in 90 days at bigdata. udid is {},idfa is {},current time is {}", request.getUdid(), request.getIdfa(),time); | 416 | udidPool.info("Has action in 90 days at bigdata. udid is {},idfa is {},current time is {}", request.getUdid(), request.getIdfa(),time); |
431 | //判断15天内是否在大数据有记录 | 417 | //判断15天内是否在大数据有记录 |
@@ -452,7 +438,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | @@ -452,7 +438,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | ||
452 | activeDingdang.info(j.toString()); | 438 | activeDingdang.info(j.toString()); |
453 | } | 439 | } |
454 | return new UnionResponse(200, "have activite in 90 days",result); | 440 | return new UnionResponse(200, "have activite in 90 days",result); |
455 | - | ||
456 | } | 441 | } |
457 | } | 442 | } |
458 | 443 | ||
@@ -460,8 +445,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | @@ -460,8 +445,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | ||
460 | if (StringUtils.equals(ClientTypeEnum.ANDROID.getName(), request.getClient_type())){ | 445 | if (StringUtils.equals(ClientTypeEnum.ANDROID.getName(), request.getClient_type())){ |
461 | String appKey = request.getAppkey()+"_android"; | 446 | String appKey = request.getAppkey()+"_android"; |
462 | // 如果90天内有记录,则直接返回 | 447 | // 如果90天内有记录,则直接返回 |
463 | -// List<AppActivateUdidList> activateUdidLists = appActivateUdidListDAO.selectByImeiUdidDate(new AppActivateUdidList(Long.valueOf(yesterday), request.getUdid(), appKey)); | ||
464 | - BaseUserActiveDay baseUserActiveDay = baseUserActiveDayMapper.selectByUdidAndAppKey(request.getUdid(), appKey); | 448 | + BaseUserActiveDay baseUserActiveDay = isNeedCheckActive?baseUserActiveDayMapper.selectByUdidAndAppKey(request.getUdid(), appKey) : null; |
465 | activeUnion.info("check android active info in 90 days. udid is {} and app_key is {},result is {}", request.getUdid(), appKey, baseUserActiveDay); | 449 | activeUnion.info("check android active info in 90 days. udid is {} and app_key is {},result is {}", request.getUdid(), appKey, baseUserActiveDay); |
466 | 450 | ||
467 | if (baseUserActiveDay!=null){ | 451 | if (baseUserActiveDay!=null){ |
@@ -506,7 +490,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | @@ -506,7 +490,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | ||
506 | log.error("activity save unionlog error is {}",e.getMessage()); | 490 | log.error("activity save unionlog error is {}",e.getMessage()); |
507 | } | 491 | } |
508 | 492 | ||
509 | - | ||
510 | // 记录日志 | 493 | // 记录日志 |
511 | JSONObject j = new JSONObject(); | 494 | JSONObject j = new JSONObject(); |
512 | j.put("apptype", request.getClient_type()); | 495 | j.put("apptype", request.getClient_type()); |
@@ -548,8 +531,16 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | @@ -548,8 +531,16 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | ||
548 | log.warn("publish activate event fail! e {}", e); | 531 | log.warn("publish activate event fail! e {}", e); |
549 | } | 532 | } |
550 | 533 | ||
534 | + //如果是通过邀请码二维码下载, 则返回落地页添加邀请码信息 | ||
535 | + String landingUrl = mktMarketingUrl.getLandingPageUrl(); | ||
536 | + activeUnion.info("get landing_page_url. mktMarketingUrl is {}, landingUrl is {}, invitecodeValue ={}", mktMarketingUrl, landingUrl, click.getInvite_code()); | ||
537 | + if(StringUtils.isNotEmpty(landingUrl) && StringUtils.isNotEmpty(click.getInvite_code())){ | ||
538 | + landingUrl = landingUrl.replace("invitecodeValue", click.getInvite_code()); | ||
539 | + } | ||
540 | + result.put("landing_page_url", StringUtils.isEmpty(landingUrl) ? "" : mktMarketingUrl.getLandingPageUrl()); | ||
541 | + activeUnion.info("active union. union_type = {}, landing_page_url = {}, result = {}, idfa = {}, imei = {}", click.getUnion_type(), landingUrl, result, request.getIdfa(), request.getImei()); | ||
542 | + | ||
551 | String url = null; | 543 | String url = null; |
552 | - //取出具体是哪个union_type | ||
553 | //根据不同的url走不同的回调 | 544 | //根据不同的url走不同的回调 |
554 | try { | 545 | try { |
555 | String union_type = click.getUnion_type(); | 546 | String union_type = click.getUnion_type(); |
@@ -606,17 +597,13 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | @@ -606,17 +597,13 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher | ||
606 | if(union_type.equals("3")){ | 597 | if(union_type.equals("3")){ |
607 | saveUnionActivity(click,request); | 598 | saveUnionActivity(click,request); |
608 | } | 599 | } |
609 | - | ||
610 | - | ||
611 | } catch (Exception e) { | 600 | } catch (Exception e) { |
612 | log.error("callback error with request={}", request, e); | 601 | log.error("callback error with request={}", request, e); |
613 | //return new UnionResponse(204, "callback error"); | 602 | //return new UnionResponse(204, "callback error"); |
614 | } | 603 | } |
615 | 604 | ||
616 | activeUnion.info("activateUnion in success request is {}", request); | 605 | activeUnion.info("activateUnion in success request is {}", request); |
617 | - | ||
618 | return new UnionResponse(200,"success",result); | 606 | return new UnionResponse(200,"success",result); |
619 | - | ||
620 | } catch (Exception e) { | 607 | } catch (Exception e) { |
621 | log.error("activateUnion error with request={}", request, e); | 608 | log.error("activateUnion error with request={}", request, e); |
622 | return new UnionResponse(200, e.getMessage(),new JSONObject()); | 609 | return new UnionResponse(200, e.getMessage(),new JSONObject()); |
@@ -47,6 +47,12 @@ rabbit_common_qq_user=yoho | @@ -47,6 +47,12 @@ rabbit_common_qq_user=yoho | ||
47 | rabbit_common_qq_password=yoho | 47 | rabbit_common_qq_password=yoho |
48 | ##########common rabbitmq ########## | 48 | ##########common rabbitmq ########## |
49 | 49 | ||
50 | +#-------------七牛云配置-------------------# | ||
51 | +qiniu.accesskey=atSf7xxIl8alEnsXbhC1bOD1GWVW3qYffz8SlB4m | ||
52 | +qiniu.secretkey=pyoJzPygXIkFWrc1BAsH6tAJ0yweTchpJwGKEwhm | ||
53 | +qiniu.domain = test | ||
54 | +qiniu.bucket = test | ||
55 | + | ||
50 | zkAddress=127.0.0.1:2181 | 56 | zkAddress=127.0.0.1:2181 |
51 | # web context | 57 | # web context |
52 | web.context=union | 58 | web.context=union |
@@ -121,10 +127,4 @@ ip.port.search.server = 192.168.102.216:8080/ | @@ -121,10 +127,4 @@ ip.port.search.server = 192.168.102.216:8080/ | ||
121 | baidu.tp.push.url=http://hoteltest.baidu.com/business/article_publish | 127 | baidu.tp.push.url=http://hoteltest.baidu.com/business/article_publish |
122 | baidu.app.id=1566454424306679 | 128 | baidu.app.id=1566454424306679 |
123 | baidu.app.token=spdtkn_test12 | 129 | baidu.app.token=spdtkn_test12 |
124 | -baidu.union.type=100000000005493 | ||
125 | - | ||
126 | -# qiniu config | ||
127 | -qiniu.accesskey: = atSf7xxIl8alEnsXbhC1bOD1GWVW3qYffz8SlB4m | ||
128 | -qiniu.secretkey: = pyoJzPygXIkFWrc1BAsH6tAJ0yweTchpJwGKEwhm | ||
129 | -qiniu.domain: = test | ||
130 | -qiniu.bucket = test | ||
130 | +baidu.union.type=100000000005493 |
@@ -125,8 +125,9 @@ baidu.app.id=${baidu.app.id} | @@ -125,8 +125,9 @@ baidu.app.id=${baidu.app.id} | ||
125 | baidu.app.token=${baidu.app.token} | 125 | baidu.app.token=${baidu.app.token} |
126 | baidu.union.type=${baidu.union.type} | 126 | baidu.union.type=${baidu.union.type} |
127 | 127 | ||
128 | -qiniu.accesskey: = ${qiniu.accesskey} | ||
129 | -qiniu.secretkey: = ${qiniu.secretkey} | ||
130 | -qiniu.domain: = ${qiniu.domain} | 128 | + |
129 | +qiniu.accesskey = ${qiniu.accesskey} | ||
130 | +qiniu.secretkey = ${qiniu.secretkey} | ||
131 | +qiniu.domain = ${qiniu.domain} | ||
131 | qiniu.bucket = ${qiniu.bucket} | 132 | qiniu.bucket = ${qiniu.bucket} |
132 | 133 |
@@ -142,7 +142,11 @@ | @@ -142,7 +142,11 @@ | ||
142 | 142 | ||
143 | window.cookie = cookie; | 143 | window.cookie = cookie; |
144 | 144 | ||
145 | - var url = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"gender":"1","channel":"2"}}'; | 145 | + var params = queryString(); |
146 | + | ||
147 | + var openbyYohobuy = decodeURIComponent(params['openby:yohobuy'] || '') || '{"action":"go.home","params":{"gender":"1","channel":"2"}}'; | ||
148 | + | ||
149 | + var url = 'yohobuy://yohobuy.com/goapp?openby:yohobuy=' + openbyYohobuy; | ||
146 | var isWechat = /micromessenger/i.test(navigator.userAgent || ''); | 150 | var isWechat = /micromessenger/i.test(navigator.userAgent || ''); |
147 | 151 | ||
148 | if(isWechat){ | 152 | if(isWechat){ |
@@ -157,12 +161,10 @@ | @@ -157,12 +161,10 @@ | ||
157 | var androidExp = new RegExp('MQQBrowser');//安卓QQ内置浏览器正则 | 161 | var androidExp = new RegExp('MQQBrowser');//安卓QQ内置浏览器正则 |
158 | var isAndroidQQ = androidExp.test(navigator.userAgent); //判断是不是QQ内置浏览器 | 162 | var isAndroidQQ = androidExp.test(navigator.userAgent); //判断是不是QQ内置浏览器 |
159 | 163 | ||
160 | - var version, type, appid, td, params; | ||
161 | - | ||
162 | - params = queryString(); | 164 | + var version, type, appid, td; |
163 | 165 | ||
164 | if(params.union_type){ | 166 | if(params.union_type){ |
165 | - url = 'yohobuy://yohobuy.com/goapp?ct='+params.union_type+'&openby:yohobuy={"action":"go.home","params":{"gender":"1","channel":"2"}}'; | 167 | + url = 'yohobuy://yohobuy.com/goapp?ct='+params.union_type+'&openby:yohobuy=' + openbyYohobuy; |
166 | } | 168 | } |
167 | 169 | ||
168 | if (isiOS) { | 170 | if (isiOS) { |
@@ -221,7 +223,7 @@ | @@ -221,7 +223,7 @@ | ||
221 | //如果setTimeout 回调超过2500ms,则弹出下载 | 223 | //如果setTimeout 回调超过2500ms,则弹出下载 |
222 | if ((+new Date()) - openTime > 500) { | 224 | if ((+new Date()) - openTime > 500) { |
223 | if (isiOS) { | 225 | if (isiOS) { |
224 | - url = '//itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8'; | 226 | + url = '//itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8'; |
225 | } else { | 227 | } else { |
226 | url = '//yoho-apps.qiniudn.com/YohoBuy_YOHO.apk'; | 228 | url = '//yoho-apps.qiniudn.com/YohoBuy_YOHO.apk'; |
227 | } | 229 | } |
@@ -259,7 +261,7 @@ | @@ -259,7 +261,7 @@ | ||
259 | url = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'; | 261 | url = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'; |
260 | }else{ | 262 | }else{ |
261 | if (isiOS) { | 263 | if (isiOS) { |
262 | - url = '//itunes.apple.com/cn/app/yoho!-you-huo/id1048984814?mt=8'; | 264 | + url = '//itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8'; |
263 | } else { | 265 | } else { |
264 | if(isAndroidQQ){ //安卓qq处理方式同微信,也进入应用宝下载 | 266 | if(isAndroidQQ){ //安卓qq处理方式同微信,也进入应用宝下载 |
265 | url = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'; | 267 | url = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445'; |
@@ -324,6 +326,9 @@ | @@ -324,6 +326,9 @@ | ||
324 | } else if (params.IMEI) { | 326 | } else if (params.IMEI) { |
325 | unionUrl += '&imei=' + params.IMEI; | 327 | unionUrl += '&imei=' + params.IMEI; |
326 | } | 328 | } |
329 | + if(params.invite_code){ | ||
330 | + unionUrl += '&invite_code=' + params.invite_code; | ||
331 | + } | ||
327 | xhrGet(unionUrl, function () { | 332 | xhrGet(unionUrl, function () { |
328 | }); | 333 | }); |
329 | } | 334 | } |
@@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
56 | 56 | ||
57 | version = (verinfo+'').replace(/[^0-9|_.]/ig,'').replace(/_/ig, '.'); | 57 | version = (verinfo+'').replace(/[^0-9|_.]/ig,'').replace(/_/ig, '.'); |
58 | type = 'ios'; | 58 | type = 'ios'; |
59 | - appid = '1048984814'; | 59 | + appid = '490655927'; |
60 | td = window.screen.width + '_' + window.screen.height + '_' + type + '_' + version; | 60 | td = window.screen.width + '_' + window.screen.height + '_' + type + '_' + version; |
61 | 61 | ||
62 | } else if (agent.indexOf('android') > -1 || agent.indexOf('linux') > -1) { | 62 | } else if (agent.indexOf('android') > -1 || agent.indexOf('linux') > -1) { |
@@ -111,7 +111,8 @@ | @@ -111,7 +111,8 @@ | ||
111 | appid: queryString.appid ? queryString.appid : appid, | 111 | appid: queryString.appid ? queryString.appid : appid, |
112 | appkey: queryString.appkey, | 112 | appkey: queryString.appkey, |
113 | idfa : queryString.idfa ? queryString.idfa : queryString.IDFA, | 113 | idfa : queryString.idfa ? queryString.idfa : queryString.IDFA, |
114 | - imei:queryString.imei?queryString.imei:queryString.IMEI | 114 | + imei:queryString.imei?queryString.imei:queryString.IMEI, |
115 | + params:queryString.params | ||
115 | }, | 116 | }, |
116 | complete: function() { | 117 | complete: function() { |
117 | 118 |
-
Please register or login to post a comment