|
|
|
@ -118,7 +118,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<InstalledCapacityVo> installedCapacity(String stationName,Integer type) { |
|
|
|
|
public List<InstalledCapacityVo> installedCapacity(String stationName,Integer type,Integer current,Integer size) { |
|
|
|
|
// 站点
|
|
|
|
|
LambdaQueryWrapper<StationEntity> wappers = Wrappers.lambdaQuery(); |
|
|
|
|
wappers.eq(StationEntity::getType, type); |
|
|
|
@ -148,7 +148,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
List<String> details = stationDevices.stream().map(device-> "[" + device.getName() + " " +device.getInstalledCapacity() +"kw]").collect(Collectors.toList()); |
|
|
|
|
item.setDetail(String.join("|",details)); |
|
|
|
|
return item; |
|
|
|
|
}).filter(capacity->Math.abs(capacity.getInstalledCapacity()) > 0).collect(Collectors.toList()); |
|
|
|
|
}).filter(capacity->Math.abs(capacity.getInstalledCapacity()) > 0).skip((long) (current - 1) * size).limit(size).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -156,7 +156,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<ElectricGenerationVo> electricGeneration(String stationName,Integer type) { |
|
|
|
|
public List<ElectricGenerationVo> electricGeneration(String stationName,Integer type,Integer current,Integer size) { |
|
|
|
|
// 站点
|
|
|
|
|
LambdaQueryWrapper<StationEntity> wappers = Wrappers.lambdaQuery(); |
|
|
|
|
wappers.eq(StationEntity::getType, type); |
|
|
|
@ -191,7 +191,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
List<String> details = targets.stream().filter(target->target.getDeptId().equals(station.getRefDept())).map(target-> "[" + Optional.ofNullable(target.getDeviceCode()).orElse("填报电量") + " " + target.getPowerYear() +"kWh]").collect(Collectors.toList()); |
|
|
|
|
item.setDetail(String.join("|",details)); |
|
|
|
|
return item; |
|
|
|
|
}).filter(generate->Math.abs(generate.getElectricGeneration()) > 0).collect(Collectors.toList()); |
|
|
|
|
}).filter(generate->Math.abs(generate.getElectricGeneration()) > 0).skip((long) (current - 1) * size).limit(size).collect(Collectors.toList()); |
|
|
|
|
}else if(HomePageConstant.PHOTOVOLTAIC.equals(type)){ |
|
|
|
|
List<PhotovoltaicTargetVo> targets = (List<PhotovoltaicTargetVo>) redisTemplate.opsForValue().get(load_photovoltaic_target_key); |
|
|
|
|
if(CollectionUtil.isEmpty(targets)){ |
|
|
|
@ -213,7 +213,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
List<String> details = targets.stream().filter(target->target.getDeptId().equals(station.getRefDept())).map(target-> "[" + Optional.ofNullable(target.getDeviceCode()).orElse("填报电量") + " " + target.getGenerationYear() +"kWh]").collect(Collectors.toList()); |
|
|
|
|
item.setDetail(String.join("|",details)); |
|
|
|
|
return item; |
|
|
|
|
}).filter(generate->Math.abs(generate.getElectricGeneration()) > 0).collect(Collectors.toList()); |
|
|
|
|
}).filter(generate->Math.abs(generate.getElectricGeneration()) > 0).skip((long) (current - 1) * size).limit(size).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
// 查询填报数据
|
|
|
|
@ -234,7 +234,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
} |
|
|
|
|
item.setDetail("站点为填报数据,暂无设备装机发电量信息!"); |
|
|
|
|
return item; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
}).skip((long) (current - 1) * size).limit(size).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -242,7 +242,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<CompleteGenerationVo> completeGeneration(String stationName,Integer type) { |
|
|
|
|
public List<CompleteGenerationVo> completeGeneration(String stationName,Integer type,Integer current,Integer size) { |
|
|
|
|
// 站点
|
|
|
|
|
LambdaQueryWrapper<StationEntity> wappers = Wrappers.lambdaQuery(); |
|
|
|
|
wappers.eq(StationEntity::getType, type); |
|
|
|
@ -292,7 +292,8 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
item.setCompleteRate(0.0); |
|
|
|
|
} |
|
|
|
|
return item; |
|
|
|
|
}).filter(complete->Math.abs(complete.getPlanGeneration()) > 0 || Math.abs(complete.getRealityGeneration()) > 0).collect(Collectors.toList()); |
|
|
|
|
}).filter(complete->Math.abs(complete.getPlanGeneration()) > 0 || Math.abs(complete.getRealityGeneration()) > 0) |
|
|
|
|
.skip((long) (current - 1) * size).limit(size).collect(Collectors.toList()); |
|
|
|
|
}else if(HomePageConstant.PHOTOVOLTAIC.equals(type)){ |
|
|
|
|
// 计划发电量
|
|
|
|
|
String mon = DateUtil.format(new Date(),"yyyy"); |
|
|
|
@ -335,7 +336,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
item.setCompleteRate(0.0); |
|
|
|
|
} |
|
|
|
|
return item; |
|
|
|
|
}).filter(complete->Math.abs(complete.getPlanGeneration()) > 0 || Math.abs(complete.getRealityGeneration()) > 0).collect(Collectors.toList()); |
|
|
|
|
}).filter(complete->Math.abs(complete.getPlanGeneration()) > 0 || Math.abs(complete.getRealityGeneration()) > 0).skip((long) (current - 1) * size).limit(size).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
String mon = DateUtil.format(new Date(),"yyyy"); |
|
|
|
|
List<PowerEntity> powers = powerService.list(Wrappers.<PowerEntity>lambdaQuery() |
|
|
|
@ -357,7 +358,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
item.setCompleteRate(Double.valueOf(stationPowers.stream().sorted(Comparator.comparing(PowerEntity::getMon).reversed()).collect(Collectors.toList()).get(0).getPowerRateYear())); |
|
|
|
|
} |
|
|
|
|
return item; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
}).skip((long) (current - 1) * size).limit(size).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -365,10 +366,10 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<CompleteTicketVo> completeTicket(String areaName,Integer type) { |
|
|
|
|
public List<CompleteTicketVo> completeTicket(String areaName,Integer type,Integer current,Integer size) { |
|
|
|
|
// 光伏/风电双票填报数据
|
|
|
|
|
if(HomePageConstant.WIND_POWER.equals(type) || HomePageConstant.PHOTOVOLTAIC.equals(type)){ |
|
|
|
|
return this.getcompleteFillTicket(areaName,type); |
|
|
|
|
return this.getcompleteFillTicket(areaName,type,current,size); |
|
|
|
|
} |
|
|
|
|
// 平台业务数据
|
|
|
|
|
List<Integer> types; |
|
|
|
@ -390,6 +391,25 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
CountDownLatch countDownLatch = new CountDownLatch(areas.size()); |
|
|
|
|
List<CompleteTicketVo> completeTickets = new ArrayList<>(); |
|
|
|
|
exe.execute(()-> { |
|
|
|
|
if(StringUtil.isEmpty(areaName)){ |
|
|
|
|
for (Dept dept: areas.stream().filter(area->area.getDeptName().equals(areaName)).collect(Collectors.toList())) { |
|
|
|
|
// 双票
|
|
|
|
|
DoublePassRateVO doublePass = ticketInfoAllClient.getDoublePassRate(Collections.singletonList(dept.getId()), firstDateTime, LocalDateTime.now()); |
|
|
|
|
CompleteTicketVo completeTicketVo = new CompleteTicketVo(); |
|
|
|
|
if (ObjectUtil.isEmpty(doublePass)) { |
|
|
|
|
completeTicketVo.setAreaName(dept.getDeptName()); |
|
|
|
|
completeTicketVo.setTicketCount("0"); |
|
|
|
|
completeTicketVo.setCompleteCount("0"); |
|
|
|
|
completeTicketVo.setCompleteRate("0.0"); |
|
|
|
|
} else { |
|
|
|
|
completeTicketVo.setAreaName(dept.getDeptName()); |
|
|
|
|
completeTicketVo.setTicketCount(doublePass.getDoubleTicketCount().toString()); |
|
|
|
|
completeTicketVo.setCompleteCount(doublePass.getDoubleTicketPassCount().toString()); |
|
|
|
|
completeTicketVo.setCompleteRate(doublePass.getDoublePassRate()); |
|
|
|
|
} |
|
|
|
|
completeTickets.add(completeTicketVo); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
for (Dept dept: areas) { |
|
|
|
|
// 双票
|
|
|
|
|
DoublePassRateVO doublePass = ticketInfoAllClient.getDoublePassRate(Collections.singletonList(dept.getId()), firstDateTime, LocalDateTime.now()); |
|
|
|
@ -406,6 +426,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
completeTicketVo.setCompleteRate(doublePass.getDoublePassRate()); |
|
|
|
|
} |
|
|
|
|
completeTickets.add(completeTicketVo); |
|
|
|
|
} |
|
|
|
|
countDownLatch.countDown(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -417,7 +438,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
Thread.currentThread().interrupt(); |
|
|
|
|
} |
|
|
|
|
exe.shutdown(); |
|
|
|
|
return completeTickets.stream().filter(complete->Math.abs(Integer.parseInt(complete.getTicketCount())) > 0 || Math.abs(Integer.parseInt(complete.getCompleteCount())) > 0).collect(Collectors.toList()); |
|
|
|
|
return completeTickets.stream().filter(complete->Math.abs(Integer.parseInt(complete.getTicketCount())) > 0 || Math.abs(Integer.parseInt(complete.getCompleteCount())) > 0).skip((long) (current - 1) * size).limit(size).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -451,7 +472,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
* @param type |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private List<CompleteTicketVo> getcompleteFillTicket(String stationName, Integer type) { |
|
|
|
|
private List<CompleteTicketVo> getcompleteFillTicket(String stationName, Integer type,Integer current,Integer size) { |
|
|
|
|
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery() |
|
|
|
|
.eq(StationEntity::getType, type) |
|
|
|
|
.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE) |
|
|
|
@ -478,7 +499,7 @@ public class TargetServiceImpl implements TargetService {
|
|
|
|
|
item.setCompleteRate(String.valueOf(BigDecimal.valueOf(rate/ stationPower.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue())); |
|
|
|
|
} |
|
|
|
|
return item; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
}).skip((long) (current - 1) * size).limit(size).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|