|
@@ -333,7 +333,7 @@ public class StatMeterReadRateByBuildingServiceImpl implements StatMeterReadRate
|
|
|
//2、根据数据项查询客户
|
|
|
//List<Customer> customerList = customerService.getCustomerListByItem(loginUser.getSiteId(), buildingIds, customerId);
|
|
|
|
|
|
- List<Integer> customerIds = customerId != null?customerService.findAllSubIds(customerId):null;
|
|
|
+ List<Integer> customerIds = customerId != null?customerService.findAllIds(customerId):null;
|
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
|
|
//Integer startDate = Integer.valueOf(LocalDate.now().plusDays(-1).format(formatter));
|
|
@@ -383,10 +383,16 @@ public class StatMeterReadRateByBuildingServiceImpl implements StatMeterReadRate
|
|
|
|
|
|
//4、组装树形数据
|
|
|
List<CustomerRateDto> list = TreeUtil.getCustomerRateTree(customerRateDtoList, 0, 1);
|
|
|
+ if (list == null) {
|
|
|
+ return newArrayList();
|
|
|
+ }
|
|
|
List<CustomerRateDto> newList = list.stream().filter(p -> (p.getList() != null && p.getList().size() > 0) || (p.getChildren() != null && p.getChildren().size() > 0)).collect(Collectors.toList());
|
|
|
//List<CustomerRateDto> newList = list.stream().filter(p -> p.getCustomerId()==121).collect(Collectors.toList());
|
|
|
TreeUtil.postorderTraversalCustomerRate(newList);
|
|
|
TreeUtil.postorderTraversalCustomerRateCalculate(newList);
|
|
|
+ if (customerId != null) {
|
|
|
+ return TreeUtil.getCustomerRateTreeNode(newList,customerId);
|
|
|
+ }
|
|
|
return newList;
|
|
|
}
|
|
|
|