This commit is contained in:
ls
2025-02-22 13:35:09 +08:00
parent 5664ff3161
commit 9294cdbc3f
5 changed files with 57 additions and 17 deletions

View File

@@ -44,7 +44,12 @@ public class Result<T> implements Serializable {
@Schema(description = "返回数据对象")
private T result;
private Object xhyCount;
private Object lhsCount;
/**
* 不返回数据
*
* @return /**
* 时间戳
*/
@Schema(description = "时间戳")
@@ -128,6 +133,7 @@ public class Result<T> implements Serializable {
return r;
}
public static <T> Result<T> OK(String msg, T data) {
Result<T> r = new Result<T>();
r.setSuccess(true);

View File

@@ -16,6 +16,7 @@ import org.jeecg.common.api.vo.Result;
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.NasaDataRecord;
import org.jeecg.modules.database.service.INasaDataRecordService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -50,14 +51,16 @@ public class NasaDataRecordController extends JeecgController<NasaDataRecord, IN
//@AutoLog(value = "NASA数据管理-分页列表查询")
@Operation(summary = "NASA数据管理-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<NasaDataRecord>> queryPageList(NasaDataRecord nasaDataRecord,
public Result<NasaDataRecordPage> queryPageList(NasaDataRecord nasaDataRecord,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<NasaDataRecord> queryWrapper = QueryGenerator.initQueryWrapper(nasaDataRecord, req.getParameterMap());
Page<NasaDataRecord> page = new Page<NasaDataRecord>(pageNo, pageSize);
IPage<NasaDataRecord> pageList = nasaDataRecordService.page(page, queryWrapper);
pageList.getRecords().forEach(nr -> {
long totalCountLhs = 0;
long totalCountXhy = 0;
for (NasaDataRecord nr : pageList.getRecords()) {
String fileList = nr.getFileList();
if (StringUtils.isNotBlank(fileList)) {
List<Map<String, String>> list = JSON.parseObject(fileList, new TypeReference<>() {});
@@ -65,8 +68,16 @@ public class NasaDataRecordController extends JeecgController<NasaDataRecord, IN
list.forEach(files::putAll);
nr.setFileMap(files);
}
});
return Result.OK(pageList);
totalCountLhs += Optional.ofNullable(nr.getTotalCountLhs()).orElse(0l);
totalCountXhy += Optional.ofNullable(nr.getTotalCountNasa()).orElse(0l);
}
NasaDataRecordPage result = new NasaDataRecordPage();
result.setPageList(pageList);
result.setLhsCount(totalCountLhs);
result.setLhsTotal(totalCountLhs);
result.setXhyCount(totalCountXhy);
result.setXyhTotal(totalCountXhy);
return Result.OK(result);
}
/**

View File

@@ -0,0 +1,23 @@
/*
* Ant Group
* Copyright (c) 2004-2025 All Rights Reserved.
*/
package org.jeecg.modules.database.dto;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.Data;
import org.jeecg.modules.database.entity.NasaDataRecord;
/**
* @author lise
* @version NasaDataRecordPage.java, v 0.1 2025年02月22日 13:30 lise
*/
@Data
public class NasaDataRecordPage {
private IPage<NasaDataRecord> pageList;
private long lhsCount;
private long lhsTotal;
private long xhyCount;
private long xyhTotal;
}

View File

@@ -7,7 +7,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
@@ -113,12 +112,6 @@ public class Experiment implements Serializable {
//@Excel(name = "辐射源类型", width = 15)
@Schema(description = "辐射源类型")
private String radiationSourceType;
/**
* 样品型号
*/
//@Excel(name = "样品型号", width = 15)
@Schema(description = "样品型号")
private String sampleModel;
/**
* 试验负责人
*/
@@ -197,6 +190,13 @@ public class Experiment implements Serializable {
@TableField(exist = false)
private List<ExperimentUser> experimentUserList;
@TableField(exist = false)
private String sampleType;
@TableField(exist = false)
private String sampleName;
@TableField(exist = false)
private String equipmentMode;
private String sampleModel;
//@TableField(exist = false)
//@ExcelCollection(name = "辐照")

View File

@@ -121,13 +121,13 @@ public class NasaDataRecord implements Serializable {
*/
@Excel(name = "西核院统计", width = 15)
@Schema(description = "西核院统计")
private String totalCountNasa;
private long totalCountNasa;
/**
* 理化所统计
*/
@Excel(name = "理化所统计", width = 15)
@Schema(description = "理化所统计")
private String totalCountLhs;
private long totalCountLhs;
/**
* 附件IDs
*/