update
This commit is contained in:
@@ -15,6 +15,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.modules.database.constant.ExperimentStatus;
|
||||
import org.jeecg.modules.database.dto.NasaDataRecordPage;
|
||||
import org.jeecg.modules.database.entity.*;
|
||||
import org.jeecg.modules.database.service.*;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
@@ -64,6 +65,8 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
|
||||
private IExperimentIrradiationBoardService experimentIrradiationBoardService;
|
||||
@Autowired
|
||||
private IExperimentFileService experimentFileService;
|
||||
@Autowired
|
||||
private INasaDataRecordService nasaDataRecordService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
@@ -150,8 +153,8 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
|
||||
}
|
||||
if (StringUtils.isNotBlank(experiment.getId())) {
|
||||
Experiment dbExp = experimentService.getById(experiment.getId());
|
||||
if (!StringUtils.equals(dbExp.getStatus(), ExperimentStatus.STAGING)
|
||||
|| !StringUtils.equals(dbExp.getStatus(), ExperimentStatus.PRE_TEST)) {
|
||||
if (!StringUtils.equals(dbExp.getStatus(), ExperimentStatus.STAGING) || !StringUtils.equals(dbExp.getStatus(),
|
||||
ExperimentStatus.PRE_TEST)) {
|
||||
return Result.error("实验状态不正确!");
|
||||
}
|
||||
}
|
||||
@@ -348,4 +351,26 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
|
||||
return super.importExcel(request, response, Experiment.class);
|
||||
}
|
||||
|
||||
@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();
|
||||
|
||||
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();
|
||||
|
||||
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