修复[删除报告]不生效Bug
This commit is contained in:
@@ -3,8 +3,6 @@ package com.adc.da.report.service;
|
||||
import com.adc.da.report.eo.ReportLabelEntity;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【ts_report_label】的数据库操作Service
|
||||
@@ -16,5 +14,5 @@ public interface IReportLabelService extends IService<ReportLabelEntity> {
|
||||
* 根据报表Id删除所有报表标签关系
|
||||
* @param reportIds 报表id
|
||||
*/
|
||||
void deleteReportLabelByReportId(List<String> reportIds);
|
||||
void deleteReportLabelByReportId(String[] reportIds);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
});
|
||||
|
||||
//修改报表标签关系表(先删后增)
|
||||
iReportLabelService.deleteReportLabelByReportId(Collections.singletonList(entity.getId()));
|
||||
iReportLabelService.deleteReportLabelByReportId(new String[]{entity.getId()});
|
||||
|
||||
//插入报表标签关系表
|
||||
labelList.forEach((label) -> {
|
||||
@@ -286,7 +286,7 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
List<String> nameList = new ArrayList<>();
|
||||
String[] idList = ids.split(",");
|
||||
//删除所有报表标签关系记录
|
||||
iReportLabelService.deleteReportLabelByReportId(Collections.singletonList(Arrays.toString(idList)));
|
||||
iReportLabelService.deleteReportLabelByReportId(idList);
|
||||
for (String id : idList) {
|
||||
ReportEntity entity = reportDao.selectById(id);
|
||||
entity.setDelFlag("1");
|
||||
|
||||
+4
-3
@@ -8,7 +8,6 @@ import com.adc.da.report.dao.mysql.ReportLabelDao;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
@@ -23,9 +22,11 @@ public class ReportLabelServiceImpl extends ServiceImpl<ReportLabelDao, ReportLa
|
||||
private ReportLabelDao reportLabelDao;
|
||||
|
||||
@Override
|
||||
public void deleteReportLabelByReportId(List<String> reportId) {
|
||||
public void deleteReportLabelByReportId(String[] reportId) {
|
||||
LambdaQueryWrapper<ReportLabelEntity> reportLabelWrapper = new LambdaQueryWrapper<>();
|
||||
reportLabelWrapper.in(ReportLabelEntity::getReportId, reportId);
|
||||
for (String id : reportId) {
|
||||
reportLabelWrapper.eq(ReportLabelEntity::getReportId, id);
|
||||
}
|
||||
reportLabelDao.delete(reportLabelWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user