Commit 8d245c0a authored by tianbo's avatar tianbo

refactor(jg): 优化检验日期为空的处理

- 在处理下次检验日期时,增加了对空值的过滤 - 避免了可能因空指针异常导致的程序崩溃
parent da2db7e0
......@@ -218,7 +218,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
List<IdxBizJgInspectionDetectionInfo> inspectInfos = jgInspectionDetectionInfoService.checkInspectionInfo(record);
List<Date> nextInspectDates = inspectInfos.stream().map(IdxBizJgInspectionDetectionInfo::getNextInspectDate).collect(Collectors.toList());
Date currentDate = new Date();
nextInspectDates.forEach(next -> {
nextInspectDates.stream().filter(Objects::nonNull).forEach(next -> {
// 下次检验日期在当前时间之前的
if (next.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()
.isBefore(currentDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate())) {
......
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