wangyunpeng 1 месяц назад
Родитель
Сommit
def0043845

+ 10 - 7
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/BuckStrategyV1.java

@@ -271,7 +271,8 @@ public class BuckStrategyV1 implements ReplyStrategyService {
                         .filter(x -> x.getGhId().equals(bucketDataParam.getGhId()))
                         .collect(Collectors.toList());
                 if (CollectionUtils.isEmpty(collect)) {
-                    log.error("insertSmallData 算法排序数据异常,data:" + JSON.toJSONString(smallDataCgiReplyList));
+                    log.info("BuckStrategyV1 insertSmallData 数据未变更跳过,key:{},ghId:{},data:{}",
+                            key, bucketDataParam.getGhId(), JSON.toJSONString(smallDataCgiReplyList));
                     continue;
                 }
                 CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
@@ -472,9 +473,10 @@ public class BuckStrategyV1 implements ReplyStrategyService {
                         existCgiReplyBucketDataList.addAll(list);
                     }
                 }
-                //if (existNum == bucketDataParam.getVideos().size()) {
-                //    continue;
-                //}
+                if (existCgiReplyBucketDataList.size() == bucketDataParam.getMiniPageDatas().size()) {
+                    // 当前与历史条数一致且页面路径一致,不更新
+                    return result;
+                }
             }
 
             Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(bucketDataParam.getVideos());
@@ -521,9 +523,10 @@ public class BuckStrategyV1 implements ReplyStrategyService {
                         existCgiReplyBucketDataList.addAll(list);
                     }
                 }
-                //if (existNum == bucketDataParam.getVideos().size()) {
-                //    continue;
-                //}
+                if (existCgiReplyBucketDataList.size() == bucketDataParam.getVideos().size()) {
+                    // 当前与历史条数一致且视频Id一致,不更新
+                    return result;
+                }
             }
             Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(bucketDataParam.getVideos());
             for (int i = 0; i < bucketDataParam.getVideos().size(); i++) {

+ 10 - 8
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/ThirdPartyPushMessageStrategyV1.java

@@ -183,8 +183,8 @@ public class ThirdPartyPushMessageStrategyV1 implements ReplyStrategyService {
                         .filter(x -> x.getGhId().equals(bucketDataParam.getGhId()))
                         .collect(Collectors.toList());
                 if (CollectionUtils.isEmpty(collect)) {
-                    log.error("ThirdPartyPushMessageStrategyV1 insertSmallData 算法排序数据异常 ,key:" + key +
-                            ",data:" + JSON.toJSONString(smallDataCgiReplyList) + ",ghId:" + bucketDataParam.getGhId());
+                    log.info("ThirdPartyPushMessageStrategyV1 insertSmallData 数据未变更跳过,key:{},ghId:{},data:{}",
+                            key, bucketDataParam.getGhId(), JSON.toJSONString(smallDataCgiReplyList));
                     continue;
                 }
                 CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
@@ -338,9 +338,10 @@ public class ThirdPartyPushMessageStrategyV1 implements ReplyStrategyService {
                                 existCgiReplyBucketDataList.addAll(list);
                             }
                         }
-                        //if (existNum == bucketDataParam.getVideos().size()) {
-                        //    continue;
-                        //}
+                        if (existCgiReplyBucketDataList.size() == bucketDataParam.getMiniPageDatas().size()) {
+                            // 当前与历史条数一致且页面路径一致,不更新
+                            continue;
+                        }
                     }
                     Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(bucketDataParam.getVideos());
                     for (int i = 0; i < bucketDataParam.getMiniPageDatas().size(); i++) {
@@ -386,9 +387,10 @@ public class ThirdPartyPushMessageStrategyV1 implements ReplyStrategyService {
                                 existCgiReplyBucketDataList.addAll(list);
                             }
                         }
-                        //if (existNum == bucketDataParam.getVideos().size()) {
-                        //    continue;
-                        //}
+                        if (existCgiReplyBucketDataList.size() == bucketDataParam.getVideos().size()) {
+                            // 当前与历史条数一致且视频Id一致,不更新
+                            continue;
+                        }
                     }
                     Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(bucketDataParam.getVideos());
                     List<ContentPlatformGzhPlanVideo> gzhPlanVideoList = contentPlatformPlanService.getGzhPlanVideoListByCooperateAccountId(bucketDataParam.getGhId());

+ 6 - 4
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/WeComPushMessageStrategyV1.java

@@ -152,7 +152,8 @@ public class WeComPushMessageStrategyV1 implements ReplyStrategyService {
                     .filter(x -> x.getGhId().equals(bucketDataParam.getGhId()))
                     .collect(Collectors.toList());
             if (CollectionUtils.isEmpty(collect)) {
-                log.error("ThirdPartyPushMessageStrategyV1 insertSmallData 算法排序数据异常,data:" + JSON.toJSONString(smallDataCgiReplyList));
+                log.info("WeComPushMessageStrategyV1 insertSmallData 数据未变更跳过,key:{},ghId:{},data:{}",
+                        key, bucketDataParam.getGhId(), JSON.toJSONString(smallDataCgiReplyList));
                 continue;
             }
             CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
@@ -272,9 +273,10 @@ public class WeComPushMessageStrategyV1 implements ReplyStrategyService {
                             existCgiReplyBucketDataList.addAll(list);
                         }
                     }
-                    //if (existNum == bucketDataParam.getVideos().size()) {
-                    //    continue;
-                    //}
+                    if (existCgiReplyBucketDataList.size() == bucketDataParam.getVideos().size()) {
+                        // 当前与历史条数一致且视频Id一致,不更新
+                        continue;
+                    }
                 }
                 Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(bucketDataParam.getVideos());
                 for (int i = 0; i < bucketDataParam.getVideos().size(); i++) {