...
|
...
|
@@ -359,18 +359,23 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher |
|
|
//强制删除带ip的key
|
|
|
yHRedisTemplate.delete(UNION_KEY + "_" + request.getClientIp() + "_" + request.getAppkey());
|
|
|
|
|
|
if (union != null && union.getIsActivate() != null && union.getIsActivate().byteValue() == 1) {
|
|
|
// 如果90天之内有过激活日志,则不允许重复激活
|
|
|
log.warn("activateUnion error because 90 days has activate info with param is {}", request);
|
|
|
return new UnionResponse(203, "have activite in 90 days");
|
|
|
}
|
|
|
// UnionTypeModel u = UnionConstant.unionTypeMap.get(Integer.parseInt(click.getUnion_type()));
|
|
|
String unionTypekey = "yh:union:uniontype:"+click.getUnion_type();
|
|
|
MktMarketingUrl mktMarketingUrl = redisValueCache.get(unionTypekey,MktMarketingUrl.class);
|
|
|
if(mktMarketingUrl==null){
|
|
|
mktMarketingUrl = mktMarketingUrlDAO.selectByPrimaryKey(Long.valueOf(click.getUnion_type()));
|
|
|
redisValueCache.set(unionTypekey,mktMarketingUrl,1, TimeUnit.HOURS);
|
|
|
}
|
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("landing_page_url",mktMarketingUrl.getLandingPageUrl());
|
|
|
|
|
|
if (union != null && union.getIsActivate() != null && union.getIsActivate().byteValue() == 1) {
|
|
|
// 如果90天之内有过激活日志,则不允许重复激活
|
|
|
log.warn("activateUnion error because 90 days has activate info with param is {}", request);
|
|
|
return new UnionResponse(203, "have activite in 90 days",result);
|
|
|
}
|
|
|
// UnionTypeModel u = UnionConstant.unionTypeMap.get(Integer.parseInt(click.getUnion_type()));
|
|
|
|
|
|
UnionTypeModel u = new UnionTypeModel();
|
|
|
u.setName(mktMarketingUrl.getName());
|
|
|
u.setValue(String.valueOf(mktMarketingUrl.getUnionType()));
|
...
|
...
|
@@ -418,7 +423,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher |
|
|
j.put("tdid", request.getTdid());
|
|
|
activeDingdang.info(j.toString());
|
|
|
}
|
|
|
return new UnionResponse(203, "have activite in 90 days");
|
|
|
return new UnionResponse(203, "have activite in 90 days",result);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -501,7 +506,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher |
|
|
}
|
|
|
if (StringUtils.isEmpty(url)) {
|
|
|
log.info("activateUnion in success request is {}", request);
|
|
|
return new UnionResponse();
|
|
|
return new UnionResponse(200,"success",result);
|
|
|
}
|
|
|
if(!"3".equals(union_type)){
|
|
|
url = URLDecoder.decode(url, "UTF-8");
|
...
|
...
|
@@ -530,7 +535,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher |
|
|
activeUnion.info("activateUnion call union success url={}, and result={}", url, pair);
|
|
|
if (pair.getLeft() != 200) {
|
|
|
log.warn("callback error with request={}", request);
|
|
|
return new UnionResponse(204, "callback error");
|
|
|
return new UnionResponse(204, "callback error",result);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error("callback error with request={}", request, e);
|
...
|
...
|
@@ -539,8 +544,8 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher |
|
|
|
|
|
|
|
|
activeUnion.info("activateUnion in success request is {}", request);
|
|
|
|
|
|
return new UnionResponse();
|
|
|
|
|
|
return new UnionResponse(200,"success",result);
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
log.error("activateUnion error with request={}", request, e);
|
...
|
...
|
|