Forráskód Böngészése

Merge remote-tracking branch 'origin/add_fans_delaped' into add_fans_delaped

zoujiajian 2 éve
szülő
commit
b3a75373f3

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/entity/CorpCustomerAcquisitionLinkPopularize.java

@@ -36,7 +36,7 @@ public class CorpCustomerAcquisitionLinkPopularize extends BaseEntity {
     private Long time;
 
     /**
-     * 类型为 加粉,是否要延期回传
+     * 是否记录回传
      */
     private Boolean delayedPost;
 

+ 17 - 15
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpEventActionServiceImpl.java

@@ -1100,21 +1100,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 					//如果为加粉则直接回传
 					if (corpCustomerAcquisitionLinkPopularize.getType() == 1) {
 						//如果需要延后主动回传的做持久化.
-						if(corpCustomerAcquisitionLinkPopularize.getDelayedPost()){
-							CorpCustomerAcquistionCallback corpCustomerAcquistionCallback =
-									corpCustomerAcquistionCallbackMapper.selectOne(Wrappers.lambdaQuery(CorpCustomerAcquistionCallback.class).eq(CorpCustomerAcquistionCallback::getCallback, callback).eq(CorpCustomerAcquistionCallback::getUnionId, unionId));
-							if(corpCustomerAcquistionCallback == null){
-								corpCustomerAcquistionCallback = new CorpCustomerAcquistionCallback();
-							}
-							corpCustomerAcquistionCallback.setCallback(callback);
-							corpCustomerAcquistionCallback.setEvent(corpCustomerAcquistionCallback.getEvent());
-							corpCustomerAcquistionCallback.setUnionId(unionId);
-							if(corpCustomerAcquistionCallback.getId() != null){
-								corpCustomerAcquistionCallbackMapper.updateById(corpCustomerAcquistionCallback);
-							}else {
-								corpCustomerAcquistionCallbackMapper.insert(corpCustomerAcquistionCallback);
-							}
-						}else {
+						if(!corpCustomerAcquisitionLinkPopularize.getDelayedPost()){
 							postData(callback, corpCustomerAcquisitionLinkPopularize.getEvent());
 						}
 					}else {
@@ -1126,6 +1112,22 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 						//深度回传.
 						redisService.set(String.format(RedisService.key.CORP_CUSTOMER_ACQUISTION_UNIONID_CLICKID.getName(),unionId), json, corpCustomerAcquisitionLinkPopularize.getTime() * 60 * 60);
 					}
+
+					if(corpCustomerAcquisitionLinkPopularize.getDelayedPost()){
+						CorpCustomerAcquistionCallback corpCustomerAcquistionCallback =
+								corpCustomerAcquistionCallbackMapper.selectOne(Wrappers.lambdaQuery(CorpCustomerAcquistionCallback.class).eq(CorpCustomerAcquistionCallback::getCallback, callback).eq(CorpCustomerAcquistionCallback::getUnionId, unionId));
+						if(corpCustomerAcquistionCallback == null){
+							corpCustomerAcquistionCallback = new CorpCustomerAcquistionCallback();
+						}
+						corpCustomerAcquistionCallback.setCallback(callback);
+						corpCustomerAcquistionCallback.setEvent(corpCustomerAcquistionCallback.getEvent());
+						corpCustomerAcquistionCallback.setUnionId(unionId);
+						if(corpCustomerAcquistionCallback.getId() != null){
+							corpCustomerAcquistionCallbackMapper.updateById(corpCustomerAcquistionCallback);
+						}else {
+							corpCustomerAcquistionCallbackMapper.insert(corpCustomerAcquistionCallback);
+						}
+					}
 				}
 			}
 		}