已删除16个文件
已修改29个文件
1234 ■■■■ 文件已修改
iailab-cloud/iailab-gateway/src/main/resources/application.yaml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-framework/iailab-common/src/main/java/com/iailab/framework/common/util/string/StrUtils.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/controller/admin/task/BpmTaskController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/BpmTaskEventListener.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/demo/exection/DemoDelegateClassExecutionListener.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/demo/exection/DemoDelegateExpressionExecutionListener.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/demo/exection/DemoSpringExpressionExecutionListener.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/demo/task/DemoDelegateClassTaskListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/demo/task/DemoDelegateExpressionTaskListener.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/demo/task/DemoSpringExpressionTaskListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/service/task/BpmTaskServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/BpmTaskCandidateInvokerTest.java 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/expression/BpmTaskAssignLeaderExpressionTest.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateDeptLeaderStrategyTest.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateDeptMemberStrategyTest.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateExpressionStrategyTest.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateGroupStrategyTest.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidatePostStrategyTest.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateRoleStrategyTest.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateUserStrategyTest.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/service/category/BpmCategoryServiceImplTest.java 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/service/definition/BpmFormServiceTest.java 144 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/service/definition/BpmUserGroupServiceTest.java 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/resources/application-unit-test.yaml 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/resources/logback.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/resources/sql/clean.sql 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-bpm/iailab-module-bpm-biz/src/test/resources/sql/create_tables.sql 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/plan/PlanItemApiImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/PointCollector.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/CalculateHandle.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/CumulateHandle.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/resources/application.yaml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-infra/iailab-module-infra-biz/src/main/resources/application.yaml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/PredictModelHandler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemNormalHandlerImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictModelHandlerImpl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleConstructor.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleDataConstructor.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/controller/admin/auth/AuthController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/convert/auth/AuthConvert.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-system/iailab-module-system-biz/src/main/resources/application.yaml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-cloud/iailab-gateway/src/main/resources/application.yaml
@@ -148,7 +148,7 @@
logging:
  file:
    name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径
    name: @log.path@/iailab-gateway/log/${spring.application.name}.log # 日志文件名,全路径
knife4j:
  # 聚合 Swagger 文档,参考 https://doc.xiaominfo.com/docs/action/springcloud-gateway 文档
iailab-framework/iailab-common/src/main/java/com/iailab/framework/common/util/string/StrUtils.java
@@ -77,4 +77,14 @@
                .collect(Collectors.joining("\n"));
    }
    /**
     * 判断字符串是不是数字
     *
     * @param str
     * @return
     */
    public static boolean isNumeric(String str) {
        return str.matches("-?\\d+(\\.\\d+)?");
    }
}
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/controller/admin/task/BpmTaskController.java
@@ -4,6 +4,7 @@
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.number.NumberUtils;
import com.iailab.framework.datapermission.core.annotation.DataPermission;
import com.iailab.module.bpm.controller.admin.task.vo.task.*;
import com.iailab.module.bpm.convert.task.BpmTaskConvert;
import com.iailab.module.bpm.dal.dataobject.definition.BpmFormDO;
@@ -60,6 +61,7 @@
    @GetMapping("todo-page")
    @Operation(summary = "获取 Todo 待办任务分页")
    @PreAuthorize("@ss.hasPermission('bpm:task:query')")
    @DataPermission(enable = false) // 关闭数据权限,避免只查看自己时,查询不到部门。
    public CommonResult<PageResult<BpmTaskRespVO>> getTaskTodoPage(@Valid BpmTaskPageReqVO pageVO) {
        PageResult<Task> pageResult = taskService.getTaskTodoPage(getLoginUserId(), pageVO);
        if (CollUtil.isEmpty(pageResult.getList())) {
@@ -69,9 +71,11 @@
        // 拼接数据
        Map<String, ProcessInstance> processInstanceMap = processInstanceService.getProcessInstanceMap(
                convertSet(pageResult.getList(), Task::getProcessInstanceId));
        // TODO 此处有bug
        Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
                convertSet(processInstanceMap.values(), instance -> Long.valueOf(instance.getStartUserId())));
        return success(BpmTaskConvert.INSTANCE.buildTodoTaskPage(pageResult, processInstanceMap, userMap));
        PageResult<BpmTaskRespVO> bpmTaskRespVOPageResult = BpmTaskConvert.INSTANCE.buildTodoTaskPage(pageResult, processInstanceMap, userMap);
        return success(bpmTaskRespVOPageResult);
    }
    @GetMapping("done-page")
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/BpmTaskEventListener.java
@@ -4,6 +4,7 @@
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.iailab.framework.common.util.number.NumberUtils;
import com.iailab.framework.datapermission.core.annotation.DataPermission;
import com.iailab.module.bpm.enums.definition.BpmBoundaryEventType;
import com.iailab.module.bpm.framework.flowable.core.enums.BpmnModelConstants;
import com.iailab.module.bpm.framework.flowable.core.util.BpmnModelUtils;
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/demo/exection/DemoDelegateClassExecutionListener.java
@@ -1,8 +1,12 @@
package com.iailab.module.bpm.framework.flowable.core.listener.demo.exection;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.flowable.bpmn.model.FieldExtension;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;
import java.util.List;
/**
 * 类型为 class 的 ExecutionListener 监听器示例
@@ -14,8 +18,15 @@
    @Override
    public void execute(DelegateExecution execution) {
        log.info("[execute][execution({}) 被调用!变量有:{}]", execution.getId(),
        log.info("[execute][execution({}) 执行监听器(类)被调用!变量有:{}]", execution.getId(),
                execution.getCurrentFlowableListener().getFieldExtensions());
        List<FieldExtension> fieldExtensions = execution.getCurrentFlowableListener().getFieldExtensions();
        if(ObjectUtils.isNotEmpty(fieldExtensions)) {
            fieldExtensions.stream().forEach(fieldExtension -> {
                System.out.println(fieldExtension.getFieldName());
                System.out.println(fieldExtension.getExpression());
            });
        }
    }
}
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/demo/exection/DemoDelegateExpressionExecutionListener.java
@@ -1,9 +1,13 @@
package com.iailab.module.bpm.framework.flowable.core.listener.demo.exection;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.flowable.bpmn.model.FieldExtension;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;
import java.util.List;
/**
 * 类型为 delegateExpression 的 ExecutionListener 监听器示例
@@ -16,8 +20,15 @@
    @Override
    public void execute(DelegateExecution execution) {
        log.info("[execute][execution({}) 被调用!变量有:{}]", execution.getId(),
        log.info("[execute][execution({}) 执行监听器(委托表达式被调用)!变量有:{}]", execution.getId(),
                execution.getCurrentFlowableListener().getFieldExtensions());
        List<FieldExtension> fieldExtensions = execution.getCurrentFlowableListener().getFieldExtensions();
        if(ObjectUtils.isNotEmpty(fieldExtensions)) {
            fieldExtensions.stream().forEach(fieldExtension -> {
                System.out.println(fieldExtension.getFieldName());
                System.out.println(fieldExtension.getStringValue());
            });
        }
    }
}
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/demo/exection/DemoSpringExpressionExecutionListener.java
@@ -1,8 +1,12 @@
package com.iailab.module.bpm.framework.flowable.core.listener.demo.exection;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.flowable.bpmn.model.FieldExtension;
import org.flowable.engine.delegate.DelegateExecution;
import org.springframework.stereotype.Component;
import java.util.List;
/**
 * 类型为 expression 的 ExecutionListener 监听器示例
@@ -14,8 +18,15 @@
public class DemoSpringExpressionExecutionListener {
    public void execute(DelegateExecution execution) {
        log.info("[execute][execution({}) 被调用!变量有:{}]", execution.getId(),
        log.info("[execute][execution({}) 执行监听器(spring表达式)被调用!变量有:{}]", execution.getId(),
                execution.getCurrentFlowableListener().getFieldExtensions());
        List<FieldExtension> fieldExtensions = execution.getCurrentFlowableListener().getFieldExtensions();
        if(ObjectUtils.isNotEmpty(fieldExtensions)) {
            fieldExtensions.stream().forEach(fieldExtension -> {
                System.out.println(fieldExtension.getFieldName());
                System.out.println(fieldExtension.getExpression());
            });
        }
    }
}
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/demo/task/DemoDelegateClassTaskListener.java
@@ -14,7 +14,7 @@
    @Override
    public void notify(DelegateTask delegateTask) {
        log.info("[execute][task({}) 被调用]", delegateTask.getId());
        log.info("[execute][task({}) 任务监听器(类)被调用]", delegateTask.getId());
    }
}
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/demo/task/DemoDelegateExpressionTaskListener.java
@@ -5,6 +5,8 @@
import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
 * 类型为 delegateExpression 的 TaskListener 监听器示例
 *
@@ -16,7 +18,9 @@
    @Override
    public void notify(DelegateTask delegateTask) {
        log.info("[execute][task({}) 被调用]", delegateTask.getId());
        log.info("[execute][task({}) 任务监听器(委托表达式)被调用]", delegateTask.getId());
        Map<String, Object> variables = delegateTask.getVariables();
        System.out.println(variables.toString());;
    }
}
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/framework/flowable/core/listener/demo/task/DemoSpringExpressionTaskListener.java
@@ -14,7 +14,7 @@
public class DemoSpringExpressionTaskListener {
    public void notify(DelegateTask delegateTask) {
        log.info("[execute][task({}) 被调用]", delegateTask.getId());
        log.info("[execute][task({}) 任务监听器(spring表达式)被调用]", delegateTask.getId());
    }
}
iailab-module-bpm/iailab-module-bpm-biz/src/main/java/com/iailab/module/bpm/service/task/BpmTaskServiceImpl.java
@@ -9,6 +9,7 @@
import com.iailab.framework.common.util.number.NumberUtils;
import com.iailab.framework.common.util.object.ObjectUtils;
import com.iailab.framework.common.util.object.PageUtils;
import com.iailab.framework.datapermission.core.annotation.DataPermission;
import com.iailab.framework.web.core.util.WebFrameworkUtils;
import com.iailab.module.bpm.controller.admin.task.vo.task.*;
import com.iailab.module.bpm.convert.task.BpmTaskConvert;
@@ -1145,7 +1146,6 @@
                        }
                    }
                }
                AdminUserRespDTO startUser = adminUserApi.getUser(Long.valueOf(processInstance.getStartUserId())).getCheckedData();
                messageService.sendMessageWhenTaskAssigned(BpmTaskConvert.INSTANCE.convert(processInstance, startUser, task));
            }
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/BpmTaskCandidateInvokerTest.java
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/expression/BpmTaskAssignLeaderExpressionTest.java
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateDeptLeaderStrategyTest.java
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateDeptMemberStrategyTest.java
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateExpressionStrategyTest.java
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateGroupStrategyTest.java
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidatePostStrategyTest.java
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateRoleStrategyTest.java
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/framework/flowable/core/candidate/strategy/BpmTaskCandidateUserStrategyTest.java
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/service/category/BpmCategoryServiceImplTest.java
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/service/definition/BpmFormServiceTest.java
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/java/com/iailab/module/bpm/service/definition/BpmUserGroupServiceTest.java
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/resources/application-unit-test.yaml
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/resources/logback.xml
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/resources/sql/clean.sql
文件已删除
iailab-module-bpm/iailab-module-bpm-biz/src/test/resources/sql/create_tables.sql
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/plan/PlanItemApiImpl.java
@@ -70,6 +70,9 @@
    @Override
    public List<ApiPlanItemDTO> getInfoByIds(Set<String> planIds) {
        if (CollectionUtils.isEmpty(planIds)) {
            return new ArrayList<>();
        }
        List<PlanItemEntity> plans = planItemService.getInfoByIds(planIds);
        return ConvertUtils.sourceToTarget(plans,ApiPlanItemDTO.class);
    }
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/PointCollector.java
@@ -3,6 +3,7 @@
import com.iailab.module.data.common.enums.DataSourceType;
import com.iailab.module.data.common.utils.R;
import com.iailab.module.data.channel.kio.collector.KingIOCollector;
import com.iailab.module.data.influxdb.pojo.InfluxPointValueBoolPOJO;
import com.iailab.module.data.influxdb.pojo.InfluxPointValueDigPOJO;
import com.iailab.module.data.influxdb.pojo.InfluxPointValueSimPOJO;
import com.iailab.module.data.point.collection.handler.CalculateHandle;
@@ -23,11 +24,14 @@
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
 * @author PanZhibao
@@ -68,6 +72,13 @@
    @Autowired
    private DaPointCollectStatusService daPointCollectStatusService;
    @Autowired
    private RedisTemplate<String, Object> redisTemplate;
    public static final String PV = "point_value:";
    public static final long offset = 60 * 3L;
    /**
     * 采集
     *
@@ -95,9 +106,22 @@
            List<DaPointDTO> pointCumulateList = daPointService.getCumulatePoint(minfreq);
            pointValues.addAll(cumulateHandle.handle(collectTime, pointCumulateList));
            log.info("存入数据库");
            log.info("存入时序库");
            influxDBService.asyncWritePointValues(pointValues);
            log.info("存入缓存");
            for (InfluxPointValuePOJO pointValue : pointValues) {
                if (pointValue instanceof InfluxPointValueSimPOJO) {
                    InfluxPointValueSimPOJO simPOJO = (InfluxPointValueSimPOJO) pointValue;
                    redisTemplate.opsForValue().set(PV + simPOJO.getPoint(), simPOJO.getValue().doubleValue(), offset, TimeUnit.SECONDS);
                } else if (pointValue instanceof InfluxPointValueDigPOJO) {
                    InfluxPointValueDigPOJO digPOJO = (InfluxPointValueDigPOJO) pointValue;
                    redisTemplate.opsForValue().set(PV + digPOJO.getPoint(), digPOJO.getValue().intValue(), offset, TimeUnit.SECONDS);
                } else if (pointValue instanceof InfluxPointValueBoolPOJO) {
                    InfluxPointValueBoolPOJO boolPOJO = (InfluxPointValueBoolPOJO) pointValue;
                    redisTemplate.opsForValue().set(PV + boolPOJO.getPoint(), boolPOJO.getValue().booleanValue(), offset, TimeUnit.SECONDS);
                }
            }
            log.info("更新采集状态");
            daPointCollectStatusService.recordStatusList(pointValues, collectTime);
            log.info("采集完成");
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/CalculateHandle.java
@@ -1,8 +1,11 @@
package com.iailab.module.data.point.collection.handler;
import com.iailab.framework.common.util.string.StrUtils;
import com.iailab.module.data.common.enums.CommonConstant;
import com.iailab.module.data.common.enums.DataTypeEnum;
import com.iailab.module.data.common.enums.JsErrorCode;
import com.iailab.module.data.common.utils.JavaScriptHandler;
import com.iailab.module.data.point.collection.PointCollector;
import com.iailab.module.data.point.collection.utils.GenInfluxPointValueUtils;
import com.iailab.module.data.point.dto.DaPointDTO;
import com.iailab.module.data.point.service.DaPointService;
@@ -10,6 +13,9 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
@@ -38,6 +44,9 @@
    @Resource
    private JavaScriptHandler javaScriptHandler;
    @Autowired
    private RedisTemplate<String, Object> redisTemplate;
    public static final String regex = "[+\\-\\*/()\\&\\|\\>\\<]";
@@ -86,7 +95,7 @@
        String result = javaScriptHandler.eval(expression);
        log.info("result=" + result);
        if (result == null) {
            return null;
            return CommonConstant.BAD_VALUE;
        } else if (result.contains(JsErrorCode.Infinity.name()) ||
                result.contains(JsErrorCode.NaN.name())) {
            log.info("计算异常,使用默认值");
@@ -95,7 +104,7 @@
            if (DataTypeEnum.INT.getCode().equals(dto.getDataType())) {
                return new BigDecimal(result).intValue();
            } else if (DataTypeEnum.FLOAT.getCode().equals(dto.getDataType())) {
                return new BigDecimal(result).setScale(10, BigDecimal.ROUND_UP).doubleValue();
                return new BigDecimal(result).setScale(4, BigDecimal.ROUND_UP).doubleValue();
            } else if (DataTypeEnum.BOOLEAN.getCode().equals(dto.getDataType())) {
                return Boolean.parseBoolean(result);
            }
@@ -110,12 +119,19 @@
            return data;
        }
        pointMathList.forEach(item -> {
            data.put(item.getPointNo(), singleCompute(item));
            Object value = CommonConstant.BAD_VALUE;
            if (redisTemplate.hasKey(PointCollector.PV + item.getPointNo())) {
                value = redisTemplate.opsForValue().get(PointCollector.PV + item.getPointNo());
            } else {
                value = singleCompute(item);
            }
            data.put(item.getPointNo(), value);
        });
        return data;
    }
    private Object singleCompute(DaPointDTO dto) {
        String result = CommonConstant.BAD_VALUE.toString();
        Map<String, Object> dataMap = new HashMap<>();
        String expression = dto.getExpression();
        String[] arr = expression.split(regex);
@@ -128,26 +144,32 @@
            pointNos.add(s);
            dataMap.putAll(measureHandle.getCurrent(pointNos));
            dataMap.putAll(constantHandle.getCurrent(pointNos));
            expression = expression.replace(s, dataMap.get(s).toString());
            String valueStr =  dataMap.get(s).toString();
            if (StrUtils.isNumeric(valueStr) && new BigDecimal(valueStr).compareTo(CommonConstant.BAD_VALUE) == 0) {
                log.info("BAD_VALUE:" + s);
            }
            if (StrUtils.isNumeric(valueStr) && new BigDecimal(valueStr).compareTo(BigDecimal.ZERO) < 0) {
                valueStr = "(" + valueStr + ")";
            }
            expression = expression.replace(s, valueStr);
        }
        expression = expression.replace("&", "&&");
        expression = expression.replace("|", "||");
        expression = expression.replace("False", "false");
        expression = expression.replace("True", "true");
        log.info("PointNo=" + dto.getPointNo() + ";expression=" + expression);
        String result = javaScriptHandler.eval(expression);
        result = javaScriptHandler.eval(expression);
        log.info("result=" + result);
        if (result == null) {
            return null;
        } else if (result.contains(JsErrorCode.Infinity.name()) ||
                result.contains(JsErrorCode.NaN.name())) {
            return CommonConstant.BAD_VALUE;
        } else if (result.contains(JsErrorCode.Infinity.name()) || result.contains(JsErrorCode.NaN.name())) {
            log.info("计算异常,使用默认值");
            return dto.getDefaultValue() == null ? BigDecimal.ZERO : dto.getDefaultValue();
        } else {
            if (DataTypeEnum.INT.getCode().equals(dto.getDataType())) {
                return new BigDecimal(result).intValue();
            } else if (DataTypeEnum.FLOAT.getCode().equals(dto.getDataType())) {
                return new BigDecimal(result).setScale(10, BigDecimal.ROUND_UP).doubleValue();
                return new BigDecimal(result).setScale(2, BigDecimal.ROUND_UP).doubleValue();
            } else if (DataTypeEnum.BOOLEAN.getCode().equals(dto.getDataType())) {
                return Boolean.parseBoolean(result);
            }
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/CumulateHandle.java
@@ -7,12 +7,14 @@
import com.iailab.module.data.common.enums.CommonConstant;
import com.iailab.module.data.enums.DataPointFreqEnum;
import com.iailab.module.data.influxdb.pojo.InfluxPointValuePOJO;
import com.iailab.module.data.point.collection.PointCollector;
import com.iailab.module.data.point.collection.utils.GenInfluxPointValueUtils;
import com.iailab.module.data.point.dto.DaPointDTO;
import com.iailab.module.data.point.service.DaPointService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
@@ -37,6 +39,9 @@
    @Autowired
    @Lazy
    private DataPointApi dataPointApi;
    @Autowired
    private RedisTemplate<String, Object> redisTemplate;
    public List<InfluxPointValuePOJO> handle(Date collectTime, List<DaPointDTO> dtos) {
        List<InfluxPointValuePOJO> result = new ArrayList<>();
@@ -73,7 +78,13 @@
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.MILLISECOND, 0);
        pointMathList.forEach(item -> {
            data.put(item.getPointNo(), singleCompute(item, calendar.getTime()));
            Object value = CommonConstant.BAD_VALUE;
            if (redisTemplate.hasKey(PointCollector.PV + item.getPointNo())) {
                value = redisTemplate.opsForValue().get(PointCollector.PV + item.getPointNo());
            } else {
                value = singleCompute(item, calendar.getTime());
            }
            data.put(item.getPointNo(), value);
        });
        return data;
    }
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java
@@ -10,6 +10,7 @@
import com.iailab.module.data.channel.kio.collector.KingIOCollector;
import com.iailab.module.data.channel.modbus.collector.ModBusCollector;
import com.iailab.module.data.channel.opcua.collector.OpcUaCollector;
import com.iailab.module.data.point.collection.PointCollector;
import com.iailab.module.data.point.collection.utils.GenInfluxPointValueUtils;
import com.iailab.module.data.point.common.PointDataTypeEnum;
import com.iailab.module.data.point.dto.DaPointDTO;
@@ -19,11 +20,13 @@
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
 * 测量点处理
@@ -57,6 +60,9 @@
    @Resource
    private DaPointService daPointService;
    @Autowired
    private RedisTemplate<String, Object> redisTemplate;
    public List<InfluxPointValuePOJO> handle(Date collectTime, List<DaPointDTO> dtos, Map<String, Object> dataMap) {
        log.info("测量点处理开始");
@@ -177,8 +183,11 @@
        pointMeasureList.forEach(
                item -> {
                    try {
                        boolean hasKey = redisTemplate.hasKey(PointCollector.PV + item.getPointNo());
                        Object value = CommonConstant.BAD_VALUE;
                        if (DataSourceType.OPCUA.getCode().equals(item.getSourceType())) {
                        if (hasKey) {
                            value = redisTemplate.opsForValue().get(PointCollector.PV + item.getPointNo());
                        } else if (DataSourceType.OPCUA.getCode().equals(item.getSourceType())) {
                            value = opcUaCollector.getTagValue(item.getSourceId(), item.getTagNo());
                        } else if (DataSourceType.ModBus.getCode().equals(item.getSourceType())) {
                            value = modBusCollector.getTagValue(item.getSourceId(), item.getTagNo());
@@ -189,9 +198,7 @@
                        } else {
                            log.info("没有匹配的TagNo=" + item.getTagNo());
                        }
                        log.info("没有匹配的TagNo=" + item.getTagNo());
                        log.info("valueStr=" + value.toString());
                        log.info("DataType=" + item.getDataType());
                        log.info("TagNo=" + item.getTagNo() + ",value=" + value.toString());
                        if (!PointDataTypeEnum.BOOLEAN.getCode().equals(item.getDataType())) {
                            BigDecimal decValue =  new BigDecimal(value.toString());
                            if (PointDataTypeEnum.FLOAT.getCode().equals(item.getDataType())) {
@@ -203,6 +210,11 @@
                        } else {
                            data.put(item.getPointNo(), value);
                        }
                        if (!hasKey) {
                            // 存入缓存
                            toRedis(value, item);
                        }
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
@@ -211,4 +223,17 @@
        );
        return data;
    }
    public void toRedis(Object value, DaPointDTO point) {
        if (PointDataTypeEnum.FLOAT.getCode().equals(point.getDataType())) {
            redisTemplate.opsForValue().set(PointCollector.PV + point.getPointNo(), new BigDecimal(value.toString()).intValue(),
                    PointCollector.offset, TimeUnit.SECONDS);
        } else if (PointDataTypeEnum.INT.getCode().equals(point.getDataType())) {
            redisTemplate.opsForValue().set(PointCollector.PV + point.getPointNo(), new BigDecimal(value.toString()).doubleValue(),
                    PointCollector.offset, TimeUnit.SECONDS);
        } else if (PointDataTypeEnum.BOOLEAN.getCode().equals(point.getDataType())) {
            redisTemplate.opsForValue().set(PointCollector.PV + point.getPointNo(), Boolean.parseBoolean(value.toString()),
                    PointCollector.offset, TimeUnit.SECONDS);
        }
    }
}
iailab-module-data/iailab-module-data-biz/src/main/resources/application.yaml
@@ -61,7 +61,7 @@
logging:
  file:
    name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径
    name: @log.path@/iailab-data/log/${spring.application.name}.log # 日志文件名,全路径
  level:
    org:
      springframework:
iailab-module-infra/iailab-module-infra-biz/src/main/resources/application.yaml
@@ -11,7 +11,7 @@
      username: @nacos.username@
      password: @nacos.password@
      discovery: # 【配置中心】配置项
        ip: @deploy.server@
#        ip: @deploy.server@
        namespace: @profiles.active@
        group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
        metadata:
@@ -58,7 +58,7 @@
logging:
  file:
    name: D:/DLUT/IailabPlat/webapp/infra/logs/${spring.application.name}.log # 日志文件名,全路径
    name: @log.path@/iailab-infra/log/${spring.application.name}.log # 日志文件名,全路径
--- #################### 接口文档配置 ####################
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/PredictModelHandler.java
@@ -22,5 +22,5 @@
     * @return
     * @throws ModelInvokeException
     */
    PredictResultVO predictByModel(Date predictTime, MmPredictModelEntity predictModel,String itemName) throws ModelInvokeException;
    PredictResultVO predictByModel(Date predictTime, MmPredictModelEntity predictModel,String itemName,String itemNo) throws ModelInvokeException;
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemNormalHandlerImpl.java
@@ -49,7 +49,7 @@
                throw new ModelInvokeException(MessageFormat.format("{0},itemId={1}",
                        ModelInvokeException.errorGetModelEntity, itemId));
            }
            predictResult = predictModelHandler.predictByModel(predictTime, predictModel,predictItemDto.getItemName());
            predictResult = predictModelHandler.predictByModel(predictTime, predictModel,predictItemDto.getItemName(),predictItemDto.getItemNo());
            predictResult.setPredictId(itemId);
        } catch (ModelResultErrorException ex) {
            throw ex;
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictModelHandlerImpl.java
@@ -57,7 +57,7 @@
     * @throws ModelInvokeException
     */
    @Override
    public synchronized PredictResultVO predictByModel(Date predictTime, MmPredictModelEntity predictModel,String itemName) throws ModelInvokeException {
    public synchronized PredictResultVO predictByModel(Date predictTime, MmPredictModelEntity predictModel,String itemName,String itemNo) throws ModelInvokeException {
        PredictResultVO result = new PredictResultVO();
        if (predictModel == null) {
            throw new ModelInvokeException("modelEntity is null");
@@ -89,7 +89,7 @@
            param2Values[portLength] = newModelBean.getDataMap().get("models");
            param2Values[portLength + 1] = settings;
            log.info("####################### 预测模型 "+ "【itemId:" + predictModel.getItemid() + ",itemName" + itemName + "】 ##########################");
            log.info("####################### 预测模型 "+ "【itemId:" + predictModel.getItemid() + ",itemName:" + itemName + ",itemNo:" + itemNo + "】 ##########################");
//            JSONObject jsonObjNewModelBean = new JSONObject();
//            jsonObjNewModelBean.put("newModelBean", newModelBean);
//            log.info(String.valueOf(jsonObjNewModelBean));
@@ -105,10 +105,9 @@
            }
            modelResult = (HashMap<String, Object>) modelResult.get(CommonConstant.MDK_RESULT);
            //打印结果
            log.info("预测模型计算完成:modelId=" + modelId + ",modelName" + predictModel.getMethodname());
            JSONObject jsonObjResult = new JSONObject();
            jsonObjResult.put("result", modelResult);
            log.info(String.valueOf(jsonObjResult));
            log.info("预测模型计算完成:modelId=" + modelId + ",modelName=" + predictModel.getMethodname() + ",modelResult=" + String.valueOf(jsonObjResult));
            List<MmItemOutputEntity> itemOutputList = mmItemOutputService.getByItemid(predictModel.getItemid());
            Map<MmItemOutputEntity, double[]> predictMatrixs = new HashMap<>();
@@ -147,8 +146,8 @@
            ex.printStackTrace();
            throw ex;
        } catch (Exception ex) {
            log.error("调用发生异常,异常信息为:{1}", ex);
//            ex.printStackTrace();
//            log.error("调用发生异常,异常信息为:{0}", ex.getMessage());
            ex.printStackTrace();
            throw new ModelInvokeException(ex.getMessage());
        }
        return result;
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleConstructor.java
@@ -32,6 +32,7 @@
            SampleDataConstructor sampleDataConstructor = sampleFactory.createSampelData(typeA);
            return sampleDataConstructor.prepareSampleData(sampleInfo);
        } catch (Exception e) {
            e.printStackTrace();
            throw new ModelInvokeException(MessageFormat.format("{0},Name:{1}",
                    ModelInvokeException.errorGetModelArithParam, itemName));
        }
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleDataConstructor.java
@@ -6,6 +6,7 @@
import com.iailab.module.data.api.point.dto.ApiPointDTO;
import com.iailab.module.data.enums.DataPointFreqEnum;
import com.iailab.module.data.enums.TimeGranularitySecEnum;
import com.iailab.module.model.mcs.pre.enums.PredGranularityEnum;
import com.iailab.module.model.mdk.common.enums.ModelParamType;
import com.iailab.module.model.mdk.sample.dto.SampleData;
import com.iailab.module.model.mdk.sample.dto.SampleInfo;
@@ -63,23 +64,9 @@
            case NORMALITEM:
            case MERGEITEM:
                // 预测值
                Calendar calendar = Calendar.getInstance();
                calendar.setTime(startTime);
                calendar.set(Calendar.HOUR_OF_DAY, 0);
                calendar.set(Calendar.MINUTE, 0);
                calendar.set(Calendar.SECOND, 0);
                calendar.add(Calendar.DAY_OF_YEAR, 1);
                startTime = calendar.getTime();
                start = startTime.getTime();
                calendar.setTime(endTime);
                calendar.set(Calendar.HOUR_OF_DAY, 0);
                calendar.set(Calendar.MINUTE, 0);
                calendar.set(Calendar.SECOND, 0);
                endTime = calendar.getTime();
                end = endTime.getTime();
                oneMin = 60 * 1000L;
                oneMin = PredGranularityEnum.MIN1.getCode() * 1000L;
                start = start - (start % oneMin) + oneMin;
                end = end - (end % oneMin) + oneMin;
                mins = ((end - start) / oneMin);
                break;
            case DATAPOINT:
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java
@@ -100,7 +100,7 @@
                break;
            case NORMALITEM:
            case MERGEITEM:
                dateTime = calendar.getTime();
                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), 60);
                break;
            case IND:
                dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), 60);
iailab-module-model/iailab-module-model-biz/src/main/resources/application.yml
@@ -58,7 +58,7 @@
logging:
  file:
    name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径
    name: @log.path@/iailab-model/log/${spring.application.name}.log # 日志文件名,全路径
  level:
    org:
      springframework:
iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/controller/admin/auth/AuthController.java
@@ -253,7 +253,7 @@
                    menu.setParentId(parentMenu.getId());
                    tempChildren.add(parentMenu);
                } else if(menu.getType().equals(MenuTypeEnum.DIR.getType())) {
                    // 为应用菜单二级目录前增加“/”
                    // 为应用菜单二级目录前增加“/” (不处理外链菜单path)
                    if(!menu.getPath().contains("http:") && !menu.getPath().contains("https:")) {
                        menu.setPath("/" + menu.getPath());
                    }
iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/convert/auth/AuthConvert.java
@@ -208,7 +208,10 @@
        List<AuthPermissionInfoRespVO.MenuVO> menuVOS = filterList(treeNodeMap.values(), node -> id.equals(node.getParentId()));
        if(type == 0) {
            menuVOS.stream().forEach(menuVO -> {
                menuVO.setPath((parentPath + "/" + menuVO.getPath()).replace("//", "/"));
                // 不处理外链菜单path
                if(!menuVO.getPath().contains("http:") && !menuVO.getPath().contains("https:")) {
                    menuVO.setPath((parentPath + "/" + menuVO.getPath()).replace("//", "/"));
                }
            });
        }
        return menuVOS;
iailab-module-system/iailab-module-system-biz/src/main/resources/application.yaml
@@ -58,7 +58,7 @@
logging:
  file:
    name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径
    name: @log.path@/iailab-system/log/${spring.application.name}.log # 日志文件名,全路径
--- #################### 接口文档配置 ####################
@@ -225,4 +225,4 @@
    begin-code: 9999 # 这里配置 9999 的原因是,测试方便。
    end-code: 9999 # 这里配置 9999 的原因是,测试方便。
debug: false
debug: true
pom.xml
@@ -122,7 +122,7 @@
                <nacos.metadata.version>1.0.0</nacos.metadata.version>
                <log.path>D:\DLUT\iailab-plat</log.path>
                <logstash.address>127.0.0.1:4560</logstash.address>
                <deploy.server>192.168.56.1</deploy.server>
                <deploy.server>172.16.216.132</deploy.server>
            </properties>
            <activation>
                <!-- 默认环境 -->
@@ -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>D:\iailab</log.path>
                <logstash.address>127.0.0.1:4560</logstash.address>
                <deploy.server>10.88.4.131</deploy.server>
            </properties>