|
|
|
@ -313,7 +313,7 @@ public class RealTargetServiceImpl implements RealTargetService {
|
|
|
|
|
target.setPowerDay(this.devicePowerDay(generations,device)); |
|
|
|
|
// 昨日发电量
|
|
|
|
|
target.setPowerYesterDay(this.devicePowerYesterDay(generations,device)); |
|
|
|
|
// 当天有功功率
|
|
|
|
|
// 近24小时有功功率
|
|
|
|
|
target.setActivePowerVoList(this.getLoadsByDay(device)); |
|
|
|
|
// 30天发电量
|
|
|
|
|
target.setGenerationPowerVoList(this.getGenerationPowerList(generations,device)); |
|
|
|
@ -1483,10 +1483,12 @@ public class RealTargetServiceImpl implements RealTargetService {
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private List<ActivePowerVo> getLoadsByDay(EminfoAndEmParamVo device) { |
|
|
|
|
// 开始日期
|
|
|
|
|
String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00"; |
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
// 结束日期
|
|
|
|
|
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 23:59:59"; |
|
|
|
|
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); |
|
|
|
|
calendar.add(Calendar.DAY_OF_MONTH,-1); |
|
|
|
|
// 开始日期
|
|
|
|
|
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; |
|
|
|
|
List<AnalyseDataTaosVO> records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD); |
|
|
|
|
if (CollectionUtil.isEmpty(records)) { |
|
|
|
|
return new ArrayList<>(); |
|
|
|
@ -1988,8 +1990,8 @@ public class RealTargetServiceImpl implements RealTargetService {
|
|
|
|
|
*/ |
|
|
|
|
private List<ThirtyGenerationEntity> thirtyGenerations(List<String> stations) { |
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
String end = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME); |
|
|
|
|
calendar.add(Calendar.DAY_OF_MONTH,-29); |
|
|
|
|
String end = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATE); |
|
|
|
|
calendar.add(Calendar.DAY_OF_MONTH,-30); |
|
|
|
|
String start = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATE); |
|
|
|
|
return thirtyGenerateService.list(Wrappers.<ThirtyGenerationEntity>lambdaQuery() |
|
|
|
|
.in(ThirtyGenerationEntity::getStationId,stations) |
|
|
|
@ -2034,10 +2036,10 @@ public class RealTargetServiceImpl implements RealTargetService {
|
|
|
|
|
private List<GenerationPowerVo> getGenerationPowerList(List<ThirtyGenerationEntity> generations,EminfoAndEmParamVo device) { |
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
Date end = calendar.getTime(); |
|
|
|
|
calendar.add(Calendar.DAY_OF_MONTH,-29); |
|
|
|
|
calendar.add(Calendar.DAY_OF_MONTH,-30); |
|
|
|
|
Date start = calendar.getTime(); |
|
|
|
|
List<GenerationPowerVo> powers = new ArrayList<>(); |
|
|
|
|
while (end.compareTo(start) >= 0){ |
|
|
|
|
while (end.compareTo(start) > 0){ |
|
|
|
|
GenerationPowerVo power = new GenerationPowerVo(); |
|
|
|
|
if (CollectionUtil.isEmpty(generations)) { |
|
|
|
|
power.setDate(DateUtil.format(start,DateUtil.PATTERN_DATE)); |
|
|
|
|