递归

 /**
     * 递归查找
     * @param parent 父节点
     * @param qw
     */
    private void addSubItem(TProposalMilestoneDTO parent, QueryWrapper qw) {
        qw.clear();
        qw.eq("PID",parent.getId());
        List<TProposalMilestone> recursionRespList = tProposalMilestoneService.dbGetList(qw);
        List<TProposalMilestoneDTO> listDTO = new ArrayList<>();
        recursionRespList.stream().forEach(d->{
            TProposalMilestoneDTO dto = new TProposalMilestoneDTO();
            BeanUtil.copyProperties(d,dto);
            listDTO.add(dto);
            //进入循环
            addSubItem(dto,qw);
        });
        parent.getSubsetList().addAll(listDTO);
    }

 

posted on 2024-11-14 21:00  五官一体即忢  阅读(0)  评论(0编辑  收藏  举报

导航