fix:exportSampleInformation

This commit is contained in:
nieziyan 2023-11-08 15:24:09 +08:00
parent b89295f1e1
commit 8cf1294ffe

View File

@ -1315,17 +1315,17 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
}
@Override
public void exportSampleInformation(Integer sampleId, String sampleFileName, HttpServletRequest request, HttpServletResponse response) {
Result<StringBuffer> result = viewSampleInformation(sampleId, sampleFileName, request);
StringBuffer buffer = result.getResult();
if (ObjectUtil.isNull(buffer)) return;
String sampleInfo = buffer.toString();
public void exportSampleInformation(Integer sampleId, String sampleFileName,
HttpServletRequest request, HttpServletResponse response) {
Result<String> result = viewSampleInformation(sampleId, sampleFileName, request);
String sampleInfo = result.getResult();
if (StrUtil.isBlank(sampleInfo)) return;
String colon = SymbolConstant.COLON;
String space = SymbolConstant.SPACE;
String line = SymbolConstant.LINE;
List<String> sampleInfos = ListUtil.toList(sampleInfo.split(line)).stream()
.filter(StrUtil::isNotBlank)
.filter(item -> StrUtil.contains(item,colon))
.filter(item -> StrUtil.contains(item, colon))
.collect(Collectors.toList());
Map<String,Object> dataMap = new HashMap<>();
for (String s : sampleInfos) {
@ -3954,7 +3954,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
export = StrUtil.replace(sampleFileName, ".PHD", ".xls");
}
String template = SAVETOEXCEL.getName();
ExportUtil.exportXls(response, template, analyze,export);
ExportUtil.exportXls(response, template, analyze, export);
}
@Override