增加每次批量监测点的数量

This commit is contained in:
wr
2025-03-13 20:38:25 +08:00
parent 127ad2e563
commit 7b986006dd
6 changed files with 25 additions and 6 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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<List<String>> pendingIds = ListUtils.partition(lineIds, 5);
List<List<String>> pendingIds = ListUtils.partition(lineIds, NUM);
for (List<String> pendingId : pendingIds) {
List<LineDevGetDTO> lineDevGetDTOList = commTerminalGeneralClient.getMonitorDetailList(pendingId).getData();
List<MeasurementCountDTO> countList = dataVFeignClient.getMeasurementCount(pendingId, beginDay, endDay).getData();
@@ -89,7 +94,7 @@ public class IDataIntegrityServiceImpl implements IDataIntegrityService {
List<String> devIdList = calculatedParam.getIdList();
List<DataIntegrityDto> info = new ArrayList<>();
List<List<String>> pendingIds = ListUtils.partition(devIdList, 100);
List<List<String>> pendingIds = ListUtils.partition(devIdList, NUM);
for (List<String> pendingId : pendingIds) {
lineParam.setLineId(pendingId);
List<DataIntegrityDto> data = dataIntegrityFeignClient.getRawData(lineParam).getData();

View File

@@ -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;

View File

@@ -55,6 +55,8 @@ logging:
mybatis-plus:
#别名扫描
type-aliases-package: com.njcn.harmonic.pojo
line:
num: 100
mqtt:
client-id: @artifactId@${random.value}