|
|
@@ -143,6 +143,8 @@ public class MarketingCampaignServiceImpl
|
|
|
"count(distinct customer_id) as cnt", qw -> qw.eq("status", 1));
|
|
|
Map<Long, Long> cancelledMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
|
"count(*) as cnt", qw -> qw.eq("status", -3));
|
|
|
+ Map<Long, Long> totalEmailMap = countEmailsByCampaign(marketingCampaignIdList,
|
|
|
+ "count(*) as cnt", qw -> { });
|
|
|
for (MarketingCampaignVO vo : marketingCampaignVOList) {
|
|
|
Long id = vo.getId();
|
|
|
vo.setOpenedCustomerCount(toInt(openedMap.get(id)));
|
|
|
@@ -155,6 +157,8 @@ public class MarketingCampaignServiceImpl
|
|
|
vo.setSentEmailCount(sent);
|
|
|
vo.setCancelledEmailCount(cancelled);
|
|
|
vo.setEmailCountStats(pending + sent + cancelled);
|
|
|
+ int totalEmail = toInt(totalEmailMap.get(id));
|
|
|
+ vo.setSentRate(totalEmail > 0 ? (double) sent / totalEmail : 0.0);
|
|
|
int sentCustomer = toInt(sentCustomerMap.get(id));
|
|
|
vo.setSentCustomerCount(sentCustomer);
|
|
|
vo.setOpenRateText(buildRate(toInt(openedMap.get(id)), sentCustomer));
|