微调
This commit is contained in:
@@ -26,7 +26,6 @@ import javax.annotation.Resource;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@@ -60,23 +59,22 @@ public class BusinessServiceImpl implements IBusinessService {
|
|||||||
RestTemplateUtil restTemplateUtil = new RestTemplateUtil();
|
RestTemplateUtil restTemplateUtil = new RestTemplateUtil();
|
||||||
TokenResult tokenWithRestTemplate = tokenComponent.getTokenWithRestTemplate();
|
TokenResult tokenWithRestTemplate = tokenComponent.getTokenWithRestTemplate();
|
||||||
if (null == tokenWithRestTemplate) {
|
if (null == tokenWithRestTemplate) {
|
||||||
log.error("token信息没有获取到");
|
log.error("token信息获取失败");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject jsonObject;
|
JSONObject jsonObject;
|
||||||
JSONObject jsonObjectSub;
|
JSONObject jsonObjectSub;
|
||||||
//将发电客户编号按500尺寸分片
|
//将发电用户编号按500尺寸分片
|
||||||
List<List<ExcelData>> partitionList = ListUtils.partition(excelDataList, 500);
|
List<List<ExcelData>> partitionList = ListUtils.partition(excelDataList, 500);
|
||||||
for (List<ExcelData> excelData : partitionList) {
|
for (List<ExcelData> excelData : partitionList) {
|
||||||
Map</*表名*/String, List<Map</*属性名*/String,/*数值*/String>>> typeData = new HashMap<>();
|
Map</*表名*/String, List<Map</*属性名*/String,/*数值*/String>>> typeData = new HashMap<>();
|
||||||
//按批次处理客户编号数据
|
|
||||||
jsonObject = JSONUtil.createObj();
|
jsonObject = JSONUtil.createObj();
|
||||||
jsonObjectSub = JSONUtil.createObj();
|
jsonObjectSub = JSONUtil.createObj();
|
||||||
jsonObject.set("page", 1);
|
jsonObject.set("page", 1);
|
||||||
jsonObject.set("perPage", 10000);
|
jsonObject.set("perPage", 10000);
|
||||||
jsonObject.set("startTime", startTime);
|
jsonObject.set("startTime", startTime);
|
||||||
jsonObject.set("endTime", endTime);
|
jsonObject.set("endTime", endTime);
|
||||||
//处理客户编号
|
//按批次处理用户编号数据
|
||||||
List<String> generationUserIDList = excelData.stream().map(t -> "160".concat(t.getGenerationUserID())).collect(Collectors.toList());
|
List<String> generationUserIDList = excelData.stream().map(t -> "160".concat(t.getGenerationUserID())).collect(Collectors.toList());
|
||||||
jsonObjectSub.set("consNos", generationUserIDList);
|
jsonObjectSub.set("consNos", generationUserIDList);
|
||||||
//1公专变2低压用户3光伏
|
//1公专变2低压用户3光伏
|
||||||
@@ -110,7 +108,7 @@ public class BusinessServiceImpl implements IBusinessService {
|
|||||||
userIdConcatMeasType.addAll(temp);
|
userIdConcatMeasType.addAll(temp);
|
||||||
}
|
}
|
||||||
//处理各个record的数据,因用户下可能有多个测量点,按指标循环,默认采用第一个匹配上的做数据处理
|
//处理各个record的数据,因用户下可能有多个测量点,按指标循环,默认采用第一个匹配上的做数据处理
|
||||||
for (CommonTelemetry commonTelemetry : records) {
|
for (CommonTelemetry commonTelemetry : records) { // 最多循环500*16次
|
||||||
String dataIdentify = commonTelemetry.getConsNo().concat(StrPool.AT).concat(commonTelemetry.getMeasTypeCode());
|
String dataIdentify = commonTelemetry.getConsNo().concat(StrPool.AT).concat(commonTelemetry.getMeasTypeCode());
|
||||||
if (userIdConcatMeasType.contains(dataIdentify)) {
|
if (userIdConcatMeasType.contains(dataIdentify)) {
|
||||||
//首个包含该标识的数据进行处理
|
//首个包含该标识的数据进行处理
|
||||||
|
|||||||
Reference in New Issue
Block a user