2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-04-18 25467e37012939fb621ee6e43edc2587ba48dc63
ximon-admin/src/main/java/com/sandu/ximon/admin/service/IpVolumeFileService.java
@@ -73,27 +73,20 @@
    public LambdaQueryWrapper<IpVolumeFile> listFile(BaseConditionVO baseConditionVO, String keyword) {
        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
        LambdaQueryWrapper<IpVolumeFile> wrapper;
        LambdaQueryWrapper<IpVolumeFile> wrapper = Wrappers.lambdaQuery(IpVolumeFile.class);
        if (SecurityUtils.getClientId() == null) {
            wrapper = Wrappers.lambdaQuery(IpVolumeFile.class);
        } else {
            if (clientService.findClientId()) {
                wrapper = Wrappers.lambdaQuery(IpVolumeFile.class).eq(IpVolumeFile::getUserId, SecurityUtils.getUserId());
            } else {
                wrapper = Wrappers.lambdaQuery(IpVolumeFile.class).eq(IpVolumeFile::getClientId, clientService.getClientId())
        //不是超管
        if (SecurityUtils.getClientId() != null) {
            wrapper = wrapper.eq(IpVolumeFile::getClientId, SecurityUtils.getUserId())
                        .or(file -> {
                            file.eq(IpVolumeFile::getClientId, SecurityUtils.getUserId());
                        file.eq(IpVolumeFile::getUserId, SecurityUtils.getUserId());
                        });
            }
        if (!keyword.isEmpty()) {
            wrapper.like(IpVolumeFile::getFileName, keyword);
        }
        if (keyword.isEmpty()) {
            return wrapper;
        } else {
            return wrapper.like(IpVolumeFile::getFileName, keyword);
        }
    }