zhang-content/pom.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
zhang-content/src/main/java/com/ruoyi/mapper/ZfAncestorMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
zhang-content/src/main/java/com/ruoyi/service/impl/ZAuthorityServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
zhang-content/src/main/java/com/ruoyi/service/impl/ZfAncestorServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
zhang-content/pom.xml
@@ -28,6 +28,19 @@ <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.5.2</version> <exclusions> <!-- 解决jsqlparser 依赖版本解析问题--> <exclusion> <artifactId>jsqlparser</artifactId> <groupId>com.github.jsqlparser</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.github.jsqlparser</groupId> <artifactId>jsqlparser</artifactId> <version>4.6</version> </dependency> <!-- MyBatis代码生成器依赖,要使用代码生成器,就需要导入代码生成器依赖 --> zhang-content/src/main/java/com/ruoyi/mapper/ZfAncestorMapper.java
@@ -19,11 +19,11 @@ @Mapper public interface ZfAncestorMapper extends BaseMapper<ZfAncestor> { @Select("select * , zf_role.name as roleName from zf_ancestor, zf_clan,zf_role where zf_ancestor.clan_id = zf_clan.clan_id and zf_ancestor.role_id = zf_role.id ${ew.customSqlSegment}") @Select("select * , zf_role.name as roleName from zf_ancestor inner join zf_clan on zf_ancestor.clan_id = zf_clan.clan_id inner join zf_role on zf_ancestor.role_id = zf_role.id ${ew.customSqlSegment}") Page<AncestorClan> selectInfo(Page page, @Param(Constants.WRAPPER) Wrapper<Object> queryWrapper); @Select("select * , zf_role.name as roleName from zf_ancestor, zf_clan,zf_role where zf_ancestor.clan_id = zf_clan.clan_id and zf_ancestor.role_id = zf_role.id ${ew.customSqlSegment}") @Select("select * , zf_role.name as roleName from zf_ancestor inner join zf_clan on zf_ancestor.clan_id = zf_clan.clan_id inner join zf_role on zf_ancestor.role_id = zf_role.id ${ew.customSqlSegment}") List<AncestorClan> selectAllInfo( @Param(Constants.WRAPPER) Wrapper<Object> queryWrapper); } zhang-content/src/main/java/com/ruoyi/service/impl/ZAuthorityServiceImpl.java
@@ -5,10 +5,8 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.domain.ZAuthority; import com.ruoyi.domain.ZInfoUser; import com.ruoyi.domain.ZfCode; import com.ruoyi.domain.ZfFamily; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.domain.*; import com.ruoyi.domain.dto.AuthorityDto; import com.ruoyi.domain.dto.AuthorityDto2; import com.ruoyi.domain.dto.AuthorityDtoWithName; @@ -53,9 +51,9 @@ public List<ZAuthority> getAuthority() { SysUser user = SecurityUtils.getLoginUser().getUser(); Long userId = user.getUserId(); ZInfoUser zInfoUser = zInfoUserService.getInfoBysysId(userId); LambdaQueryWrapper<ZAuthority> lqw = new LambdaQueryWrapper<>(); lqw.eq(ZAuthority::getUid,userId); lqw.eq(ZAuthority::getUid,zInfoUser.getUserId()); return list(lqw); } @@ -276,12 +274,24 @@ return AjaxResult.success(returnData); } private LambdaQueryWrapper<ZAuthority> uniqueCondition(ZAuthority zAuthority) { LambdaQueryWrapper<ZAuthority> lqw = new LambdaQueryWrapper<>(); lqw.eq(zAuthority.getUid()!=null,ZAuthority::getUid,zAuthority.getUid()); lqw.eq(zAuthority.getFid()!=null,ZAuthority::getFid,zAuthority.getFid()); lqw.eq(zAuthority.getAuthority()!=null,ZAuthority::getAuthority,zAuthority.getAuthority()); return lqw; } public void addData(ZAuthority za) { //判断是否重复授权 LambdaQueryWrapper<ZAuthority> lqw = uniqueCondition(za); List<ZAuthority> list = list(lqw); // if(list.size()>0){ throw new RuntimeException("请勿新增重复数据"); } zAuthorityService.save(za); } zhang-content/src/main/java/com/ruoyi/service/impl/ZfAncestorServiceImpl.java
@@ -134,6 +134,7 @@ @Override public List<AncestorClan> selectByCondition(ZfAncestor zfAncestor) { QueryWrapper<Object> lqw = new QueryWrapper<>(); lqw.eq(zfAncestor.getClanId() !=null , " zf_ancestor.clan_id", zfAncestor.getClanId()); lqw.like(StringUtils.isNotEmpty(zfAncestor.getName()),"zf_ancestor.name",zfAncestor.getName()); zhang-content/src/main/java/com/ruoyi/service/impl/ZfContactServiceImpl.java
@@ -208,11 +208,11 @@ //要查自己家庭的 ZInfoUser myself = zInfoUserService.getMyself(); Long familyId = myself.getFamilyId(); //也要查别人授权的 List<ZAuthority> authority = zAuthorityService.getAuthority(); List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(CONTACT_LIST)).map(ZAuthority::getFid).collect(Collectors.toList()); //加上自己家庭的id idList.add(familyId); LambdaQueryWrapper<ZfContact> lambdaQueryWrapper = buildCondition(zfContact, idList); List<ZfContact> beanRecords = list(lambdaQueryWrapper); @@ -285,10 +285,21 @@ } Long familyId = myself.getFamilyId(); //也要查别人授权的 // // System.out.println("--------------7777----------------"); // // System.out.println(familyId); List<ZAuthority> authority = zAuthorityService.getAuthority(); List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(CONTACT_LIST)).map(ZAuthority::getFid).collect(Collectors.toList()); //加上自己家庭的id idList.add(familyId); // // System.out.println(idList.size()); // System.out.println(idList.get(0)); // // System.out.println("------------------------------"); idList.add(familyId); // String familyIds = listFamilyIds(); // String secondFamilyAuthority = listSecondFamilyIds(); LambdaQueryWrapper<ZfContact> lqw = buildCondition(zfContact, idList);