Commit f727eeb5 authored by tianbo's avatar tianbo

fix(jg):删除无用方法

parent 8c174122
...@@ -388,7 +388,7 @@ public class DataHandlerController extends BaseController { ...@@ -388,7 +388,7 @@ public class DataHandlerController extends BaseController {
@PostMapping(value = "/handleDataQualityScore") @PostMapping(value = "/handleDataQualityScore")
@ApiOperation(httpMethod = "POST", value = "修复es中未正常生成数据等级的数据", notes = "修复es中未正常生成数据等级的数据") @ApiOperation(httpMethod = "POST", value = "修复es中未正常生成数据等级的数据", notes = "修复es中未正常生成数据等级的数据")
public ResponseModel<String> handleDataQualityScore() { public ResponseModel<String> handleDataQualityScore() {
return ResponseHelper.buildResponse(dataHandlerService.handleDataQualityScore2()); return ResponseHelper.buildResponse(dataHandlerService.handleDataQualityScore());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -2324,38 +2324,8 @@ public class DataHandlerServiceImpl { ...@@ -2324,38 +2324,8 @@ public class DataHandlerServiceImpl {
return weatherTankFieldPatcher.patchBatchData(); return weatherTankFieldPatcher.patchBatchData();
} }
public String handleDataQualityScore() {
log.info("处理数据质量评分开始");
AtomicLong total = new AtomicLong(0L);
try {
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
buildQuery(boolQuery);
esSearchService.searchResponseInBatch(IDX_BIZ_VIEW_JG_ALL, boolQuery, 2000, searchHits -> {
List<ESEquipmentCategoryDto> esEquipmentCategoryList = searchHits.stream().map(searchHit -> JSONObject.parseObject(searchHit.getSourceAsString(), ESEquipmentCategoryDto.class)).collect(Collectors.toList());
// 数据库查询设备数据等级
if (!ValidationUtil.isEmpty(esEquipmentCategoryList)) {
List<String> equipRecords = esEquipmentCategoryList.stream().map(ESEquipmentCategoryDto::getSEQUENCE_NBR).collect(Collectors.toList());
List<IdxBizJgUseInfo> baseEnterpriseInfoList = useInfoService.list(new LambdaQueryWrapper<IdxBizJgUseInfo>().select(IdxBizJgUseInfo::getRecord, IdxBizJgUseInfo::getDataQualityScore).in(IdxBizJgUseInfo::getRecord, equipRecords));
if (!ValidationUtil.isEmpty(baseEnterpriseInfoList)) {
Map<String, Integer> equipDataQualityScoreMap = baseEnterpriseInfoList.stream().collect(Collectors.toMap(IdxBizJgUseInfo::getRecord, IdxBizJgUseInfo::getDataQualityScore));
esEquipmentCategoryList.forEach(x -> x.setDataQualityScore(equipDataQualityScoreMap.get(x.getSEQUENCE_NBR())));
}
}
esEquipmentCategory.saveAll(esEquipmentCategoryList);
total.addAndGet(esEquipmentCategoryList.size());
});
} catch (Exception e) {
throw new RuntimeException(e);
}
log.info("处理数据质量评分结束,更新{}条设备", total.get());
return "success";
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String handleDataQualityScore2() { public String handleDataQualityScore() {
log.info("处理数据质量评分开始"); log.info("处理数据质量评分开始");
AtomicLong total = new AtomicLong(0L); AtomicLong total = new AtomicLong(0L);
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment