|
@@ -20,10 +20,7 @@ import com.storlead.trade.dto.MarketEmailsDTO;
|
|
|
import com.storlead.trade.entity.*;
|
|
import com.storlead.trade.entity.*;
|
|
|
import com.storlead.trade.mapper.MarketEmailsMapper;
|
|
import com.storlead.trade.mapper.MarketEmailsMapper;
|
|
|
import com.storlead.trade.service.*;
|
|
import com.storlead.trade.service.*;
|
|
|
-import com.storlead.trade.vo.MarketEmailsCustomerVO;
|
|
|
|
|
-import com.storlead.trade.vo.MarketEmailsManagementVO;
|
|
|
|
|
-import com.storlead.trade.vo.MarketEmailsOpenVO;
|
|
|
|
|
-import com.storlead.trade.vo.ScheduleStageVO;
|
|
|
|
|
|
|
+import com.storlead.trade.vo.*;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -169,6 +166,7 @@ public class MarketEmailsServiceImpl extends MyBaseServiceImpl<MarketEmailsMappe
|
|
|
wrapper.ne(MarketEmailsEntity::getRecipient, "");
|
|
wrapper.ne(MarketEmailsEntity::getRecipient, "");
|
|
|
// 只查需要的列,减少数据传输
|
|
// 只查需要的列,减少数据传输
|
|
|
wrapper.select(MarketEmailsEntity::getRecipient,
|
|
wrapper.select(MarketEmailsEntity::getRecipient,
|
|
|
|
|
+ MarketEmailsEntity::getId,
|
|
|
MarketEmailsEntity::getCustomerId,
|
|
MarketEmailsEntity::getCustomerId,
|
|
|
MarketEmailsEntity::getFirstOpenTime,
|
|
MarketEmailsEntity::getFirstOpenTime,
|
|
|
MarketEmailsEntity::getHasProtect,
|
|
MarketEmailsEntity::getHasProtect,
|
|
@@ -379,6 +377,7 @@ public class MarketEmailsServiceImpl extends MyBaseServiceImpl<MarketEmailsMappe
|
|
|
wrapper.isNotNull(MarketEmailsEntity::getRecipient);
|
|
wrapper.isNotNull(MarketEmailsEntity::getRecipient);
|
|
|
wrapper.ne(MarketEmailsEntity::getRecipient, "");
|
|
wrapper.ne(MarketEmailsEntity::getRecipient, "");
|
|
|
wrapper.select(MarketEmailsEntity::getRecipient,
|
|
wrapper.select(MarketEmailsEntity::getRecipient,
|
|
|
|
|
+ MarketEmailsEntity::getId,
|
|
|
MarketEmailsEntity::getCustomerId,
|
|
MarketEmailsEntity::getCustomerId,
|
|
|
MarketEmailsEntity::getHasProtect,
|
|
MarketEmailsEntity::getHasProtect,
|
|
|
MarketEmailsEntity::getHasSuspend,
|
|
MarketEmailsEntity::getHasSuspend,
|
|
@@ -389,15 +388,15 @@ public class MarketEmailsServiceImpl extends MyBaseServiceImpl<MarketEmailsMappe
|
|
|
List<MarketEmailsEntity> all = this.list(wrapper);
|
|
List<MarketEmailsEntity> all = this.list(wrapper);
|
|
|
|
|
|
|
|
// 按 recipient 聚合
|
|
// 按 recipient 聚合
|
|
|
- Map<String, com.storlead.trade.vo.MarketEmailsReplyVO> aggMap = new HashMap<>();
|
|
|
|
|
|
|
+ Map<String, MarketEmailsReplyVO> 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.MarketEmailsReplyVO vo = aggMap.computeIfAbsent(r, k -> {
|
|
|
|
|
- com.storlead.trade.vo.MarketEmailsReplyVO v = new com.storlead.trade.vo.MarketEmailsReplyVO();
|
|
|
|
|
|
|
+ MarketEmailsReplyVO vo = aggMap.computeIfAbsent(r, k -> {
|
|
|
|
|
+ MarketEmailsReplyVO v = new MarketEmailsReplyVO();
|
|
|
v.setRecipient(k);
|
|
v.setRecipient(k);
|
|
|
v.setReplyCount(0L);
|
|
v.setReplyCount(0L);
|
|
|
return v;
|
|
return v;
|
|
@@ -525,13 +524,13 @@ public class MarketEmailsServiceImpl extends MyBaseServiceImpl<MarketEmailsMappe
|
|
|
List<MarketEmailsEntity> all = this.list(wrapper);
|
|
List<MarketEmailsEntity> all = this.list(wrapper);
|
|
|
|
|
|
|
|
// 按 recipient 聚合(同一客户多个保护/暂停记录合并为一张卡片)
|
|
// 按 recipient 聚合(同一客户多个保护/暂停记录合并为一张卡片)
|
|
|
- Map<String, com.storlead.trade.vo.MarketEmailsProtectVO> aggMap = new HashMap<>();
|
|
|
|
|
|
|
+ Map<String, MarketEmailsProtectVO> 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()) continue;
|
|
if (r == null || r.isEmpty()) continue;
|
|
|
- com.storlead.trade.vo.MarketEmailsProtectVO vo = aggMap.computeIfAbsent(r, k -> {
|
|
|
|
|
- com.storlead.trade.vo.MarketEmailsProtectVO v = new com.storlead.trade.vo.MarketEmailsProtectVO();
|
|
|
|
|
|
|
+ MarketEmailsProtectVO vo = aggMap.computeIfAbsent(r, k -> {
|
|
|
|
|
+ MarketEmailsProtectVO v = new MarketEmailsProtectVO();
|
|
|
v.setRecipient(k);
|
|
v.setRecipient(k);
|
|
|
v.setHasProtect(0);
|
|
v.setHasProtect(0);
|
|
|
v.setHasSuspend(0);
|
|
v.setHasSuspend(0);
|