| | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.alibaba.druid.sql.PagerUtils.limit; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | * 根据UserId和分享人shareId查看已经授权给那些人那些数据 |
| | | */ |
| | | @Override |
| | | public List<Long> listByFidAid(ShareMore zfDoctor) { |
| | | public AjaxResult listByFidAid(ShareMore zfDoctor,Integer pageNo ,Integer pageSize) { |
| | | //找到对应的赋予数据的用户以及数据内容 |
| | | Long [] shareIds = zfDoctor.getShareIds(); |
| | | List<Long> beanRecord3 = new ArrayList<>(); |
| | | List<ZfDoctor> beanRecord3 = new ArrayList<>(); |
| | | for (Long shareId : shareIds) { |
| | | { |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | .eq(ZfDoctorShare::getUserId, getUserId()); |
| | | List<ZfDoctorShare> beanRecords = list(lqw); |
| | | for (ZfDoctorShare beanRecord : beanRecords ) { |
| | | beanRecord3.add(beanRecord.getShareContent()); |
| | | beanRecord3.add(zfDoctorService.getById(beanRecord.getShareContent())); |
| | | } |
| | | } |
| | | } |
| | | List<ZfDoctor> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | |
| | | return beanRecord3; |
| | | int totalPage = (beanRecord3.size() -1) / pageSize +1; |
| | | |
| | | Page<ZfDoctor> zfDoctorPage = new Page<>(pageNo, pageSize,totalPage); |
| | | HashMap<String, Object> data = MapUtils.getResult(zfDoctorPage, record); |
| | | |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | @Override |
| | |
| | | * 用户自己查看别人分享的数据==用户自己查看别人分享的数据和分享人 |
| | | */ |
| | | @Override |
| | | public AjaxResult listUserId() { |
| | | public AjaxResult listUserId(ShareMore zfDoctorInteger,Integer pageNo ,Integer pageSize) { |
| | | //找到对应的赋予数据的用户以及数据内容 |
| | | List<ZfDoctor> bs = new ArrayList<>(); |
| | | LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | bs.add(bs2); |
| | | } |
| | | log.info("从数据库中查到的为:{}", bs); |
| | | return AjaxResult.success(bs); |
| | | List<ZfDoctor> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | |
| | | int totalPage = (bs.size() -1) / pageSize +1; |
| | | |
| | | Page<ZfDoctor> zfDoctorPage = new Page<>(pageNo, pageSize,totalPage); |
| | | HashMap<String, Object> data = MapUtils.getResult(zfDoctorPage, record); |
| | | return AjaxResult.success(data); |
| | | |
| | | } |
| | | public Long getUserId(){ |