Commit 2e545a80 by liuzz

异常信息统计bug

parent 5d612191
......@@ -528,7 +528,7 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
.replaceAll("\\(", "")
.replaceAll("\\)", "")
.split(",");
b = Convert.toInt(split[1]);
b = split.length == 1? 0: Convert.toInt(split[1]);
a = Convert.toInt(split[0]) - b;
}else if (StringUtils.containsIgnoreCase(vo.getFieldType(), "char")){
c = Convert.toInt(StrUtil.replaceIgnoreCase(
......@@ -541,8 +541,8 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
.replaceAll("\\(", "")
.replaceAll("\\)", "")
.split(",");
y = Convert.toInt(split[1]);
x = Convert.toInt(split[0]) - b;
y = split.length == 1? 0: Convert.toInt(split[1]);
x = Convert.toInt(split[0]) - y;
}else if (StringUtils.containsIgnoreCase(vo.getColumnType(), "char")){
z = Convert.toInt(StrUtil.replaceIgnoreCase(
StrUtil.replaceIgnoreCase(vo.getColumnType(), "varchar2", ""), "varchar", "")
......@@ -677,22 +677,6 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
@SneakyThrows
public static void main(String[] args) {
ExecutorService executorService = Executors.newFixedThreadPool(10);
List<Integer> taskList = Arrays.asList(1, 1, 3, 3, 5, 6, 9, 9, 9, 9);
CompletableFuture<?>[] array = taskList.stream()
.map(i -> CompletableFuture.runAsync(() -> {
try {
TimeUnit.SECONDS.sleep(i);
} catch (InterruptedException e) {
throw new RuntimeException("休眠异常:"+ i);
}
System.out.println(StrUtil.format("当前线程:{}:当前数据:{}",Thread.currentThread().getName(),i));
if (i == 6){
throw new RuntimeException("指定错误:"+ i);
}
}, executorService))
.toArray(CompletableFuture<?>[]::new);
CompletableFuture.allOf(array).get();
System.out.println("结束");
System.out.println("1,".split(",").length);
}
}
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