| | |
| | | import com.gkhy.exam.system.mapper.ProductItemMapper; |
| | | import com.gkhy.exam.system.mapper.SysCompanyMapper; |
| | | import com.gkhy.exam.system.service.CatalogueService; |
| | | import com.gkhy.exam.system.service.ProjectDocumentService; |
| | | import com.gkhy.exam.system.service.SysCompanyService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private CompanyIndustryTemplateMapper companyIndustryTemplateMapper; |
| | | @Autowired |
| | | private ProductItemMapper productItemMapper; |
| | | @Autowired |
| | | private ProjectDocumentService projectDocumentService; |
| | | |
| | | /** |
| | | * 目录管理 |
| | |
| | | return CommonResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult selectCatalogueDocumentList(CatalogueReq catalogueReq) { |
| | | List<CatalogueVo> catalogueVos = catalogueMapper.selectCatalogueList(catalogueReq); |
| | | for (CatalogueVo catalogueVo : catalogueVos) { |
| | | List<ProjectDocument> projectDocuments = projectDocumentService.selectList(catalogueVo.getCompanyId(), catalogueReq.getItemId(), catalogueVo.getId()); |
| | | catalogueVo.setProjectDocuments(projectDocuments); |
| | | } |
| | | |
| | | List<CatalogueVo> collect = catalogueVos.stream().filter(catalogueVo -> catalogueVo.getParentId() == 0).collect(Collectors.toList()); |
| | | for (CatalogueVo catalogueVo : collect) { |
| | | List<CatalogueVo> getchildren = getchildren(catalogueVo, catalogueVos); |
| | | catalogueVo.setChildren(getchildren); |
| | | } |
| | | return CommonResult.success(collect); |
| | | } |
| | | |
| | | private void saveCatalogue(List<CatalogueVo> children,Catalogue catalogue) { |
| | | for (CatalogueVo child : children) { |
| | | Catalogue catalogue1 = new Catalogue(); |