Commit ac9ec9d4 authored by caotao's avatar caotao

1.优化整理测点导入逻辑,如果已经存在了frontMoudle跟system则进行新增操作。

2.优化模拟量接口,过滤掉垃圾数据并且增加数据排序操作。
parent 5f87d7d8
......@@ -259,12 +259,12 @@ public class DemoController extends BaseController {
equipmentsJxiopDocMysqlList.forEach(equipmentsJxiopDocMysql -> {
ESEquipments esEquipments = equipmentsRepository.findById(equipmentsJxiopDocMysql.getId()).get();
//更新模块
if (equipmentsJxiopDocMysql.getFrontModule().contains(pointImportDto.getFrontModule())) {
if (!equipmentsJxiopDocMysql.getFrontModule().contains(pointImportDto.getFrontModule())) {
equipmentsJxiopDocMysql.setFrontModule(equipmentsJxiopDocMysql.getFrontModule() + "," + pointImportDto.getFrontModule());
esEquipments.setFrontModule(equipmentsJxiopDocMysql.getFrontModule() + "," + pointImportDto.getFrontModule());
}
//更新类型
if (equipmentsJxiopDocMysql.getSystemType().contains(pointImportDto.getSystemType())) {
if (!equipmentsJxiopDocMysql.getSystemType().contains(pointImportDto.getSystemType())) {
equipmentsJxiopDocMysql.setSystemType(equipmentsJxiopDocMysql.getSystemType()+","+pointImportDto.getSystemType());
esEquipments.setSystemType(equipmentsJxiopDocMysql.getSystemType()+","+pointImportDto.getSystemType());
}
......
......@@ -1378,8 +1378,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
Map<String, List<String>> queryCodtion = new HashMap<>();
Map<String, String> likeMap = new HashMap<>();
queryCodtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
queryCodtion.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList("模拟量"));
// queryCodtion.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList("模拟量"));
likeMap.put(CommonConstans.QueryStringFrontMoudle, map.get("boosterName"));
likeMap.put(CommonConstans.QueryStringSystemTypeKeyword, "模拟量");
if ("1主变高压侧".equals(map.get("boosterName")) || "1主变低压侧".equals(map.get("boosterName"))) {
likeMap.put(CommonConstans.QueryStringFrontMoudle, "压侧");
List<ESEquipments> listData = commonServiceImpl.getListDataByCondtions(queryCodtion, null, ESEquipments.class, likeMap);
......@@ -1407,6 +1408,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
} else {
List<ESEquipments> listData = commonServiceImpl.getListDataByCondtions(queryCodtion, null, ESEquipments.class, likeMap);
Integer traceIdCount = listData.stream().filter(esEquipments -> !StringUtils.isEmpty(esEquipments.getTraceId())).collect(Collectors.toList()).size();
if (traceIdCount > 0) {
listData = listData.stream().filter(esEquipments -> !StringUtils.isEmpty(esEquipments.getTraceId())).collect(Collectors.toList());
listData.sort(Comparator.comparing(ESEquipments::getTraceId, Comparator.comparingInt(Integer::parseInt)));
}
ArrayList<Map<String, String>> resultList = new ArrayList<>();
listData.forEach(item -> {
HashMap<String, String> stringStringHashMap = new HashMap<>();
......
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