|
@@ -173,15 +173,15 @@ public class MarketEmailsServiceImpl extends MyBaseServiceImpl<MarketEmailsMappe
|
|
|
MarketEmailsEntity::getHasSuspend);
|
|
MarketEmailsEntity::getHasSuspend);
|
|
|
List<MarketEmailsEntity> all = this.list(wrapper);
|
|
List<MarketEmailsEntity> all = this.list(wrapper);
|
|
|
// 按 recipient 聚合
|
|
// 按 recipient 聚合
|
|
|
- Map<String, com.storlead.trade.vo.MarketEmailsOpenVO> aggMap = new HashMap<>();
|
|
|
|
|
|
|
+ Map<String, MarketEmailsOpenVO> aggMap = new HashMap<>();
|
|
|
if (!CollectionUtils.isEmpty(all)) {
|
|
if (!CollectionUtils.isEmpty(all)) {
|
|
|
for (MarketEmailsEntity e : all) {
|
|
for (MarketEmailsEntity e : all) {
|
|
|
String r = e.getRecipient();
|
|
String r = e.getRecipient();
|
|
|
if (r == null || r.isEmpty()) {
|
|
if (r == null || r.isEmpty()) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- com.storlead.trade.vo.MarketEmailsOpenVO vo = aggMap.computeIfAbsent(r, k -> {
|
|
|
|
|
- com.storlead.trade.vo.MarketEmailsOpenVO v = new com.storlead.trade.vo.MarketEmailsOpenVO();
|
|
|
|
|
|
|
+ MarketEmailsOpenVO vo = aggMap.computeIfAbsent(r, k -> {
|
|
|
|
|
+ MarketEmailsOpenVO v = new MarketEmailsOpenVO();
|
|
|
v.setRecipient(k);
|
|
v.setRecipient(k);
|
|
|
v.setClickCount(0L);
|
|
v.setClickCount(0L);
|
|
|
return v;
|
|
return v;
|
|
@@ -651,8 +651,8 @@ public class MarketEmailsServiceImpl extends MyBaseServiceImpl<MarketEmailsMappe
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 批量收 ID,减少 N+1
|
|
// 批量收 ID,减少 N+1
|
|
|
- java.util.Set<Long> customerIdSet = new java.util.HashSet<>();
|
|
|
|
|
- java.util.Set<Long> sopDetailIdSet = new java.util.HashSet<>();
|
|
|
|
|
|
|
+ Set<Long> customerIdSet = new HashSet<>();
|
|
|
|
|
+ Set<Long> sopDetailIdSet = new HashSet<>();
|
|
|
for (MarketEmailsEntity e : entityList) {
|
|
for (MarketEmailsEntity e : entityList) {
|
|
|
if (e.getCustomerId() != null) customerIdSet.add(e.getCustomerId());
|
|
if (e.getCustomerId() != null) customerIdSet.add(e.getCustomerId());
|
|
|
if (e.getMarketingCampaignSopDetailId() != null) sopDetailIdSet.add(e.getMarketingCampaignSopDetailId());
|
|
if (e.getMarketingCampaignSopDetailId() != null) sopDetailIdSet.add(e.getMarketingCampaignSopDetailId());
|
|
@@ -660,7 +660,7 @@ public class MarketEmailsServiceImpl extends MyBaseServiceImpl<MarketEmailsMappe
|
|
|
|
|
|
|
|
Map<Long, CustomerEntity> customerMap = customerIdSet.isEmpty()
|
|
Map<Long, CustomerEntity> customerMap = customerIdSet.isEmpty()
|
|
|
? Collections.emptyMap()
|
|
? Collections.emptyMap()
|
|
|
- : customerTradeService.listByIds(new java.util.ArrayList<>(customerIdSet)).stream()
|
|
|
|
|
|
|
+ : customerTradeService.listByIds(new ArrayList<>(customerIdSet)).stream()
|
|
|
.collect(Collectors.toMap(CustomerEntity::getId, c -> c, (a, c) -> a));
|
|
.collect(Collectors.toMap(CustomerEntity::getId, c -> c, (a, c) -> a));
|
|
|
Map<Long, MarketingCampaignSopDetailEntity> sopDetailMap = sopDetailIdSet.isEmpty()
|
|
Map<Long, MarketingCampaignSopDetailEntity> sopDetailMap = sopDetailIdSet.isEmpty()
|
|
|
? Collections.emptyMap()
|
|
? Collections.emptyMap()
|