fix(质量分析): 增加查询代码字段shixunCodeIds

master
youys 5 days ago
parent 268808fb1b
commit 3c6a5734dd

@ -8,6 +8,7 @@ import net.educoder.ecsonar.model.TaskInfoDetail;
import net.educoder.ecsonar.model.vo.QualityInspectUserDataVO;
import net.educoder.ecsonar.services.DbOperateService;
import net.educoder.ecsonar.services.SonarService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.tomcat.util.http.fileupload.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -64,15 +65,16 @@ public class QualityInspectRunnable implements Runnable {
List<Long> codeIds = userData.getCodeIds();
List<Long> shiXunCodeIds = userData.getStudentWorkShixunCodeIds();
for (Long codeId : codeIds) {
processCodeId(codeId, path, projectName, dbOperateService::queryGameCodesById);
}
for (Long codeId : shiXunCodeIds) {
processCodeId(codeId, path, projectName, dbOperateService::queryShiXunCodesById);
if(CollectionUtils.isNotEmpty(shiXunCodeIds)){
for (Long codeId : shiXunCodeIds) {
processCodeId(codeId, path, projectName, dbOperateService::queryShiXunCodesById);
}
}else{
for (Long codeId : codeIds) {
processCodeId(codeId, path, projectName, dbOperateService::queryGameCodesById);
}
}
// 写完所有文件开始用sonar进行质量分析
SonarScannerParam param = new SonarScannerParam(projectName, path);
if (Constant.C.equalsIgnoreCase(language) || Constant.CXX.equalsIgnoreCase(language)) {

@ -14,7 +14,7 @@ spring.datasource.master.driverClassName=org.postgresql.Driver
#### test ######
spring.datasource.readonly.driverClassName=com.mysql.jdbc.Driver
spring.datasource.readonly.url=jdbc:mysql://testeducoder-public.mysql.polardb.rds.aliyuncs.com:3306/newtesteducoderweb?userSSL=false&useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false
spring.datasource.readonly.url=jdbc:mysql://testeducoder-public.mysql.polardb.rds.aliyuncs.com:3306/newtesteducoderweb?useSSL=false&useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false
spring.datasource.readonly.username=testeducoder
spring.datasource.readonly.password=TEST@123

Loading…
Cancel
Save