|
@@ -250,20 +250,36 @@ public class FileService {
|
|
|
List<String> lines = new ArrayList<>();
|
|
|
IoUtil.readLines(new InputStreamReader(inputStream, "utf-8"), lines);
|
|
|
int curRow = 0;
|
|
|
- for (String string : lines) {
|
|
|
- if (string.equals("注销信息")) {
|
|
|
+ boolean processNext = false;
|
|
|
+
|
|
|
+ for (String line : lines) {
|
|
|
+ if (line.equals("注销信息")) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (processNext) {
|
|
|
+ List<String> values = Arrays.asList(line.split("\t"));
|
|
|
+ if (values.size() > 1) {
|
|
|
+ mongoExcelService.getRows(
|
|
|
+ 0,
|
|
|
+ curRow,
|
|
|
+ values.stream().map(PublicStatic::removeAllSpecial).collect(Collectors.toList())
|
|
|
+ );
|
|
|
+ curRow++;
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
- List<String> values = Arrays.asList(string.split("\t"));
|
|
|
- if (values.size() <= 1) {
|
|
|
- continue;
|
|
|
+ if (line.contains("账户状态\t账号")) {
|
|
|
+ // 先存储表头行
|
|
|
+ mongoExcelService.getRows(
|
|
|
+ 0,
|
|
|
+ curRow,
|
|
|
+ Arrays.stream(line.split("\t"))
|
|
|
+ .map(PublicStatic::removeAllSpecial)
|
|
|
+ .collect(Collectors.toList())
|
|
|
+ );
|
|
|
+ curRow++;
|
|
|
+ processNext = true;
|
|
|
}
|
|
|
- mongoExcelService.getRows(
|
|
|
- 0,
|
|
|
- curRow,
|
|
|
- values.stream().map(PublicStatic::removeAllSpecial).collect(Collectors.toList())
|
|
|
- );
|
|
|
- curRow++;
|
|
|
}
|
|
|
mongoExcelService.insertRest();
|
|
|
}
|