|
@@ -2,7 +2,9 @@ package cn.iselab.mooctest.site.service.impl;
|
|
|
|
|
|
import cn.iselab.mooctest.site.dao.ExamDao;
|
|
import cn.iselab.mooctest.site.dao.ExamDao;
|
|
import cn.iselab.mooctest.site.models.Task;
|
|
import cn.iselab.mooctest.site.models.Task;
|
|
|
|
+import cn.iselab.mooctest.site.service.BaseService;
|
|
import cn.iselab.mooctest.site.service.ExamStatusService;
|
|
import cn.iselab.mooctest.site.service.ExamStatusService;
|
|
|
|
+import cn.iselab.mooctest.site.web.logic.CalculateSocreLogic;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -10,10 +12,13 @@ import org.springframework.stereotype.Service;
|
|
* Created by shanshan on 2017/7/17.
|
|
* Created by shanshan on 2017/7/17.
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
-public class ExamStatusServiceImpl implements ExamStatusService {
|
|
|
|
|
|
+public class ExamStatusServiceImpl extends BaseService implements ExamStatusService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ExamDao examDao;
|
|
private ExamDao examDao;
|
|
|
|
+
|
|
|
|
+ @Autowired CalculateSocreLogic calculateSocreLogic;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Integer updateStatus(Task task) {
|
|
public Integer updateStatus(Task task) {
|
|
int status = 0;
|
|
int status = 0;
|
|
@@ -29,6 +34,13 @@ public class ExamStatusServiceImpl implements ExamStatusService {
|
|
} else {
|
|
} else {
|
|
status = Task.STATUS_SCORING;
|
|
status = Task.STATUS_SCORING;
|
|
}
|
|
}
|
|
|
|
+ if (task.getStatus().equals(Task.STATUS_ONGOING) && status == Task.STATUS_SCORING) {
|
|
|
|
+ try {
|
|
|
|
+ calculateSocreLogic.competeAnalysis(task.getId());
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ LOG.error("计算竞争分析出错,task id : "+ task.getId() + " " + e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
examDao.updateStatusById(task.getId(),status);
|
|
examDao.updateStatusById(task.getId(),status);
|
|
return status;
|
|
return status;
|
|
}
|
|
}
|