From 46f46c73ef2cf1719f0de7c0258e6bcd4335966c Mon Sep 17 00:00:00 2001
From: whywhyo <1511349576@qq.com>
Date: 星期二, 25 七月 2023 22:37:08 +0800
Subject: [PATCH] 519648

---
 zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyServiceImpl.java |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyServiceImpl.java
index 6e8ee6e..0717c18 100644
--- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyServiceImpl.java
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZAutobiographyServiceImpl.java
@@ -8,7 +8,9 @@
 import com.ruoyi.service.ZAutobiographyService;
 import org.springframework.stereotype.Service;
 
+import java.util.Comparator;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -25,15 +27,21 @@
     public List<ZAutobiography> selectAutobiographyList(Long userId) {
         LambdaQueryWrapper<ZAutobiography> lqw = new LambdaQueryWrapper<>();
         lqw.eq(ZAutobiography::getUserId,userId);
-        return list(lqw);
+        List<ZAutobiography> result = list(lqw);
+        result.forEach(zAutobiography -> {
+            if (zAutobiography.getAgeBegin() == null){
+                throw new RuntimeException("鏈夋暟鎹殑璧峰骞撮緞娌℃湁濉�");
+            }
+        });
+        return result.stream().sorted(Comparator.comparingInt(z -> Integer.parseInt(z.getAgeBegin()))).collect(Collectors.toList());
     }
 
     @Override
-    public List<ZAutobiography> listByTerm(Long userId,Integer termId) {
+    public List<ZAutobiography> listByTerm(Long userId,String term) {
 
         LambdaQueryWrapper<ZAutobiography> lqw = new LambdaQueryWrapper<>();
         lqw.eq(ZAutobiography::getUserId,userId);
-        lqw.eq(ZAutobiography::getType,termId);
+        lqw.eq(ZAutobiography::getTerm,term);
         return list(lqw);
     }
 }

--
Gitblit v1.9.1