|
|
|
@ -10,6 +10,8 @@ import com.kiisoo.ic.common.utils.MD5FileUtil;
|
|
|
|
|
import com.kiisoo.ic.common.utils.httpClientUtil.HttpClientUtil;
|
|
|
|
|
import com.kiisoo.ic.common.utils.httpClientUtil.HttpResult;
|
|
|
|
|
import com.kiisoo.ic.config.WxCpConfiguration;
|
|
|
|
|
import com.kiisoo.ic.customer.bean.OpCustomerDTO;
|
|
|
|
|
import com.kiisoo.ic.customer.service.CustomerViewService;
|
|
|
|
|
import com.kiisoo.ic.domain.mapper.PrivilageDomainEntityDOMapper;
|
|
|
|
|
import com.kiisoo.ic.domain.service.PrivilageDomainService;
|
|
|
|
|
import com.kiisoo.ic.employee.entity.PrivilageCpUserDO;
|
|
|
|
@ -91,6 +93,12 @@ public class StorePromotionDataService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private PrivilageDomainService privilageDomainService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 权限业务
|
|
|
|
|
*/
|
|
|
|
|
@Autowired
|
|
|
|
|
private CustomerViewService customerViewService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 权限业务
|
|
|
|
|
*/
|
|
|
|
@ -457,9 +465,22 @@ public class StorePromotionDataService {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PageInfo<PoiCustomerContactDataStat> listUserBehaviorData(List<Long> storeIds,Date startDate, Date endDate,Integer pageNum,Integer pageSize){
|
|
|
|
|
public PageInfo<PoiCustomerContactDataStat> listUserBehaviorData(Long userId,Long companyId,Long shopId,Date startDate, Date endDate,Integer pageNum,Integer pageSize){
|
|
|
|
|
Set<Long> shopIds = new HashSet<>();
|
|
|
|
|
|
|
|
|
|
if (shopId != null) {
|
|
|
|
|
//如果有店铺则查店铺
|
|
|
|
|
shopIds.add(shopId);
|
|
|
|
|
} else if (companyId != null) {
|
|
|
|
|
//如果有公司则查公司店铺
|
|
|
|
|
Set<Long> sp = customerViewService.getCompanyShop(companyId, userId);
|
|
|
|
|
shopIds.addAll(sp);
|
|
|
|
|
} else {
|
|
|
|
|
//查询用户权限店铺
|
|
|
|
|
shopIds = new HashSet<>(privilageDomainService.listUserDatePermission(userId));
|
|
|
|
|
}
|
|
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
|
|
List<PoiCustomerContactDataStat> results = poiCustomerContactDataStatMapper.selectSumDataByShopIds(storeIds,startDate,endDate);
|
|
|
|
|
List<PoiCustomerContactDataStat> results = poiCustomerContactDataStatMapper.selectSumDataByShopIds(shopIds,startDate,endDate);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(results)){
|
|
|
|
|
results.forEach(result -> {
|
|
|
|
|
Long storeId = result.getStoreId();
|
|
|
|
|