|
@ -243,6 +243,8 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { |
|
|
public List<Integer> importExcel(String customerId,List<IcNeighborHoodExcel> list,String staffId, List<Integer> numList) { |
|
|
public List<Integer> importExcel(String customerId,List<IcNeighborHoodExcel> list,String staffId, List<Integer> numList) { |
|
|
//2021.11.9 需求变更 当前工作人员只能导致自己所属组织下数据,网格名对应不上的数据舍弃【注:需求就这样】 sun
|
|
|
//2021.11.9 需求变更 当前工作人员只能导致自己所属组织下数据,网格名对应不上的数据舍弃【注:需求就这样】 sun
|
|
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); |
|
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); |
|
|
|
|
|
//查询当前组织下网格列表
|
|
|
|
|
|
List<CustomerGridEntity> customerGridList = customerGridDao.selectByPid(staffInfoCache.getAgencyId()); |
|
|
//组织名称不一样的数据舍弃
|
|
|
//组织名称不一样的数据舍弃
|
|
|
Iterator<IcNeighborHoodExcel> iterator = list.iterator(); |
|
|
Iterator<IcNeighborHoodExcel> iterator = list.iterator(); |
|
|
while (iterator.hasNext()) { |
|
|
while (iterator.hasNext()) { |
|
@ -251,6 +253,14 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { |
|
|
numList.add(obj.getRowNum()); |
|
|
numList.add(obj.getRowNum()); |
|
|
iterator.remove(); |
|
|
iterator.remove(); |
|
|
} |
|
|
} |
|
|
|
|
|
//当前组织下网格名不存在的也不允许导入
|
|
|
|
|
|
customerGridList.forEach(g->{ |
|
|
|
|
|
if(!obj.getGridName().trim().equals(g.getGridName())){ |
|
|
|
|
|
numList.add(obj.getRowNum()); |
|
|
|
|
|
iterator.remove(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
//end sun
|
|
|
//end sun
|
|
|
|
|
|
|
|
@ -260,13 +270,15 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { |
|
|
} |
|
|
} |
|
|
//获取所有组织 list
|
|
|
//获取所有组织 list
|
|
|
List<String> agencyNameList = list.stream().map(item -> item.getAgencyName()).collect(Collectors.toList()); |
|
|
List<String> agencyNameList = list.stream().map(item -> item.getAgencyName()).collect(Collectors.toList()); |
|
|
|
|
|
agencyNameList = agencyNameList.stream().distinct().collect(Collectors.toList()); |
|
|
//获取所有网格 list
|
|
|
//获取所有网格 list
|
|
|
List<String> gridNameList = list.stream().map(item->item.getGridName()).collect(Collectors.toList()); |
|
|
//List<String> gridNameList = list.stream().map(item->item.getGridName()).collect(Collectors.toList());
|
|
|
//获取所有物业 list
|
|
|
//获取所有物业 list
|
|
|
List<String> propertyNameList = list.stream().map(item->item.getPropertyName()).collect(Collectors.toList()); |
|
|
List<String> propertyNameList = list.stream().map(item->item.getPropertyName()).collect(Collectors.toList()); |
|
|
|
|
|
propertyNameList = propertyNameList.stream().distinct().collect(Collectors.toList()); |
|
|
//查询对应的id
|
|
|
//查询对应的id
|
|
|
List<CustomerAgencyEntity> customerAgencyList = customerAgencyDao.selectList(new QueryWrapper<CustomerAgencyEntity>().lambda().in(CustomerAgencyEntity::getOrganizationName, agencyNameList)); |
|
|
List<CustomerAgencyEntity> customerAgencyList = customerAgencyDao.selectList(new QueryWrapper<CustomerAgencyEntity>().lambda().in(CustomerAgencyEntity::getOrganizationName, agencyNameList)); |
|
|
List<CustomerGridEntity> customerGridList = customerGridDao.selectList(new QueryWrapper<CustomerGridEntity>().lambda().in(CustomerGridEntity::getGridName, gridNameList)); |
|
|
//List<CustomerGridEntity> customerGridList = customerGridDao.selectList(new QueryWrapper<CustomerGridEntity>().lambda().in(CustomerGridEntity::getGridName, gridNameList));
|
|
|
List<IcPropertyManagementEntity> icPropertyManagementList = icPropertyManagementDao.selectList(new QueryWrapper<IcPropertyManagementEntity>().lambda().in(IcPropertyManagementEntity::getName, propertyNameList)); |
|
|
List<IcPropertyManagementEntity> icPropertyManagementList = icPropertyManagementDao.selectList(new QueryWrapper<IcPropertyManagementEntity>().lambda().in(IcPropertyManagementEntity::getName, propertyNameList)); |
|
|
|
|
|
|
|
|
Map<String,CustomerAgencyEntity> agencyMap = customerAgencyList.stream().collect(Collectors.toMap(CustomerAgencyEntity::getOrganizationName, Function.identity(),(key1, key2)->key1)); |
|
|
Map<String,CustomerAgencyEntity> agencyMap = customerAgencyList.stream().collect(Collectors.toMap(CustomerAgencyEntity::getOrganizationName, Function.identity(),(key1, key2)->key1)); |
|
|