Authored by zhengwen.ge

品友

... ... @@ -43,14 +43,15 @@ public class PinYouServiceImpl implements IPinYouService {
@Override
public UnionResponse sendPinYou() {
log.info("begin sendPinyou");
//从redis里面获取大数据的数据
Long viewSize = redisListCache.size(UNION_VIEW_KEY);
Long transSize = redisListCache.size(UNION_TRANS_KEY);
List<ViewPinYouRequestBO> viewPinYouRequestBOList = new ArrayList<>();
int viewSizeInt = viewSize == null ? 0 : viewSize.intValue();
int transSizeInt = transSize == null ? 0 : transSize.intValue();
log.info("viewSize is {},transSize is {}",viewSizeInt,viewSizeInt);
List<TransPinYouRequestBO> transPinYouRequestBOList = new ArrayList<>();
if (viewSizeInt > 0) {
for (int i = 0; i < viewSizeInt; i++) {
ViewPinYouRequestBO viewPinYouRequestBO = redisListCache.rightPop(UNION_VIEW_KEY, ViewPinYouRequestBO.class);
... ... @@ -65,12 +66,14 @@ public class PinYouServiceImpl implements IPinYouService {
}
if (CollectionUtils.isNotEmpty(viewPinYouRequestBOList)) {
log.info("viewPinYouRequestBOList size is {}",viewPinYouRequestBOList.size());
for (ViewPinYouRequestBO requestBO : viewPinYouRequestBOList) {
sendView(requestBO);
}
}
if (CollectionUtils.isNotEmpty(transPinYouRequestBOList)) {
log.info("transPinYouRequestBOList size is {}",transPinYouRequestBOList.size());
for (TransPinYouRequestBO transPinYouRequestBO : transPinYouRequestBOList) {
sendTrans(transPinYouRequestBO);
}
... ...
... ... @@ -268,11 +268,11 @@ public class UnionServiceImpl implements IUnionService {
// return new UnionResponse(205, "not click record");
// }
// 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");
// }
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()));
//如果是ios系统,还要到大数据表里面判断这个用户是否90天内的活跃用户,如果是的话,这次激活就不成功
String yesterday = DateUtil.dateAdd(DateUtil.getToday("yyyyMMdd"), "d", -1, "yyyyMMdd");
... ...
... ... @@ -39,12 +39,14 @@ public class PinYouTask {
*/
@Scheduled(cron = "0 0 6 * * ?")
public void run(){
log.info("begin run pinyoutask");
//从redis里面获取大数据的数据
Long viewSize = redisListCache.size(UNION_VIEW_KEY);
Long transSize = redisListCache.size(UNION_TRANS_KEY);
List<ViewPinYouRequestBO> viewPinYouRequestBOList = new ArrayList<>();
int viewSizeInt = viewSize == null ? 0 : viewSize.intValue();
int transSizeInt = transSize == null ? 0:transSize.intValue();
log.info("viewSize is {},transSize is {}",viewSizeInt,viewSizeInt);
List<TransPinYouRequestBO> transPinYouRequestBOList = new ArrayList<>();
if(viewSizeInt>0){
... ...