|
@@ -144,7 +144,7 @@ public class MarketingCampaignServiceImpl
|
|
|
Map<Long, Long> pendingMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
Map<Long, Long> pendingMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
|
"count(*) as cnt", qw -> qw.eq("status", -1));
|
|
"count(*) as cnt", qw -> qw.eq("status", -1));
|
|
|
Map<Long, Long> sentMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
Map<Long, Long> sentMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
|
- "count(*) as cnt", qw -> qw.eq("status", 1).eq("has_first", 1));
|
|
|
|
|
|
|
+ "count(*) as cnt", qw -> qw.eq("status", 1));
|
|
|
Map<Long, Long> firstSentMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
Map<Long, Long> firstSentMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
|
"count(*) as cnt", qw -> qw.eq("status", 1).eq("has_first", 1));
|
|
"count(*) as cnt", qw -> qw.eq("status", 1).eq("has_first", 1));
|
|
|
Map<Long, Long> openedEmailMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
Map<Long, Long> openedEmailMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
@@ -153,6 +153,9 @@ public class MarketingCampaignServiceImpl
|
|
|
"count(*) as cnt", qw -> qw.eq("status", 1).eq("has_reply", 1));
|
|
"count(*) as cnt", qw -> qw.eq("status", 1).eq("has_reply", 1));
|
|
|
Map<Long, Long> cancelledMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
Map<Long, Long> cancelledMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
|
"count(*) as cnt", qw -> qw.eq("status", -3));
|
|
"count(*) as cnt", qw -> qw.eq("status", -3));
|
|
|
|
|
+ //退回
|
|
|
|
|
+ Map<Long, Long> backMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
|
|
|
+ "count(*) as cnt", qw -> qw.eq("status", -4));
|
|
|
Map<Long, Long> totalEmailMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
Map<Long, Long> totalEmailMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
|
"count(*) as cnt", qw -> { });
|
|
"count(*) as cnt", qw -> { });
|
|
|
|
|
|
|
@@ -169,14 +172,15 @@ public class MarketingCampaignServiceImpl
|
|
|
int sent = toInt(sentMap.get(id));
|
|
int sent = toInt(sentMap.get(id));
|
|
|
int firstSent = toInt(firstSentMap.get(id));
|
|
int firstSent = toInt(firstSentMap.get(id));
|
|
|
int cancelled = toInt(cancelledMap.get(id));
|
|
int cancelled = toInt(cancelledMap.get(id));
|
|
|
|
|
+ int back = toInt(backMap.get(id));
|
|
|
vo.setPendingEmailCount(pending);
|
|
vo.setPendingEmailCount(pending);
|
|
|
vo.setSentEmailCount(sent);
|
|
vo.setSentEmailCount(sent);
|
|
|
vo.setCancelledEmailCount(cancelled);
|
|
vo.setCancelledEmailCount(cancelled);
|
|
|
- vo.setEmailCountStats(pending + sent + cancelled);
|
|
|
|
|
|
|
+ vo.setEmailCountStats(pending + sent + cancelled+back);
|
|
|
int totalEmail = toInt(totalEmailMap.get(id));
|
|
int totalEmail = toInt(totalEmailMap.get(id));
|
|
|
|
|
|
|
|
int firstTotalEmail = toInt(firstTotalEmailMap.get(id));
|
|
int firstTotalEmail = toInt(firstTotalEmailMap.get(id));
|
|
|
- vo.setSentRate(totalEmail > 0 ? (double) firstSent / firstTotalEmail : 0.0);
|
|
|
|
|
|
|
+ vo.setSentRate(totalEmail > 0 ? (double) sent / totalEmail : 0.0);
|
|
|
vo.setOpenRateText(buildRate(toInt(openedEmailMap.get(id)), sent));
|
|
vo.setOpenRateText(buildRate(toInt(openedEmailMap.get(id)), sent));
|
|
|
vo.setReplyRateText(buildRate(toInt(repliedEmailMap.get(id)), sent));
|
|
vo.setReplyRateText(buildRate(toInt(repliedEmailMap.get(id)), sent));
|
|
|
}
|
|
}
|
|
@@ -272,7 +276,7 @@ public class MarketingCampaignServiceImpl
|
|
|
Map<Long, List<MarketEmailsEntity>> emailsBySopDetail = new HashMap<>();
|
|
Map<Long, List<MarketEmailsEntity>> emailsBySopDetail = new HashMap<>();
|
|
|
List<MarketEmailsEntity> campaignEmails = marketEmailsService.lambdaQuery()
|
|
List<MarketEmailsEntity> campaignEmails = marketEmailsService.lambdaQuery()
|
|
|
.eq(MarketEmailsEntity::getMarketingCampaignId, id)
|
|
.eq(MarketEmailsEntity::getMarketingCampaignId, id)
|
|
|
- .eq(MarketEmailsEntity::getHasFirst, 1)
|
|
|
|
|
|
|
+// .eq(MarketEmailsEntity::getHasFirst, 1)
|
|
|
.ne(MarketEmailsEntity::getStatus,-3)
|
|
.ne(MarketEmailsEntity::getStatus,-3)
|
|
|
.eq(MarketEmailsEntity::getIsDelete, CommonConstant.DEL_FLAG_0)
|
|
.eq(MarketEmailsEntity::getIsDelete, CommonConstant.DEL_FLAG_0)
|
|
|
.list();
|
|
.list();
|
|
@@ -350,7 +354,7 @@ public class MarketingCampaignServiceImpl
|
|
|
Integer sentCountLong = marketEmailsService.lambdaQuery()
|
|
Integer sentCountLong = marketEmailsService.lambdaQuery()
|
|
|
.eq(MarketEmailsEntity::getMarketingCampaignId, id)
|
|
.eq(MarketEmailsEntity::getMarketingCampaignId, id)
|
|
|
.eq(MarketEmailsEntity::getIsDelete, CommonConstant.DEL_FLAG_0)
|
|
.eq(MarketEmailsEntity::getIsDelete, CommonConstant.DEL_FLAG_0)
|
|
|
- .eq(MarketEmailsEntity::getHasFirst, 1)
|
|
|
|
|
|
|
+// .eq(MarketEmailsEntity::getHasFirst, 1)
|
|
|
.eq(MarketEmailsEntity::getStatus, 1)
|
|
.eq(MarketEmailsEntity::getStatus, 1)
|
|
|
.count();
|
|
.count();
|
|
|
Integer sentCount = sentCountLong == null ? 0 : sentCountLong.intValue();
|
|
Integer sentCount = sentCountLong == null ? 0 : sentCountLong.intValue();
|
|
@@ -360,7 +364,7 @@ public class MarketingCampaignServiceImpl
|
|
|
Integer emailCountAllLong = marketEmailsService.lambdaQuery()
|
|
Integer emailCountAllLong = marketEmailsService.lambdaQuery()
|
|
|
.eq(MarketEmailsEntity::getMarketingCampaignId, id)
|
|
.eq(MarketEmailsEntity::getMarketingCampaignId, id)
|
|
|
.eq(MarketEmailsEntity::getIsDelete, CommonConstant.DEL_FLAG_0)
|
|
.eq(MarketEmailsEntity::getIsDelete, CommonConstant.DEL_FLAG_0)
|
|
|
- .eq(MarketEmailsEntity::getHasFirst, 1)
|
|
|
|
|
|
|
+// .eq(MarketEmailsEntity::getHasFirst, 1)
|
|
|
.count();
|
|
.count();
|
|
|
int emailCountAll = emailCountAllLong == null ? 0 : emailCountAllLong.intValue();
|
|
int emailCountAll = emailCountAllLong == null ? 0 : emailCountAllLong.intValue();
|
|
|
|
|
|
|
@@ -369,7 +373,7 @@ public class MarketingCampaignServiceImpl
|
|
|
Integer openCountLong = marketEmailsService.lambdaQuery()
|
|
Integer openCountLong = marketEmailsService.lambdaQuery()
|
|
|
.eq(MarketEmailsEntity::getMarketingCampaignId, id)
|
|
.eq(MarketEmailsEntity::getMarketingCampaignId, id)
|
|
|
.eq(MarketEmailsEntity::getIsDelete, CommonConstant.DEL_FLAG_0)
|
|
.eq(MarketEmailsEntity::getIsDelete, CommonConstant.DEL_FLAG_0)
|
|
|
- .eq(MarketEmailsEntity::getHasFirst, 1)
|
|
|
|
|
|
|
+// .eq(MarketEmailsEntity::getHasFirst, 1)
|
|
|
.eq(MarketEmailsEntity::getStatus, 1)
|
|
.eq(MarketEmailsEntity::getStatus, 1)
|
|
|
.eq(MarketEmailsEntity::getHasReader, 1)
|
|
.eq(MarketEmailsEntity::getHasReader, 1)
|
|
|
.count();
|
|
.count();
|