From b6f534ab44ea6cf6f68f4644ad794c5adf684613 Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Wed, 2 Apr 2025 09:30:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9E=8D=E9=92=A2bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/xz/controller/XzRiskPredictionController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzRiskPredictionController.java b/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzRiskPredictionController.java index 5594c3e44..bbe851c99 100644 --- a/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzRiskPredictionController.java +++ b/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzRiskPredictionController.java @@ -142,7 +142,13 @@ public class XzRiskPredictionController { .eq(WorkerInfo::getInserviceType, 1)); resultMap.put("total", list.size()); // 高龄人员 - long ageCount = list.stream().filter(l -> StringUtils.isNotBlank(l.getBirthday()) && DateUtil.ageOfNow(l.getBirthday()) >= 50).count(); + long ageCount = list.stream().filter(l -> { + try { + return StringUtils.isNotBlank(l.getBirthday()) && DateUtil.ageOfNow(l.getBirthday()) >= 50; + } catch (Exception e) { + return false; + } + }).count(); resultMap.put("age", list.size() == 0 ? null : new BigDecimal(ageCount).divide(new BigDecimal(list.size()), 2, BigDecimal.ROUND_HALF_UP)); // 特殊工种人数 WorkerType workerType = workerTypeService.getOne(Wrappers.lambdaQuery()