|
@@ -24,17 +24,17 @@ public class FomatExcelFileUtil {
|
|
|
private static String dir = "d:/examcloud-data-export/ret/";
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
- Map<String, BatchQuestionsCountDto> map = new HashMap<>();
|
|
|
+ Map<String, BatchQuestionsMaxCountDto> map = new HashMap<>();
|
|
|
File dirFile = new File(dir);
|
|
|
for (File f : dirFile.listFiles()) {
|
|
|
fillData(f, map);
|
|
|
}
|
|
|
- List<BatchQuestionsCountDto> ret = new ArrayList<>();
|
|
|
+ List<BatchQuestionsMaxCountDto> ret = new ArrayList<>();
|
|
|
ret.addAll(map.values());
|
|
|
- Collections.sort(ret, new Comparator<BatchQuestionsCountDto>() {
|
|
|
+ Collections.sort(ret, new Comparator<BatchQuestionsMaxCountDto>() {
|
|
|
|
|
|
@Override
|
|
|
- public int compare(BatchQuestionsCountDto o1, BatchQuestionsCountDto o2) {
|
|
|
+ public int compare(BatchQuestionsMaxCountDto o1, BatchQuestionsMaxCountDto o2) {
|
|
|
String c1 = o1.getCourseCode();
|
|
|
String c2 = o2.getCourseCode();
|
|
|
return c1.compareTo(c2);
|
|
@@ -49,7 +49,7 @@ public class FomatExcelFileUtil {
|
|
|
}
|
|
|
file.createNewFile();
|
|
|
fos = new FileOutputStream(file);
|
|
|
- ExportUtils.makeExcel(BatchQuestionsCountDto.class, ret, fos);
|
|
|
+ ExportUtils.makeExcel(BatchQuestionsMaxCountDto.class, ret, fos);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
} finally {
|
|
@@ -63,9 +63,9 @@ public class FomatExcelFileUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private static void fillData(File file, Map<String, BatchQuestionsCountDto> map) {
|
|
|
- String fileName = file.getName();
|
|
|
- String fn = fileName.substring(0, fileName.lastIndexOf("."));
|
|
|
+ private static void fillData(File file, Map<String, BatchQuestionsMaxCountDto> map) {
|
|
|
+ // String fileName = file.getName();
|
|
|
+ // String fn = fileName.substring(0, fileName.lastIndexOf("."));
|
|
|
XSSFWorkbook wb = null;
|
|
|
try {
|
|
|
wb = new XSSFWorkbook(file);
|
|
@@ -80,33 +80,37 @@ public class FomatExcelFileUtil {
|
|
|
String val = row.getCell(c).getStringCellValue().trim();
|
|
|
total = total + Integer.valueOf(val);
|
|
|
}
|
|
|
- BatchQuestionsCountDto dto = map.get(subjectCode);
|
|
|
+ BatchQuestionsMaxCountDto dto = map.get(subjectCode);
|
|
|
if (dto == null) {
|
|
|
- dto = new BatchQuestionsCountDto();
|
|
|
+ dto = new BatchQuestionsMaxCountDto();
|
|
|
dto.setCourseCode(subjectCode);
|
|
|
dto.setCourseName(subjectName);
|
|
|
map.put(subjectCode, dto);
|
|
|
}
|
|
|
- if ("230517".equals(fn)) {
|
|
|
- dto.setC1(total);
|
|
|
- } else if ("230821".equals(fn)) {
|
|
|
- dto.setC2(total);
|
|
|
- } else if ("230914".equals(fn)) {
|
|
|
- dto.setC3(total);
|
|
|
- } else if ("231205".equals(fn)) {
|
|
|
- dto.setC4(total);
|
|
|
- } else if ("231219".equals(fn)) {
|
|
|
- dto.setC5(total);
|
|
|
- } else if ("240313".equals(fn)) {
|
|
|
- dto.setC6(total);
|
|
|
- } else if ("240320".equals(fn)) {
|
|
|
- dto.setC7(total);
|
|
|
- } else if ("240612".equals(fn)) {
|
|
|
- dto.setC8(total);
|
|
|
- } else if ("240618".equals(fn)) {
|
|
|
- dto.setC9(total);
|
|
|
+ if (dto.getCount() < total) {
|
|
|
+ dto.setCount(total);
|
|
|
}
|
|
|
|
|
|
+ // if ("230517".equals(fn)) {
|
|
|
+ // dto.setC1(total);
|
|
|
+ // } else if ("230821".equals(fn)) {
|
|
|
+ // dto.setC2(total);
|
|
|
+ // } else if ("230914".equals(fn)) {
|
|
|
+ // dto.setC3(total);
|
|
|
+ // } else if ("231205".equals(fn)) {
|
|
|
+ // dto.setC4(total);
|
|
|
+ // } else if ("231219".equals(fn)) {
|
|
|
+ // dto.setC5(total);
|
|
|
+ // } else if ("240313".equals(fn)) {
|
|
|
+ // dto.setC6(total);
|
|
|
+ // } else if ("240320".equals(fn)) {
|
|
|
+ // dto.setC7(total);
|
|
|
+ // } else if ("240612".equals(fn)) {
|
|
|
+ // dto.setC8(total);
|
|
|
+ // } else if ("240618".equals(fn)) {
|
|
|
+ // dto.setC9(total);
|
|
|
+ // }
|
|
|
+
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|