Commit e0e26763 authored by 霍传世's avatar 霍传世

测试生成上传任务表

parent 0dcd88b5
......@@ -210,6 +210,7 @@ public class PDFGeByProvinceBatchController {
Map<String, List<ClassBasicReportParameters>> classSubjectReport = synthesisClassSubjectReportParameters.stream().collect(Collectors.groupingBy(ClassBasicReportParameters::getProvince));
ExecutorService executorService = Executors.newFixedThreadPool(10);
//分组开始执行记录
for (String key : schoolReport.keySet()) {
......@@ -219,6 +220,7 @@ public class PDFGeByProvinceBatchController {
List<ClassBasicReportParameters> classBasicReport = classReport.get(key);
List<ClassBasicReportParameters> classSubject = classSubjectReport.get(key);
for (BasicReportParameters schoolLevel : schoolBasicReport) {
executorService.submit(() -> {
logger.info("school:"+schoolLevel.getSchool()+"loading---------------------------------------------------------------");
Map<String, List<BasicReportParameters>> schoolMap= schoolSubject.stream().collect(Collectors.groupingBy(BasicReportParameters::getSchool));
Map<String, List<ClassBasicReportParameters>> classBasic = classBasicReport.stream().collect(Collectors.groupingBy(ClassBasicReportParameters::getSchool));
......@@ -228,13 +230,29 @@ public class PDFGeByProvinceBatchController {
ProcessBuilder processBuilder = new ProcessBuilder();
processBuilder.command("bash", "-c", schoolLevel.getCommand());
processBuilder.redirectErrorStream(true); // 合并标准输出和错误输出
Process process = processBuilder.start();
Process process = null;
try {
process = processBuilder.start();
} catch (IOException e) {
throw new RuntimeException(e);
}
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
while ((line = reader.readLine()) != null) {
while (true) {
try {
if (!((line = reader.readLine()) != null)) break;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
try {
int exitCode = process.waitFor();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
logger.info("exitCode:"+schoolLevel.getSchool());
});
//上传文件
// File basicFile = new File("/myworkSpace/basic/");
// File[] basicFiles = basicFile.listFiles();
......
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