大屏接口

master
yechenhao 6 years ago
parent 20a471b186
commit 6080942259

@ -118,17 +118,9 @@ public class CustomerViewService {
}
//柱状图好友list
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 会员数据暂时不能根据店铺查询
// Long vipCount = opVipDOMapper.selectVipCount(shopIds, null, null);
Long vipCount = opVipDOMapper.selectVipCountNew();
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());
handleChartData(customerList, validCustomerList, customerViewVO);
//设置新增好友好友总数拉黑数vip人数
setCustomerViewData(customerViewVO, customerCount, validCustomerCount, validDeleteCustomerCount, vipCount, customerList, validCustomerList, selectStartTime, selectEndTime);
setCustomerViewData(customerViewVO, vipCount, customerList, validCustomerList, selectStartTime, selectEndTime);
//前十名排行list等
List<CustomerViewCompanyVO> orgNewCustomerList = getOrgNewCustomerList(newCustimerList);
List<CustomerViewShopVO> shopNewCustomerList = getShopNewCustomerList(newCustimerList);
@ -150,6 +142,24 @@ public class CustomerViewService {
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
* @param userId id
@ -163,29 +173,20 @@ public class CustomerViewService {
/**
* vip
* @param customerViewVO VO
* @param customerCount
* @param validCustomerCount ()
* @param validDeleteCustomerCount
* @param vipCount
* @param customerList list
* @param validCustomerList list
* @param selectStartTime
* @param selectEndTime
*/
public void setCustomerViewData(CustomerViewVO customerViewVO, Long customerCount, Long validCustomerCount, Long validDeleteCustomerCount, Long vipCount,
List<OpCustomer> customerList, List<OpCustomer> validCustomerList, String selectStartTime, String selectEndTime){
public void setCustomerViewData(CustomerViewVO customerViewVO, Long vipCount,List<OpCustomer> customerList,
List<OpCustomer> validCustomerList, String selectStartTime, String selectEndTime){
//新增好友
Long newCustomerCount = customerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).count();
customerViewVO.setNewCustomer(newCustomerCount);
//新增好友(去重)
Long newValidCustomerCount = validCustomerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).count();
customerViewVO.setNewValidCustomer(newValidCustomerCount);
//好友总数
customerViewVO.setAllCustomer(customerCount);
//好友总数(去重)
customerViewVO.setAllValidCustomer(validCustomerCount);
//删除拉黑数(累计去重)
customerViewVO.setValidDeleteCustomer(validDeleteCustomerCount);
//会员总数
customerViewVO.setAllVipCount(vipCount);

Loading…
Cancel
Save