| | |
| | | // 分类 |
| | | // 一级分类 |
| | | if (!Cools.isEmpty(excel.getPriClass()) && !Cools.isEmpty(excel.getSecClass())) { |
| | | Tag priTag = tagService.getOne(new LambdaQueryWrapper<Tag>().eq(Tag::getName, excel.getPriClass()).eq(Tag::getLevel, 2)); |
| | | Tag priTag = tagService.getOne(new LambdaQueryWrapper<Tag>().eq(Tag::getName, excel.getPriClass()).eq(Tag::getLevel, 2).eq(Tag::getHostId, hostId)); |
| | | if (priTag == null) { |
| | | Tag top = tagService.getTop(hostId); |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | |
| | | null, // 修改人员 |
| | | null // 备注 |
| | | ); |
| | | priTag.setHostId(hostId); |
| | | if (tagMapper.insert(priTag) == 0) { |
| | | throw new CoolException("保存一级分类失败"); |
| | | } |
| | | } |
| | | // 二级分类 |
| | | Tag secTag = tagService.getOne(new LambdaQueryWrapper<Tag>().eq(Tag::getName, excel.getPriClass()).eq(Tag::getLevel, 3)); |
| | | Tag secTag = tagService.getOne(new LambdaQueryWrapper<Tag>().eq(Tag::getName, excel.getSecClass()).eq(Tag::getLevel, 3).eq(Tag::getHostId, hostId)); |
| | | if (secTag == null) { |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(priTag.getId()); |
| | |
| | | null, // 修改人员 |
| | | null // 备注 |
| | | ); |
| | | secTag.setHostId(hostId); |
| | | if (tagMapper.insert(secTag) == 0) { |
| | | throw new CoolException("保存二级分类失败"); |
| | | } |