123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- package com.gyee.power.fitting.common.config;
- import com.gyee.power.fitting.model.anno.AnnotationTool;
- import com.gyee.power.fitting.model.anno.FixedVo;
- import com.gyee.power.fitting.model.custom.PowerPointData;
- import lombok.Data;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.boot.context.properties.ConfigurationProperties;
- import org.springframework.boot.system.ApplicationHome;
- import org.springframework.core.annotation.Order;
- import org.springframework.stereotype.Component;
- import java.io.File;
- import java.util.List;
- import java.util.Map;
- import java.util.stream.Collectors;
- @Data
- @Order(0)
- @Component
- @ConfigurationProperties(prefix = "gyee")
- public class GyeeConfig {
- public File jarF = null;
- {
- ApplicationHome h = new ApplicationHome(getClass());
- jarF = h.getSource();
- //jarF = new File("D:\\java\\sis-background\\power-fitting\\target\\classes");
- }
- /** 数据适配器网址 **/
- private String adapterfdUrl;
- private String adaptergfUrl;
- /** 数据准备保存路径(原始数据) **/
- private String filePathPrepare;
- /** 数据处理保存路径(处理后的数据) **/
- private String filePathProcess;
- /** 数据拟合保存路径(拟合后的数据) **/
- private String filePathFitting;
- /** 配置文件路径 **/
- private String filePathPower;
- /**
- * 数据压缩下载
- **/
- private String filePathDownload;
- /**
- * 功率曲线拟合测点
- **/
- private String points;
- /**
- * 适配器读取数据等间隔时间
- **/
- private Integer interval;
- /**
- * 数据是否离线执行
- **/
- private boolean offLine;
- /**
- * 是否实时计算
- **/
- private boolean realTimeCal;
- //光伏转换效率系数
- private Map<String, Double> gfzhxlxs;
- public List<String> getPoints() {
- return getUniformCodes();
- }
- public String getFilePathPrepare() {
- return jarF.getParentFile().getAbsolutePath() + File.separator + filePathPrepare;
- }
- public void setFilePathPrepare(String filePathPrepare) {
- this.filePathPrepare = filePathPrepare;
- }
- public String getFilePathProcess() {
- return jarF.getParentFile().getAbsolutePath() + File.separator + filePathProcess;
- }
- public void setFilePathProcess(String filePathProcess) {
- this.filePathProcess = filePathProcess;
- }
- public String getFilePathFitting() {
- return jarF.getParentFile().getAbsolutePath() + File.separator + filePathFitting;
- }
- public void setFilePathFitting(String filePathFitting) {
- this.filePathFitting = filePathFitting;
- }
- public String getFilePathDownload() {
- return jarF.getParentFile().getAbsolutePath() + File.separator + filePathDownload;
- }
- public void setFilePathDownload(String filePathDownload) {
- this.filePathDownload = filePathDownload;
- }
- private List<String> getUniformCodes(){
- List<FixedVo> fxList = AnnotationTool.getFixedVoList(PowerPointData.class);
- List<String> codes = fxList.stream().filter(f -> !StringUtils.isEmpty(f.getUniformCode()))
- .map(d -> d.getUniformCode()).collect(Collectors.toList());
- return codes;
- }
- public String getFilePathPower() {
- return jarF.getParentFile().getAbsolutePath() + File.separator + filePathPower;
- }
- public void setFilePathPower(String filePathPower) {
- this.filePathPower = filePathPower;
- }
- public String getGfDataPath() {
- return getFilePathPrepare() + "gf" + File.separator;
- }
- }
|