update
This commit is contained in:
@@ -354,22 +354,17 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
|
||||
@GetMapping(value = "/statistics")
|
||||
public Result<NasaDataRecordPage> queryPageList(NasaDataRecord nasaDataRecord) {
|
||||
NasaDataRecordPage result = new NasaDataRecordPage();
|
||||
List<NasaDataRecord> list = nasaDataRecordService.list();
|
||||
long totalCountLhs = list.stream().filter(Objects::nonNull).mapToLong(NasaDataRecord::getTotalCountLhs).filter(Objects::nonNull)
|
||||
.sum();
|
||||
long totalCountXhy = list.stream().filter(Objects::nonNull).mapToLong(NasaDataRecord::getTotalCountNasa).filter(Objects::nonNull)
|
||||
.sum();
|
||||
Long nasaCountLhs = nasaDataRecordService.sumLhs();
|
||||
Long nasaCountXhy = nasaDataRecordService.sumXhy();
|
||||
|
||||
List<Experiment> experimentList = experimentService.list();
|
||||
long experimentLhs = experimentList.stream().filter(Objects::nonNull).mapToLong(Experiment::getTotalCountLhs).filter(
|
||||
Objects::nonNull).sum();
|
||||
long experimentXhy = experimentList.stream().filter(Objects::nonNull).mapToLong(Experiment::getTotalCountXhy).filter(
|
||||
Objects::nonNull).sum();
|
||||
Long localCountLhs = experimentService.sumLhs();
|
||||
Long localCountXhy = experimentService.sumXhy();
|
||||
|
||||
result.setLhsCount(localCountLhs);
|
||||
result.setLhsTotal(nasaCountLhs + localCountLhs);
|
||||
result.setXhyCount(localCountXhy);
|
||||
result.setXyhTotal(nasaCountXhy + localCountXhy);
|
||||
|
||||
result.setLhsCount(experimentLhs);
|
||||
result.setLhsTotal(totalCountLhs + experimentLhs);
|
||||
result.setXhyCount(experimentXhy);
|
||||
result.setXyhTotal(totalCountXhy + experimentXhy);
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user