|
@@ -1,12 +1,18 @@
|
|
|
package com.qmth.teachcloud.report.business.templete.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
+import com.qmth.teachcloud.report.business.entity.TBPaper;
|
|
|
import com.qmth.teachcloud.report.business.service.AnalyzeForReportService;
|
|
|
+import com.qmth.teachcloud.report.business.service.TBExamService;
|
|
|
+import com.qmth.teachcloud.report.business.service.TBPaperService;
|
|
|
import com.qmth.teachcloud.report.business.templete.service.TaskCalculateService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@@ -18,12 +24,25 @@ import java.util.Map;
|
|
|
public class TaskCalculateServiceImpl implements TaskCalculateService {
|
|
|
@Resource
|
|
|
private AnalyzeForReportService analyzeForReportService;
|
|
|
+ @Resource
|
|
|
+ private TBExamService tbExamService;
|
|
|
+ @Resource
|
|
|
+ private TBPaperService tbPaperService;
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public Map<String, Object> dataCalculate(Map<String, Object> map) throws Exception {
|
|
|
Long examId = SystemConstant.convertIdToLong(String.valueOf(map.get("examId")));
|
|
|
String courseCode = String.valueOf(map.get("courseCode"));
|
|
|
+ BigDecimal coefficient = BigDecimal.valueOf(Long.parseLong(String.valueOf(map.get("coefficient"))));
|
|
|
+ List<TBPaper> tbPaperList = tbPaperService.list(new QueryWrapper<TBPaper>().lambda()
|
|
|
+ .eq(TBPaper::getExamId, examId).eq(TBPaper::getCourseCode, courseCode));
|
|
|
+ for (TBPaper tbPaper : tbPaperList) {
|
|
|
+ tbPaper.setCoefficient(coefficient);
|
|
|
+ }
|
|
|
+ tbPaperService.updateBatchById(tbPaperList);
|
|
|
+ analyzeForReportService.normalAssignScore(examId,tbExamService.getById(examId).getSchoolId(),courseCode);
|
|
|
+
|
|
|
analyzeForReportService.dataCalculate(examId,courseCode);
|
|
|
return map;
|
|
|
}
|