fix:废除标签同时废除标签文件关系
This commit is contained in:
parent
b961c267c8
commit
52ed7f3a53
|
|
@ -13,7 +13,9 @@ import com.electromagnetic.industry.software.common.pojo.TreeNode;
|
|||
import com.electromagnetic.industry.software.common.util.IdWorker;
|
||||
import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
||||
import com.electromagnetic.industry.software.manage.mapper.EdTagLibraryMapper;
|
||||
import com.electromagnetic.industry.software.manage.mapper.FileTagRelationMapper;
|
||||
import com.electromagnetic.industry.software.manage.pojo.models.EdTagLibrary;
|
||||
import com.electromagnetic.industry.software.manage.pojo.models.FileTagRelation;
|
||||
import com.electromagnetic.industry.software.manage.pojo.resp.FileTagInfo;
|
||||
import com.electromagnetic.industry.software.manage.pojo.resp.TagListVO;
|
||||
import com.electromagnetic.industry.software.manage.service.EdTagLibraryService;
|
||||
|
|
@ -21,12 +23,16 @@ import org.springframework.beans.BeanUtils;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class EdTagLibraryServiceImpl extends ServiceImpl<EdTagLibraryMapper, EdTagLibrary> implements EdTagLibraryService {
|
||||
|
||||
@Resource
|
||||
FileTagRelationMapper fileTagRelationMapper;
|
||||
|
||||
/**
|
||||
* 新建标签组
|
||||
*
|
||||
|
|
@ -182,6 +188,8 @@ public class EdTagLibraryServiceImpl extends ServiceImpl<EdTagLibraryMapper, EdT
|
|||
// 如果是标签组,级联删除其下的所有标签
|
||||
if (tag.getType() == 0) {
|
||||
this.remove(new LambdaQueryWrapper<EdTagLibrary>().eq(EdTagLibrary::getParentId, tagId));
|
||||
// 删除标签关联文件
|
||||
fileTagRelationMapper.delete(new LambdaQueryWrapper<FileTagRelation>().eq(FileTagRelation::getTagId, tagId));
|
||||
}
|
||||
// 删除本身
|
||||
boolean isDeleted = this.removeById(tagId);
|
||||
|
|
|
|||
Loading…
Reference in New Issue