潘志宝
2024-12-25 874dd8d939b4ae61efbb799855c9ddf328722972
Merge branch 'master' of http://dlindusit.com:53929/r/iailab-plat

# Conflicts:
# pom.xml
已修改9个文件
59 ■■■■ 文件已修改
iailab-module-data/iailab-module-data-biz/src/main/resources/application.yaml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/enums/OutResultType.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemResultJsonService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultJsonServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/resources/logback-spring.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/resources/application.yaml
@@ -61,7 +61,7 @@
logging:
  file:
    name: @log.path@/iailab-data/log/${spring.application.name}.log # 日志文件名,全路径
    name: @log.path@/log/${spring.application.name}.log # 日志文件名,全路径
  level:
    org:
      springframework:
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
@@ -336,7 +336,11 @@
        dataView.setRangeL(rangeL);
        dataView.setLimitH(limitH);
        dataView.setLimitL(limitL);
        dataView.setRealData(getHisData(outPut.getPointid(), startTime, endTime, timeFormat));
        if (StringUtils.isNotBlank(outPut.getPointid())) {
            dataView.setRealData(getHisData(outPut.getPointid(), startTime, endTime, timeFormat));
        } else {
            dataView.setRealData(new ArrayList<>());
        }
        dataView.setCurData(mmItemResultJsonService.getData(outPut.getId(), predictTime, timeFormat));
        switch (lineType) {
            case TN:
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/enums/OutResultType.java
@@ -13,7 +13,7 @@
public enum OutResultType {
    D1(1, "一维数组"),
    D2(2, "二维数组"),
    D(3, "二维数组");
    D(3, "double");
    private Integer code;
    private String desc;
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemResultJsonService.java
@@ -14,4 +14,6 @@
public interface MmItemResultJsonService extends BaseService<MmItemResultJsonEntity> {
    List<Object[]> getData(String outputId, Date predictTime, String timeFormat);
    String getDoubleData(String outputId, Date predictTime);
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultJsonServiceImpl.java
@@ -48,4 +48,13 @@
        });
        return result;
    }
    @Override
    public String getDoubleData(String outputId, Date predictTime) {
        QueryWrapper<MmItemResultJsonEntity> wrapper = new QueryWrapper<>();
        wrapper.eq("outputid", outputId)
                .eq("predicttime", predictTime);
        MmItemResultJsonEntity mmItemResultJsonEntity = baseDao.selectOne(wrapper);
        return null == mmItemResultJsonEntity ? null : mmItemResultJsonEntity.getCumulant();
    }
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleDataConstructor.java
@@ -8,8 +8,10 @@
import com.iailab.module.data.api.point.dto.ApiPointValueQueryDTO;
import com.iailab.module.data.common.ApiDataQueryDTO;
import com.iailab.module.data.common.ApiDataValueDTO;
import com.iailab.module.model.common.enums.OutResultType;
import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity;
import com.iailab.module.model.mcs.pre.service.MmItemOutputService;
import com.iailab.module.model.mcs.pre.service.MmItemResultJsonService;
import com.iailab.module.model.mcs.pre.service.MmItemResultService;
import com.iailab.module.model.mcs.pre.service.MmItemTypeService;
import com.iailab.module.model.mdk.common.enums.ModelParamType;
@@ -19,6 +21,7 @@
import com.iailab.module.model.mdk.sample.dto.SampleInfo;
import com.iailab.module.model.mdk.vo.DataValueVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -45,6 +48,9 @@
    @Autowired
    private MmItemResultService mmItemResultService;
    @Autowired
    private MmItemResultJsonService mmItemResultJsonService;
    @Autowired
    private MmItemTypeService mmItemTypeService;
@@ -141,8 +147,24 @@
                break;
            case NORMALITEM:
            case MERGEITEM:
//                MmItemOutputEntity outPut = mmItemOutputService.getOutPutById(columnItem.getParamId());
                List<DataValueVO> predictValue = mmItemResultService.getPredictValue(columnItem.getParamId(), columnItem.getStartTime(), columnItem.getEndTime());
                MmItemOutputEntity outPut = mmItemOutputService.getOutPutById(columnItem.getParamId());
                OutResultType outResultType = OutResultType.getEumByCode(outPut.getResultType());
                List<DataValueVO> predictValue = new ArrayList<>();
                // double类型特殊处理
                if (outResultType.equals(OutResultType.D)) {
                    // columnItem.getStartTime()就是预测时间
                    String doubleData = mmItemResultJsonService.getDoubleData(outPut.getId(), columnItem.getStartTime());
                    if (StringUtils.isNotBlank(doubleData)) {
                        DataValueVO dataValueVO = new DataValueVO();
                        dataValueVO.setDataTime(columnItem.getStartTime());
                        dataValueVO.setDataValue(Double.valueOf(doubleData));
                        predictValue.add(dataValueVO);
                    }
                } else {
                    predictValue = mmItemResultService.getPredictValue(outPut.getId(), columnItem.getStartTime(), columnItem.getEndTime());
                }
                if (CollectionUtils.isEmpty(predictValue)) {
                    break;
                }
iailab-module-model/iailab-module-model-biz/src/main/resources/application.yml
@@ -58,7 +58,7 @@
logging:
  file:
    name: @log.path@/iailab-model/log/${spring.application.name}.log # 日志文件名,全路径
    name: @log.path@/log/${spring.application.name}.log # 日志文件名,全路径
  level:
    org:
      springframework:
iailab-module-model/iailab-module-model-biz/src/main/resources/logback-spring.xml
@@ -31,11 +31,11 @@
            <!-- 启动服务时,是否清理历史日志,一般不建议清理 -->
            <cleanHistoryOnStart>${LOGBACK_ROLLINGPOLICY_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart>
            <!-- 日志文件,到达多少容量,进行滚动 -->
            <maxFileSize>${LOGBACK_ROLLINGPOLICY_MAX_FILE_SIZE:-10MB}</maxFileSize>
            <maxFileSize>${LOGBACK_ROLLINGPOLICY_MAX_FILE_SIZE:-100MB}</maxFileSize>
            <!-- 日志文件的总大小,0 表示不限制 -->
            <totalSizeCap>${LOGBACK_ROLLINGPOLICY_TOTAL_SIZE_CAP:-0}</totalSizeCap>
            <!-- 日志文件的保留天数 -->
            <maxHistory>${LOGBACK_ROLLINGPOLICY_MAX_HISTORY:-30}</maxHistory>
            <maxHistory>${LOGBACK_ROLLINGPOLICY_MAX_HISTORY:-7}</maxHistory>
        </rollingPolicy>
    </appender>
    <!-- 异步写入日志,提升性能 -->
pom.xml
@@ -120,7 +120,7 @@
                <nacos.username>nacos</nacos.username>
                <nacos.password>nacos</nacos.password>
                <nacos.metadata.version>1.0.0</nacos.metadata.version>
                <log.path>D:\DLUT\iailab-plat</log.path>
                <log.path>D:/DLUT/iailab-plat</log.path>
                <logstash.address>127.0.0.1:4560</logstash.address>
                <deploy.server>127.0.0.1</deploy.server>
            </properties>
@@ -140,7 +140,7 @@
                <nacos.username>nacos</nacos.username>
                <nacos.password>nacos</nacos.password>
                <nacos.metadata.version>1.0.0</nacos.metadata.version>
                <log.path>/home/iailab</log.path>
                <log.path>.</log.path>
                <logstash.address>127.0.0.1:4560</logstash.address>
                <deploy.server>172.16.59.105</deploy.server>
            </properties>
@@ -156,7 +156,7 @@
                <nacos.username>nacos</nacos.username>
                <nacos.password>nacos</nacos.password>
                <nacos.metadata.version>1.0.0</nacos.metadata.version>
                <log.path>D:\iailab\logs</log.path>
                <log.path>.</log.path>
                <logstash.address>127.0.0.1:4560</logstash.address>
                <deploy.server>10.88.4.131</deploy.server>
            </properties>