diff --git a/jeecg-module-monitor-info-database/pom.xml b/jeecg-module-monitor-info-database/pom.xml
index b52058d..6108559 100644
--- a/jeecg-module-monitor-info-database/pom.xml
+++ b/jeecg-module-monitor-info-database/pom.xml
@@ -23,5 +23,11 @@
jeecg-boot-base-core
${jeecgboot.version}
+
+ io.swagger
+ swagger-annotations
+ 1.6.6
+ compile
+
\ No newline at end of file
diff --git a/jeecg-module-monitor-info-database/src/main/java/org/jeecg/controller/GardsCorrectionFactorDetailController.java b/jeecg-module-monitor-info-database/src/main/java/org/jeecg/controller/GardsCorrectionFactorDetailController.java
new file mode 100644
index 0000000..d78880c
--- /dev/null
+++ b/jeecg-module-monitor-info-database/src/main/java/org/jeecg/controller/GardsCorrectionFactorDetailController.java
@@ -0,0 +1,217 @@
+package org.jeecg.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.v3.oas.annotations.Operation;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.modules.base.entity.configuration.GardsCorrectionFactor;
+import org.jeecg.modules.base.entity.configuration.GardsCorrectionFactorDetail;
+import org.jeecg.modules.base.entity.configuration.GardsCorrectionFactorEff;
+import org.jeecg.modules.base.vo.DetectorMapDTO;
+import org.jeecg.modules.base.vo.GardsCorrectionFactorDetailVO;
+import org.jeecg.modules.base.vo.GardsCorrectionFactorEffVO;
+import org.jeecg.service.GardsCorrectionFactorDetailService;
+import org.jeecg.service.GardsCorrectionFactorEffService;
+import org.jeecgframework.poi.excel.ExcelExportUtil;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 级联符合校正因子库--校正因子
+ */
+@Slf4j
+@RestController
+@RequestMapping("/gardsCorrectionFactorDetail")
+public class GardsCorrectionFactorDetailController {
+ final short titleHeight = 8;
+ @Autowired
+ private GardsCorrectionFactorDetailService detailService;
+ @Autowired
+ private GardsCorrectionFactorEffService effService;
+
+ /**
+ * 分页查询
+ */
+ @GetMapping("/page")
+ @Operation(summary = "分页查询")
+ public Result> list(
+ @RequestParam(defaultValue = "1") int pageNum,
+ @RequestParam(defaultValue = "10") int size,
+ @RequestParam(required = false)String stationCode,
+ @RequestParam(required = false)String detectorCode,
+ @RequestParam(required = false)String nuclideName) {
+ return Result.ok(
+ detailService.findPage(pageNum, size, stationCode, detectorCode, nuclideName));
+ }
+
+ /**
+ * 添加
+ *
+ * @param detail
+ * @return
+ */
+ @PostMapping("/add")
+ @Operation(summary = "添加")
+ public Result> add(@RequestBody GardsCorrectionFactorDetail detail) {
+ return Result.ok(detailService.save(detail));
+ }
+
+ /**
+ * 更新
+ *
+ * @param detail
+ * @return
+ */
+ @PutMapping("/update")
+ @Operation(summary = "更新")
+ public Result> update(@RequestBody GardsCorrectionFactorDetail detail) {
+ return Result.ok(detailService.updateById(detail));
+ }
+
+ /**
+ * 删除
+ *
+ * @param id
+ * @return
+ */
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除")
+ public Result> delete(@RequestParam(name = "id") Integer id) {
+ return Result.ok(detailService.removeById(id));
+ }
+
+ @AutoLog(value = "导出模版")
+ @Operation(summary = "导出模版")
+ @GetMapping("/exportTemplate")
+ public void exportTemplate(HttpServletResponse response) throws IOException {
+ ExportParams params = new ExportParams();
+ params.setTitle("探测器模拟及联符合校正因子信息");
+ params.setFixedTitle(true);
+ params.setTitleHeight(titleHeight);
+ params.setType(ExcelType.XSSF);
+ ExcelExportUtil.exportExcel(params, GardsCorrectionFactorDetailVO.class, new ArrayList<>())
+ .write(response.getOutputStream());
+ }
+
+ @AutoLog(value = "导出Excel")
+ @Operation(summary = "导出校正因子Excel")
+ @GetMapping("/exportExcel")
+ public void exportExcel(HttpServletResponse response,
+ @RequestParam(required = false) String stationCode,
+ @RequestParam(required = false) String detectorCode,
+ @RequestParam(required = false) String nuclideName)
+ throws IOException {
+ ExportParams params = new ExportParams();
+ params.setTitle("探测器模拟及联符合校正因子信息");
+ params.setFixedTitle(true);
+ params.setTitleHeight(titleHeight);
+ params.setType(ExcelType.XSSF);
+
+ List list = detailService.findList(
+ stationCode, detectorCode, nuclideName);
+ ExcelExportUtil.exportExcel(params, GardsCorrectionFactorDetailVO.class, list)
+ .write(response.getOutputStream());
+ }
+
+
+ /**
+ * 通过excel导入数据
+ *
+ * @param request
+ * @return
+ */
+ @AutoLog(value = "导入GardsAccelerator数据")
+ @PostMapping(value = "/importExcel")
+ public Result> importExcel(HttpServletRequest request) {
+ // 1. 获取上传文件
+ MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+ Map fileMap = multipartRequest.getFileMap();
+
+ // 2. 遍历文件进行处理
+ for (Map.Entry entity : fileMap.entrySet()) {
+ // 获取上传文件对象
+ MultipartFile file = entity.getValue();
+ ImportParams params = new ImportParams();
+ // 设置标题行行数(通常为1,如果没有标题填0)
+ params.setTitleRows(1);
+ // 设置表头行数(通常为1)
+ params.setHeadRows(1);
+ params.setNeedSave(true);
+
+ try {
+ // 3. 使用 AutoPoi 工具类解析 Excel
+ List list =
+ ExcelImportUtil.importExcel(file.getInputStream(),
+ GardsCorrectionFactorDetailVO.class, params);
+
+ // 预加载映射关系 (Key: Code, Value: DTO)
+ // SQL: SELECT DETECTOR_ID, DETECTOR_CODE, STATION_ID FROM GARDS_DETECTORS
+ Map refMap = effService.queryAllDetectorRef().stream()
+ .collect(Collectors.toMap(DetectorMapDTO::getDetectorCode, d -> d,
+ (k1, k2) -> k1));
+
+ // 转换GardsCorrectionFactorDetail并保存
+ List entityList = new ArrayList<>();
+
+ for (GardsCorrectionFactorDetailVO vo : list) {
+ if (StringUtils.isEmpty(vo.getDetectorCode())) {
+ continue;
+ }
+
+ // 根据 Excel 里的探测器代码获取数据库 ID
+ DetectorMapDTO ref = refMap.get(vo.getDetectorCode().trim());
+
+ if (ref == null) {
+ return Result.error(
+ "导入中止:系统中不存在探测器代码 [" + vo.getDetectorCode() + "]");
+ }
+ GardsCorrectionFactorDetail effEntity = new GardsCorrectionFactorDetail();
+ BeanUtils.copyProperties(vo, effEntity);
+ // 填充两个关联 ID
+ effEntity.setDetectorId(ref.getDetectorId());
+ effEntity.setStationId(ref.getStationId());
+ entityList.add(effEntity);
+ }
+
+ // 4. 批量保存数据到数据库
+ if (!CollectionUtils.isEmpty(entityList)) {
+
+ //detailService.saveBatch(entityList);
+
+
+ entityList.forEach(item -> detailService.save(item));
+ }
+ return Result.OK("文件导入成功!数据行数:" + list.size());
+ } catch (Exception e) {
+ return Result.error("文件导入失败:" + e.getMessage());
+ } finally {
+ try {
+ file.getInputStream().close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ return Result.error("文件导入失败!");
+ }
+
+
+}
diff --git a/jeecg-module-monitor-info-database/src/main/java/org/jeecg/controller/GardsCorrectionFactorEffController.java b/jeecg-module-monitor-info-database/src/main/java/org/jeecg/controller/GardsCorrectionFactorEffController.java
new file mode 100644
index 0000000..2c596c3
--- /dev/null
+++ b/jeecg-module-monitor-info-database/src/main/java/org/jeecg/controller/GardsCorrectionFactorEffController.java
@@ -0,0 +1,234 @@
+package org.jeecg.controller;
+
+import io.swagger.v3.oas.annotations.Operation;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.modules.base.entity.configuration.GardsCorrectionFactor;
+import org.jeecg.modules.base.entity.configuration.GardsCorrectionFactorEff;
+import org.jeecg.modules.base.vo.DetectorMapDTO;
+import org.jeecg.modules.base.vo.DetectorOptionVO;
+import org.jeecg.modules.base.vo.GardsCorrectionFactorEffVO;
+import org.jeecg.modules.base.vo.StationOptionVO;
+import org.jeecg.service.GardsCorrectionFactorEffService;
+import org.jeecgframework.poi.excel.ExcelExportUtil;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 级联符合校正因子库--峰效率
+ */
+@Slf4j
+@RestController
+@RequestMapping("/gardsCorrectionFactorEff")
+public class GardsCorrectionFactorEffController {
+ private final short titleHeight = 8;
+ @Autowired
+ private GardsCorrectionFactorEffService effService;
+
+ /**
+ * 分页查询
+ */
+ @GetMapping("/page")
+ @Operation(summary = "分页查询")
+ public Result> list(@RequestParam(defaultValue = "1") int pageNum,
+ @RequestParam(defaultValue = "10") int size,
+ @RequestParam(required = false) String stationCode,
+ @RequestParam(required = false) String detectorCode) {
+ return Result.OK(effService.findPage(pageNum, size, stationCode, detectorCode));
+ }
+
+ /**
+ * 添加
+ *
+ * @param eff 实体
+ * @return Result
+ */
+ @PostMapping("/add")
+ @Operation(summary = "添加")
+ public Result> add(@RequestBody GardsCorrectionFactorEff eff) {
+
+ return Result.OK(effService.add(eff));
+ }
+
+ /**
+ * 更新
+ *
+ * @param eff 实体
+ * @return Result
+ */
+ @PutMapping("/update")
+ @Operation(summary = "更新")
+ public Result> update(@RequestBody GardsCorrectionFactorEff eff) {
+ return Result.OK(effService.update(eff));
+ }
+
+ /**
+ * 删除
+ *
+ * @param id 主键ID
+ * @return Result
+ */
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除")
+ public Result> delete(@RequestParam(name = "id") Integer id) {
+ effService.delete(id);
+ return Result.OK();
+ }
+
+
+ @AutoLog(value = "导出模版")
+ @Operation(summary = "导出模版")
+ @GetMapping("/exportTemplate")
+ public void exportTemplate(HttpServletResponse response) throws IOException {
+ ExportParams params = new ExportParams();
+ params.setTitle("探测器模拟及联符合校正因子信息");
+ params.setFixedTitle(true);
+ params.setTitleHeight(titleHeight);
+ params.setType(ExcelType.XSSF);
+ ExcelExportUtil.exportExcel(params, GardsCorrectionFactorEffVO.class, new ArrayList<>())
+ .write(response.getOutputStream());
+ }
+
+ @AutoLog(value = "导出Excel")
+ @Operation(summary = "导出校正因子Excel")
+ @GetMapping("/exportExcel")
+ public void exportExcel(HttpServletResponse response,
+ @RequestParam(required = false) String stationCode,
+ @RequestParam(required = false) String detectorCode)
+ throws IOException {
+ ExportParams params = new ExportParams();
+ params.setTitle("探测器模拟及联符合校正因子效率信息");
+ params.setFixedTitle(true);
+ params.setTitleHeight(titleHeight);
+ params.setType(ExcelType.XSSF);
+
+ List list = effService.selectVOList(
+ stationCode, detectorCode);
+ ExcelExportUtil.exportExcel(params, GardsCorrectionFactor.class, list)
+ .write(response.getOutputStream());
+ }
+
+
+ /**
+ * 通过excel导入数据
+ *
+ * @param request
+ * @return
+ */
+ @AutoLog(value = "导入GardsAccelerator数据")
+ @PostMapping(value = "/importExcel")
+ public Result> importExcel(HttpServletRequest request) {
+ // 1. 获取上传文件
+ MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+ Map fileMap = multipartRequest.getFileMap();
+
+ // 2. 遍历文件进行处理
+ for (Map.Entry entity : fileMap.entrySet()) {
+ // 获取上传文件对象
+ MultipartFile file = entity.getValue();
+ ImportParams params = new ImportParams();
+ // 设置标题行行数(通常为1,如果没有标题填0)
+ params.setTitleRows(1);
+ // 设置表头行数(通常为1)
+ params.setHeadRows(1);
+ params.setNeedSave(true);
+
+ try {
+ // 使用 AutoPoi 工具类解析 Excel
+ List voList =
+ ExcelImportUtil.importExcel(file.getInputStream(),
+ GardsCorrectionFactorEffVO.class, params);
+
+ if (!CollectionUtils.isEmpty(voList)) {
+
+ // 预加载映射关系 (Key: Code, Value: DTO)
+ // SQL: SELECT DETECTOR_ID, DETECTOR_CODE, STATION_ID FROM GARDS_DETECTORS
+ Map refMap = effService.queryAllDetectorRef().stream()
+ .collect(Collectors.toMap(DetectorMapDTO::getDetectorCode, d -> d,
+ (k1, k2) -> k1));
+
+ // 转换GardsCorrectionFactorEff并保存
+ List entityList = new ArrayList<>();
+
+ for (GardsCorrectionFactorEffVO vo : voList) {
+ if (StringUtils.isEmpty(vo.getDetectorCode())) {
+ continue;
+ }
+
+ // 根据 Excel 里的探测器代码获取数据库 ID
+ DetectorMapDTO ref = refMap.get(vo.getDetectorCode().trim());
+
+ if (ref == null) {
+ return Result.error(
+ "导入中止:系统中不存在探测器代码 [" + vo.getDetectorCode() +
+ "]");
+ }
+ GardsCorrectionFactorEff effEntity = new GardsCorrectionFactorEff();
+ BeanUtils.copyProperties(vo, effEntity);
+ // 填充两个关联 ID
+ effEntity.setDetectorId(ref.getDetectorId());
+ effEntity.setStationId(ref.getStationId());
+ entityList.add(effEntity);
+ }
+ // 4. 批量保存数据到数据库
+ if (!CollectionUtils.isEmpty(entityList)) {
+ entityList.forEach(item -> effService.save(item));
+
+ //effService.saveBatch(entityList);
+ }
+ return Result.OK("文件导入成功!数据行数:" + entityList.size());
+ }
+
+ } catch (Exception e) {
+ return Result.error("文件导入失败:" + e.getMessage());
+ } finally {
+ try {
+ file.getInputStream().close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ return Result.error("文件导入失败!");
+ }
+
+ @AutoLog(value = "获取站点列表")
+
+
+ // 下拉框:站点
+ @GetMapping("/stations")
+ public List getStations() {
+ return effService.getStationOptions();
+ }
+
+ // 根据站点 ID 过滤探测器
+ @AutoLog(value = "获取探测器")
+ @GetMapping("/detectors")
+ public List getDetectors(@RequestParam(value = "stationId",required = false) Long stationId) {
+ if (stationId == null) {
+ return Collections.emptyList();
+ }
+ return effService.getDetectorOptions(stationId);
+ }
+
+
+}
diff --git a/jeecg-module-monitor-info-database/src/main/java/org/jeecg/service/GardsCorrectionFactorDetailService.java b/jeecg-module-monitor-info-database/src/main/java/org/jeecg/service/GardsCorrectionFactorDetailService.java
new file mode 100644
index 0000000..74a1e0f
--- /dev/null
+++ b/jeecg-module-monitor-info-database/src/main/java/org/jeecg/service/GardsCorrectionFactorDetailService.java
@@ -0,0 +1,28 @@
+package org.jeecg.service;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.base.entity.configuration.GardsCorrectionFactor;
+import org.jeecg.modules.base.entity.configuration.GardsCorrectionFactorDetail;
+import org.jeecg.modules.base.vo.GardsCorrectionFactorDetailVO;
+
+import java.util.List;
+import java.util.Map;
+
+public interface GardsCorrectionFactorDetailService extends IService {
+
+ IPage findPage(Integer pageNum, Integer pageSize,
+ String stationCode, String detectorCode, String nuclideName);
+
+ List findList(String stationCode, String detectorCode, String nuclideName);
+
+
+ List