diff --git a/src/main/java/com/kiisoo/ic/customer/mapper/OpCustomerDOMapper.java b/src/main/java/com/kiisoo/ic/customer/mapper/OpCustomerDOMapper.java index 3814b7b..6a6a405 100644 --- a/src/main/java/com/kiisoo/ic/customer/mapper/OpCustomerDOMapper.java +++ b/src/main/java/com/kiisoo/ic/customer/mapper/OpCustomerDOMapper.java @@ -10,6 +10,7 @@ import com.kiisoo.ic.ls.bean.StoreAddDTO; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; +import javax.xml.crypto.Data; import java.util.Date; import java.util.List; import java.util.Set; @@ -63,4 +64,6 @@ public interface OpCustomerDOMapper extends BaseMapper { * 查询店铺拓客top10 */ List selectAddCustomerTopShop(@Param("shopIds")List shopIds, @Param("startDate")String startDate, @Param("endDate")String endDate); + + Integer countCustomerByDate(@Param("startDate")String startDate, @Param("endDate") String endDate); } diff --git a/src/main/java/com/kiisoo/ic/customer/service/CustomerViewService.java b/src/main/java/com/kiisoo/ic/customer/service/CustomerViewService.java index 0e2f5f8..9727df7 100644 --- a/src/main/java/com/kiisoo/ic/customer/service/CustomerViewService.java +++ b/src/main/java/com/kiisoo/ic/customer/service/CustomerViewService.java @@ -217,8 +217,15 @@ public class CustomerViewService { handleChartData(customerList, validCustomerList, customerViewVO); //设置新增好友,新增好友(去重),vip人数 - setCustomerViewData(customerViewVO, customerList, validCustomerList, selectStartTime, selectEndTime); +// setCustomerViewData(customerViewVO, customerList, validCustomerList, selectStartTime, selectEndTime); + //新增好友 +// Long newCustomerCount = customerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).count(); + Integer newCustomerCount = opCustomerDOMapper.countCustomerByDate(selectStartTime, selectEndTime); + customerViewVO.setNewCustomer(new Long(newCustomerCount)); + //新增好友(去重) + Long newValidCustomerCount = validCustomerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).count(); + customerViewVO.setNewValidCustomer(newValidCustomerCount); return customerViewVO; } diff --git a/src/main/resources/mapper/OpCustomerDOMapper.xml b/src/main/resources/mapper/OpCustomerDOMapper.xml index 878759c..dbd5d82 100644 --- a/src/main/resources/mapper/OpCustomerDOMapper.xml +++ b/src/main/resources/mapper/OpCustomerDOMapper.xml @@ -177,4 +177,14 @@ and customer.id = #{customerId} + +