|
|
|
@ -3,11 +3,13 @@ package com.ibeetl.jlw.service;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.jlw.util.ToolUtils;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.ibeetl.admin.core.entity.CoreUser;
|
|
|
|
|
import com.ibeetl.admin.core.service.CoreBaseService;
|
|
|
|
|
import com.ibeetl.admin.core.util.BeanCopyUtil;
|
|
|
|
|
import com.ibeetl.admin.core.util.PlatformException;
|
|
|
|
|
import com.ibeetl.admin.core.util.TimeTool;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
@ -34,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
@ -43,6 +46,9 @@ import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static com.ibeetl.admin.core.util.ExcelUtil.convertData;
|
|
|
|
|
import static com.ibeetl.admin.core.util.ExcelUtil.write;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 成绩 Service
|
|
|
|
|
* 当分布式ID开启后请勿使用insert(*,true)
|
|
|
|
@ -82,8 +88,12 @@ public class TeacherOpenCourseScoreDashboardService extends CoreBaseService<Teac
|
|
|
|
|
private StudentHandsOnTaskTheoryDao theoryService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentHandsOnTaskReportDao reportService;
|
|
|
|
|
@Autowired private TeacherOpenCourseChatLogDao courseChatLogDao;
|
|
|
|
|
@Autowired private GeneralQuestionLogDao generalQuestionLogDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TeacherOpenCourseChatLogDao courseChatLogDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentService studentService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PageQuery<TeacherOpenCourseScoreDashboard> queryByCondition(PageQuery query) {
|
|
|
|
|
PageQuery ret = teacherOpenCourseScoreDashboardDao.queryByCondition(query);
|
|
|
|
@ -498,7 +508,7 @@ public class TeacherOpenCourseScoreDashboardService extends CoreBaseService<Teac
|
|
|
|
|
BigDecimal mul = NumberUtil.mul(div, 100);
|
|
|
|
|
scoreDashboard.setCourseScore(mul);
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
BigDecimal b = BigDecimal.ZERO;
|
|
|
|
|
for (QuestionLogSummary questionLogSummary : select1) {
|
|
|
|
|
b = b.add(questionLogSummary.getQuestionLogSummaryStudentTotalScore());
|
|
|
|
@ -645,13 +655,13 @@ public class TeacherOpenCourseScoreDashboardService extends CoreBaseService<Teac
|
|
|
|
|
if (interactionResultSetting.contains("1")) {
|
|
|
|
|
chatScore = NumberUtil.mul(count2, NumberUtil.toBigDecimal(weight.getInteractionResultMessageScore()));
|
|
|
|
|
}
|
|
|
|
|
if(interactionResultSetting.contains("2")) {
|
|
|
|
|
if (interactionResultSetting.contains("2")) {
|
|
|
|
|
chatScore = NumberUtil.mul(count, NumberUtil.toBigDecimal(weight.getInteractionResultQuestionScore()));
|
|
|
|
|
}
|
|
|
|
|
if(interactionResultSetting.contains("3")) {
|
|
|
|
|
if (interactionResultSetting.contains("3")) {
|
|
|
|
|
chatScore = NumberUtil.mul(count3, NumberUtil.toBigDecimal(weight.getInteractionResultAnswerScore()));
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
chatScore = BigDecimal.valueOf(count2);
|
|
|
|
|
}
|
|
|
|
|
scoreDashboard.setChatScore(chatScore);
|
|
|
|
@ -733,4 +743,40 @@ public class TeacherOpenCourseScoreDashboardService extends CoreBaseService<Teac
|
|
|
|
|
public void deleteTeacherOpenCourseAllRelatedByTeacherOpenCourseId(@NotNull(message = "开课ID不能为空!") Long teacherOpenCourseId) {
|
|
|
|
|
log.info("需要实现删除操作!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<TeacherOpenCourseScoreDashboard> queryByConditionQueryNotPage(TeacherOpenCourseScoreDashboardQuery teacherOpenCourseScoreDashboardQuery) {
|
|
|
|
|
return teacherOpenCourseScoreDashboardDao.queryByConditionQueryNotPage(teacherOpenCourseScoreDashboardQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void export(HttpServletResponse response, TeacherOpenCourseScoreDashboardQuery teacherOpenCourseScoreDashboardQuery, CoreUser coreUser) throws IOException {
|
|
|
|
|
if (coreUser.isStudent()) {
|
|
|
|
|
Student student = studentService.getByUserId(coreUser.getId());
|
|
|
|
|
if (student != null) {
|
|
|
|
|
teacherOpenCourseScoreDashboardQuery.setStudentId(student.getStudentId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/** 构建表头 */
|
|
|
|
|
Map<String, String> header = new LinkedHashMap<>(13);
|
|
|
|
|
header.put("studentSn", "学号");
|
|
|
|
|
header.put("studentName", "姓名");
|
|
|
|
|
header.put("className", "班级");
|
|
|
|
|
header.put("signinScore", "签到成绩");
|
|
|
|
|
header.put("courseScore", "章节练习成绩");
|
|
|
|
|
header.put("realOperationScore", "课程实操成绩");
|
|
|
|
|
header.put("questionHomeworkScore", "作业成绩");
|
|
|
|
|
header.put("examScore", "考试成绩");
|
|
|
|
|
header.put("chatScore", "互动成绩");
|
|
|
|
|
header.put("totalScore", "总成绩");
|
|
|
|
|
header.put("manualScore", "手动调整的分数");
|
|
|
|
|
header.put("lastScore", "最终成绩");
|
|
|
|
|
header.put("lastStatus", "成绩状态");
|
|
|
|
|
|
|
|
|
|
List<TeacherOpenCourseScoreDashboard> teacherOpenCourseScoreDashboardList = this.queryByConditionQueryNotPage(teacherOpenCourseScoreDashboardQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> maps = BeanCopyUtil.baseEntity2MapWithParallel(teacherOpenCourseScoreDashboardList);
|
|
|
|
|
|
|
|
|
|
String filename = StrUtil.format("成绩-导出 {}.xlsx", System.currentTimeMillis());
|
|
|
|
|
write(response, filename, "Sheet1", header.values(), convertData(header.keySet(), maps));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|