|
|
@@ -649,16 +649,16 @@ public class MarketingCampaignServiceImpl
|
|
|
.le(MarketingCampaignEntity::getBeginData, today)
|
|
|
.list();
|
|
|
if (!CollectionUtils.isEmpty(autoStartList)) {
|
|
|
+ List<MarketingCampaignEntity> removeList = new ArrayList<>();
|
|
|
+
|
|
|
for (MarketingCampaignEntity entity : autoStartList) {
|
|
|
- //如果要开启营销活动,需要先生成全部邮件模板
|
|
|
- if (entity.getStatus() == STATUS_RUNNING) {
|
|
|
// 1. 查询该营销活动绑定的 SOP 步骤(marketing_campaign_sop_detail_id 列表)
|
|
|
LambdaQueryWrapper<MarketingCampaignSopDetailEntity> sopWrapper = new LambdaQueryWrapper<>();
|
|
|
sopWrapper.eq(MarketingCampaignSopDetailEntity::getMarketingId, entity.getId());
|
|
|
sopWrapper.eq(MarketingCampaignSopDetailEntity::getIsDelete, CommonConstant.DEL_FLAG_0);
|
|
|
List<MarketingCampaignSopDetailEntity> sopDetailList = marketingCampaignSopDetailService.list(sopWrapper);
|
|
|
if (CollectionUtils.isEmpty(sopDetailList)) {
|
|
|
- continue;
|
|
|
+ removeList.add(entity);
|
|
|
}
|
|
|
List<Long> sopDetailIds = sopDetailList.stream()
|
|
|
.map(MarketingCampaignSopDetailEntity::getId)
|
|
|
@@ -678,9 +678,15 @@ public class MarketingCampaignServiceImpl
|
|
|
.filter(sopId -> sopId != null)
|
|
|
.collect(Collectors.toSet());
|
|
|
if (readySopDetailIds.size() < sopDetailIds.size()) {
|
|
|
- continue;
|
|
|
+ removeList.add(entity);
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(removeList)){
|
|
|
+ autoStartList.removeAll(removeList);
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isEmpty(autoStartList)){
|
|
|
+ return;
|
|
|
}
|
|
|
List<Long> autoStartIdList = autoStartList.stream()
|
|
|
.map(MarketingCampaignEntity::getId)
|