|
@@ -1,5 +1,6 @@
|
|
|
package com.tzld.piaoquan.longarticle.service.local.impl;
|
|
package com.tzld.piaoquan.longarticle.service.local.impl;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
@@ -159,7 +160,20 @@ public class CoreServiceImpl implements CoreService {
|
|
|
//操作计划遍历
|
|
//操作计划遍历
|
|
|
List<Plan> planList = planAccountService.getPlanList();
|
|
List<Plan> planList = planAccountService.getPlanList();
|
|
|
Set<String> planIdSet = planList.stream().map(Plan::getPlanId).collect(Collectors.toSet());
|
|
Set<String> planIdSet = planList.stream().map(Plan::getPlanId).collect(Collectors.toSet());
|
|
|
- List<LongArticleSystemPlan> allLongArticleSystemPlans = aigcService.getAllLongArticleSystemPlan();
|
|
|
|
|
|
|
+ List<LongArticleSystemPlan> allLongArticleSystemPlans = null;
|
|
|
|
|
+ int retryTimes = 3;
|
|
|
|
|
+ int retryCount = 0;
|
|
|
|
|
+ while (retryCount < retryTimes) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ allLongArticleSystemPlans = aigcService.getAllLongArticleSystemPlan();
|
|
|
|
|
+ if (CollectionUtil.isNotEmpty(allLongArticleSystemPlans)) {
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("initPlanAccount error, retryCount: {}", retryCount, e);
|
|
|
|
|
+ }
|
|
|
|
|
+ retryCount++;
|
|
|
|
|
+ }
|
|
|
for (LongArticleSystemPlan longArticleSystemPlan : allLongArticleSystemPlans) {
|
|
for (LongArticleSystemPlan longArticleSystemPlan : allLongArticleSystemPlans) {
|
|
|
Plan plan = createPlan(longArticleSystemPlan);
|
|
Plan plan = createPlan(longArticleSystemPlan);
|
|
|
planAccountService.saveOrUpdatePlan(plan);
|
|
planAccountService.saveOrUpdatePlan(plan);
|