递归
/** * 递归查找 * @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); }
吾乃代码搬运工,侵联删