推广管理零售公司

master
Caps 6 years ago
parent 14ed9681d0
commit 67de527c09

@ -326,27 +326,27 @@ public class RetailCompanyService {
List<PoiStore> list1 = selectShopByCompany(org.getId());
List<Long> stores = list1.stream().map(PoiStore::getId).collect(Collectors.toList());
//根据门店查询导购人数
QueryWrapper<PoiStoreStaff> wrapperStaff = new QueryWrapper<>();
wrapperStaff.in("store_id",stores);
List<PoiStoreStaff> listStaff = poiStoreStaffDOMapper.selectList(wrapperStaff);
// //根据门店查询导购人数
// QueryWrapper<PoiStoreStaff> wrapperStaff = new QueryWrapper<>();
// wrapperStaff.in("store_id",stores);
// List<PoiStoreStaff> listStaff = poiStoreStaffDOMapper.selectList(wrapperStaff);
//组织成员的客户个数
QueryWrapper<OpSellerCustomerRelation> wrapper2 = new QueryWrapper<>();
wrapper2.in("user_id", listStaff.stream().map(PoiStoreStaff::getUserId).collect(Collectors.toList()));
List<OpSellerCustomerRelation> opRelations = listStaff.size() == 0 ? new ArrayList<>() : opSellerCustomerRelationDOMapper.selectList(wrapper2);
wrapper2.in("store_id", stores);
List<OpSellerCustomerRelation> opRelations = opSellerCustomerRelationDOMapper.selectList(wrapper2);
long count = opRelations.stream().map(OpSellerCustomerRelation::getCustomerId).distinct().count();
organizationalVO.setAllCustomer((int) count);
//组织成员的客户有效个数
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);
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();
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<>();

Loading…
Cancel
Save