修改新增数接口。

dev_0531
kevin jiang 5 years ago
parent 02e257b996
commit dd840823b2

@ -10,6 +10,7 @@ import com.kiisoo.ic.ls.bean.StoreAddDTO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.xml.crypto.Data;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -63,4 +64,6 @@ public interface OpCustomerDOMapper extends BaseMapper<OpCustomer> {
* top10 * top10
*/ */
List<StoreAddDTO> selectAddCustomerTopShop(@Param("shopIds")List<Long> shopIds, @Param("startDate")String startDate, @Param("endDate")String endDate); List<StoreAddDTO> selectAddCustomerTopShop(@Param("shopIds")List<Long> shopIds, @Param("startDate")String startDate, @Param("endDate")String endDate);
Integer countCustomerByDate(@Param("startDate")String startDate, @Param("endDate") String endDate);
} }

@ -217,8 +217,15 @@ public class CustomerViewService {
handleChartData(customerList, validCustomerList, customerViewVO); handleChartData(customerList, validCustomerList, customerViewVO);
//设置新增好友新增好友去重vip人数 //设置新增好友新增好友去重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; return customerViewVO;
} }

@ -177,4 +177,14 @@
and customer.id = #{customerId} and customer.id = #{customerId}
</if> </if>
</select> </select>
<select id="countCustomerByDate" resultType="java.lang.Integer">
SELECT count(1)
from op_seller_customer_relation t1
join poi_store t0 on t0.id = t1.store_id
left join poi_store_staff t5 ON t5.store_id = t0.id and t1.user_id = t5.id
JOIN op_customer t2 ON t2.id = t1.customer_id
where t2.create_time >= #{startDate}
and t2.create_time &lt;= #{endDate}
</select>
</mapper> </mapper>

Loading…
Cancel
Save