From 03eaf574e069890c1ff581c2212657f729562ff6 Mon Sep 17 00:00:00 2001 From: duwenyuan <15600000461@163.com> Date: Tue, 15 Jul 2025 15:40:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96QCFlagParam?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/modules/entity/vo/Sections.java | 53 ++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/Sections.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/Sections.java index cf5ed71b..3ac27b7b 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/Sections.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/Sections.java @@ -1,11 +1,22 @@ package org.jeecg.modules.entity.vo; import lombok.Data; +import org.jeecg.common.properties.ParameterProperties; +import org.jeecg.modules.base.enums.StationDetailType; +import org.jeecg.modules.entity.vo.QCFlagParmData.QCFlagParam; +import org.jeecg.modules.entity.vo.QCFlagParmData.Rule; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Unmarshaller; +import java.io.File; import java.io.Serializable; import java.util.LinkedList; import java.util.List; +import static org.jeecg.modules.base.enums.StationDetailType.*; + @Data public class Sections implements Serializable { @@ -17,7 +28,17 @@ public class Sections implements Serializable { private List airVolumeSections; - public Sections(){ + //region QC-Flag参数 + private List collectionTimeRules; + + private List acquisitionTimeRules; + + private List xeVolumeRules; + + private List airVolumeRules; + + //endregion + public Sections() { collectionTimeSections = new LinkedList<>(); collectionTimeSections.add(0.0); collectionTimeSections.add(6.0); @@ -43,4 +64,34 @@ public class Sections implements Serializable { airVolumeSections.add(10.0); } + + public Sections(StationDetailType sectionsType,String pathname) { + try { + // 创建JAXB上下文 + JAXBContext context = JAXBContext.newInstance(QCFlagParam.class); + // 创建Unmarshaller + Unmarshaller unmarshaller = context.createUnmarshaller(); + + File file = new File(pathname); + QCFlagParam config = (QCFlagParam) unmarshaller.unmarshal(file); + switch (sectionsType) { + case SAUNA: + collectionTimeRules = config.sauna.getCollectionTime().getRules(); + acquisitionTimeRules = config.sauna.getAcquisitionTime().getRules(); + xeVolumeRules = config.sauna.getXeVolume().getRules(); + airVolumeRules = config.sauna.getAirVolume().getRules(); + break; + case SAUNA2: + collectionTimeRules = config.sauna2.getCollectionTime().getRules(); + acquisitionTimeRules = config.sauna2.getAcquisitionTime().getRules(); + xeVolumeRules = config.sauna2.getXeVolume().getRules(); + airVolumeRules = config.sauna2.getAirVolume().getRules(); + break; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + }