| | |
| | | @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) { |
| | |
| | | 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}") |
| | |
| | | @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 -> { |