diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/DicServiceImpl.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/DicServiceImpl.java index 75c882b1d..8f6371be6 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/DicServiceImpl.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/DicServiceImpl.java @@ -19,6 +19,7 @@ import com.njcn.user.pojo.param.FunctionParam; import com.njcn.user.pojo.po.Function; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; import java.util.Comparator; @@ -83,7 +84,17 @@ public class DicServiceImpl extends ServiceImpl implements IDicS public List getDicTree(String code) { List list = dicMapper.getAllDic(); return list.stream() - .filter(fun -> Objects.equals(TemplateTreeEnum.FATHER_PID,fun.getPid())&&fun.getCode().equals(code)) + .filter(fun -> { + boolean flag =true; + boolean flag1 =true; + flag = Objects.equals(TemplateTreeEnum.FATHER_PID,fun.getPid()); + if(!StringUtils.isEmpty(code)){ + flag1 = fun.getCode().equals(code); + } + + return flag&&flag1; + + }) .peek(funS -> funS.setChildren(getChildList(funS, list))) .sorted(Comparator.comparingInt(DicVO::getSort)) .collect(Collectors.toList());