|  | @@ -134,33 +134,43 @@ public class CwProjectBusinessTypeController {
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @ApiLog("查询业务类型树")
 | 
	
		
			
				|  |  |      @GetMapping("findList")
 | 
	
		
			
				|  |  | -    public ResponseEntity<List<CwProjectBusinessType>> findList(){
 | 
	
		
			
				|  |  | -        List<CwProjectBusinessType> cwProjectBusinessTypeList = cwProjectBusinessTypeService.list();
 | 
	
		
			
				|  |  | -        List<String> idList = new ArrayList<>();
 | 
	
		
			
				|  |  | -        cwProjectBusinessTypeList.stream().forEach(item->{
 | 
	
		
			
				|  |  | -            if (StringUtils.isNotBlank(item.getParentIds())){
 | 
	
		
			
				|  |  | -                String[] split = item.getParentIds().split(",");
 | 
	
		
			
				|  |  | -                for (String s : split) {
 | 
	
		
			
				|  |  | -                    idList.add(s);
 | 
	
		
			
				|  |  | +    public ResponseEntity<IPage<CwProjectBusinessTypeDTO>> findList(CwProjectBusinessTypeDTO cwProjectBusinessTypeDTO, Page<CwProjectBusinessTypeDTO> page){
 | 
	
		
			
				|  |  | +        page.setSize(-1);
 | 
	
		
			
				|  |  | +        IPage<CwProjectBusinessTypeDTO> result = new Page<CwProjectBusinessTypeDTO>();
 | 
	
		
			
				|  |  | +        if(ObjectUtil.isNotEmpty(cwProjectBusinessTypeDTO)){
 | 
	
		
			
				|  |  | +            if(StringUtils.isNotBlank(cwProjectBusinessTypeDTO.getName())){
 | 
	
		
			
				|  |  | +                //根据type模糊查询
 | 
	
		
			
				|  |  | +                List<CwProjectBusinessType> cwProjectBusinessTypeList = cwProjectBusinessTypeService.list(new QueryWrapper<CwProjectBusinessType>().lambda()
 | 
	
		
			
				|  |  | +                        .like(StringUtils.isNotBlank(cwProjectBusinessTypeDTO.getName()), CwProjectBusinessType::getName, cwProjectBusinessTypeDTO.getName())
 | 
	
		
			
				|  |  | +                );
 | 
	
		
			
				|  |  | +                List<String> idList = new ArrayList<>();
 | 
	
		
			
				|  |  | +                cwProjectBusinessTypeList.stream().forEach(item->{
 | 
	
		
			
				|  |  | +                    if (StringUtils.isNotBlank(item.getParentIds())){
 | 
	
		
			
				|  |  | +                        String[] split = item.getParentIds().split(",");
 | 
	
		
			
				|  |  | +                        for (String s : split) {
 | 
	
		
			
				|  |  | +                            idList.add(s);
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    List<CwProjectBusinessType> list = cwProjectBusinessTypeService.list(new QueryWrapper<CwProjectBusinessType>().lambda().like(CwProjectBusinessType::getParentIds, "," + item.getId() + ","));
 | 
	
		
			
				|  |  | +                    idList.addAll(list.stream().map(CwProjectBusinessType::getId).collect(Collectors.toList()));
 | 
	
		
			
				|  |  | +                    idList.add(item.getId());
 | 
	
		
			
				|  |  | +                });
 | 
	
		
			
				|  |  | +                List<String> ids = idList.stream().distinct().filter(item->{
 | 
	
		
			
				|  |  | +                    if (!"0".equals(item)){
 | 
	
		
			
				|  |  | +                        return true;
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    return false;
 | 
	
		
			
				|  |  | +                }).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +                if(CollectionUtil.isNotEmpty(ids)){
 | 
	
		
			
				|  |  | +                    QueryWrapper<CwProjectBusinessType> wrapper = new QueryWrapper<CwProjectBusinessType>()
 | 
	
		
			
				|  |  | +                            .in("cw_pbt.id",idList);
 | 
	
		
			
				|  |  | +                    result = cwProjectBusinessTypeService.findListByIsShow (page,wrapper);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | +            }else{
 | 
	
		
			
				|  |  | +                result = cwProjectBusinessTypeService.findListByIsShow (page,new QueryWrapper<CwProjectBusinessType>());
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            List<CwProjectBusinessType> list = cwProjectBusinessTypeService.list(new QueryWrapper<CwProjectBusinessType>().lambda().like(CwProjectBusinessType::getParentIds, "," + item.getId() + ","));
 | 
	
		
			
				|  |  | -            idList.addAll(list.stream().map(CwProjectBusinessType::getId).collect(Collectors.toList()));
 | 
	
		
			
				|  |  | -            idList.add(item.getId());
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  | -        List<String> ids = idList.stream().distinct().filter(item->{
 | 
	
		
			
				|  |  | -            if (!"0".equals(item)){
 | 
	
		
			
				|  |  | -                return true;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            return false;
 | 
	
		
			
				|  |  | -        }).collect(Collectors.toList());
 | 
	
		
			
				|  |  | -        if(CollectionUtil.isNotEmpty(ids)) {
 | 
	
		
			
				|  |  | -            QueryWrapper<CwProjectBusinessType> wrapper = new QueryWrapper<CwProjectBusinessType>()
 | 
	
		
			
				|  |  | -                    .in("cw_pbt.id", idList);
 | 
	
		
			
				|  |  | -            //List<CwProjectBusinessType> list = cwProjectBusinessTypeService.findList(wrapper);
 | 
	
		
			
				|  |  | -            //return  ResponseEntity.ok(list);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        return ResponseEntity.ok(cwProjectBusinessTypeList);
 | 
	
		
			
				|  |  | +        return ResponseEntity.ok (result);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 |