|
@@ -17,6 +17,7 @@ import cn.iselab.mooctest.site.service.fromKibug.ReportService;
|
|
|
import cn.iselab.mooctest.site.web.data.fromKibug.ReportScriptResultVO;
|
|
import cn.iselab.mooctest.site.web.data.fromKibug.ReportScriptResultVO;
|
|
|
import cn.iselab.mooctest.site.web.data.fromKibug.ReportVO;
|
|
import cn.iselab.mooctest.site.web.data.fromKibug.ReportVO;
|
|
|
import cn.iselab.mooctest.site.web.exception.IllegalOperationException;
|
|
import cn.iselab.mooctest.site.web.exception.IllegalOperationException;
|
|
|
|
|
+import cn.iselab.mooctest.site.web.logic.CalculateSocreLogic;
|
|
|
import cn.iselab.mooctest.site.web.logic.ReportLogic;
|
|
import cn.iselab.mooctest.site.web.logic.ReportLogic;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -41,6 +42,8 @@ public class ReportLogicImpl implements ReportLogic {
|
|
|
private ScriptAutoResultDao scriptAutoResultDao;
|
|
private ScriptAutoResultDao scriptAutoResultDao;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CaseTakeDao caseTakeDao;
|
|
private CaseTakeDao caseTakeDao;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CalculateSocreLogic calculateSocreLogic;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Long createReport(ReportVO vo) throws Exception {
|
|
public Long createReport(ReportVO vo) throws Exception {
|
|
@@ -80,12 +83,14 @@ public class ReportLogicImpl implements ReportLogic {
|
|
|
@Override
|
|
@Override
|
|
|
public void recordReportScript(long reportId, ReportScriptResultVO vo) throws Exception {
|
|
public void recordReportScript(long reportId, ReportScriptResultVO vo) throws Exception {
|
|
|
ScriptAutoResult scriptAutoResult = reportService.getScriptAutoResult(reportId);
|
|
ScriptAutoResult scriptAutoResult = reportService.getScriptAutoResult(reportId);
|
|
|
|
|
+
|
|
|
|
|
+ Report report = reportService.getReport(reportId);
|
|
|
|
|
+ if (report == null) {
|
|
|
|
|
+ throw new IllegalOperationException("错误的报告Id");
|
|
|
|
|
+ }
|
|
|
|
|
+ CaseTake caseTake = caseTakeDao.findOne(report.getCaseTakeId());
|
|
|
|
|
+
|
|
|
if (scriptAutoResult == null) {
|
|
if (scriptAutoResult == null) {
|
|
|
- Report report = reportService.getReport(reportId);
|
|
|
|
|
- if (report == null) {
|
|
|
|
|
- throw new IllegalOperationException("错误的报告Id");
|
|
|
|
|
- }
|
|
|
|
|
- CaseTake caseTake = caseTakeDao.findOne(report.getCaseTakeId());
|
|
|
|
|
scriptAutoResult = new ScriptAutoResult();
|
|
scriptAutoResult = new ScriptAutoResult();
|
|
|
scriptAutoResult.setReportId(reportId);
|
|
scriptAutoResult.setReportId(reportId);
|
|
|
scriptAutoResult.setApplicationId(caseTake.getApplicationId());
|
|
scriptAutoResult.setApplicationId(caseTake.getApplicationId());
|
|
@@ -99,5 +104,7 @@ public class ReportLogicImpl implements ReportLogic {
|
|
|
scriptAutoResult.setResult(vo.getResult());
|
|
scriptAutoResult.setResult(vo.getResult());
|
|
|
}
|
|
}
|
|
|
scriptAutoResultDao.save(scriptAutoResult);
|
|
scriptAutoResultDao.save(scriptAutoResult);
|
|
|
|
|
+
|
|
|
|
|
+ calculateSocreLogic.calculateScore(caseTake.getTaskId(),caseTake.getCaseId(),caseTake.getParticipantId());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|