|
@@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
import cn.com.qmth.examcloud.core.oe.admin.api.ExamStudentDataCloudService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.api.ExamStudentDataCloudService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamStudentDataBean;
|
|
import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamStudentDataBean;
|
|
import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamStudentScoreDataBean;
|
|
import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamStudentScoreDataBean;
|
|
@@ -55,10 +56,10 @@ public class ReportsComputeServiceImpl implements ReportsComputeService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ExamStudentDataCloudService examStudentDataCloudService;
|
|
private ExamStudentDataCloudService examStudentDataCloudService;
|
|
-
|
|
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private ExamCourseDataReportCloudService examCourseDataReportCloudService;
|
|
private ExamCourseDataReportCloudService examCourseDataReportCloudService;
|
|
-
|
|
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private ExamOrgReportCloudService examOrgReportBeanCloudService;
|
|
private ExamOrgReportCloudService examOrgReportBeanCloudService;
|
|
|
|
|
|
@@ -129,7 +130,7 @@ public class ReportsComputeServiceImpl implements ReportsComputeService {
|
|
updateToFail(et, "考试id为空");
|
|
updateToFail(et, "考试id为空");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
List<Long> examIds = Arrays.asList(pro.getExamIds().split(",")).stream().map(str -> Long.parseLong(str))
|
|
List<Long> examIds = Arrays.asList(pro.getExamIds().split(",")).stream().map(str -> Long.parseLong(str))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
Map<String, Object> result = new HashMap<String, Object>();
|
|
Map<String, Object> result = new HashMap<String, Object>();
|
|
@@ -193,32 +194,32 @@ public class ReportsComputeServiceImpl implements ReportsComputeService {
|
|
// 判断任务终止
|
|
// 判断任务终止
|
|
checkIsStoping(et.getId());
|
|
checkIsStoping(et.getId());
|
|
// 设置中心、课程、考试code和名称
|
|
// 设置中心、课程、考试code和名称
|
|
- //TODO
|
|
|
|
-
|
|
|
|
|
|
+ // TODO
|
|
|
|
+
|
|
// 判断任务终止
|
|
// 判断任务终止
|
|
checkIsStoping(et.getId());
|
|
checkIsStoping(et.getId());
|
|
-
|
|
|
|
- //清除旧数据
|
|
|
|
- DeleteExamOrgReportByProjectReq dreq1=new DeleteExamOrgReportByProjectReq();
|
|
|
|
|
|
+
|
|
|
|
+ // 清除旧数据
|
|
|
|
+ DeleteExamOrgReportByProjectReq dreq1 = new DeleteExamOrgReportByProjectReq();
|
|
dreq1.setProjectId(pro.getId());
|
|
dreq1.setProjectId(pro.getId());
|
|
dreq1.setRootOrgId(pro.getRootOrgId());
|
|
dreq1.setRootOrgId(pro.getRootOrgId());
|
|
examOrgReportBeanCloudService.deleteExamOrgReportByProject(dreq1);
|
|
examOrgReportBeanCloudService.deleteExamOrgReportByProject(dreq1);
|
|
-
|
|
|
|
- DeleteExamCourseDataReportByProjectReq dreq2=new DeleteExamCourseDataReportByProjectReq();
|
|
|
|
|
|
+
|
|
|
|
+ DeleteExamCourseDataReportByProjectReq dreq2 = new DeleteExamCourseDataReportByProjectReq();
|
|
dreq2.setProjectId(pro.getId());
|
|
dreq2.setProjectId(pro.getId());
|
|
dreq2.setRootOrgId(pro.getRootOrgId());
|
|
dreq2.setRootOrgId(pro.getRootOrgId());
|
|
examCourseDataReportCloudService.deleteExamCourseDataReportByProject(dreq2);
|
|
examCourseDataReportCloudService.deleteExamCourseDataReportByProject(dreq2);
|
|
-
|
|
|
|
- //保存计算结果
|
|
|
|
- SaveExamOrgReportListReq req1=new SaveExamOrgReportListReq();
|
|
|
|
|
|
+
|
|
|
|
+ // 保存计算结果
|
|
|
|
+ SaveExamOrgReportListReq req1 = new SaveExamOrgReportListReq();
|
|
req1.setBeans(new ArrayList<ExamOrgReportBean>(examOrgReport.values()));
|
|
req1.setBeans(new ArrayList<ExamOrgReportBean>(examOrgReport.values()));
|
|
examOrgReportBeanCloudService.saveExamOrgReportList(req1);
|
|
examOrgReportBeanCloudService.saveExamOrgReportList(req1);
|
|
-
|
|
|
|
|
|
+
|
|
// 判断任务终止
|
|
// 判断任务终止
|
|
checkIsStoping(et.getId());
|
|
checkIsStoping(et.getId());
|
|
-
|
|
|
|
- //保存计算结果
|
|
|
|
- SaveExamCourseDataReportListReq req2=new SaveExamCourseDataReportListReq();
|
|
|
|
|
|
+
|
|
|
|
+ // 保存计算结果
|
|
|
|
+ SaveExamCourseDataReportListReq req2 = new SaveExamCourseDataReportListReq();
|
|
req2.setBeans(new ArrayList<ExamCourseDataReportBean>(examCourseDataReport.values()));
|
|
req2.setBeans(new ArrayList<ExamCourseDataReportBean>(examCourseDataReport.values()));
|
|
examCourseDataReportCloudService.saveExamCourseDataReportList(req2);
|
|
examCourseDataReportCloudService.saveExamCourseDataReportList(req2);
|
|
}
|
|
}
|
|
@@ -553,4 +554,18 @@ public class ReportsComputeServiceImpl implements ReportsComputeService {
|
|
jobStopFlag.remove(et.getId());
|
|
jobStopFlag.remove(et.getId());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Transactional
|
|
|
|
+ @Override
|
|
|
|
+ public void add(Long projectId, Long rootOrgId) {
|
|
|
|
+ List<ReportsComputeEntity> list=reportsComputeRepo.findByProjectIdAndRootOrgIdAndStatus(projectId,rootOrgId,ReportsComputeStatus.COMPUTING);
|
|
|
|
+ if(list!=null&&list.size()>0) {
|
|
|
|
+ throw new StatusException("10001", "该项目正在计算中");
|
|
|
|
+ }
|
|
|
|
+ ReportsComputeEntity e=new ReportsComputeEntity();
|
|
|
|
+ e.setProjectId(projectId);
|
|
|
|
+ e.setRootOrgId(rootOrgId);
|
|
|
|
+ e.setStatus(ReportsComputeStatus.NONE);
|
|
|
|
+ reportsComputeRepo.save(e);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|