|
|
|
@ -178,7 +178,12 @@ public class GenerateServiceImpl extends BaseServiceImpl<GenerateMapper, Generat
|
|
|
|
|
powerDay.setGenerate(0f); |
|
|
|
|
return powerDay; |
|
|
|
|
} |
|
|
|
|
powerDay.setGenerate((float) records.stream().filter(record->record.getFillDate().equals(day)).mapToDouble(GenerateEntity::getGenerate).sum()); |
|
|
|
|
double sum = records.stream().filter(record->record.getFillDate().equals(day)).mapToDouble(GenerateEntity::getGenerate).sum(); |
|
|
|
|
if(Math.abs(sum) > 0){ |
|
|
|
|
powerDay.setGenerate((float)sum); |
|
|
|
|
}else{ |
|
|
|
|
powerDay.setGenerate(0f); |
|
|
|
|
} |
|
|
|
|
return powerDay; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
@ -231,7 +236,12 @@ public class GenerateServiceImpl extends BaseServiceImpl<GenerateMapper, Generat
|
|
|
|
|
powerMonth.setPower(0f); |
|
|
|
|
return powerMonth; |
|
|
|
|
} |
|
|
|
|
powerMonth.setPower((float) format.stream().filter(o->o.getFillDate().equals(mon)).mapToDouble(GenerateEntity::getGenerate).sum()); |
|
|
|
|
double sum = format.stream().filter(o->o.getFillDate().equals(mon)).mapToDouble(GenerateEntity::getGenerate).sum(); |
|
|
|
|
if(Math.abs(sum) > 0){ |
|
|
|
|
powerMonth.setPower((float)sum); |
|
|
|
|
}else{ |
|
|
|
|
powerMonth.setPower(0f); |
|
|
|
|
} |
|
|
|
|
return powerMonth; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|