|
|
@ -118,17 +118,9 @@ public class CustomerViewService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//柱状图好友list
|
|
|
|
//柱状图好友list
|
|
|
|
List<OpCustomer> customerList = opCustomerDOMapper.selectCustomerList(shopIds, null, null, startTime, endTime);
|
|
|
|
List<OpCustomer> customerList = opCustomerDOMapper.selectCustomerList(shopIds, null, null, startTime, endTime);
|
|
|
|
//好友总数
|
|
|
|
|
|
|
|
Long customerCount = opCustomerDOMapper.selectCustomerCount(shopIds, null, null, null);
|
|
|
|
|
|
|
|
//好友总数(去重)
|
|
|
|
|
|
|
|
Long validCustomerCount = opCustomerDOMapper.selectCustomerCount(shopIds, VALID, null, null);
|
|
|
|
|
|
|
|
//删除拉黑数
|
|
|
|
|
|
|
|
Long validDeleteCustomerCount = poiCustomerContactDataStatMapper.selectDeleteCustomer(shopIds).stream()
|
|
|
|
|
|
|
|
.filter(contactDO -> contactDO.getNegativeFeedbackCnt() != null)
|
|
|
|
|
|
|
|
.map(PoiCustomerContactDataStat::getNegativeFeedbackCnt).mapToLong(a -> a).sum();
|
|
|
|
|
|
|
|
//会员总数
|
|
|
|
//会员总数
|
|
|
|
//todo 会员数据暂时不能根据店铺查询
|
|
|
|
//todo 会员数据暂时不能根据店铺查询
|
|
|
|
// Long vipCount = opVipDOMapper.selectVipCount(shopIds, null, null);
|
|
|
|
|
|
|
|
Long vipCount = opVipDOMapper.selectVipCountNew();
|
|
|
|
Long vipCount = opVipDOMapper.selectVipCountNew();
|
|
|
|
|
|
|
|
|
|
|
|
List<OpCustomer> newCustimerList = customerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).collect(Collectors.toList());
|
|
|
|
List<OpCustomer> newCustimerList = customerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).collect(Collectors.toList());
|
|
|
@ -139,7 +131,7 @@ public class CustomerViewService {
|
|
|
|
List<OpCustomer> validCustomerList = customerList.stream().filter(customerDO -> VALID.equals(customerDO.getValidType())).collect(Collectors.toList());
|
|
|
|
List<OpCustomer> validCustomerList = customerList.stream().filter(customerDO -> VALID.equals(customerDO.getValidType())).collect(Collectors.toList());
|
|
|
|
handleChartData(customerList, validCustomerList, customerViewVO);
|
|
|
|
handleChartData(customerList, validCustomerList, customerViewVO);
|
|
|
|
//设置新增好友,好友总数,拉黑数,vip人数
|
|
|
|
//设置新增好友,好友总数,拉黑数,vip人数
|
|
|
|
setCustomerViewData(customerViewVO, customerCount, validCustomerCount, validDeleteCustomerCount, vipCount, customerList, validCustomerList, selectStartTime, selectEndTime);
|
|
|
|
setCustomerViewData(customerViewVO, vipCount, customerList, validCustomerList, selectStartTime, selectEndTime);
|
|
|
|
//前十名排行list等
|
|
|
|
//前十名排行list等
|
|
|
|
List<CustomerViewCompanyVO> orgNewCustomerList = getOrgNewCustomerList(newCustimerList);
|
|
|
|
List<CustomerViewCompanyVO> orgNewCustomerList = getOrgNewCustomerList(newCustimerList);
|
|
|
|
List<CustomerViewShopVO> shopNewCustomerList = getShopNewCustomerList(newCustimerList);
|
|
|
|
List<CustomerViewShopVO> shopNewCustomerList = getShopNewCustomerList(newCustimerList);
|
|
|
@ -150,6 +142,24 @@ public class CustomerViewService {
|
|
|
|
return customerViewVO;
|
|
|
|
return customerViewVO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 获取拉黑
|
|
|
|
|
|
|
|
* @param userId
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public CustomerViewVO getDelNum(Long userId){
|
|
|
|
|
|
|
|
List<Long> shopIds = getShopIds(userId);
|
|
|
|
|
|
|
|
//删除拉黑数
|
|
|
|
|
|
|
|
Long validDeleteCustomerCount = poiCustomerContactDataStatMapper.selectDeleteCustomer(shopIds).stream()
|
|
|
|
|
|
|
|
.filter(contactDO -> contactDO.getNegativeFeedbackCnt() != null)
|
|
|
|
|
|
|
|
.map(PoiCustomerContactDataStat::getNegativeFeedbackCnt).mapToLong(a -> a).sum();
|
|
|
|
|
|
|
|
//返回对象
|
|
|
|
|
|
|
|
CustomerViewVO result = new CustomerViewVO();
|
|
|
|
|
|
|
|
result.setValidDeleteCustomer(validDeleteCustomerCount);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* shopIds
|
|
|
|
* shopIds
|
|
|
|
* @param userId 用户id
|
|
|
|
* @param userId 用户id
|
|
|
@ -163,29 +173,20 @@ public class CustomerViewService {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 新增好友,好友总数,拉黑数,vip人数
|
|
|
|
* 新增好友,好友总数,拉黑数,vip人数
|
|
|
|
* @param customerViewVO 客户概览VO
|
|
|
|
* @param customerViewVO 客户概览VO
|
|
|
|
* @param customerCount 好友总数
|
|
|
|
|
|
|
|
* @param validCustomerCount 好友总数(去重)
|
|
|
|
|
|
|
|
* @param validDeleteCustomerCount 删除来黑数(累计去重)
|
|
|
|
|
|
|
|
* @param vipCount 会员总数
|
|
|
|
* @param vipCount 会员总数
|
|
|
|
* @param customerList 新增好友list
|
|
|
|
* @param customerList 新增好友list
|
|
|
|
* @param validCustomerList 新增好友(去重)list
|
|
|
|
* @param validCustomerList 新增好友(去重)list
|
|
|
|
* @param selectStartTime 选中开始时间
|
|
|
|
* @param selectStartTime 选中开始时间
|
|
|
|
* @param selectEndTime 选中结束时间
|
|
|
|
* @param selectEndTime 选中结束时间
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void setCustomerViewData(CustomerViewVO customerViewVO, Long customerCount, Long validCustomerCount, Long validDeleteCustomerCount, Long vipCount,
|
|
|
|
public void setCustomerViewData(CustomerViewVO customerViewVO, Long vipCount,List<OpCustomer> customerList,
|
|
|
|
List<OpCustomer> customerList, List<OpCustomer> validCustomerList, String selectStartTime, String selectEndTime){
|
|
|
|
List<OpCustomer> validCustomerList, String selectStartTime, String selectEndTime){
|
|
|
|
//新增好友
|
|
|
|
//新增好友
|
|
|
|
Long newCustomerCount = customerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).count();
|
|
|
|
Long newCustomerCount = customerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).count();
|
|
|
|
customerViewVO.setNewCustomer(newCustomerCount);
|
|
|
|
customerViewVO.setNewCustomer(newCustomerCount);
|
|
|
|
//新增好友(去重)
|
|
|
|
//新增好友(去重)
|
|
|
|
Long newValidCustomerCount = validCustomerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).count();
|
|
|
|
Long newValidCustomerCount = validCustomerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).count();
|
|
|
|
customerViewVO.setNewValidCustomer(newValidCustomerCount);
|
|
|
|
customerViewVO.setNewValidCustomer(newValidCustomerCount);
|
|
|
|
//好友总数
|
|
|
|
|
|
|
|
customerViewVO.setAllCustomer(customerCount);
|
|
|
|
|
|
|
|
//好友总数(去重)
|
|
|
|
|
|
|
|
customerViewVO.setAllValidCustomer(validCustomerCount);
|
|
|
|
|
|
|
|
//删除拉黑数(累计去重)
|
|
|
|
|
|
|
|
customerViewVO.setValidDeleteCustomer(validDeleteCustomerCount);
|
|
|
|
|
|
|
|
//会员总数
|
|
|
|
//会员总数
|
|
|
|
customerViewVO.setAllVipCount(vipCount);
|
|
|
|
customerViewVO.setAllVipCount(vipCount);
|
|
|
|
|
|
|
|
|
|
|
|