推广管理零售公司

master
Caps 6 years ago
parent 14ed9681d0
commit 67de527c09

@ -326,27 +326,27 @@ public class RetailCompanyService {
List<PoiStore> list1 = selectShopByCompany(org.getId()); List<PoiStore> list1 = selectShopByCompany(org.getId());
List<Long> stores = list1.stream().map(PoiStore::getId).collect(Collectors.toList()); List<Long> stores = list1.stream().map(PoiStore::getId).collect(Collectors.toList());
//根据门店查询导购人数 // //根据门店查询导购人数
QueryWrapper<PoiStoreStaff> wrapperStaff = new QueryWrapper<>(); // QueryWrapper<PoiStoreStaff> wrapperStaff = new QueryWrapper<>();
wrapperStaff.in("store_id",stores); // wrapperStaff.in("store_id",stores);
List<PoiStoreStaff> listStaff = poiStoreStaffDOMapper.selectList(wrapperStaff); // List<PoiStoreStaff> listStaff = poiStoreStaffDOMapper.selectList(wrapperStaff);
//组织成员的客户个数 //组织成员的客户个数
QueryWrapper<OpSellerCustomerRelation> wrapper2 = new QueryWrapper<>(); QueryWrapper<OpSellerCustomerRelation> wrapper2 = new QueryWrapper<>();
wrapper2.in("user_id", listStaff.stream().map(PoiStoreStaff::getUserId).collect(Collectors.toList())); wrapper2.in("store_id", stores);
List<OpSellerCustomerRelation> opRelations = listStaff.size() == 0 ? new ArrayList<>() : opSellerCustomerRelationDOMapper.selectList(wrapper2); List<OpSellerCustomerRelation> opRelations = opSellerCustomerRelationDOMapper.selectList(wrapper2);
long count = opRelations.stream().map(OpSellerCustomerRelation::getCustomerId).distinct().count(); long count = opRelations.stream().map(OpSellerCustomerRelation::getCustomerId).distinct().count();
organizationalVO.setAllCustomer((int) count); organizationalVO.setAllCustomer((int) count);
//组织成员的客户有效个数 //组织成员的客户有效个数
QueryWrapper<OpSellerCustomerRelation> wrapper4 = new QueryWrapper<>(); QueryWrapper<OpSellerCustomerRelation> wrapper4 = new QueryWrapper<>();
wrapper4.in("user_id", listStaff.stream().map(PoiStoreStaff::getUserId).collect(Collectors.toList())); wrapper4.in("store_id", stores);
wrapper4.eq("type", 1); wrapper4.eq("type", 1);
List<OpSellerCustomerRelation> opRelations1 = listStaff.size() == 0 ? new ArrayList<>() : opSellerCustomerRelationDOMapper.selectList(wrapper4); List<OpSellerCustomerRelation> opRelations1 = opSellerCustomerRelationDOMapper.selectList(wrapper4);
long countAble = opRelations1.stream().map(OpSellerCustomerRelation::getCustomerId).distinct().count(); long countAble = opRelations1.stream().map(OpSellerCustomerRelation::getCustomerId).distinct().count();
organizationalVO.setEffectiveCustomer((int) countAble); organizationalVO.setEffectiveCustomer((int) countAble);
//计算新增客户数据 //计算新增客户数据
newCustomerUser(startTime, endTime, organizationalVO, listStaff.stream().map(PoiStoreStaff::getUserId).collect(Collectors.toList())); newCustomerStore(startTime, endTime, organizationalVO, stores);
//被拉黑的客户数 //被拉黑的客户数
QueryWrapper<PoiCustomerContactDataStat> wrapper3 = new QueryWrapper<>(); QueryWrapper<PoiCustomerContactDataStat> wrapper3 = new QueryWrapper<>();

Loading…
Cancel
Save