Commit d6f818bc authored by tianbo's avatar tianbo

fix(安全问题): 修复设计使用年限查询逻辑

- 修改了对 overDesignLifeRecords 和 overDesignLifeAgainRecords 的空检查逻辑- 将 if (ValidationUtil.isEmpty()) 条件反转,确保在记录非空时才添加到 allEquipRecords - 这个修改解决了可能由于空检查逻辑错误导致的安全问题跟踪生成服务的问题
parent 6fa72b5d
...@@ -215,12 +215,12 @@ public class SafetyProblemTracingGenServiceImpl{ ...@@ -215,12 +215,12 @@ public class SafetyProblemTracingGenServiceImpl{
List<Map<String, Object>> allEquipRecords = Lists.newArrayList(); List<Map<String, Object>> allEquipRecords = Lists.newArrayList();
// 查询当天超设计使用年限的设备-首次超期 // 查询当天超设计使用年限的设备-首次超期
List<Map<String, Object>> overDesignLifeRecords = commonMapper.queryOverDesignLifeRecord(new Date()); List<Map<String, Object>> overDesignLifeRecords = commonMapper.queryOverDesignLifeRecord(new Date());
if (ValidationUtil.isEmpty(overDesignLifeRecords)) { if (!ValidationUtil.isEmpty(overDesignLifeRecords)) {
allEquipRecords.addAll(overDesignLifeRecords); allEquipRecords.addAll(overDesignLifeRecords);
} }
// 查询当天超设计使用年限的设备-办理超期登记后再次超期 // 查询当天超设计使用年限的设备-办理超期登记后再次超期
List<Map<String, Object>> overDesignLifeAgainRecords = commonMapper.queryOverDesignLifeAgainRecord(new Date()); List<Map<String, Object>> overDesignLifeAgainRecords = commonMapper.queryOverDesignLifeAgainRecord(new Date());
if (ValidationUtil.isEmpty(overDesignLifeRecords)) { if (!ValidationUtil.isEmpty(overDesignLifeRecords)) {
allEquipRecords.addAll(overDesignLifeAgainRecords); allEquipRecords.addAll(overDesignLifeAgainRecords);
} }
updateEquipAndSendMessage(allEquipRecords, SafetyProblemTypeEnum.SJNXCQ); updateEquipAndSendMessage(allEquipRecords, SafetyProblemTypeEnum.SJNXCQ);
......
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