Commit c896b6fd authored by tianbo's avatar tianbo

fix(jg):修复安全问题追踪服务中的设备记录处理逻辑

parent 64072c71
...@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; ...@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
...@@ -309,7 +310,7 @@ public class SafetyProblemTracingServiceImpl extends BaseService<SafetyProblemTr ...@@ -309,7 +310,7 @@ public class SafetyProblemTracingServiceImpl extends BaseService<SafetyProblemTr
// 如果设备存在并且没有新的问题,则更新Other表和ES状态 // 如果设备存在并且没有新的问题,则更新Other表和ES状态
if (!ValidationUtil.isEmpty(detail) && ValidationUtil.isEmpty(newSafetyProblemTracings)) { if (!ValidationUtil.isEmpty(detail) && ValidationUtil.isEmpty(newSafetyProblemTracings)) {
// 获取设备问题源记录 // 获取设备问题源记录
Set<String> records = newSafetyProblemTracings.stream().map(SafetyProblemTracing::getSourceId).collect(Collectors.toSet()); Set<String> records = Sets.newHashSet(detail.get("SEQUENCE_NBR").toString());
// 更新Other表和ES状态 // 更新Other表和ES状态
updateOtherTableAndES(records); updateOtherTableAndES(records);
} }
...@@ -329,7 +330,7 @@ public class SafetyProblemTracingServiceImpl extends BaseService<SafetyProblemTr ...@@ -329,7 +330,7 @@ public class SafetyProblemTracingServiceImpl extends BaseService<SafetyProblemTr
log.error("Other表更新失败,设备record:{},错误原因:{}", records, e.getMessage(), e); log.error("Other表更新失败,设备record:{},错误原因:{}", records, e.getMessage(), e);
} }
// 更新ES状态 // 更新ES状态(添加异常处理)
try { try {
Iterable<ESEquipmentCategoryDto> esEquipmentIter = esEquipmentCategory.findAllById(records); Iterable<ESEquipmentCategoryDto> esEquipmentIter = esEquipmentCategory.findAllById(records);
esEquipmentIter.forEach(dto -> esEquipmentIter.forEach(dto ->
......
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