Commit d1bdce02 by huangjinxin

fix:组织树支持查询所有

1 parent e7f935bd
...@@ -13,6 +13,7 @@ import com.google.common.collect.Lists; ...@@ -13,6 +13,7 @@ import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -44,8 +45,12 @@ public class OrganizationServiceImpl implements OrganizationService { ...@@ -44,8 +45,12 @@ public class OrganizationServiceImpl implements OrganizationService {
public Result<?> getOrganizationTree(String levelType, String levelValue) { public Result<?> getOrganizationTree(String levelType, String levelValue) {
// 如果传递了精确的id,只返回对应的tree内容;如果没有传递,返回所有tree内容 // 如果传递了精确的id,只返回对应的tree内容;如果没有传递,返回所有tree内容
List<OrganizationTreeDTO.Result> rs = new ArrayList<>(); List<OrganizationTreeDTO.Result> rs = new ArrayList<>();
for (String value : levelValue.split(",")) { if (StringUtils.isBlank(levelType) && StringUtils.isBlank(levelValue)) {
rs.add(getOrganizationTreeByOrgId(levelType, value)); rs.add(getOrganizationTreeByOrgId(levelType, levelValue));
} else {
for (String value : levelValue.split(",")) {
rs.add(getOrganizationTreeByOrgId(levelType, value));
}
} }
return Result.success(rs); return Result.success(rs);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!