修复删除标签后,刷新不出列表的Bug

This commit is contained in:
2023-04-21 10:42:09 +08:00
parent d835a37453
commit ed9adf2a93
2 changed files with 29 additions and 0 deletions
@@ -142,8 +142,15 @@ public class ITreeLabelServiceImpl extends ServiceImpl<TreeLabelDao, TreeLabelEn
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean deleteById(String id) {
List<String> nodeAndChildrenIds = findNodeAndChildrenIds(getTreeLabelRoot(), id).stream().distinct().collect(Collectors.toList());
LambdaQueryWrapper<ReportLabelEntity> wrapper = new LambdaQueryWrapper<>();
nodeAndChildrenIds.forEach(labelLd -> {
wrapper.eq(ReportLabelEntity::getLabelId, labelLd);
reportLabelDao.delete(wrapper);
});
int i = treeLabelDao.deleteBatchIds(nodeAndChildrenIds);
return i != 0;
}
@@ -0,0 +1,22 @@
package com.adc.da.report.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.adc.da.report.eo.ReportLabelEntity;
import com.adc.da.report.service.IReportLabelService;
import com.adc.da.report.dao.mysql.ReportLabelDao;
import org.springframework.stereotype.Service;
/**
* @author ThinkBook
* @description 针对表【ts_report_label】的数据库操作Service实现
* @createDate 2023-04-19 11:28:48
*/
@Service
public class ReportLabelServiceImpl extends ServiceImpl<ReportLabelDao, ReportLabelEntity>
implements IReportLabelService {
}