update
This commit is contained in:
@@ -44,7 +44,12 @@ public class Result<T> implements Serializable {
|
|||||||
@Schema(description = "返回数据对象")
|
@Schema(description = "返回数据对象")
|
||||||
private T result;
|
private T result;
|
||||||
|
|
||||||
|
private Object xhyCount;
|
||||||
|
private Object lhsCount;
|
||||||
/**
|
/**
|
||||||
|
* 不返回数据
|
||||||
|
*
|
||||||
|
* @return /**
|
||||||
* 时间戳
|
* 时间戳
|
||||||
*/
|
*/
|
||||||
@Schema(description = "时间戳")
|
@Schema(description = "时间戳")
|
||||||
@@ -128,6 +133,7 @@ public class Result<T> implements Serializable {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static <T> Result<T> OK(String msg, T data) {
|
public static <T> Result<T> OK(String msg, T data) {
|
||||||
Result<T> r = new Result<T>();
|
Result<T> r = new Result<T>();
|
||||||
r.setSuccess(true);
|
r.setSuccess(true);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.jeecg.common.api.vo.Result;
|
|||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
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.entity.NasaDataRecord;
|
||||||
import org.jeecg.modules.database.service.INasaDataRecordService;
|
import org.jeecg.modules.database.service.INasaDataRecordService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -50,14 +51,16 @@ public class NasaDataRecordController extends JeecgController<NasaDataRecord, IN
|
|||||||
//@AutoLog(value = "NASA数据管理-分页列表查询")
|
//@AutoLog(value = "NASA数据管理-分页列表查询")
|
||||||
@Operation(summary = "NASA数据管理-分页列表查询")
|
@Operation(summary = "NASA数据管理-分页列表查询")
|
||||||
@GetMapping(value = "/list")
|
@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 = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
QueryWrapper<NasaDataRecord> queryWrapper = QueryGenerator.initQueryWrapper(nasaDataRecord, req.getParameterMap());
|
QueryWrapper<NasaDataRecord> queryWrapper = QueryGenerator.initQueryWrapper(nasaDataRecord, req.getParameterMap());
|
||||||
Page<NasaDataRecord> page = new Page<NasaDataRecord>(pageNo, pageSize);
|
Page<NasaDataRecord> page = new Page<NasaDataRecord>(pageNo, pageSize);
|
||||||
IPage<NasaDataRecord> pageList = nasaDataRecordService.page(page, queryWrapper);
|
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();
|
String fileList = nr.getFileList();
|
||||||
if (StringUtils.isNotBlank(fileList)) {
|
if (StringUtils.isNotBlank(fileList)) {
|
||||||
List<Map<String, String>> list = JSON.parseObject(fileList, new TypeReference<>() {});
|
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);
|
list.forEach(files::putAll);
|
||||||
nr.setFileMap(files);
|
nr.setFileMap(files);
|
||||||
}
|
}
|
||||||
});
|
totalCountLhs += Optional.ofNullable(nr.getTotalCountLhs()).orElse(0l);
|
||||||
return Result.OK(pageList);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -7,7 +7,6 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -113,12 +112,6 @@ public class Experiment implements Serializable {
|
|||||||
//@Excel(name = "辐射源类型", width = 15)
|
//@Excel(name = "辐射源类型", width = 15)
|
||||||
@Schema(description = "辐射源类型")
|
@Schema(description = "辐射源类型")
|
||||||
private String radiationSourceType;
|
private String radiationSourceType;
|
||||||
/**
|
|
||||||
* 样品型号
|
|
||||||
*/
|
|
||||||
//@Excel(name = "样品型号", width = 15)
|
|
||||||
@Schema(description = "样品型号")
|
|
||||||
private String sampleModel;
|
|
||||||
/**
|
/**
|
||||||
* 试验负责人
|
* 试验负责人
|
||||||
*/
|
*/
|
||||||
@@ -197,6 +190,13 @@ public class Experiment implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<ExperimentUser> experimentUserList;
|
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)
|
//@TableField(exist = false)
|
||||||
//@ExcelCollection(name = "辐照")
|
//@ExcelCollection(name = "辐照")
|
||||||
|
|||||||
@@ -121,13 +121,13 @@ public class NasaDataRecord implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@Excel(name = "西核院统计", width = 15)
|
@Excel(name = "西核院统计", width = 15)
|
||||||
@Schema(description = "西核院统计")
|
@Schema(description = "西核院统计")
|
||||||
private String totalCountNasa;
|
private long totalCountNasa;
|
||||||
/**
|
/**
|
||||||
* 理化所统计
|
* 理化所统计
|
||||||
*/
|
*/
|
||||||
@Excel(name = "理化所统计", width = 15)
|
@Excel(name = "理化所统计", width = 15)
|
||||||
@Schema(description = "理化所统计")
|
@Schema(description = "理化所统计")
|
||||||
private String totalCountLhs;
|
private long totalCountLhs;
|
||||||
/**
|
/**
|
||||||
* 附件IDs
|
* 附件IDs
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user