From 7b986006dd694a9dbabf8cf6250c92093988b596 Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Thu, 13 Mar 2025 20:38:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=AF=8F=E6=AC=A1=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E7=9B=91=E6=B5=8B=E7=82=B9=E7=9A=84=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../algorithm/serviceimpl/line/DataCleanServiceImpl.java | 5 ++++- .../algorithm/serviceimpl/line/DayDataServiceImpl.java | 5 ++++- .../serviceimpl/line/IDataCrossingServiceImpl.java | 4 +++- .../serviceimpl/line/IDataIntegrityServiceImpl.java | 9 +++++++-- .../serviceimpl/line/IDataOnlineRateServiceImpl.java | 6 +++++- .../algorithm-boot/src/main/resources/bootstrap.yml | 2 ++ 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DataCleanServiceImpl.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DataCleanServiceImpl.java index 1e98e1d..171736a 100644 --- a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DataCleanServiceImpl.java +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DataCleanServiceImpl.java @@ -18,6 +18,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.ListUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -36,7 +37,9 @@ import java.util.stream.Collectors; public class DataCleanServiceImpl implements IDataCleanService { private static final Logger logger = LoggerFactory.getLogger(DataCleanServiceImpl.class); - private final static Integer NUM = 100; + + @Value("${line.num}") + private Integer NUM = 100; @Resource private DataVFeignClient dataVFeignClient; diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DayDataServiceImpl.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DayDataServiceImpl.java index 7d7a571..63dbb48 100644 --- a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DayDataServiceImpl.java +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/DayDataServiceImpl.java @@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.ListUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -31,7 +32,9 @@ import java.util.stream.Collectors; public class DayDataServiceImpl implements IDayDataService { private static final Logger logger = LoggerFactory.getLogger(DayDataServiceImpl.class); - private final static Integer NUM = 100; + + @Value("${line.num}") + private Integer NUM = 100; @Resource private DataVFeignClient dataVFeignClient; @Resource diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataCrossingServiceImpl.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataCrossingServiceImpl.java index e7ea47e..db7d8c6 100644 --- a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataCrossingServiceImpl.java +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataCrossingServiceImpl.java @@ -27,6 +27,7 @@ import org.apache.commons.collections4.ListUtils; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; @@ -50,7 +51,8 @@ import java.util.stream.Collectors; public class IDataCrossingServiceImpl implements IDataCrossingService { private static final Logger logger = LoggerFactory.getLogger(DayDataServiceImpl.class); - private final static Integer NUM = 100; + @Value("${line.num}") + private Integer NUM = 100; @Resource private DataVFeignClient dataVFeignClient; @Resource diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataIntegrityServiceImpl.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataIntegrityServiceImpl.java index b5e9b7f..77b756a 100644 --- a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataIntegrityServiceImpl.java +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataIntegrityServiceImpl.java @@ -16,6 +16,7 @@ import com.njcn.device.biz.pojo.dto.LineDevGetDTO; import com.njcn.influx.pojo.constant.InfluxDBTableConstant; import lombok.RequiredArgsConstructor; import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -33,6 +34,10 @@ import java.util.stream.Collectors; @Service @RequiredArgsConstructor public class IDataIntegrityServiceImpl implements IDataIntegrityService { + + @Value("${line.num}") + private Integer NUM = 100; + @Resource private CommTerminalGeneralClient commTerminalGeneralClient; @Resource @@ -54,7 +59,7 @@ public class IDataIntegrityServiceImpl implements IDataIntegrityService { DatePattern.NORM_DATETIME_PATTERN ); //以尺寸100分片 - List> pendingIds = ListUtils.partition(lineIds, 5); + List> pendingIds = ListUtils.partition(lineIds, NUM); for (List pendingId : pendingIds) { List lineDevGetDTOList = commTerminalGeneralClient.getMonitorDetailList(pendingId).getData(); List countList = dataVFeignClient.getMeasurementCount(pendingId, beginDay, endDay).getData(); @@ -89,7 +94,7 @@ public class IDataIntegrityServiceImpl implements IDataIntegrityService { List devIdList = calculatedParam.getIdList(); List info = new ArrayList<>(); - List> pendingIds = ListUtils.partition(devIdList, 100); + List> pendingIds = ListUtils.partition(devIdList, NUM); for (List pendingId : pendingIds) { lineParam.setLineId(pendingId); List data = dataIntegrityFeignClient.getRawData(lineParam).getData(); diff --git a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataOnlineRateServiceImpl.java b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataOnlineRateServiceImpl.java index 7947172..bbaabb5 100644 --- a/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataOnlineRateServiceImpl.java +++ b/algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/serviceimpl/line/IDataOnlineRateServiceImpl.java @@ -24,6 +24,7 @@ import com.njcn.user.api.DeptFeignClient; import com.njcn.user.pojo.po.Dept; import lombok.RequiredArgsConstructor; import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -38,7 +39,10 @@ import java.util.stream.Collectors; @Service @RequiredArgsConstructor public class IDataOnlineRateServiceImpl implements IDataOnlineRateService { - private final static Integer NUM = 100; + + @Value("${line.num}") + private Integer NUM = 100; + private final Integer online = 1; @Resource private PqsCommunicateFeignClient communicateFeignClient; diff --git a/algorithm/algorithm-boot/src/main/resources/bootstrap.yml b/algorithm/algorithm-boot/src/main/resources/bootstrap.yml index bf50866..6d0bdba 100644 --- a/algorithm/algorithm-boot/src/main/resources/bootstrap.yml +++ b/algorithm/algorithm-boot/src/main/resources/bootstrap.yml @@ -55,6 +55,8 @@ logging: mybatis-plus: #别名扫描 type-aliases-package: com.njcn.harmonic.pojo +line: + num: 100 mqtt: client-id: @artifactId@${random.value} \ No newline at end of file