| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZfEvent; |
| | | import com.ruoyi.domain.ZfRelation; |
| | | import com.ruoyi.domain.dto.UserRelationDto; |
| | | import com.ruoyi.mapper.ZInfoUserMapper; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfRelationService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | @Slf4j |
| | | public class ZInfoUserServiceImpl extends ServiceImpl<ZInfoUserMapper, ZInfoUser> implements ZInfoUserService { |
| | | |
| | | @Autowired |
| | | private ZfRelationService zfRelationService; |
| | | |
| | | @Override |
| | | public AjaxResult selectInfoList(ZInfoUser zInfoUser, Integer pageNum, Integer pageSize) { |
| | |
| | | return list; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult searchMyRelation(Long userId) { |
| | | |
| | | LambdaQueryWrapper<ZfRelation> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfRelation::getMyId,userId); |
| | | List<ZfRelation> relationList = zfRelationService.list(lqw); |
| | | |
| | | ArrayList<UserRelationDto> otherUserList = new ArrayList<>(); |
| | | |
| | | relationList.stream().map( |
| | | (relation)->{ |
| | | Long otherId = relation.getOtherId(); |
| | | ZInfoUser otherUser = getById(otherId); |
| | | UserRelationDto userRelationDto = new UserRelationDto(); |
| | | BeanUtils.copyProperties(otherUser,userRelationDto); |
| | | userRelationDto.setRelation(relation.getRelation()); |
| | | otherUserList.add(userRelationDto); |
| | | return relation; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | |
| | | return AjaxResult.success(otherUserList); |
| | | } |
| | | } |