diff --git a/algorithm/algorithm-api/src/main/java/com/njcn/algorithm/pojo/liteflow/LiteFlowFeignClient.java b/algorithm/algorithm-api/src/main/java/com/njcn/algorithm/pojo/liteflow/LiteFlowAlgorithmFeignClient.java similarity index 76% rename from algorithm/algorithm-api/src/main/java/com/njcn/algorithm/pojo/liteflow/LiteFlowFeignClient.java rename to algorithm/algorithm-api/src/main/java/com/njcn/algorithm/pojo/liteflow/LiteFlowAlgorithmFeignClient.java index 6d25c44..035f719 100644 --- a/algorithm/algorithm-api/src/main/java/com/njcn/algorithm/pojo/liteflow/LiteFlowFeignClient.java +++ b/algorithm/algorithm-api/src/main/java/com/njcn/algorithm/pojo/liteflow/LiteFlowAlgorithmFeignClient.java @@ -2,7 +2,7 @@ package com.njcn.algorithm.pojo.liteflow; import com.njcn.algorithm.pojo.bo.BaseParam; -import com.njcn.algorithm.pojo.liteflow.fallback.LiteFlowFeignClientFallbackFactory; +import com.njcn.algorithm.pojo.liteflow.fallback.LiteFlowAlgorithmFeignClientFallbackFactory; import com.njcn.common.pojo.constant.ServerInfo; import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; @@ -13,11 +13,11 @@ import org.springframework.web.bind.annotation.RequestBody; * @author xuyang */ @FeignClient( - value = ServerInfo.DATA_PLATFORM,//对应模块名 - path = "/executor",//对应controller请求类 - fallbackFactory = LiteFlowFeignClientFallbackFactory.class//服务降级处理类 + value = ServerInfo.ALGORITHM_BOOT,//对应模块名 + path = "/algorithmExecutor",//对应controller请求类 + fallbackFactory = LiteFlowAlgorithmFeignClientFallbackFactory.class//服务降级处理类 ) -public interface LiteFlowFeignClient { +public interface LiteFlowAlgorithmFeignClient { @ApiOperation("监测点算法执行链") @PostMapping("/measurementPointExecutor") diff --git a/algorithm/algorithm-api/src/main/java/com/njcn/algorithm/pojo/liteflow/fallback/LiteFlowFeignClientFallbackFactory.java b/algorithm/algorithm-api/src/main/java/com/njcn/algorithm/pojo/liteflow/fallback/LiteFlowAlgorithmFeignClientFallbackFactory.java similarity index 88% rename from algorithm/algorithm-api/src/main/java/com/njcn/algorithm/pojo/liteflow/fallback/LiteFlowFeignClientFallbackFactory.java rename to algorithm/algorithm-api/src/main/java/com/njcn/algorithm/pojo/liteflow/fallback/LiteFlowAlgorithmFeignClientFallbackFactory.java index fb3f5d2..f53f78b 100644 --- a/algorithm/algorithm-api/src/main/java/com/njcn/algorithm/pojo/liteflow/fallback/LiteFlowFeignClientFallbackFactory.java +++ b/algorithm/algorithm-api/src/main/java/com/njcn/algorithm/pojo/liteflow/fallback/LiteFlowAlgorithmFeignClientFallbackFactory.java @@ -1,7 +1,7 @@ package com.njcn.algorithm.pojo.liteflow.fallback; import com.njcn.algorithm.pojo.bo.BaseParam; -import com.njcn.algorithm.pojo.liteflow.LiteFlowFeignClient; +import com.njcn.algorithm.pojo.liteflow.LiteFlowAlgorithmFeignClient; import com.njcn.algorithm.pojo.util.PrepareEnumUtil; import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.exception.BusinessException; @@ -11,9 +11,9 @@ import org.springframework.stereotype.Component; @Slf4j @Component -public class LiteFlowFeignClientFallbackFactory implements FallbackFactory { +public class LiteFlowAlgorithmFeignClientFallbackFactory implements FallbackFactory { @Override - public LiteFlowFeignClient create(Throwable throwable) { + public LiteFlowAlgorithmFeignClient create(Throwable throwable) { Enum exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK; if (throwable.getCause() instanceof BusinessException) { BusinessException businessException = (BusinessException)throwable.getCause(); @@ -21,7 +21,7 @@ public class LiteFlowFeignClientFallbackFactory implements FallbackFactory finalExceptionEnum = exceptionEnum; - return new LiteFlowFeignClient() { + return new LiteFlowAlgorithmFeignClient() { @Override public void measurementPointExecutor(BaseParam baseParam) { log.error("{}异常,降级处理,异常为:{}", "监测点算法执行链: ", throwable.toString()); diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/ExecutionCenter.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/ExecutionCenter.java index 5d764f1..d7fd39a 100644 --- a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/ExecutionCenter.java +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/ExecutionCenter.java @@ -50,7 +50,7 @@ import java.util.stream.Collectors; @Slf4j @Api(tags = "算法执行中心") @RestController -@RequestMapping("/executor") +@RequestMapping("/algorithmExecutor") @RequiredArgsConstructor public class ExecutionCenter extends BaseController { diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataFlickerImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataFlickerImpl.java index 6ad9a75..58ae2f5 100644 --- a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataFlickerImpl.java +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataFlickerImpl.java @@ -147,12 +147,16 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl list = dataFlickerMapper.selectByQueryWrapper(influxQueryWrapper); if (CollUtil.isNotEmpty(list)) { Map> abnormalTime = lineParam.getAbnormalTime(); - if (abnormalTime.containsKey(lineParam.getLineId().get(0))) { - List timeList = abnormalTime.get(lineParam.getLineId().get(0)); - //有异常数据,当前监测点自身的异常数据 - if (CollectionUtil.isNotEmpty(timeList)) { - result.addAll(list.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList())); + if (CollUtil.isNotEmpty(abnormalTime)){ + if (abnormalTime.containsKey(lineParam.getLineId().get(0))) { + List timeList = abnormalTime.get(lineParam.getLineId().get(0)); + //有异常数据,当前监测点自身的异常数据 + if (CollectionUtil.isNotEmpty(timeList)) { + result.addAll(list.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList())); + } } + }else{ + result.addAll(list); } } return result.size(); diff --git a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataVImpl.java b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataVImpl.java index 7673242..5950f30 100644 --- a/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataVImpl.java +++ b/data-processing/data-processing-boot/src/main/java/com/njcn/dataProcess/service/impl/influxdb/InfluxdbDataVImpl.java @@ -185,12 +185,16 @@ public class InfluxdbDataVImpl extends MppServiceImpl list = dataVMapper.selectByQueryWrapper(influxQueryWrapper); if (CollUtil.isNotEmpty(list)) { Map> abnormalTime = lineParam.getAbnormalTime(); - if (abnormalTime.containsKey(lineParam.getLineId().get(0))) { - List timeList = abnormalTime.get(lineParam.getLineId().get(0)); - //有异常数据,当前监测点自身的异常数据 - if (CollectionUtil.isNotEmpty(timeList)) { - result.addAll(list.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList())); + if(CollUtil.isNotEmpty(abnormalTime)){ + if (abnormalTime.containsKey(lineParam.getLineId().get(0))) { + List timeList = abnormalTime.get(lineParam.getLineId().get(0)); + //有异常数据,当前监测点自身的异常数据 + if (CollectionUtil.isNotEmpty(timeList)) { + result.addAll(list.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList())); + } } + }else{ + result.addAll(list); } } return result.size();