|
|
@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.bstek.ureport.provider.report.ReportFile; |
|
|
|
import com.bstek.ureport.provider.report.ReportFile; |
|
|
|
import com.bstek.ureport.provider.report.ReportProvider; |
|
|
|
import com.bstek.ureport.provider.report.ReportProvider; |
|
|
|
|
|
|
|
import com.cloud.kicc.common.security.util.SecurityUtils; |
|
|
|
import com.cloud.kicc.report.api.entity.ReportSystemFile; |
|
|
|
import com.cloud.kicc.report.api.entity.ReportSystemFile; |
|
|
|
import com.cloud.kicc.report.properties.ReportDatabaseProperties; |
|
|
|
import com.cloud.kicc.report.properties.ReportDatabaseProperties; |
|
|
|
import com.cloud.kicc.report.service.IReportFileService; |
|
|
|
import com.cloud.kicc.report.service.IReportFileService; |
|
|
@ -32,6 +33,7 @@ public class DatabaseProvider implements ReportProvider { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public InputStream loadReport(String file) { |
|
|
|
public InputStream loadReport(String file) { |
|
|
|
|
|
|
|
SecurityUtils.openInterfaceTemporaryLoginSession("1510539584287346688"); |
|
|
|
ReportSystemFile reportSystemFile = service.getOne(Wrappers.<ReportSystemFile>lambdaQuery().eq(ReportSystemFile::getName, getFileName(file))); |
|
|
|
ReportSystemFile reportSystemFile = service.getOne(Wrappers.<ReportSystemFile>lambdaQuery().eq(ReportSystemFile::getName, getFileName(file))); |
|
|
|
byte[] content = reportSystemFile.getContent(); |
|
|
|
byte[] content = reportSystemFile.getContent(); |
|
|
|
return new ByteArrayInputStream(content); |
|
|
|
return new ByteArrayInputStream(content); |
|
|
@ -39,11 +41,13 @@ public class DatabaseProvider implements ReportProvider { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void deleteReport(String file) { |
|
|
|
public void deleteReport(String file) { |
|
|
|
|
|
|
|
SecurityUtils.openInterfaceTemporaryLoginSession("1510539584287346688"); |
|
|
|
service.remove(Wrappers.<ReportSystemFile>lambdaUpdate().eq(ReportSystemFile::getName, getFileName(file))); |
|
|
|
service.remove(Wrappers.<ReportSystemFile>lambdaUpdate().eq(ReportSystemFile::getName, getFileName(file))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<ReportFile> getReportFiles() { |
|
|
|
public List<ReportFile> getReportFiles() { |
|
|
|
|
|
|
|
SecurityUtils.openInterfaceTemporaryLoginSession("1510539584287346688"); |
|
|
|
List<ReportSystemFile> list = service.list(); |
|
|
|
List<ReportSystemFile> list = service.list(); |
|
|
|
List<ReportFile> reportFiles= new ArrayList<>(); |
|
|
|
List<ReportFile> reportFiles= new ArrayList<>(); |
|
|
|
list.forEach(reportSystemFile -> { |
|
|
|
list.forEach(reportSystemFile -> { |
|
|
@ -59,6 +63,7 @@ public class DatabaseProvider implements ReportProvider { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void saveReport(String file, String content) { |
|
|
|
public void saveReport(String file, String content) { |
|
|
|
|
|
|
|
SecurityUtils.openInterfaceTemporaryLoginSession("1510539584287346688"); |
|
|
|
String fileName = getFileName(file); |
|
|
|
String fileName = getFileName(file); |
|
|
|
ReportSystemFile reportFile = service.getOne(Wrappers.<ReportSystemFile>lambdaQuery().eq(ReportSystemFile::getName, fileName)); |
|
|
|
ReportSystemFile reportFile = service.getOne(Wrappers.<ReportSystemFile>lambdaQuery().eq(ReportSystemFile::getName, fileName)); |
|
|
|
if (reportFile == null) { |
|
|
|
if (reportFile == null) { |
|
|
|