|  | @@ -4,8 +4,10 @@ import cn.iocoder.yudao.module.pms.controller.admin.vo.IotInfoPageReqVO;
 | 
	
		
			
				|  |  |  import cn.iocoder.yudao.module.pms.controller.admin.vo.IotInfoSaveReqVO;
 | 
	
		
			
				|  |  |  import cn.iocoder.yudao.module.pms.dal.dataobject.IotInfoClassifyDO;
 | 
	
		
			
				|  |  |  import cn.iocoder.yudao.module.pms.dal.dataobject.IotInfoDO;
 | 
	
		
			
				|  |  | +import cn.iocoder.yudao.module.pms.dal.dataobject.IotTreeDO;
 | 
	
		
			
				|  |  |  import cn.iocoder.yudao.module.pms.dal.mysql.IotInfoMapper;
 | 
	
		
			
				|  |  |  import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  |  import javax.annotation.Resource;
 | 
	
		
			
				|  |  |  import org.springframework.validation.annotation.Validated;
 | 
	
	
		
			
				|  | @@ -34,6 +36,8 @@ public class IotInfoServiceImpl implements IotInfoService {
 | 
	
		
			
				|  |  |      private IotInfoMapper iotInfoMapper;
 | 
	
		
			
				|  |  |      @Resource
 | 
	
		
			
				|  |  |      private IotInfoClassifyService iotInfoClassifyService;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private IotTreeService iotTreeService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public Long createIotInfo(IotInfoSaveReqVO createReqVO) {
 | 
	
	
		
			
				|  | @@ -77,6 +81,25 @@ public class IotInfoServiceImpl implements IotInfoService {
 | 
	
		
			
				|  |  |      public PageResult<IotInfoDO> getIotInfoPage(IotInfoPageReqVO pageReqVO) {
 | 
	
		
			
				|  |  |          return iotInfoMapper.selectPage(pageReqVO, getInfoCondition(pageReqVO.getClassId()));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public PageResult<IotInfoDO> getIotInfoFilePage(IotInfoPageReqVO pageReqVO) {
 | 
	
		
			
				|  |  | +        return iotInfoMapper.selectPage(pageReqVO, getInfoFileCondition(pageReqVO.getClassId()));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private Set<Long> getInfoFileCondition(Long classId) {
 | 
	
		
			
				|  |  | +        if (Objects.isNull(classId)) {
 | 
	
		
			
				|  |  | +            return Collections.emptySet();
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        IotTreeDO iotTree = iotTreeService.getIotTree(classId);
 | 
	
		
			
				|  |  | +        if (Objects.isNull(iotTree)) {
 | 
	
		
			
				|  |  | +            throw exception(IOT_INFO_NOT_EXISTS);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        Set<Long> fileIds = convertSet(iotTreeService.getChildTreeList(classId), IotTreeDO::getOriginId);
 | 
	
		
			
				|  |  | +        fileIds.add(iotTree.getOriginId()); // 包括自身
 | 
	
		
			
				|  |  | +        return fileIds;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      private Set<Long> getInfoCondition(Long classId) {
 | 
	
		
			
				|  |  |          if (classId == null) {
 | 
	
		
			
				|  |  |              return Collections.emptySet();
 | 
	
	
		
			
				|  | @@ -85,4 +108,6 @@ public class IotInfoServiceImpl implements IotInfoService {
 | 
	
		
			
				|  |  |          deptIds.add(classId); // 包括自身
 | 
	
		
			
				|  |  |          return deptIds;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  }
 |