From eca4f8d22bb70a55ee89af5ecd9cf8517a3cc664 Mon Sep 17 00:00:00 2001 From: CeDo <cedoogle@gmail.com> Date: 星期四, 20 五月 2021 19:40:54 +0800 Subject: [PATCH] bugfixed --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java | 6 ++---- springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java | 2 +- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java index 2ef9345..112cc5f 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java @@ -1561,11 +1561,9 @@ @PostMapping("/eldersauth/getMyfamilyElders/{userId}") R<List<ComMngFamilyInfoVO>> getMyfamilyElders(@PathVariable("userId") Long userId){ List<ComMngFamilyInfoVO> list = comMngPopulationDAO.listFamilyByUserId(userId); - - List<ComMngFamilyInfoVO> sortedList = list.stream().sorted(Comparator.comparing(ComMngFamilyInfoVO::getCreateAt).reversed()).collect(Collectors.toList()); - + List<ComMngFamilyInfoVO> listRt = new ArrayList<>(); - sortedList.forEach(rt -> { + list.forEach(rt -> { int age = IdCard.IdNOToAge(rt.getIdCard()); boolean isElders = age >= 80; if (isElders) { diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java index 91d0028..f98dd5d 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java @@ -94,7 +94,7 @@ List<ComMngPopulationVO> listPopulation(ComMngPopulationDTO populationVO); - @Select("select id,user_id,relationship,`name`,id_card,phone,age,health,job,create_at,update_at,card_photo_front,card_photo_back,family_book from com_mng_family_info where user_id=#{userId}") + @Select("select id,user_id,relationship,`name`,id_card,phone,age,health,job,create_at,update_at,card_photo_front,card_photo_back,family_book from com_mng_family_info where user_id=#{userId} order by create_at desc ") List<ComMngFamilyInfoVO> listFamilyByUserId(Long userId); @Select("select id,`name`,phone,relation from com_mng_population where road = #{comMngPopulationDO.road} and door_no = #{comMngPopulationDO.doorNo} and floor = #{comMngPopulationDO.floor} and unit_no = #{comMngPopulationDO.unitNo} and house_no = #{comMngPopulationDO.houseNo} and id != #{comMngPopulationDO.id}") diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java index c10e970..197facb 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java @@ -755,7 +755,7 @@ @Override public R listFamily(Long userId,Long pageNum, Long pageSize) { List<ComMngFamilyInfoVO> comMngFamilyInfoVOS = new ArrayList<>(); - LambdaQueryWrapper<ComMngFamilyInfoDO> query = new QueryWrapper<ComMngFamilyInfoDO>().lambda().eq(ComMngFamilyInfoDO::getUserId, userId); + LambdaQueryWrapper<ComMngFamilyInfoDO> query = new QueryWrapper<ComMngFamilyInfoDO>().lambda().eq(ComMngFamilyInfoDO::getUserId, userId).orderByDesc(ComMngFamilyInfoDO::getCreateAt); IPage<ComMngFamilyInfoDO> pageData = comMngFamilyInfoDAO.selectPage(new Page<>(pageNum,pageSize), query); if (!ObjectUtils.isEmpty(pageData.getRecords())) { pageData.getRecords().forEach(comMngFamilyInfoDO -> { -- Gitblit v1.7.1