| | |
| | | return lqw; |
| | | } |
| | | |
| | | // public List<ZfShareData> getAllByShareId(ZfShareData zfShareData1){ |
| | | // SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | // Long userId = user.getUserId(); |
| | | // |
| | | // ZfShareData zfShareData = new ZfShareData(); |
| | | // zfShareData.setUserId(userId.intValue()); |
| | | // List<ZfShareData> zfShareDataList = zfShareDataService.selectList(zfShareData); |
| | | // zfShareData.setUserId(zfShareData1.getUserId()); |
| | | // zfShareDataList.addAll(zfShareDataService.selectList(zfShareData)); |
| | | // return zfShareDataList; |
| | | // } |
| | | |
| | | public List<Long> getAll(){ |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | List<Long> allList = new ArrayList<>(); |
| | | Long source = zfShareDataService.getSource(userId); |
| | | allList.add(source); |
| | | allList.addAll(zfShareDataService.getAllPerson(Collections.singletonList(source))); |
| | | |
| | | List<ZfShareData> shareId = zfShareDataService.getShareId(userId); |
| | | List<ZfShareData> zfShareDataList = zfShareDataService.selectList(); |
| | | List<Long> collect = allList.stream().distinct().collect(Collectors.toList()); |
| | | |
| | | List<Long> all = new ArrayList<>(); |
| | | all.add(userId); |
| | | if(shareId.size() >0 ) { |
| | | if (shareId.get(0).getMasterAccount() == 0 || shareId.get(0).getMasterAccount() == userId.intValue()) { |
| | | all.add(shareId.get(0).getUserId().longValue()); |
| | | } |
| | | else { |
| | | all.clear(); |
| | | all.add(0L); |
| | | return all; |
| | | } |
| | | } |
| | | if (zfShareDataList.size()>0 && (zfShareDataList.get(0).getMasterAccount() == 0 || zfShareDataList.get(0).getMasterAccount() == userId.intValue())){ |
| | | for (ZfShareData zfShareOther: zfShareDataList) { |
| | | all.add(zfShareOther.getSharedId().longValue()); |
| | | } |
| | | } |
| | | |
| | | if(collect.size() > 1 ) { |
| | | Integer masterAccount = zfShareDataService.getByShareId(collect).get(0).getMasterAccount(); |
| | | if (masterAccount != 0 || masterAccount != userId.intValue()) { |
| | | all.clear(); |
| | | } |
| | | all.addAll(collect); |
| | | } |
| | | return all; |
| | | } |
| | | |
| | |
| | | LambdaQueryWrapper<ZSelfNote> lqw = buildCondition(zSelfNote); |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | List<ZfShareData> zfShareOtherList = zfShareDataService.selectList(); |
| | | List<ZfShareData> shareId = zfShareDataService.getShareId(userId); |
| | | if (list(lqw).size()==0) { |
| | | |
| | | List<Long> all = getAll(); |
| | | if (all.contains(userId)) { |
| | | List<ZfShareData> byShareId = zfShareDataService.getByShareId(all); |
| | | Integer masterAccount = 0; |
| | | if(zfShareOtherList.size()>0 ){ |
| | | masterAccount = zfShareOtherList.get(0).getMasterAccount();} |
| | | if(shareId.size()>0){ |
| | | masterAccount = shareId.get(0).getMasterAccount(); |
| | | if(byShareId.size()>0){ |
| | | masterAccount = byShareId.get(0).getMasterAccount(); |
| | | } |
| | | ZInfoUser infoBysysId = zInfoUserService.getInfoBysysId(masterAccount.longValue()); |
| | | if (infoBysysId !=null) |