|
|
|
@ -5,13 +5,14 @@ import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.StuTrainingExample;
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs;
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.SysKnowledgeSummary;
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample;
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.SysWeight;
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.resource_entity.TestSysKnowledgeSummary;
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.stu_dto.ReceivingObject;
|
|
|
|
|
import com.sztzjy.financial_bigdata.mapper.StuTrainingMapper;
|
|
|
|
|
import com.sztzjy.financial_bigdata.mapper.SysKnowledgeSummaryMapper;
|
|
|
|
|
import com.sztzjy.financial_bigdata.mapper.SysObjectiveQuestionMapper;
|
|
|
|
|
import com.sztzjy.financial_bigdata.mapper.SysWeightMapper;
|
|
|
|
|
import com.sztzjy.financial_bigdata.resourceCenterAPI.KnowledgeSummaryApi;
|
|
|
|
|
import com.sztzjy.financial_bigdata.service.tea.ITeaGradeManageService;
|
|
|
|
|
import com.sztzjy.financial_bigdata.util.PdfUtil;
|
|
|
|
|
import com.sztzjy.financial_bigdata.util.ResultEntity;
|
|
|
|
|
import com.sztzjy.financial_bigdata.util.file.IFileUtil;
|
|
|
|
@ -32,6 +33,7 @@ import java.io.File;
|
|
|
|
|
import java.io.FileNotFoundException;
|
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -50,6 +52,10 @@ public class StuKnowledgeNote {
|
|
|
|
|
private String filePath;
|
|
|
|
|
@Autowired
|
|
|
|
|
private SysKnowledgeSummaryMapper sysKnowledgeSummaryMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private SysWeightMapper sysWeightMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ITeaGradeManageService iTeaGradeManageService;
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@ApiOperation("知识笔记-保存")
|
|
|
|
@ -112,10 +118,10 @@ public class StuKnowledgeNote {
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@ApiOperation("***知识概要-获取页面")
|
|
|
|
|
@PostMapping("getSysKnowledgeSummaryByChapterId")
|
|
|
|
|
public ResultEntity<TestSysKnowledgeSummary> getSysKnowledgeSummaryByChapterId(@RequestParam String chapterId,@RequestParam String courseId, @RequestParam String schoolId, @RequestParam String systemOwner) {
|
|
|
|
|
public ResultEntity<TestSysKnowledgeSummary> getSysKnowledgeSummaryByChapterId(@RequestParam String chapterId, @RequestParam String courseId, @RequestParam String schoolId, @RequestParam String systemOwner) {
|
|
|
|
|
TestSysKnowledgeSummary sysKnowledgeSummary = null;
|
|
|
|
|
try {
|
|
|
|
|
sysKnowledgeSummary = KnowledgeSummaryApi.getSysKnowledgeSummary(courseId,chapterId, schoolId, systemOwner);
|
|
|
|
|
sysKnowledgeSummary = KnowledgeSummaryApi.getSysKnowledgeSummary(courseId, chapterId, schoolId, systemOwner);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "资源中心接口异常");
|
|
|
|
|
}
|
|
|
|
@ -161,7 +167,39 @@ public class StuKnowledgeNote {
|
|
|
|
|
} else {
|
|
|
|
|
return new ResultEntity<>(list.get(0).getTrainingId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@ApiOperation("知识概要-算分")
|
|
|
|
|
@PostMapping("getScore") //阅读1分钟得60分,1分钟以下不得分,多1分钟加10分。 60分为默认值老师可修改
|
|
|
|
|
public ResultEntity<BigDecimal> getScore(@ApiParam("数字 单位分钟") @RequestParam Integer minutes,
|
|
|
|
|
@RequestParam String courseId,
|
|
|
|
|
@RequestParam String schoolId,
|
|
|
|
|
@RequestParam String systemOwner,
|
|
|
|
|
@RequestParam String trainingId) {
|
|
|
|
|
StuTrainingWithBLOBs stuTrainingWithBLOBs = stuTrainingMapper.selectByPrimaryKey(trainingId);
|
|
|
|
|
if (stuTrainingWithBLOBs.getKnowledgeSummaryCompleteStatus() != null) {
|
|
|
|
|
//不为空直接返回
|
|
|
|
|
return new ResultEntity<>(stuTrainingWithBLOBs.getKnowledgeSummaryScore());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//为空设置
|
|
|
|
|
SysWeight sysWeight = iTeaGradeManageService.getSysWeightResultEntity(courseId, schoolId, systemOwner);
|
|
|
|
|
BigDecimal knowledgeSummaryDefaultRule = sysWeight.getKnowledgeSummaryDefaultRule();
|
|
|
|
|
if (minutes < 1) {
|
|
|
|
|
stuTrainingWithBLOBs.setKnowledgeSummaryScore(BigDecimal.ZERO);
|
|
|
|
|
} else if (minutes == 1) {
|
|
|
|
|
stuTrainingWithBLOBs.setKnowledgeSummaryScore(knowledgeSummaryDefaultRule); //老师只能修改这个分值
|
|
|
|
|
} else {
|
|
|
|
|
int extraMinutes = minutes - 1;
|
|
|
|
|
int totalScore = 60 + extraMinutes * 10;
|
|
|
|
|
knowledgeSummaryDefaultRule = BigDecimal.valueOf(totalScore);
|
|
|
|
|
stuTrainingWithBLOBs.setKnowledgeSummaryScore(knowledgeSummaryDefaultRule);
|
|
|
|
|
}
|
|
|
|
|
stuTrainingWithBLOBs.setResourceLearningCompleteStatus(minutes);
|
|
|
|
|
stuTrainingMapper.updateByPrimaryKey(stuTrainingWithBLOBs);
|
|
|
|
|
return new ResultEntity<>(knowledgeSummaryDefaultRule);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|