|
@@ -333,7 +333,7 @@ public class StatMeterReadRateByBuildingServiceImpl implements StatMeterReadRate
|
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
|
|
//Integer startDate = Integer.valueOf(LocalDate.now().plusDays(-1).format(formatter));
|
|
|
- Integer startDate = 20200619;
|
|
|
+ Integer startDate = 20200317;
|
|
|
|
|
|
|
|
|
List<CustomerRateDto> customerRateDtoList = newArrayList();
|
|
@@ -349,6 +349,8 @@ public class StatMeterReadRateByBuildingServiceImpl implements StatMeterReadRate
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
customerRateDtoList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2("sc_stat_meter_read_rate_by_building_15day",loginUser.getSiteId(), startDate, buildingIds,channelId,customerIds);
|
|
|
}else if (period == 99) {// 上个月,查询15天表
|
|
|
+ DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMM");
|
|
|
+ startDate = Integer.parseInt(LocalDateTime.now().plusMonths(-1).format(df));
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
customerRateDtoList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2("sc_stat_meter_read_rate_by_building_month",loginUser.getSiteId(), startDate, buildingIds,channelId,customerIds);
|
|
|
}
|
|
@@ -373,7 +375,7 @@ public class StatMeterReadRateByBuildingServiceImpl implements StatMeterReadRate
|
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
|
|
//Integer startDate = Integer.valueOf(LocalDate.now().plusDays(-1).format(formatter));
|
|
|
- Integer startDate = 20200619;
|
|
|
+ Integer startDate = 20200317;
|
|
|
|
|
|
|
|
|
List<CustomerRateDto> customerRateDtoList = newArrayList();
|
|
@@ -384,6 +386,8 @@ public class StatMeterReadRateByBuildingServiceImpl implements StatMeterReadRate
|
|
|
} else if (period == 15) {// 近15天,查询15天表
|
|
|
customerRateDtoList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2("sc_stat_meter_read_rate_by_building_15day",loginUser.getSiteId(), startDate, buildingIds,channelId,subIds);
|
|
|
}else if (period == 99) {// 上个月,查询15天表
|
|
|
+ DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMM");
|
|
|
+ startDate = Integer.parseInt(LocalDateTime.now().plusMonths(-1).format(df));
|
|
|
customerRateDtoList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2("sc_stat_meter_read_rate_by_building_month",loginUser.getSiteId(), startDate, buildingIds,channelId,subIds);
|
|
|
}
|
|
|
if (customerRateDtoList != null && customerRateDtoList.size()>0) {
|
|
@@ -444,21 +448,26 @@ public class StatMeterReadRateByBuildingServiceImpl implements StatMeterReadRate
|
|
|
//1、查询数据权限的建筑ids
|
|
|
List<Integer> buildingIds = buildingService.getIdsByDataPermission();
|
|
|
|
|
|
+ List<Integer> customerIds = newArrayList();
|
|
|
+ if (channelId != null) {
|
|
|
+ customerIds = customerService.findAllSubIds(customerId);
|
|
|
+ }
|
|
|
+
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
|
|
//Integer startDate = Integer.valueOf(LocalDate.now().plusDays(-1).format(formatter));
|
|
|
- Integer startDate = 20200619;
|
|
|
+ Integer startDate = 20200317;
|
|
|
|
|
|
- //2、根据数据项查询客户
|
|
|
- //List<Customer> customerList = customerService.getCustomerListByItem(loginUser.getSiteId(), buildingIds, null);
|
|
|
|
|
|
if (period == 2) {
|
|
|
- return statMeterReadRateByBuildingMapper.getCountByCustomerV2("sc_stat_meter_read_rate_by_building",loginUser.getSiteId(), startDate, buildingIds, channelId, customerId);
|
|
|
+ return statMeterReadRateByBuildingMapper.getCountByCustomerV2("sc_stat_meter_read_rate_by_building",loginUser.getSiteId(), startDate, buildingIds, channelId, customerIds);
|
|
|
} else if (period == 7) {
|
|
|
- return statMeterReadRateByBuildingMapper.getCountByCustomerV2("sc_stat_meter_read_rate_by_building_7day",loginUser.getSiteId(), startDate, buildingIds, channelId, customerId);
|
|
|
+ return statMeterReadRateByBuildingMapper.getCountByCustomerV2("sc_stat_meter_read_rate_by_building_7day",loginUser.getSiteId(), startDate, buildingIds, channelId, customerIds);
|
|
|
} else if (period == 15) {
|
|
|
- return statMeterReadRateByBuildingMapper.getCountByCustomerV2("sc_stat_meter_read_rate_by_building_15day",loginUser.getSiteId(), startDate, buildingIds, channelId, customerId);
|
|
|
+ return statMeterReadRateByBuildingMapper.getCountByCustomerV2("sc_stat_meter_read_rate_by_building_15day",loginUser.getSiteId(), startDate, buildingIds, channelId, customerIds);
|
|
|
} else if (period == 99) {
|
|
|
- return statMeterReadRateByBuildingMapper.getCountByCustomerV2("sc_stat_meter_read_rate_by_building_month",loginUser.getSiteId(), startDate, buildingIds, channelId, customerId);
|
|
|
+ DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMM");
|
|
|
+ startDate = Integer.parseInt(LocalDateTime.now().plusMonths(-1).format(df));
|
|
|
+ return statMeterReadRateByBuildingMapper.getCountByCustomerV2("sc_stat_meter_read_rate_by_building_month",loginUser.getSiteId(), startDate, buildingIds, channelId, customerIds);
|
|
|
}
|
|
|
return null;
|
|
|
}
|