queryDomainUserRelInfo方法修改。

This commit is contained in:
wangzhijiang
2022-03-03 15:43:43 +08:00
parent 92f69cc248
commit 6498399734
@@ -14,6 +14,7 @@ import com.jero.modules.subscribe.entity.OnlCgformSubscribe;
import com.jero.modules.subscribe.mapper.OnlCgformSubscribeMapper; import com.jero.modules.subscribe.mapper.OnlCgformSubscribeMapper;
import com.jero.modules.system.entity.SysUser; import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.mapper.SysUserMapper; import com.jero.modules.system.mapper.SysUserMapper;
import me.zhyd.oauth.utils.StringUtils;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -88,26 +89,21 @@ public class DomainManageServiceImpl extends ServiceImpl<DomainUserRelMapper, Do
@Override @Override
public List<String> queryDomainUserRelInfo(Map<String, Object> params) { public List<String> queryDomainUserRelInfo(Map<String, Object> params) {
String domainId = (String) params.get("domainId"); String domainId = (String) params.get("domainId");
if(oConvertUtils.isEmpty(domainId)){
throw new JeroBootException("领域id不能为空!");
}
String documentId = (String) params.get("documentId"); String documentId = (String) params.get("documentId");
if(oConvertUtils.isEmpty(documentId)){
throw new JeroBootException("文档id不能为空");
}
List<String> result = new ArrayList<>(); List<String> result = new ArrayList<>();
try { try {
//获取订阅该领域的所有用户信息 //获取订阅该领域的所有用户信息
if(StringUtils.isNotEmpty(domainId)){
QueryWrapper<DomainUserRel> queryDomain = new QueryWrapper<>(); QueryWrapper<DomainUserRel> queryDomain = new QueryWrapper<>();
queryDomain.lambda().eq(DomainUserRel::getDomainId,domainId); queryDomain.lambda().eq(DomainUserRel::getDomainId,domainId);
List<DomainUserRel> domainUserRelList = super.baseMapper.selectList(queryDomain); List<DomainUserRel> domainUserRelList = super.baseMapper.selectList(queryDomain);
if(CollectionUtils.isNotEmpty(domainUserRelList)){ if(CollectionUtils.isNotEmpty(domainUserRelList)){
result = domainUserRelList.stream().map(DomainUserRel::getUserId).distinct().collect(Collectors.toList()); result = domainUserRelList.stream().map(DomainUserRel::getUserId).distinct().collect(Collectors.toList());
} }
}
//获取该文档所有订阅用户的信息 //获取该文档所有订阅用户的信息
if(StringUtils.isNotEmpty(documentId)){
QueryWrapper<OnlCgformSubscribe> querySubscribe = new QueryWrapper<>(); QueryWrapper<OnlCgformSubscribe> querySubscribe = new QueryWrapper<>();
querySubscribe.lambda().eq(OnlCgformSubscribe::getDocumentId,documentId); querySubscribe.lambda().eq(OnlCgformSubscribe::getDocumentId,documentId);
List<OnlCgformSubscribe> onlCgformSubscribeList = onlCgformSubscribeMapper.selectList(querySubscribe); List<OnlCgformSubscribe> onlCgformSubscribeList = onlCgformSubscribeMapper.selectList(querySubscribe);
@@ -125,6 +121,7 @@ public class DomainManageServiceImpl extends ServiceImpl<DomainUserRelMapper, Do
} }
} }
} }
}
}catch (Exception ex){ }catch (Exception ex){
log.error("根据领域id、文档id查询用户失败:" + ex.getMessage()); log.error("根据领域id、文档id查询用户失败:" + ex.getMessage());
throw new JeroBootException("根据领域id、文档id查询用户失败!"); throw new JeroBootException("根据领域id、文档id查询用户失败!");