6 天以前 | dengzedong | |
6 天以前 | houzhongjian | |
6 天以前 | dengzedong | |
6 天以前 | 潘志宝 | |
6 天以前 | dengzedong | |
6 天以前 | 潘志宝 | |
6 天以前 | 潘志宝 | |
6 天以前 | dongyukun | |
6 天以前 | dongyukun | |
6 天以前 | 潘志宝 |
iailab-cloud/iailab-gateway/src/main/resources/application.yaml
@@ -142,6 +142,7 @@ server: port: 48080 servlet: context-path: / session: timeout: 120s iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql
@@ -129,7 +129,7 @@ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='KIO测点表'; CREATE TABLE t_da_point( `id` VARCHAR(255) NOT NULL COMMENT 'ID' , `id` VARCHAR(36) NOT NULL COMMENT 'ID' , `point_no` VARCHAR(36) COMMENT '测点编码' , `point_name` VARCHAR(36) COMMENT '测点名称' , `point_type` VARCHAR(10) COMMENT '测点类型' , @@ -169,7 +169,7 @@ CREATE TABLE t_da_math_point( `id` VARCHAR(36) NOT NULL COMMENT 'ID' , `point_id` VARCHAR(36) COMMENT '测点ID' , `expression` VARCHAR(500) COMMENT '计算公式' , `expression` VARCHAR(2000) COMMENT '计算公式' , PRIMARY KEY (id) USING BTREE, UNIQUE KEY `uk_point_id` (`point_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '计算点表'; iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java
@@ -138,16 +138,15 @@ @ApiAccessLog(operateType = EXPORT) public void exportPointList(@Validated DaPointPageReqVO exportReqVO, HttpServletResponse response) throws IOException { exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); List<DaPointExcelVO> dataList = new ArrayList<>(); List<DaPointDTO> measurePointList = daPointService.getMeasurePoint(exportReqVO); List<DaPointExcelVO> dataList = ConvertUtils.sourceToTarget(daPointService.getList(exportReqVO), DaPointExcelVO.class); /*List<DaPointDTO> measurePointList = daPointService.getMeasurePoint(exportReqVO); dataList.addAll(ConvertUtils.sourceToTarget(measurePointList, DaPointExcelVO.class)); List<DaPointDTO> mathPointList = daPointService.getMathPoint(exportReqVO); dataList.addAll(ConvertUtils.sourceToTarget(mathPointList, DaPointExcelVO.class)); List<DaPointDTO> constantPointList = daPointService.getConstantPoint(exportReqVO); dataList.addAll(ConvertUtils.sourceToTarget(constantPointList, DaPointExcelVO.class)); List<DaPointDTO> cumulatePointList = daPointService.getCumulatePoint(exportReqVO); dataList.addAll(ConvertUtils.sourceToTarget(cumulatePointList, DaPointExcelVO.class)); dataList.addAll(ConvertUtils.sourceToTarget(cumulatePointList, DaPointExcelVO.class));*/ ExcelUtils.write(response, "测点列表.xls", "测点列表", DaPointExcelVO.class, dataList); } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointCollectStatusService.java
@@ -15,6 +15,8 @@ */ public interface DaPointCollectStatusService extends BaseService<DaPointCollectStatusEntity> { void add(String pointNo); @Async void recordStatus(String pointNo, String collectValue, Date collectTime); iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointCollectStatusServiceImpl.java
@@ -26,6 +26,15 @@ public class DaPointCollectStatusServiceImpl extends BaseServiceImpl<DaPointCollectStatusDao, DaPointCollectStatusEntity> implements DaPointCollectStatusService { @Override public void add(String pointNo) { DaPointCollectStatusEntity entity = new DaPointCollectStatusEntity(); entity.setId(UUID.randomUUID().toString()); entity.setPointNo(pointNo); baseDao.insert(entity); } @Override public void recordStatus(String pointNo, String collectValue, Date collectTime) { QueryWrapper<DaPointCollectStatusEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("point_no", pointNo); @@ -47,6 +56,7 @@ } @Override public void recordStatusList(List<InfluxPointValuePOJO> pointValues, Date collectTime) { List<String> listGood = new ArrayList<>(); List<String> listBad = new ArrayList<>(); iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java
@@ -64,6 +64,9 @@ @Resource private ChannelSourceService channelSourceService; @Resource private DaPointCollectStatusService daPointCollectStatusService; private static Map<String, DaPointDTO> pointIdMap = new ConcurrentHashMap<>(); private static Map<String, DaPointDTO> pointNoMap = new ConcurrentHashMap<>(); @@ -182,6 +185,7 @@ daPointEntity.setCreateTime(new Date()); daPointDao.insert(daPointEntity); daPointCollectStatusService.add(daPointEntity.getPointNo()); // 清空缓存 clearCache(); } @@ -417,6 +421,7 @@ } daPointDao.insert(daPointEntity); daPointCollectStatusService.add(daPointEntity.getPointNo()); respVO.getCreatePointnames().add(importPoint.getPointName()); return; } iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/vo/DaPointExcelVO.java
@@ -96,4 +96,8 @@ @Schema(description = "除数") @ExcelProperty("除数") private Integer divisor; @Schema(description = "采集质量") @ExcelProperty("采集质量") private String collectQuality; } iailab-module-data/iailab-module-data-biz/src/main/resources/logback-spring.xml
@@ -1,86 +1,76 @@ <?xml version="1.0" encoding="UTF-8"?> <configuration scan="true"> <property name="LOG_TEMP" value="./logs"/> <configuration> <!-- 引用 Spring Boot 的 logback 基础配置 --> <include resource="org/springframework/boot/logging/logback/defaults.xml" /> <!-- <include resource="org/springframework/boot/logging/logback/base.xml" /> --> <logger name="org.springframework.web" level="INFO"/> <logger name="org.springboot.sample" level="TRACE" /> <!-- 变量 iailab.info.base-package,基础业务包 --> <springProperty scope="context" name="iailab.info.base-package" source="iailab.info.base-package"/> <!-- 格式化输出:%d 表示日期,%X{tid} SkWalking 链路追踪编号,%thread 表示线程名,%-5level:级别从左显示 5 个字符宽度,%msg:日志消息,%n是换行符 --> <property name="PATTERN_DEFAULT" value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | %highlight(${LOG_LEVEL_PATTERN:-%5p} ${PID:- }) | %boldYellow(%thread [%tid]) %boldGreen(%-40.40logger{39}) | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/> <!-- 开发、测试环境 --> <springProfile name="dev,test,prod"> <logger name="org.springframework.web" level="INFO"/> <logger name="org.springboot.sample" level="INFO" /> <logger name="com.iailab" level="DEBUG" /> </springProfile> <!-- 生产环境 --> <!--<springProfile name="prod">--> <!--<logger name="org.springframework.web" level="ERROR"/>--> <!--<logger name="org.springboot.sample" level="ERROR" />--> <!--<logger name="io.renren" level="ERROR" />--> <!--</springProfile>--> <!-- 日志文件存放路径 --> <property name="log_home" value="./logs" /> <!-- 日志输出格式 --> <!--生产用--> <property name="log.pattern" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] | [%thread][%-5level] | [%logger{20}.%method,line : %line] %msg%n" /> <!--本地测试使用--> <!--<property name="log.pattern" value="[%boldGreen(%d{yyyy-MM-dd HH:mm:ss.SSS})] | [%highlight(%thread][%-5level)] | [%boldYellow(%logger{20}.%method,%line)] %msg%n" />--> <!-- 日志输出格式【控制台】 --> <!--<property name="log.pattern" value="%date{yyyy-MM-dd HH:mm:ss} | [ line: %line ] | %boldGreen(%thread) | %highlight(%-5level) | %boldYellow(%logger).%method | %msg%n"/>--> <!-- 控制台输出 --> <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <!--<pattern>${logPatternConsoleLog}</pattern>--> <pattern>${log.pattern}</pattern> <!-- 控制台 Appender --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout"> <pattern>${PATTERN_DEFAULT}</pattern> </layout> </encoder> </appender> <logger name="m-shop-mybatis-sql" level="debug"></logger> <!-- debug级别设置 --> <appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender"> <prudent>true</prudent> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <!--过滤 DEBUG--> <level>DEBUG</level> <!--匹配到就禁止--> <!--<onMatch>ACCEPT</onMatch>--> <!--没有匹配到就允许--> <!--<onMismatch>DENY</onMismatch>--> </filter> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!--<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">--> <!--日志文件输出的文件名--> <!--<FileNamePattern>${log_home}/log-info.%d{yyyy-MM-dd}.%i.log</FileNamePattern>--> <FileNamePattern>${log_home}/log-debug.%d{yyyy-MM-dd}.log</FileNamePattern> <!--<maxFileSize>100MB</maxFileSize>--> <!-- 日志最大的历史 7天 --> <maxHistory>7</maxHistory> <totalSizeCap>2GB</totalSizeCap> <cleanHistoryOnStart>true</cleanHistoryOnStart> <!-- 文件 Appender --> <!-- 参考 Spring Boot 的 file-appender.xml 编写 --> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout"> <pattern>${PATTERN_DEFAULT}</pattern> </layout> </encoder> <!-- 日志文件名 --> <file>${LOG_FILE}</file> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <!-- 滚动后的日志文件名 --> <fileNamePattern>${LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN:-${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz}</fileNamePattern> <!-- 启动服务时,是否清理历史日志,一般不建议清理 --> <cleanHistoryOnStart>${LOGBACK_ROLLINGPOLICY_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart> <!-- 日志文件,到达多少容量,进行滚动 --> <maxFileSize>${LOGBACK_ROLLINGPOLICY_MAX_FILE_SIZE:-10MB}</maxFileSize> <!-- 日志文件的总大小,0 表示不限制 --> <totalSizeCap>${LOGBACK_ROLLINGPOLICY_TOTAL_SIZE_CAP:-0}</totalSizeCap> <!-- 日志文件的保留天数 --> <maxHistory>${LOGBACK_ROLLINGPOLICY_MAX_HISTORY:-30}</maxHistory> </rollingPolicy> <!--<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">--> <!--<!– 单文件最大50MB –>--> <!--<maxFileSize>50MB</maxFileSize>--> <!--</triggeringPolicy>--> <encoder> <pattern>${log.pattern}</pattern> </appender> <!-- 异步写入日志,提升性能 --> <appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender"> <!-- 不丢失日志。默认的,如果队列的 80% 已满,则会丢弃 TRACT、DEBUG、INFO 级别的日志 --> <discardingThreshold>0</discardingThreshold> <!-- 更改默认的队列的深度,该值会影响性能。默认值为 256 --> <queueSize>256</queueSize> <appender-ref ref="FILE"/> </appender> <!-- SkyWalking GRPC 日志收集,实现日志中心。注意:SkyWalking 8.4.0 版本开始支持 --> <appender name="GRPC" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender"> <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout"> <pattern>${PATTERN_DEFAULT}</pattern> </layout> </encoder> </appender> <!-- 系统模块日志级别控制 --> <!--<logger name="com.btrh" level="info" />--> <!-- Spring日志级别控制 --> <!--<logger name="org.springframework" level="info" />--> <!--系统操作日志--> <root level="INFO"> <appender-ref ref="console" /> <appender-ref ref="file_debug" /> </root> <!-- 本地环境 --> <springProfile name="local"> <root level="INFO"> <appender-ref ref="STDOUT"/> <appender-ref ref="GRPC"/> <!-- 本地环境下,如果不想接入 SkyWalking 日志服务,可以注释掉本行 --> <appender-ref ref="ASYNC"/> <!-- 本地环境下,如果不想打印日志,可以注释掉本行 --> </root> </springProfile> <!-- 其它环境 --> <springProfile name="dev,test,stage,prod,default"> <root level="INFO"> <appender-ref ref="STDOUT"/> <appender-ref ref="ASYNC"/> <appender-ref ref="GRPC"/> </root> </springProfile> </configuration> iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/point/DaPointDao.xml
@@ -98,9 +98,13 @@ t3.source_name, t2.tag_no, t2.dimension, t2.value_type t2.value_type, t6.collect_value, t6.collect_quality, t6.collect_time from t_da_point t1 left join t_da_measure_point t2 on t2.point_id = t1.id left join t_da_point_collect_status t6 on t6.point_no = t1.point_no left join ( select id source_id,server_name source_name from t_channel_opcua_device @@ -136,6 +140,9 @@ <if test="isEnable != null "> and t1.is_enable = #{isEnable} </if> <if test="collectQuality != null and collectQuality != ''"> and t6.collect_quality = #{collectQuality} </if> </where> order by t1.create_time desc, t1.point_no desc </select> iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
@@ -134,7 +134,7 @@ Date predictTime = reqVO.getPredictTime(); if (predictTime == null) { MmItemOutputEntity output = mmItemOutputService.getOutPutById(reqVO.getOutIds().get(0)); ItemVO predictItem = mmPredictItemService.getItemById(output.getItemid()); ItemVO predictItem = mmPredictItemService.getItemByIdFromCache(output.getItemid()); if (predictItem.getLastTime() != null) { predictTime = predictItem.getLastTime(); } else { @@ -235,7 +235,7 @@ @Override public PreDataItemChartRespVO getPreDataItemChart(PreDataItemChartReqVO reqVO) { PreDataItemChartRespVO result = new PreDataItemChartRespVO(); ItemVO predictItem = mmPredictItemService.getItemById(reqVO.getItemId()); ItemVO predictItem = mmPredictItemService.getItemByIdFromCache(reqVO.getItemId()); if (predictItem == null) { return result; } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/enums/OutResultType.java
@@ -12,7 +12,8 @@ @AllArgsConstructor public enum OutResultType { D1(1, "一维数组"), D2(2, "二维数组"); D2(2, "二维数组"), D(3, "二维数组"); private Integer code; private String desc; iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemResultService.java
@@ -1,5 +1,6 @@ package com.iailab.module.model.mcs.pre.service; import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; import com.iailab.module.model.mdk.vo.DataValueVO; import java.util.Date; @@ -17,4 +18,6 @@ List<DataValueVO> getPredictValue(String outputid, Date startTime, Date endTime); List<Object[]> getData(String outputid, Date startTime, Date endTime, String timeFormat); void savePredictValue(Map<MmItemOutputEntity, Double> predictDoubleValues, Date predictTime); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictItemService.java
@@ -8,7 +8,6 @@ import com.iailab.module.model.mdk.vo.ItemVO; import com.iailab.module.model.mdk.vo.MergeItemVO; import java.util.Date; import java.util.List; import java.util.Map; @@ -28,6 +27,7 @@ ItemVO getItemByItemNo(String itemNo); ItemVO getItemByIdFromCache(String itemId); ItemVO getItemById(String itemId); ItemVO getItemByOutPutId(String outPutId); iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultServiceImpl.java
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.iailab.framework.common.util.date.DateUtils; import com.iailab.module.model.mcs.pre.dao.MmItemResultDao; import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; import com.iailab.module.model.mcs.pre.entity.MmItemResultEntity; import com.iailab.module.model.mcs.pre.entity.MmItemResultJsonEntity; import com.iailab.module.model.mcs.pre.service.MmItemResultService; @@ -138,4 +139,19 @@ }); return result; } @Override public void savePredictValue(Map<MmItemOutputEntity, Double> predictDoubleValues, Date predictTime) { for (Map.Entry<MmItemOutputEntity, Double> entry : predictDoubleValues.entrySet()) { MmItemResultJsonEntity resultJson = new MmItemResultJsonEntity(); resultJson.setId(UUID.randomUUID().toString()); resultJson.setOutputid(entry.getKey().getId()); resultJson.setPredicttime(predictTime); resultJson.setCumulant(String.valueOf(entry.getValue())); Map<String, Object> map4 = new HashMap(2); map4.put("TABLENAME", "T_MM_ITEM_RESULT_JSON"); map4.put("entity", resultJson); mmItemResultDao.savePredictJsonValue(map4); } } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelArithSettingsServiceImpl.java
@@ -56,6 +56,6 @@ @Override public void updatePyFile(String pyModule, String fileName) { baseMapper.updatePyFile(pyModule + "." + fileName.substring(0,fileName.lastIndexOf("_")),pyModule + "." + fileName); baseMapper.updatePyFile(pyModule + "." + fileName.substring(0,fileName.lastIndexOf("_")+1),pyModule + "." + fileName); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java
@@ -258,7 +258,7 @@ } @Override public ItemVO getItemById(String itemId) { public ItemVO getItemByIdFromCache(String itemId) { if (StringUtils.isBlank(itemId)) { return null; } @@ -275,6 +275,17 @@ } @Override public ItemVO getItemById(String itemId) { Map<String, Object> params = new HashMap<>(1); params.put("ITEMID", itemId); List<ItemVO> list = mmPredictItemDao.getItem(params); if (CollectionUtils.isEmpty(list)) { return null; } return list.get(0); } @Override public ItemVO getItemByOutPutId(String outPutId) { if (StringUtils.isBlank(outPutId)) { return null; @@ -284,7 +295,7 @@ return null; } String itemId = outPutById.getItemid(); return getItemById(itemId); return getItemByIdFromCache(itemId); } @Override iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelSettingServiceImpl.java
@@ -56,6 +56,6 @@ @Override public void updatePyFile(String pyModule, String fileName) { baseDao.updatePyFile(pyModule + "." + fileName.substring(0,fileName.lastIndexOf("_")),pyModule + "." + fileName); baseDao.updatePyFile(pyModule + "." + fileName.substring(0,fileName.lastIndexOf("_")+1),pyModule + "." + fileName); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/factory/ItemEntityFactory.java
@@ -77,7 +77,7 @@ * @return */ public ItemVO getItemById(String itemId) { ItemVO ItemVO = mmPredictItemService.getItemById(itemId); ItemVO ItemVO = mmPredictItemService.getItemByIdFromCache(itemId); if (!ItemVOHashMap.containsKey(itemId)) { if (ItemVO != null) { ItemVOHashMap.put(itemId, ItemVO); iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/PredictResultHandler.java
@@ -91,6 +91,10 @@ public void savePredictResult(PredictResultVO predictResult) { Map<String, List<DataValueVO>> resultMap = convertToPredictData(predictResult); mmItemResultService.savePredictValue(resultMap, predictResult.getLt(), "n", predictResult.getPredictTime()); // 存double类型输出 if (!CollectionUtils.isEmpty(predictResult.getPredictDoubleValues())) { mmItemResultService.savePredictValue(predictResult.getPredictDoubleValues(), predictResult.getPredictTime()); } } public List<DataValueVO> getPredictValueByItemNo(String itemNo, Date start, Date end) { iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemNormalHandlerImpl.java
@@ -40,7 +40,6 @@ public PredictResultVO predict(Date predictTime, ItemVO predictItemDto) throws ItemInvokeException { PredictResultVO predictResult = new PredictResultVO(); String itemId = predictItemDto.getId(); predictResult.setPredictId(itemId); try { MmPredictModelEntity predictModel = mmPredictModelService.getActiveModelByItemId(itemId); if (predictModel == null) { @@ -48,6 +47,7 @@ ModelInvokeException.errorGetModelEntity, itemId)); } predictResult = predictModelHandler.predictByModel(predictTime, predictModel); predictResult.setPredictId(itemId); } catch (Exception ex) { throw new ItemInvokeException(MessageFormat.format("{0},itemId={1}", ItemInvokeException.errorItemFailed, itemId)); iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictModelHandlerImpl.java
@@ -86,13 +86,13 @@ param2Values[portLength] = newModelBean.getDataMap().get("models"); param2Values[portLength + 1] = settings; log.info("#######################预测模型 " + predictModel.getItemid() + " ##########################"); JSONObject jsonObjNewModelBean = new JSONObject(); jsonObjNewModelBean.put("newModelBean", newModelBean); log.info(String.valueOf(jsonObjNewModelBean)); JSONObject jsonObjParam2Values = new JSONObject(); jsonObjParam2Values.put("param2Values", param2Values); log.info(String.valueOf(jsonObjParam2Values)); log.info("####################### 预测模型 "+ "【itemId:" + predictModel.getItemid() + ",modelName" + predictModel.getMethodname() + "】 ##########################"); // JSONObject jsonObjNewModelBean = new JSONObject(); // jsonObjNewModelBean.put("newModelBean", newModelBean); // log.info(String.valueOf(jsonObjNewModelBean)); // JSONObject jsonObjParam2Values = new JSONObject(); // jsonObjParam2Values.put("param2Values", param2Values); // log.info(String.valueOf(jsonObjParam2Values)); //IAILMDK.run HashMap<String, Object> modelResult = DllUtils.run(newModelBean, param2Values, predictModel.getMpkprojectid()); @@ -102,13 +102,14 @@ } modelResult = (HashMap<String, Object>) modelResult.get(CommonConstant.MDK_RESULT); //打印结果 log.info("预测模型计算完成:modelId=" + modelId + modelResult); log.info("预测模型计算完成:modelId=" + modelId + ",modelName" + predictModel.getMethodname()); JSONObject jsonObjResult = new JSONObject(); jsonObjResult.put("result", modelResult); log.info(String.valueOf(jsonObjResult)); List<MmItemOutputEntity> itemOutputList = mmItemOutputService.getByItemid(predictModel.getItemid()); Map<MmItemOutputEntity, double[]> predictMatrixs = new HashMap<>(itemOutputList.size()); Map<MmItemOutputEntity, double[]> predictMatrixs = new HashMap<>(); Map<MmItemOutputEntity, Double> predictDoubleValues = new HashMap<>(); for (MmItemOutputEntity output : itemOutputList) { if (!modelResult.containsKey(output.getResultstr())) { continue; @@ -127,11 +128,16 @@ } predictMatrixs.put(output, tempColumn); break; case D: Double temp3 = (Double) modelResult.get(output.getResultstr()); predictDoubleValues.put(output, temp3); break; default: break; } } result.setPredictMatrixs(predictMatrixs); result.setPredictDoubleValues(predictDoubleValues); result.setModelResult(modelResult); result.setPredictTime(predictTime); } catch (Exception ex) { iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleInfoConstructor.java
@@ -105,7 +105,7 @@ */ @Override protected Integer getSampleCycle(String modelId) { return mmPredictItemService.getItemById(mmPredictModelService.getInfoFromCatch(modelId).getItemid()).getGranularity(); return mmPredictItemService.getItemByIdFromCache(mmPredictModelService.getInfoFromCatch(modelId).getItemid()).getGranularity(); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java
@@ -179,7 +179,7 @@ granularity = mmPredictItemService.getItemByOutPutId(columnItem.getParamId()).getGranularity(); break; case MERGEITEM: granularity = mmPredictItemService.getItemById(columnItem.getParamId()).getGranularity(); granularity = mmPredictItemService.getItemByIdFromCache(columnItem.getParamId()).getGranularity(); break; case IND: ApiIndItemDTO indItemDTO = indItemApi.getInfoById(columnItem.getParamId()); iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/vo/PredictResultVO.java
@@ -36,6 +36,7 @@ * 统一预测入口的预测类型(循环调用、手动调用) Map<MmItemOutputEntity,double[]> */ private Map<MmItemOutputEntity, double[]> predictMatrixs; private Map<MmItemOutputEntity, Double> predictDoubleValues; /** * 时间间隔 (当前预测时间 与 上一次预测时间 相差的分钟数;系统计算得出) iailab-module-model/iailab-module-model-biz/src/main/resources/logback-spring.xml
@@ -1,86 +1,76 @@ <?xml version="1.0" encoding="UTF-8"?> <configuration scan="true"> <property name="LOG_TEMP" value="./logs"/> <configuration> <!-- 引用 Spring Boot 的 logback 基础配置 --> <include resource="org/springframework/boot/logging/logback/defaults.xml" /> <!-- <include resource="org/springframework/boot/logging/logback/base.xml" /> --> <logger name="org.springframework.web" level="INFO"/> <logger name="org.springboot.sample" level="TRACE" /> <!-- 变量 iailab.info.base-package,基础业务包 --> <springProperty scope="context" name="iailab.info.base-package" source="iailab.info.base-package"/> <!-- 格式化输出:%d 表示日期,%X{tid} SkWalking 链路追踪编号,%thread 表示线程名,%-5level:级别从左显示 5 个字符宽度,%msg:日志消息,%n是换行符 --> <property name="PATTERN_DEFAULT" value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | %highlight(${LOG_LEVEL_PATTERN:-%5p} ${PID:- }) | %boldYellow(%thread [%tid]) %boldGreen(%-40.40logger{39}) | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/> <!-- 开发、测试环境 --> <springProfile name="dev,test,prod"> <logger name="org.springframework.web" level="INFO"/> <logger name="org.springboot.sample" level="INFO" /> <logger name="com.iailab" level="DEBUG" /> <!-- 控制台 Appender --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout"> <pattern>${PATTERN_DEFAULT}</pattern> </layout> </encoder> </appender> <!-- 文件 Appender --> <!-- 参考 Spring Boot 的 file-appender.xml 编写 --> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout"> <pattern>${PATTERN_DEFAULT}</pattern> </layout> </encoder> <!-- 日志文件名 --> <file>${LOG_FILE}</file> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <!-- 滚动后的日志文件名 --> <fileNamePattern>${LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN:-${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz}</fileNamePattern> <!-- 启动服务时,是否清理历史日志,一般不建议清理 --> <cleanHistoryOnStart>${LOGBACK_ROLLINGPOLICY_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart> <!-- 日志文件,到达多少容量,进行滚动 --> <maxFileSize>${LOGBACK_ROLLINGPOLICY_MAX_FILE_SIZE:-10MB}</maxFileSize> <!-- 日志文件的总大小,0 表示不限制 --> <totalSizeCap>${LOGBACK_ROLLINGPOLICY_TOTAL_SIZE_CAP:-0}</totalSizeCap> <!-- 日志文件的保留天数 --> <maxHistory>${LOGBACK_ROLLINGPOLICY_MAX_HISTORY:-30}</maxHistory> </rollingPolicy> </appender> <!-- 异步写入日志,提升性能 --> <appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender"> <!-- 不丢失日志。默认的,如果队列的 80% 已满,则会丢弃 TRACT、DEBUG、INFO 级别的日志 --> <discardingThreshold>0</discardingThreshold> <!-- 更改默认的队列的深度,该值会影响性能。默认值为 256 --> <queueSize>256</queueSize> <appender-ref ref="FILE"/> </appender> <!-- SkyWalking GRPC 日志收集,实现日志中心。注意:SkyWalking 8.4.0 版本开始支持 --> <appender name="GRPC" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender"> <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout"> <pattern>${PATTERN_DEFAULT}</pattern> </layout> </encoder> </appender> <!-- 本地环境 --> <springProfile name="local"> <root level="INFO"> <appender-ref ref="STDOUT"/> <appender-ref ref="GRPC"/> <!-- 本地环境下,如果不想接入 SkyWalking 日志服务,可以注释掉本行 --> <appender-ref ref="ASYNC"/> <!-- 本地环境下,如果不想打印日志,可以注释掉本行 --> </root> </springProfile> <!-- 其它环境 --> <springProfile name="dev,test,stage,prod,default"> <root level="INFO"> <appender-ref ref="STDOUT"/> <appender-ref ref="ASYNC"/> <appender-ref ref="GRPC"/> </root> </springProfile> <!-- 生产环境 --> <!--<springProfile name="prod">--> <!--<logger name="org.springframework.web" level="ERROR"/>--> <!--<logger name="org.springboot.sample" level="ERROR" />--> <!--<logger name="io.renren" level="ERROR" />--> <!--</springProfile>--> <!-- 日志文件存放路径 --> <property name="log_home" value="./logs" /> <!-- 日志输出格式 --> <!--生产用--> <property name="log.pattern" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] | [%thread][%-5level] | [%logger{20}.%method,line : %line] %msg%n" /> <!--本地测试使用--> <!--<property name="log.pattern" value="[%boldGreen(%d{yyyy-MM-dd HH:mm:ss.SSS})] | [%highlight(%thread][%-5level)] | [%boldYellow(%logger{20}.%method,%line)] %msg%n" />--> <!-- 日志输出格式【控制台】 --> <!--<property name="log.pattern" value="%date{yyyy-MM-dd HH:mm:ss} | [ line: %line ] | %boldGreen(%thread) | %highlight(%-5level) | %boldYellow(%logger).%method | %msg%n"/>--> <!-- 控制台输出 --> <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <!--<pattern>${logPatternConsoleLog}</pattern>--> <pattern>${log.pattern}</pattern> </encoder> </appender> <logger name="m-shop-mybatis-sql" level="debug"></logger> <!-- debug级别设置 --> <appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender"> <prudent>true</prudent> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <!--过滤 DEBUG--> <level>DEBUG</level> <!--匹配到就禁止--> <!--<onMatch>ACCEPT</onMatch>--> <!--没有匹配到就允许--> <!--<onMismatch>DENY</onMismatch>--> </filter> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!--<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">--> <!--日志文件输出的文件名--> <!--<FileNamePattern>${log_home}/log-info.%d{yyyy-MM-dd}.%i.log</FileNamePattern>--> <FileNamePattern>${log_home}/log-debug.%d{yyyy-MM-dd}.log</FileNamePattern> <!--<maxFileSize>100MB</maxFileSize>--> <!-- 日志最大的历史 7天 --> <maxHistory>7</maxHistory> <totalSizeCap>2GB</totalSizeCap> <cleanHistoryOnStart>true</cleanHistoryOnStart> </rollingPolicy> <!--<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">--> <!--<!– 单文件最大50MB –>--> <!--<maxFileSize>50MB</maxFileSize>--> <!--</triggeringPolicy>--> <encoder> <pattern>${log.pattern}</pattern> </encoder> </appender> <!-- 系统模块日志级别控制 --> <!--<logger name="com.btrh" level="info" />--> <!-- Spring日志级别控制 --> <!--<logger name="org.springframework" level="info" />--> <!--系统操作日志--> <root level="INFO"> <appender-ref ref="console" /> <appender-ref ref="file_debug" /> </root> </configuration> </configuration> iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/user/AdminUserApi.java
@@ -1,6 +1,7 @@ package com.iailab.module.system.api.user; import cn.hutool.core.convert.Convert; import com.fhs.core.trans.anno.AutoTrans; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.util.collection.CollectionUtils; import com.iailab.module.system.api.user.dto.AdminUserRespDTO; @@ -14,12 +15,13 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import static com.iailab.module.system.api.user.AdminUserApi.PREFIX; import java.util.*; @FeignClient(name = ApiConstants.NAME) @Tag(name = "RPC 服务 - 管理员用户") //@AutoTrans(namespace = PREFIX, fields = {"nickname"}) // TODO @iailab:需要 easy-trans 做个 bugfix @AutoTrans(namespace = PREFIX, fields = {"nickname"}) // TODO @iailab:需要 easy-trans 做个 bugfix public interface AdminUserApi extends AutoTransable<AdminUserRespDTO> { String PREFIX = ApiConstants.PREFIX + "/user"; iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/controller/admin/auth/AuthController.java
@@ -136,7 +136,7 @@ Set<Long> menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId)); List<MenuDO> menuList = menuService.getMenuList(menuIds); menuList = menuService.filterDisableMenus(menuList); menuList = menuService.filterMenus(menuList, "system"); // menuList = menuService.filterMenus(menuList, "system"); // 2. 拼接结果返回 return success(AuthConvert.INSTANCE.convert(user, roles, menuList)); iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/framework/sms/core/client/impl/AliyunSmsClientTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/framework/sms/core/client/impl/TencentSmsClientTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/auth/AdminAuthServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/dept/DeptServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/dept/PostServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/dict/DictDataServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/dict/DictTypeServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/logger/LoginLogServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/logger/OperateLogServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/mail/MailAccountServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/mail/MailLogServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/mail/MailSendServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/mail/MailTemplateServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/notice/NoticeServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/notify/NotifyMessageServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/notify/NotifySendServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/notify/NotifyTemplateServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/oauth2/OAuth2ApproveServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/oauth2/OAuth2ClientServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/oauth2/OAuth2CodeServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/oauth2/OAuth2GrantServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/oauth2/OAuth2TokenServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/permission/MenuServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/permission/PermissionServiceTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/permission/RoleServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/sms/SmsChannelServiceTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/sms/SmsCodeServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/sms/SmsLogServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/sms/SmsSendServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/sms/SmsTemplateServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/social/SocialClientServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/social/SocialUserServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/tenant/TenantPackageServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/tenant/TenantServiceImplTest.java
文件已删除 iailab-module-system/iailab-module-system-biz/src/test/java/com/iailab/module/system/service/user/AdminUserServiceImplTest.java
文件已删除