From 99cf641da997ac75cd9d6ff82634e523994068bc Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Wed, 28 Dec 2022 15:33:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B4=E9=BE=84=E5=88=86=E5=B8=83=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/system/service/impl/PlatformService.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java index 748a4ff..250d1a7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java @@ -8,7 +8,6 @@ import com.ruoyi.system.mapper.TRecordMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -77,13 +76,13 @@ public class PlatformService { public Map ageCount(Long hospitalId, Long doctorId) { List tPatients = tRecordMapper.ageCount(hospitalId, doctorId); //20-30 - long count20 = tPatients.stream().filter(a -> a.getAge() >= 20 && a.getAge() <= 30).count(); + long count20 = tPatients.stream().filter(a -> a.getAge() != null && a.getAge() >= 20 && a.getAge() <= 30).count(); //31-40 - long count31 = tPatients.stream().filter(a -> a.getAge() >= 31 && a.getAge() <= 40).count(); + long count31 = tPatients.stream().filter(a -> a.getAge() != null && a.getAge() >= 31 && a.getAge() <= 40).count(); //41-50 - long count41 = tPatients.stream().filter(a -> a.getAge() >= 41 && a.getAge() <= 50).count(); + long count41 = tPatients.stream().filter(a -> a.getAge() != null && a.getAge() >= 41 && a.getAge() <= 50).count(); //51- - long count51 = tPatients.stream().filter(a -> a.getAge() >= 51).count(); + long count51 = tPatients.stream().filter(a -> a.getAge() != null && a.getAge() >= 51).count(); Map map = new HashMap(){{ put("count20",count20); put("count31",count31);