Commit 3acdacec authored by pengxin's avatar pengxin

数据优化处理。

parent 2b853d01
...@@ -211,6 +211,10 @@ public class DatasetOutputServiceImpl extends BaseService<DatasetOutput, Long> i ...@@ -211,6 +211,10 @@ public class DatasetOutputServiceImpl extends BaseService<DatasetOutput, Long> i
JsonNode rootNode = objectMapper.readTree(datasetData.getData()); JsonNode rootNode = objectMapper.readTree(datasetData.getData());
String output = rootNode.get(DatasetConstant.OUTPUT).textValue(); String output = rootNode.get(DatasetConstant.OUTPUT).textValue();
String instruction = rootNode.get(DatasetConstant.INSTRUCTION).textValue(); String instruction = rootNode.get(DatasetConstant.INSTRUCTION).textValue();
// 替换"\n "为"\n"
output = output.replaceAll("\\n ", "\\n");
instruction = instruction.replaceAll("\\n ", "\\n");
txtData.append(instruction).append("[[").append(output).append("]],\n"); txtData.append(instruction).append("[[").append(output).append("]],\n");
} }
String text = txtData.substring(0, txtData.lastIndexOf(",") ); String text = txtData.substring(0, txtData.lastIndexOf(",") );
...@@ -342,8 +346,8 @@ public class DatasetOutputServiceImpl extends BaseService<DatasetOutput, Long> i ...@@ -342,8 +346,8 @@ public class DatasetOutputServiceImpl extends BaseService<DatasetOutput, Long> i
cell.setCellValue(rootNode.get(DatasetConstant.OUTPUT).textValue()); cell.setCellValue(rootNode.get(DatasetConstant.OUTPUT).textValue());
//根据内容自动填充列大小 //根据内容自动填充列大小
sheet.autoSizeColumn(0); // sheet.autoSizeColumn(0);
sheet.autoSizeColumn(1); // sheet.autoSizeColumn(1);
} }
String fileName = null; String fileName = null;
InputStream inputStream = null; InputStream inputStream = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment