湖南工业大学-2023届软件工程 质量评分

manual-analysis
youys 2 years ago
parent c5c39bb23c
commit f58ab6d20e

@ -258,7 +258,7 @@ public class SonarService {
*/ */
public void scanExcel(String excelPath) { public void scanExcel(String excelPath) {
int homeworkId = 20230302; int homeworkId = 20230402;
try { try {
List<Person> personList = ExcelUtil.readExcel(excelPath); List<Person> personList = ExcelUtil.readExcel(excelPath);

@ -57,10 +57,10 @@ public class ReadExcelRunnable implements Runnable{
// } // }
// } // }
String key = String.format("%d-%s", homeworkId, uid); String key = String.format("%d-%s", homeworkId, uid);
if(new File(path + "/.scannerwork/").exists()){ // if(new File(path + "/.scannerwork/").exists()){
System.out.println(path+ "----exist"); // System.out.println(path+ "----exist");
return; // return;
} // }
log.info("开始调用sonar:{}",key); log.info("开始调用sonar:{}",key);
sonarService.sonar(path,key); sonarService.sonar(path,key);
} }

@ -406,7 +406,7 @@ public class ExcelUtil {
String uid = row.getCell(1).getStringCellValue(); String uid = row.getCell(1).getStringCellValue();
String downloadUrl = row.getCell(2).getStringCellValue() + "?secret_key=806ac9e5a8b40233c99bb513a315ed66"; String downloadUrl = row.getCell(2).getStringCellValue();
Person person = new Person(); Person person = new Person();
person.setName(name); person.setName(name);

@ -29,17 +29,17 @@ public class RarUtil {
public static void main(String[] args) { public static void main(String[] args) {
// unrar("/tmp/20230301/201905962222/20230519153409_wuiol3vn.rar", "/Users/youyongsheng/Desktop/aa"); // unrar("/tmp/20230301/201905962222/20230519153409_wuiol3vn.rar", "/Users/youyongsheng/Desktop/aa");
un7Z("/tmp/20230301/201905962241/20230519153506_i39sv5p2.7z", "/Users/youyongsheng/Desktop/aa"); // un7Z("/tmp/20230301/201905962241/20230519153506_i39sv5p2.7z", "/Users/youyongsheng/Desktop/aa");
// unzip(); // unzip();
// valid("/tmp/20230201"); valid("/tmp/20230402");
removeFullCode("/tmp/20230302"); // removeFullCode("/tmp/20230302");
} }
public static void unzip(){ public static void unzip(){
String sourceDir = "/tmp/20230301"; String sourceDir = "/tmp/20230401";
String targetDir = "/tmp/20230302"; String targetDir = "/tmp/20230402";
File directory = new File(sourceDir); File directory = new File(sourceDir);
File[] studentDirs = directory.listFiles(); File[] studentDirs = directory.listFiles();
@ -71,12 +71,10 @@ public class RarUtil {
for (File zipFile : zipFiles) { for (File zipFile : zipFiles) {
try { try {
if(zipFile.getName().endsWith(".zip")){ if(zipFile.getName().endsWith(".zip")){
// unzip(zipFile.getAbsolutePath(), studentTargetDir); unzip(zipFile.getAbsolutePath(), studentTargetDir);
}else if(zipFile.getName().endsWith(".rar")){ }else if(zipFile.getName().endsWith(".rar")){
System.out.println(zipFile.getAbsolutePath() + " to " + targetDir);
unRar(zipFile.getAbsolutePath(), studentTargetDir); unRar(zipFile.getAbsolutePath(), studentTargetDir);
}else{ }else{
System.out.println(zipFile.getAbsolutePath() + " to " + targetDir);
RarUtil.un7Z(zipFile.getAbsolutePath(), studentTargetDir); RarUtil.un7Z(zipFile.getAbsolutePath(), studentTargetDir);
} }
} catch (Exception e) { } catch (Exception e) {
@ -110,7 +108,11 @@ public class RarUtil {
for (File studentDir : studentDirs) { for (File studentDir : studentDirs) {
if (studentDir.isDirectory()) { if (studentDir.isDirectory()) {
for (File file : studentDir.listFiles()) { File[] files = studentDir.listFiles();
if(files == null || files.length == 0){
System.out.println(studentDir.getName()+" -> null");
}
for (File file : files) {
System.out.println(studentDir.getName()+" ->" + file.getName()); System.out.println(studentDir.getName()+" ->" + file.getName());
} }
System.out.println("--------------------------------"); System.out.println("--------------------------------");

@ -68,7 +68,7 @@ public class EcsonarApplicationTests {
CountDownLatch countDownLatch = new CountDownLatch(1); CountDownLatch countDownLatch = new CountDownLatch(1);
// String excelPath = "/Users/youyongsheng/Desktop/ZQ/质量分析/2023-05-16/data.xlsx"; // String excelPath = "/Users/youyongsheng/Desktop/ZQ/质量分析/2023-05-16/data.xlsx";
String excelPath = "/Users/youyongsheng/Desktop/ZQ/质量分析/2023-05-16/111111.xlsx"; String excelPath = "/Users/youyongsheng/Desktop/ZQ/质量分析/2023-05-24/湖南工业大学-2023届软件工程-原始数据.xlsx";
sonarService.scanExcel(excelPath); sonarService.scanExcel(excelPath);
try { try {
@ -81,13 +81,13 @@ public class EcsonarApplicationTests {
@Test @Test
public void writeExcel() throws Exception { public void writeExcel() throws Exception {
int homeworkId = 20230202; int homeworkId = 20230402;
String directory = "/tmp/20230202/"; String directory = "/tmp/20230402/";
File file = new File(directory); File file = new File(directory);
File[] files = file.listFiles(); File[] files = file.listFiles();
System.out.println("学生数:" + files.length); System.out.println("学生数:" + files.length);
List<Person> personList = ExcelUtil.readExcel("/Users/youyongsheng/Desktop/ZQ/质量分析/2023-05-16/湘潭大学网络工程专业2023届-原始数据.xlsx"); List<Person> personList = ExcelUtil.readExcel("/Users/youyongsheng/Desktop/ZQ/质量分析/2023-05-24/湖南工业大学-2023届软件工程-原始数据.xlsx");
Map<String, List<Person>> collect = personList.stream().collect(Collectors.groupingBy(Person::getUid)); Map<String, List<Person>> collect = personList.stream().collect(Collectors.groupingBy(Person::getUid));
@ -100,7 +100,7 @@ public class EcsonarApplicationTests {
Metrics metrics = reportService.getMetrics(projectName); Metrics metrics = reportService.getMetrics(projectName);
String templatePath = this.getClass().getClassLoader().getResource("template1.xlsx").getPath(); String templatePath = this.getClass().getClassLoader().getResource("template1.xlsx").getPath();
String outPath = "/Users/youyongsheng/Desktop/bbbbb.xlsx"; String outPath = "/Users/youyongsheng/Desktop/ddddd.xlsx";
System.out.println("第"+(i++)+"个学生," + uid); System.out.println("第"+(i++)+"个学生," + uid);
if (CollectionUtils.isEmpty(collect.get(uid))) { if (CollectionUtils.isEmpty(collect.get(uid))) {

Loading…
Cancel
Save