diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/controller/NasaDataRecordController.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/controller/NasaDataRecordController.java index 1e79d27..fb49e30 100644 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/controller/NasaDataRecordController.java +++ b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/controller/NasaDataRecordController.java @@ -17,7 +17,9 @@ import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.modules.database.dto.NasaDataRecordPage; +import org.jeecg.modules.database.entity.Experiment; import org.jeecg.modules.database.entity.NasaDataRecord; +import org.jeecg.modules.database.service.IExperimentService; import org.jeecg.modules.database.service.INasaDataRecordService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -38,6 +40,8 @@ import java.util.*; public class NasaDataRecordController extends JeecgController { @Autowired private INasaDataRecordService nasaDataRecordService; + @Autowired + private IExperimentService experimentService; /** * 分页列表查询 @@ -75,18 +79,21 @@ public class NasaDataRecordController extends JeecgController queryPageList(NasaDataRecord nasaDataRecord) { NasaDataRecordPage result = new NasaDataRecordPage(); List list = nasaDataRecordService.list(); - long totalCountLhs = list.stream().filter(Objects::nonNull) // 排除 null 对象 - .mapToLong(NasaDataRecord::getTotalCountLhs) // 将对象映射为 long 字段 - .filter(Objects::nonNull) // 排除 myField 为 null 的情况 + long totalCountLhs = list.stream().filter(Objects::nonNull).mapToLong(NasaDataRecord::getTotalCountLhs).filter(Objects::nonNull) .sum(); - long totalCountXhy = list.stream().filter(Objects::nonNull) // 排除 null 对象 - .mapToLong(NasaDataRecord::getTotalCountNasa) // 将对象映射为 long 字段 - .filter(Objects::nonNull) // 排除 myField 为 null 的情况 + long totalCountXhy = list.stream().filter(Objects::nonNull).mapToLong(NasaDataRecord::getTotalCountNasa).filter(Objects::nonNull) .sum(); + + List 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(); + result.setLhsCount(totalCountLhs); - result.setLhsTotal(totalCountLhs); + result.setLhsTotal(totalCountLhs + experimentLhs); result.setXhyCount(totalCountXhy); - result.setXyhTotal(totalCountXhy); + result.setXyhTotal(totalCountXhy + experimentXhy); return Result.OK(result); } diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/entity/Experiment.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/entity/Experiment.java index 739bde8..f733adf 100644 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/entity/Experiment.java +++ b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/entity/Experiment.java @@ -190,6 +190,20 @@ public class Experiment implements Serializable { @TableField(exist = false) private List experimentUserList; + + /** + * 西核院统计 + */ + @Excel(name = "西核院统计", width = 15) + @Schema(description = "西核院统计") + private long totalCountXhy; + /** + * 理化所统计 + */ + @Excel(name = "理化所统计", width = 15) + @Schema(description = "理化所统计") + private long totalCountLhs; + @TableField(exist = false) private String sampleType; @TableField(exist = false)