Merge remote-tracking branch 'origin/beetlsql3-dev' into beetlsql3-dev

# Conflicts:
#	web/src/main/java/com/ibeetl/jlw/web/query/TeacherOpenCourseMergeCourseInfoQuery.java
beetlsql3-dev
maLix 2 years ago
commit 0e4cb2160f

@ -128,7 +128,7 @@ public class IpUtils {
String reg = "^((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})(\\.((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})){3}" +
"-((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})(\\.((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})){3}$";
Assert.isTrue(ReUtil.isMatch(reg, ipRange),
() -> new PlatformException("ipRangeAddressList 参数格式化错误!支持格式x.x.x.x-x.x.x.x,x.x.x.x-x.x.x.x"));
() -> new PlatformException("ipRangeAddressList 参数格式化错误!支持格式192.168.1.1-192.168.1.100"));
}
}
@ -144,7 +144,7 @@ public class IpUtils {
// 单IP的正则
String reg = "^((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})(\\.((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})){3}$";
Assert.isTrue(ReUtil.isMatch(reg, ip),
() -> new PlatformException("ipAddressList 参数格式化错误!支持格式:x.x.x.x,x.x.x.x"));
() -> new PlatformException("ipAddressList 参数格式化错误!支持格式:192.168.1.1-192.168.1.100"));
}
}

@ -0,0 +1,13 @@
package com.ibeetl.jlw.constants;
/**
*
*
* @author zhouzhao
* @date 2023/05/16 04:27:05
*/
public class TeacherOpenCourseScoreDashboardConstant {
public static final String STUDENT_ASK_MAX_SCORE = "30";
public static final String DISCUSS_MAX_SCORE = "30";
}

@ -1,6 +1,7 @@
package com.ibeetl.jlw.dao;
import com.ibeetl.jlw.entity.StudentHandsOnTaskLog;
import com.ibeetl.jlw.web.query.HandsOnAchievementQuery;
import com.ibeetl.jlw.web.query.StudentHandsOnTaskLogQuery;
import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.mapper.BaseMapper;
@ -29,4 +30,12 @@ public interface StudentHandsOnTaskLogDao extends BaseMapper<StudentHandsOnTaskL
@Update
void updateTime(Long studentHandsOnTaskPptId, Long taskLogSeconds);
/**
*
* @param handsOnTaskLogQuery
* @return
*/
List<Long> getPracticalOperationParticipantsNumberValues(StudentHandsOnTaskLogQuery handsOnTaskLogQuery);
}

@ -183,4 +183,11 @@ public interface TeacherOpenCourseQuestionLogDao extends BaseMapper<TeacherOpenC
* @return
*/
boolean logicDeleteQuestionLogBySummaryQuestionIds(Long questionSettingId);
/**
*
* @param pageQuery
* @return
*/
List<Long> getChapterExerciseParticipantsValuesNumber(TeacherOpenCourseQuestionLogQuery pageQuery);
}

@ -29,4 +29,5 @@ public interface TeacherOpenCourseStudentSigninSettingDao extends BaseMapper<Tea
List<TeacherOpenCourseStudentSigninSetting> getValuesByQuery(TeacherOpenCourseStudentSigninSettingQuery teacherOpenCourseStudentSigninSettingQuery);
List<TeacherOpenCourseStudentSigninSetting> getValuesByQueryNotWithPermission(TeacherOpenCourseStudentSigninSettingQuery teacherOpenCourseStudentSigninSettingQuery);
List<TeacherOpenCourseStudentSigninSetting> getByClassId(Long classId);
}

@ -5,10 +5,12 @@ import com.ibeetl.admin.core.entity.BaseEntity;
import com.ibeetl.admin.core.util.ValidateConfig;
import lombok.EqualsAndHashCode;
import org.beetl.sql.annotation.entity.AutoID;
import org.beetl.sql.annotation.entity.InsertIgnore;
import org.beetl.sql.fetch.annotation.Fetch;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/*
@ -116,6 +118,10 @@ public class TeacherOpenCourseMergeCourseInfo extends BaseEntity implements Comp
//后台用户ID
private Long userId ;
//新增时间
@InsertIgnore
private Date addTime;
public TeacherOpenCourseMergeCourseInfo(){
}
@ -370,6 +376,13 @@ public class TeacherOpenCourseMergeCourseInfo extends BaseEntity implements Comp
return (List<TeacherOpenCourseMergeCourseInfo>)this.get("children");
}
public Date getAddTime() {
return addTime;
}
public void setAddTime(Date addTime) {
this.addTime = addTime;
}
@Override
public int compareTo(TeacherOpenCourseMergeCourseInfo o) {

@ -6,9 +6,11 @@ import com.ibeetl.admin.core.entity.BaseEntity;
import com.ibeetl.admin.core.util.ValidateConfig;
import com.ibeetl.jlw.enums.GlobalUpStatusEnum;
import org.beetl.sql.annotation.entity.AssignID;
import org.beetl.sql.annotation.entity.InsertIgnore;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
/*
* -
@ -65,6 +67,12 @@ public class TeacherOpenCourseMergeResourcesInfo extends BaseEntity{
//后台用户ID上传人
@Dict(type = "core_user.name.1=1")
private Long userId ;
/**
*
*/
@InsertIgnore
private Date addTime;
public TeacherOpenCourseMergeResourcesInfo(){
}
@ -192,4 +200,12 @@ public class TeacherOpenCourseMergeResourcesInfo extends BaseEntity{
public void setResourcesInfoStatus(GlobalUpStatusEnum resourcesInfoStatus) {
this.resourcesInfoStatus = resourcesInfoStatus;
}
public Date getAddTime() {
return addTime;
}
public void setAddTime(Date addTime) {
this.addTime = addTime;
}
}

@ -1,17 +1,15 @@
package com.ibeetl.jlw.job;
import cn.jlw.util.DateUtil;
import com.ibeetl.jlw.entity.Quartz;
import com.ibeetl.jlw.entity.TeacherOpenCourseScoreDashboard;
import com.ibeetl.jlw.dao.TeacherOpenCourseDao;
import com.ibeetl.jlw.entity.TeacherOpenCourse;
import com.ibeetl.jlw.service.TeacherOpenCourseScoreDashboardService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ibeetl.jlw.service.*;
import lombok.extern.slf4j.Slf4j;
import com.ibeetl.jlw.dao.TeacherOpenCourseDao;
import com.ibeetl.jlw.entity.TeacherOpenCourse;
import java.util.Date;
import java.util.List;
@ -25,7 +23,8 @@ public class TeacherOpenCourseScoreDashboardJob implements Job {
@Autowired private TeacherOpenCourseDao teacherOpenCourseDao;
@Autowired private TeacherOpenCourseScoreDashboardService dashboardService;
@Autowired
private TeacherOpenCourseScoreDashboardService dashboardService;
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

@ -128,7 +128,7 @@ public class HandsOnAchievementService extends CoreBaseService<HandsOnAchievemen
}
}
int schedule = NumberUtil.div(decimal, BigDecimal.valueOf(tasksList.size()), 2).multiply(BigDecimal.valueOf(100)).intValue();
handsOnAchievement.set("schedule",schedule);
handsOnAchievement.set("schedule", schedule);
}
}

@ -3,6 +3,7 @@ package com.ibeetl.jlw.service;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSON;
import com.ibeetl.admin.core.dao.CoreUserDao;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.util.enums.DelFlagEnum;
@ -99,6 +100,8 @@ public class StatisticalAnalysisService {
@Autowired
private TeacherOpenCourseMergeResourcesQuestionService teacherOpenCourseMergeResourcesQuestionService;
@Autowired
private StudentHandsOnTaskLogService studentHandsOnTaskLogService;
private static final String PATTERN = "(?<=\"code\":\\[\").*?(?=\"\\],)";
Pattern r = Pattern.compile(PATTERN);
@ -117,11 +120,13 @@ public class StatisticalAnalysisService {
//班级数
TeacherOpenCourseMergeSchoolClassQuery classQuery = new TeacherOpenCourseMergeSchoolClassQuery();
classQuery.setTeacherOpenCourseId(teacherOpenCourseId);
classQuery.setTeacherOpenCourseMergeSchoolClassStatus(1);
List<TeacherOpenCourseMergeSchoolClass> schoolClasses = teacherOpenCourseMergeSchoolClassService.getValues(classQuery);
data.put("classNum", schoolClasses.size());
//学生人数
TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery = new TeacherOpenCourseMergeStudentQuery();
teacherOpenCourseMergeStudentQuery.setTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseMergeStudentQuery.setTeacherOpenCourseSchoolClassMergeStudentStatus(1);
List<TeacherOpenCourseMergeStudent> studentList = teacherOpenCourseMergeStudentService.getValuesByQueryNotWithPermission(teacherOpenCourseMergeStudentQuery);
data.put("studentNum", studentList.size());
//学习通过率
@ -137,23 +142,36 @@ public class StatisticalAnalysisService {
data.put("studentPassNum", 0);
}
//授课视频
TeacherOpenCourseMergeCourseInfoQuery courseInfoQuery = new TeacherOpenCourseMergeCourseInfoQuery();
courseInfoQuery.setTeacherOpenCourseId(teacherOpenCourseId);
courseInfoQuery.setCourseInfoStatus(1);
List<TeacherOpenCourseMergeCourseInfo> courseInfos = teacherOpenCourseMergeCourseInfoService.getValuesByQueryNotWithPermission(courseInfoQuery);
List<TeacherOpenCourseMergeCourseInfo> videoCount = courseInfos.stream().filter(v -> v.getCourseVideoId() != null).collect(Collectors.toList());
// TeacherOpenCourseMergeCourseInfoQuery courseInfoQuery = new TeacherOpenCourseMergeCourseInfoQuery();
// courseInfoQuery.setTeacherOpenCourseId(teacherOpenCourseId);
// courseInfoQuery.setCourseInfoStatus(1);
// List<TeacherOpenCourseMergeCourseInfo> courseInfos = teacherOpenCourseMergeCourseInfoService.getValuesByQueryNotWithPermission(courseInfoQuery);
// List<TeacherOpenCourseMergeCourseInfo> videoCount = courseInfos.stream().filter(v -> v.getCourseVideoId() != null).collect(Collectors.toList());
TeacherOpenCourseMergeResourcesInfoQuery teacherOpenCourseMergeResourcesInfoQuery = new TeacherOpenCourseMergeResourcesInfoQuery();
teacherOpenCourseMergeResourcesInfoQuery.setTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseMergeResourcesInfoQuery.setResourcesInfoStatus(GlobalUpStatusEnum.UP);
teacherOpenCourseMergeResourcesInfoQuery.setStartTime(stime);
teacherOpenCourseMergeResourcesInfoQuery.setEndTime(etime);
List<TeacherOpenCourseMergeResourcesInfo> teacherOpenCourseMergeResourcesInfo = teacherOpenCourseMergeResourcesInfoService.getValuesByQuery(teacherOpenCourseMergeResourcesInfoQuery);
List<TeacherOpenCourseMergeResourcesInfo> videoCount = teacherOpenCourseMergeResourcesInfo.stream().filter(v ->Objects.equals(v.getResourcesInfoType(),1)).collect(Collectors.toList());
data.put("teachingVideoNum", videoCount.size());
//非视频资源
data.put("nonVideoResourcesNum", courseInfos.size() - videoCount.size());
data.put("nonVideoResourcesNum", teacherOpenCourseMergeResourcesInfo.size() - videoCount.size());
//课程公告
TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery = new TeacherOpenCourseNoticeQuery();
teacherOpenCourseNoticeQuery.setTeacherOpenCourseIds(teacherOpenCourseId.toString());
teacherOpenCourseNoticeQuery.setDelFlag(0);
teacherOpenCourseNoticeQuery.setStartTime(stime);
teacherOpenCourseNoticeQuery.setEndTime(etime);
List<TeacherOpenCourseNotice> noticeList = teacherOpenCourseNoticeService.getValues(teacherOpenCourseNoticeQuery);
data.put("noticeNum", noticeList.size());
//签到
TeacherOpenCourseStudentSigninLogQuery signQuery = new TeacherOpenCourseStudentSigninLogQuery();
signQuery.setTeacherOpenCourseId(teacherOpenCourseId);
signQuery.setStartTime(stime);
signQuery.setEndTime(etime);
List<TeacherOpenCourseStudentSigninLog> signinLogs = teacherOpenCourseStudentSigninLogService.getValues(signQuery);
List<TeacherOpenCourseStudentSigninLog> collect = signinLogs.stream().filter(v -> v.getTeacherOpenCourseStudentSigninLogTag().equals(SignInTypeEnum.SIGN_IN)).collect(Collectors.toList());
//签到数量
@ -169,47 +187,79 @@ public class StatisticalAnalysisService {
//总章节数
TeacherOpenCourseMergeCourseInfoQuery teacherOpenCourseMergeCourseInfoQuery = new TeacherOpenCourseMergeCourseInfoQuery();
teacherOpenCourseMergeCourseInfoQuery.setTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseMergeCourseInfoQuery.setCourseInfoType(2);
teacherOpenCourseMergeCourseInfoQuery.setCourseInfoStatus(1);
teacherOpenCourseMergeCourseInfoQuery.setStartTime(stime);
teacherOpenCourseMergeCourseInfoQuery.setEndTime(etime);
List<TeacherOpenCourseMergeCourseInfo> openCourseMergeCourseInfos = teacherOpenCourseMergeCourseInfoService.getValues(teacherOpenCourseMergeCourseInfoQuery);
data.put("chapterNum", openCourseMergeCourseInfos.size());
//习题总数
String collect4 = openCourseMergeCourseInfos.stream().distinct().map(i -> i.getTeacherOpenCourseMergeCourseInfoId().toString()).collect(Collectors.joining(","));
TeacherOpenCourseQuestionSettingQuery teacherOpenCourseQuestionSettingQuery = new TeacherOpenCourseQuestionSettingQuery();
teacherOpenCourseQuestionSettingQuery.setTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseQuestionSettingQuery.setTeacherOpenCourseQuestionSettingStatus(1);
teacherOpenCourseQuestionSettingQuery.setTeacherOpenCourseQuestionSettingType(ResourcesQuestionSnapshotFromTypeEnum.CHAPTER_EXERCISE);
teacherOpenCourseQuestionSettingQuery.setTeacherOpenCourseMergeCourseInfoIdPlural(collect4);
List<TeacherOpenCourseQuestionSetting> courseQuestionSettings = teacherOpenCourseQuestionSettingService.getValues(teacherOpenCourseQuestionSettingQuery);
List<TeacherOpenCourseQuestionSetting> collect1 = courseQuestionSettings.stream().filter(v -> v.getTeacherOpenCourseQuestionSettingType().equals(ResourcesQuestionSnapshotFromTypeEnum.CHAPTER_EXERCISE)).collect(Collectors.toList());
data.put("chapterTotal", collect1.size());
// List<TeacherOpenCourseQuestionSetting> collect1 = courseQuestionSettings.stream().filter(v -> v.getTeacherOpenCourseQuestionSettingType().equals(ResourcesQuestionSnapshotFromTypeEnum.CHAPTER_EXERCISE)).collect(Collectors.toList());
data.put("chapterTotal", courseQuestionSettings.size());
//参与人数
String collect1 = courseQuestionSettings.stream().distinct().map(i -> i.getTeacherOpenCourseQuestionSettingId().toString()).collect(Collectors.joining(","));
TeacherOpenCourseQuestionLogQuery teacherOpenCourseQuestionLogQuery = new TeacherOpenCourseQuestionLogQuery();
String stringJoiner = CollectionUtil.join(collect1, ",");
if (StringUtils.isNotEmpty(stringJoiner)) {
teacherOpenCourseQuestionLogQuery.setTeacherOpenCourseQuestionSettingIdPlural(stringJoiner);
List<TeacherOpenCourseQuestionLog> values = teacherOpenCourseQuestionLogService.getValues(teacherOpenCourseQuestionLogQuery);
int size = values.stream().map(TeacherOpenCourseQuestionLog::getStudentId).collect(Collectors.toSet()).size();
data.put("chapterPeople", size);
} else {
data.put("chapterPeople", 0);
}
teacherOpenCourseQuestionLogQuery.setTeacherOpenCourseQuestionSettingIdPlural(collect1);
data.put("chapterPeople",StringUtils.isEmpty(collect1)? 0 : teacherOpenCourseQuestionLogService.getChapterExerciseParticipantsValuesNumber(teacherOpenCourseQuestionLogQuery));
// String stringJoiner = CollectionUtil.join(courseQuestionSettings, ",");
// if (CollectionUtil.isNotEmpty(collect1)) {
// teacherOpenCourseQuestionLogQuery.setTeacherOpenCourseQuestionSettingIdPlural(stringJoiner);
// List<TeacherOpenCourseQuestionLog> values = teacherOpenCourseQuestionLogService.getValues(teacherOpenCourseQuestionLogQuery);
// int size = values.stream().map(TeacherOpenCourseQuestionLog::getStudentId).collect(Collectors.toSet()).size();
// data.put("chapterPeople", size);
// } else {
// data.put("chapterPeople", 0);
// }
//课程实操
TeacherOpenCourseHandsOnQuery teacherOpenCourseHandsOnQuery = new TeacherOpenCourseHandsOnQuery();
teacherOpenCourseHandsOnQuery.setTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseHandsOnQuery.setStartTime(stime);
teacherOpenCourseHandsOnQuery.setEndTime(etime);
List<TeacherOpenCourseHandsOn> handsOns = teacherOpenCourseHandsOnService.getValues(teacherOpenCourseHandsOnQuery);
data.put("handsOnNum", handsOns.size());
//实操任务总数
TeacherOpenCourseHandsOnSimulationTasksQuery tasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery();
tasksQuery.setTeacherOpenCourseId(teacherOpenCourseId);
List<TeacherOpenCourseHandsOnSimulationTasks> tasksList = teacherOpenCourseHandsOnSimulationTasksService.getValues(tasksQuery);
data.put("handsOnTotal", tasksList.size());
//实操参与人数
HandsOnAchievementQuery achievementQuery = new HandsOnAchievementQuery();
List<Long> list = handsOns.stream().map(TeacherOpenCourseHandsOn::getHandsOnId).collect(Collectors.toList());
String join = CollectionUtil.join(list, ",");
if (StringUtils.isNotEmpty(join)) {
achievementQuery.setHandOnIdPlural(join);
List<HandsOnAchievement> assessmentList = handsOnAchievementService.getValues(achievementQuery);
long count = assessmentList.stream().map(HandsOnAchievement::getStudentId).count();
data.put("handsOnPeople", count);
} else {
data.put("handsOnPeople", 0);
String collect2 = handsOns.stream().distinct().map(i -> i.getHandsOnId().toString()).collect(Collectors.joining(","));
if (StringUtils.isEmpty(collect2)){
data.put("handsOnTotal",0 );
data.put("handsOnPeople",0 );
}else {
TeacherOpenCourseHandsOnSimulationTasksQuery tasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery();
tasksQuery.setTeacherOpenCourseId(teacherOpenCourseId);
tasksQuery.setHandsOnIdPlural(collect2);
List<TeacherOpenCourseHandsOnSimulationTasks> tasksList = teacherOpenCourseHandsOnSimulationTasksService.getValues(tasksQuery);
data.put("handsOnTotal",tasksList.size());
//实操参与人数
String collect3 = tasksList.stream().map(i -> i.getTaskId().toString()).collect(Collectors.joining(","));
StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery = new StudentHandsOnTaskLogQuery();
studentHandsOnTaskLogQuery.setHandsOnTaskIdPlural(collect3);
data.put("handsOnPeople",StringUtils.isEmpty(collect3) ? 0 : studentHandsOnTaskLogService.getPracticalOperationParticipantsNumberValues(studentHandsOnTaskLogQuery));
}
// List<Long> list = handsOns.stream().map(TeacherOpenCourseHandsOn::getHandsOnId).collect(Collectors.toList());
// String join = CollectionUtil.join(list, ",");
// if (StringUtils.isNotEmpty(join)) {
// achievementQuery.setHandOnIdPlural(join);
// List<HandsOnAchievement> assessmentList = handsOnAchievementService.getValues(achievementQuery);
// long count = assessmentList.stream().map(HandsOnAchievement::getStudentId).count();
// data.put("handsOnPeople", count);
// } else {
// data.put("handsOnPeople", 0);
// }
//作业
List<TeacherOpenCourseQuestionSetting> settings = courseQuestionSettings.stream().filter(v -> v.getTeacherOpenCourseQuestionSettingType().equals(ResourcesQuestionSnapshotFromTypeEnum.HOMEWORK_QUESTION)).collect(Collectors.toList());
//作业总次数

@ -13,6 +13,7 @@ import com.ibeetl.jlw.constants.StudentHandsOnTaskConstant;
import com.ibeetl.jlw.dao.StudentHandsOnTaskLogDao;
import com.ibeetl.jlw.entity.Student;
import com.ibeetl.jlw.entity.StudentHandsOnTaskLog;
import com.ibeetl.jlw.web.query.HandsOnAchievementQuery;
import com.ibeetl.jlw.web.query.StudentHandsOnTaskLogQuery;
import org.apache.commons.lang3.StringUtils;
import org.beetl.sql.core.SqlId;
@ -206,4 +207,16 @@ public class StudentHandsOnTaskLogService extends CoreBaseService<StudentHandsOn
return jsonResult;
}
/**
*
*
* @param handsOnTaskLogQuery
* @return
*/
public Integer getPracticalOperationParticipantsNumberValues(StudentHandsOnTaskLogQuery handsOnTaskLogQuery) {
List<Long> practicalOperationParticipantsNumberValues = studentHandsOnTaskLogDao.getPracticalOperationParticipantsNumberValues(handsOnTaskLogQuery);
return practicalOperationParticipantsNumberValues.size();
}
}

@ -254,6 +254,7 @@ public class StudentHandsOnTaskReportService extends CoreBaseService<StudentHand
studentHandsOnTaskReportQuery.setStudentId(student.getStudentId());
}
List<StudentHandsOnTaskReport> list = studentHandsOnTaskReportDao.getValuesByQuery(studentHandsOnTaskReportQuery);
if (null != list && list.size() > 0) {
return list.get(0);
} else {

@ -39,6 +39,7 @@ import java.util.*;
import static cn.hutool.core.collection.IterUtil.getFirst;
import static cn.hutool.core.date.DateTime.now;
import static cn.hutool.core.util.ObjectUtil.defaultIfNull;
import static cn.jlw.util.CacheUserUtil.getUniAdmin;
import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue;
/**
@ -343,6 +344,10 @@ public class StudentTeacherSystemUseLogAnalysisService extends CoreBaseService<S
* @return
*/
public PageQuery<SystemUseLogsAnalysisVO> applicationUseLogsAnalysis(PageQuery<SystemUseLogsAnalysisDTO> page) {
UniversitiesColleges uniAdmin = getUniAdmin();
if (null != uniAdmin) {
page.setPara("universitiesCollegesId", uniAdmin.getUniversitiesCollegesId());
}
return studentTeacherSystemUseLogAnalysisDao.applicationUseLogsAnalysis(page);
}

@ -151,6 +151,7 @@ public class TeacherOpenCourseHandsOnService extends CoreBaseService<TeacherOpen
public JsonResult add(TeacherOpenCourseHandsOnQuery teacherOpenCourseHandsOnQuery) {
String msg = "";
TeacherOpenCourseHandsOn teacherOpenCourseHandsOn = teacherOpenCourseHandsOnQuery.pojo();
teacherOpenCourseHandsOn.setAddTime(new Date());
teacherOpenCourseHandsOnDao.insert(teacherOpenCourseHandsOn);
teacherOpenCourseHandsOnQuery.setHandsOnId(teacherOpenCourseHandsOn.getHandsOnId());
JsonResult jsonResult = new JsonResult();

@ -12,7 +12,6 @@ import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.constants.StudentHandsOnTaskConstant;
import com.ibeetl.jlw.dao.TeacherOpenCourseHandsOnDao;
import com.ibeetl.jlw.dao.TeacherOpenCourseHandsOnSimulationTasksDao;
import com.ibeetl.jlw.dao.TeacherOpenCourseMergeResourcesQuestionDao;
@ -36,10 +35,7 @@ import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
import static cn.hutool.core.util.ArrayUtil.join;
@ -67,9 +63,6 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
@Autowired
private StudentService studentService;
@Autowired
private ResourcesQuestionService resourcesQuestionService;
@Autowired
private TeacherOpenCourseMergeResourcesQuestionDao mergeResourcesQuestionService;
@ -154,6 +147,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
String msg = "";
TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksQuery.pojo();
teacherOpenCourseHandsOnSimulationTasks.setAddTime(new Date());
String handsOnTaskProblemVo = teacherOpenCourseHandsOnSimulationTasksQuery.getHandsOnTaskProblemVo();
Long handsOnId = teacherOpenCourseHandsOnSimulationTasks.getHandsOnId();
//分数
@ -568,7 +562,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
StudentHandsOnTaskLogQuery logQuery = new StudentHandsOnTaskLogQuery();
logQuery.setHandsOnTaskId(taskId);
logQuery.setStudentId(studentId);
List<StudentHandsOnTaskLog> handsOnTaskLogs =null;
List<StudentHandsOnTaskLog> handsOnTaskLogs = null;
if (HandsOnTaskEnum.TASK_VIDEO.status.equals(task.getTaskType())) {
StudentHandsOnTaskVideoQuery videoQuery = new StudentHandsOnTaskVideoQuery();

@ -239,7 +239,6 @@ public class TeacherOpenCourseMergeCourseInfoService extends CoreBaseService<Tea
String msg = "";
TeacherOpenCourseMergeCourseInfo teacherOpenCourseMergeCourseInfo = query.pojo();
teacherOpenCourseMergeCourseInfo.setCourseInfoStatus(1);
// 获取新的排序值
TeacherOpenCourseMergeCourseInfo paras = new TeacherOpenCourseMergeCourseInfo();
paras.setCourseInfoType(teacherOpenCourseMergeCourseInfo.getCourseInfoType());

@ -225,6 +225,16 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
return sqlManager.select(SqlId.of("jlw.teacherOpenCourseQuestionLog.getTeacherOpenCourseQuestionLogValues"), TeacherOpenCourseQuestionLog.class, paras);
}
/**
*
* @param paras
* @return
*/
public Integer getChapterExerciseParticipantsValuesNumber (TeacherOpenCourseQuestionLogQuery paras){
List<Long> chapterExerciseParticipantsValuesNumber = teacherOpenCourseQuestionLogDao.getChapterExerciseParticipantsValuesNumber(paras);
return chapterExerciseParticipantsValuesNumber.size();
}
public List<TeacherOpenCourseQuestionLog> getValuesByQuery (TeacherOpenCourseQuestionLogQuery teacherOpenCourseQuestionLogQuery){
return teacherOpenCourseQuestionLogDao.getValuesByQuery(teacherOpenCourseQuestionLogQuery);
}

@ -1,8 +1,8 @@
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.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.jlw.util.ToolUtils;
import com.alibaba.fastjson.JSON;
@ -14,6 +14,7 @@ import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.util.TimeTool;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.constants.TeacherOpenCourseScoreDashboardConstant;
import com.ibeetl.jlw.dao.*;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.enums.ChatLogSendTypeEnum;
@ -23,6 +24,7 @@ import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeStudentQuery;
import com.ibeetl.jlw.web.query.TeacherOpenCourseScoreDashboardQuery;
import com.ibeetl.jlw.web.query.TeacherOpenCourseStudentSigninLogQuery;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
@ -33,6 +35,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.beetl.sql.core.SqlId;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -40,6 +43,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotNull;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
@ -72,28 +76,42 @@ public class TeacherOpenCourseScoreDashboardService extends CoreBaseService<Teac
private TeacherOpenCourseStudentSigninLogDao studentSigninLogDao;
@Autowired
private TeacherOpenCourseScheduleSessionDao teacherOpenCourseScheduleSessionDao;
@Autowired
private QuestionLogSummaryDao questionLogSummaryService;
private QuestionLogSummaryDao questionLogSummaryDao;
@Autowired
private TeacherOpenCourseQuestionSettingDao teacherOpenCourseQuestionSettingDao;
@Autowired
private StudentHandsOnTaskVideoDao videoService;
private StudentHandsOnTaskVideoDao videoDao;
@Autowired
private StudentHandsOnTaskPptDao pptService;
private StudentHandsOnTaskPptDao pptDao;
@Autowired
private StudentHandsOnTaskStepDao stepService;
private StudentHandsOnTaskStepDao stepDao;
@Autowired
private StudentHandsOnTaskTheoryDao theoryService;
private StudentHandsOnTaskTheoryDao theoryDao;
@Autowired
private StudentHandsOnTaskReportDao reportService;
private StudentHandsOnTaskReportDao reportDao;
@Autowired
private TeacherOpenCourseChatLogDao courseChatLogDao;
@Autowired
private StudentService studentService;
@Autowired
private TeacherOpenCourseStudentSigninSettingService teacherOpenCourseStudentSigninSettingService;
@Autowired
@Lazy
private TeacherOpenCourseHandsOnSimulationTasksService teacherOpenCourseHandsOnSimulationTasksService;
@Autowired
@Lazy
private TeacherOpenCourseHandsOnService teacherOpenCourseHandsOnService;
@Autowired
private HandsOnAchievementService handsOnAchievementService;
@Autowired
private TeacherOpenCourseChatLogService teacherOpenCourseChatLogService;
public PageQuery<TeacherOpenCourseScoreDashboard> queryByCondition(PageQuery query) {
PageQuery ret = teacherOpenCourseScoreDashboardDao.queryByCondition(query);
@ -437,250 +455,499 @@ public class TeacherOpenCourseScoreDashboardService extends CoreBaseService<Teac
* @return
*/
public boolean updateGrades(Long teacherOpenCourseId) {
if (teacherOpenCourseId == null) {
return false;
}
Date now = new Date();
//获取该课程的所有讨论数据
TeacherOpenCourseChatLog teacherOpenCourseChatLog = new TeacherOpenCourseChatLog();
teacherOpenCourseChatLog.setTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseChatLog.setTeacherOpenCourseChatLogStatus(1);
List<TeacherOpenCourseChatLog> teacherOpenCourseChatLogList = teacherOpenCourseChatLogService.queryObjectList(teacherOpenCourseChatLog);
//查询章节练习配置
List<TeacherOpenCourseQuestionSetting> chapterExerciseList = teacherOpenCourseQuestionSettingDao.createLambdaQuery()
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingType, ResourcesQuestionSnapshotFromTypeEnum.CHAPTER_EXERCISE)
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingStatus, 1).select();
//查询本课程的所有实操任务
TeacherOpenCourseHandsOn param = new TeacherOpenCourseHandsOn();
param.setTeacherOpenCourseId(teacherOpenCourseId);
List<TeacherOpenCourseHandsOn> handsOnList = teacherOpenCourseHandsOnService.queryObjectList(param);
//查询本课程的所有实操任务子项
List<TeacherOpenCourseHandsOnSimulationTasks> teacherOpenCourseHandsOnSimulationTasksList = null;
List<Long> handOnIdList = null;
if (CollectionUtil.isNotEmpty(handsOnList)) {
handOnIdList = handsOnList.stream().map(TeacherOpenCourseHandsOn::getHandsOnId).collect(Collectors.toList());
TeacherOpenCourseHandsOnSimulationTasks query = new TeacherOpenCourseHandsOnSimulationTasks();
query.setTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseHandsOnSimulationTasksList = teacherOpenCourseHandsOnSimulationTasksService.queryObjectList(query);
}
if (CollectionUtil.isEmpty(teacherOpenCourseHandsOnSimulationTasksList)) {
teacherOpenCourseHandsOnSimulationTasksList = new ArrayList<>();
}
if (CollectionUtil.isEmpty(handOnIdList)) {
handOnIdList = new ArrayList<>();
}
//查该课程的所有作业
List<TeacherOpenCourseQuestionSetting> homeworkList = teacherOpenCourseQuestionSettingDao.createLambdaQuery()
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingStatus, 1)
.andIn(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingType, Arrays.asList(ResourcesQuestionSnapshotFromTypeEnum.HOMEWORK_QUESTION, ResourcesQuestionSnapshotFromTypeEnum.HOMEWORK_FILE))
.select();
//查该课程的所有考试
List<TeacherOpenCourseQuestionSetting> examList = teacherOpenCourseQuestionSettingDao.createLambdaQuery()
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingStatus, 1)
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingType, ResourcesQuestionSnapshotFromTypeEnum.EXAM).select();
//查询权重
TeacherOpenCourseScoreWeight weight = weightDao.single(teacherOpenCourseId);
TeacherOpenCourseMergeStudentQuery studentQuery = new TeacherOpenCourseMergeStudentQuery();
studentQuery.setTeacherOpenCourseId(teacherOpenCourseId);
studentQuery.setTeacherOpenCourseSchoolClassMergeStudentStatus(1);
//查开课里面的学生
List<TeacherOpenCourseMergeStudent> students = mergeStudentDao.getValuesByQueryNotWithPermission(studentQuery);
//todo 章节练习成绩,课程实操成绩,作业成绩,考试成绩,互动成绩
List<TeacherOpenCourseScoreDashboard> studentScores = new ArrayList<>();
//班次数
Double classNum = null;
for (TeacherOpenCourseMergeStudent student : students) {
Long studentId = student.getStudentId();
for (TeacherOpenCourseMergeStudent teacherOpenCourseMergeStudent : students) {
Long studentId = teacherOpenCourseMergeStudent.getStudentId();
//通过id查询学生
Student student = studentService.queryById(studentId);
TeacherOpenCourseScoreDashboard teacherOpenCourseScoreDashboard = teacherOpenCourseScoreDashboardDao.createLambdaQuery()
.andEq(TeacherOpenCourseScoreDashboard::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(TeacherOpenCourseScoreDashboard::getStudentId, studentId)
.singleSimple();
if (teacherOpenCourseScoreDashboard == null) {
teacherOpenCourseScoreDashboard = new TeacherOpenCourseScoreDashboard();
teacherOpenCourseScoreDashboard.setTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseScoreDashboard.setStudentId(studentId);
teacherOpenCourseScoreDashboard.setOrgId(student.getOrgId());
teacherOpenCourseScoreDashboard.setStudentSn(student.getStudentSn());
teacherOpenCourseScoreDashboard.setStudentName(student.getStudentName());
teacherOpenCourseScoreDashboard.setExamScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setCourseScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setChatScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setSigninScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setRealOperationScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setQuestionHomeworkScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setTotalScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setManualScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setUserId(student.getUserId());
teacherOpenCourseScoreDashboard.setCreateTime(now);
teacherOpenCourseScoreDashboardDao.insert(teacherOpenCourseScoreDashboard);
}
if (teacherOpenCourseScoreDashboard.getTeacherOpenCourseScoreDashboardId() == null) {
log.error("teacherOpenCourseScoreDashboard.getTeacherOpenCourseScoreDashboardId()为空studentId:{},openCourseId:{}", studentId, teacherOpenCourseId);
continue;
}
if (student == null) {
log.error("学生不存在studentId={}", studentId);
continue;
}
TeacherOpenCourseScoreDashboard scoreDashboard = new TeacherOpenCourseScoreDashboard();
scoreDashboard.setStudentId(studentId);
TeacherOpenCourseStudentSigninLogQuery logQuery = new TeacherOpenCourseStudentSigninLogQuery();
logQuery.setTeacherOpenCourseId(teacherOpenCourseId);
logQuery.setStudentId(studentId);
logQuery.setTeacherOpenCourseStudentSigninLogTag(SignInTypeEnum.SIGN_IN);
List<TeacherOpenCourseStudentSigninLog> logs = studentSigninLogDao.getValuesByQueryNotWithPermission(logQuery);
if (CollectionUtil.isNotEmpty(logs)) {
//周次*开课星期的长度
if (weight != null && "2".equals(weight.getSignInResultSetting())) {
//查询班次
if (classNum == null) {
TeacherOpenCourseScheduleSession teacherOpenCourseScheduleSession = teacherOpenCourseScheduleSessionDao.createLambdaQuery()
.andEq(TeacherOpenCourseScheduleSession::getTeacherOpenCourseId, teacherOpenCourseId).singleSimple();
if (teacherOpenCourseScheduleSession != null) {
String teacherOpenCourseScheduleSessionStartDate = teacherOpenCourseScheduleSession.getTeacherOpenCourseScheduleSessionStartDate();
String teacherOpenCourseScheduleSessionEndDate = teacherOpenCourseScheduleSession.getTeacherOpenCourseScheduleSessionEndDate();
long l = DateUtil.betweenWeek(DateUtil.parseDate(teacherOpenCourseScheduleSessionStartDate),
DateUtil.parseDate(teacherOpenCourseScheduleSessionEndDate), true);
classNum = NumberUtil.mul(l, teacherOpenCourseScheduleSession.getTeacherOpenCourseScheduleSessionWeekNum().longValue());
scoreDashboard.setTeacherOpenCourseScoreDashboardId(teacherOpenCourseScoreDashboard.getTeacherOpenCourseScoreDashboardId());
//签到成绩
{
//所有签到记录
TeacherOpenCourseStudentSigninLogQuery logQuery = new TeacherOpenCourseStudentSigninLogQuery();
logQuery.setTeacherOpenCourseId(teacherOpenCourseId);
logQuery.setStudentId(studentId);
logQuery.setTeacherOpenCourseStudentSigninLogTag(SignInTypeEnum.SIGN_IN);
List<TeacherOpenCourseStudentSigninLog> logs = studentSigninLogDao.getValuesByQueryNotWithPermission(logQuery);
scoreDashboard.setSigninScore(BigDecimal.ZERO);
if (CollectionUtil.isNotEmpty(logs)) {
long studentAllSignCount = logs.stream().map(TeacherOpenCourseStudentSigninLog::getTeacherOpenCourseStudentSigninSettingId).distinct().count();
//签到到课率
if (weight != null && "2".equals(weight.getSignInResultSetting())) {
//有关该班级的所有签到设置
List<TeacherOpenCourseStudentSigninSetting> teacherOpenCourseStudentSigninSettingList = teacherOpenCourseStudentSigninSettingService.getByClassId(student.getClassId());
if (CollectionUtils.isNotEmpty(teacherOpenCourseStudentSigninSettingList)) {
int baseSize = teacherOpenCourseStudentSigninSettingList.size();
//0.xxx * 100 = xx.x 结果保留一位小数
BigDecimal signScore = BigDecimal.valueOf(studentAllSignCount).divide(BigDecimal.valueOf(baseSize), 3, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
scoreDashboard.setSigninScore(signScore);
} else {
classNum = 0D;
//有签到记录,但是没有签到设置,不应该出现这种情况
log.error("有签到记录,但是没有签到设置,不应该出现这种情况,studentId={}", studentId);
scoreDashboard.setSigninScore(BigDecimal.ZERO);
}
}
//按签到次数乘以签到分数
else if (weight != null && "1".equals(weight.getSignInResultSetting())) {
if (StringUtils.isNotBlank(weight.getSignInScore())) {
BigDecimal signScore = BigDecimal.valueOf(studentAllSignCount).multiply(new BigDecimal(weight.getSignInScore())).setScale(1, RoundingMode.HALF_UP);
scoreDashboard.setSigninScore(signScore);
}
}
double div = NumberUtil.div(logs.size(), classNum.intValue());
double score = NumberUtil.mul(div, 100);
scoreDashboard.setSigninScore(BigDecimal.valueOf(score));
} else if (weight != null && "1".equals(weight.getSignInResultSetting())) {
scoreDashboard.setSigninScore(BigDecimal.valueOf(NumberUtil.mul(logs.size(), Integer.parseInt(weight.getSignInScore()))));
} else {
scoreDashboard.setSigninScore(BigDecimal.valueOf(logs.size()));
}
} else {
scoreDashboard.setSigninScore(BigDecimal.ZERO);
}
//章节练习
List<TeacherOpenCourseQuestionSetting> select = teacherOpenCourseQuestionSettingDao.createLambdaQuery()
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingType, ResourcesQuestionSnapshotFromTypeEnum.CHAPTER_EXERCISE).select();
if (CollectionUtil.isEmpty(select)) {
//章节练习成绩
{
scoreDashboard.setCourseScore(BigDecimal.ZERO);
} else {
List<Long> collect = select.stream().map(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingId).collect(Collectors.toList());
List<QuestionLogSummary> select1 = questionLogSummaryService.createLambdaQuery()
.andEq(QuestionLogSummary::getPersonId, studentId)
.andIn(QuestionLogSummary::getQuestionSettingId, collect).select();
if (weight == null || "1".equals(weight.getCoursePracticeResultSetting())) {
if (CollectionUtil.isEmpty(select1)) {
scoreDashboard.setCourseScore(BigDecimal.ZERO);
} else {
BigDecimal b = BigDecimal.ZERO;
for (QuestionLogSummary questionLogSummary : select1) {
b = b.add(questionLogSummary.getQuestionLogSummarySuccessRate());
}
BigDecimal div = NumberUtil.div(b, select1.size());
BigDecimal mul = NumberUtil.mul(div, 100);
scoreDashboard.setCourseScore(mul);
if (!CollectionUtil.isEmpty(chapterExerciseList)) {
List<Long> teacherOpenCourseQuestionSettingIdList = chapterExerciseList.stream().map(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingId).collect(Collectors.toList());
//查询章节练习成绩
List<QuestionLogSummary> questionLogSummaryList = questionLogSummaryDao.createLambdaQuery()
.andEq(QuestionLogSummary::getPersonId, studentId)
.andEq(QuestionLogSummary::getQuestionLogSummaryStatus, 1)
.andIn(QuestionLogSummary::getQuestionSettingId, teacherOpenCourseQuestionSettingIdList).select();
if (CollectionUtil.isEmpty(questionLogSummaryList)) {
questionLogSummaryList = new ArrayList<>();
}
} else {
BigDecimal b = BigDecimal.ZERO;
for (QuestionLogSummary questionLogSummary : select1) {
b = b.add(questionLogSummary.getQuestionLogSummaryStudentTotalScore());
Map<Long, List<QuestionLogSummary>> questionLogSummaryMap = questionLogSummaryList.stream().collect(Collectors.groupingBy(QuestionLogSummary::getQuestionSettingId));
//按正确率计算
if (weight == null || "1".equals(weight.getCoursePracticeResultSetting())) {
//总章节练习数
int baseSize = teacherOpenCourseQuestionSettingIdList.size();
//总正确率
BigDecimal allSuccessRate = BigDecimal.ZERO;
for (Long settingId : teacherOpenCourseQuestionSettingIdList) {
List<QuestionLogSummary> list = questionLogSummaryMap.get(settingId);
if (CollectionUtils.isEmpty(list)) {
continue;
}
list.sort(Comparator.comparing(QuestionLogSummary::getQuestionLogSummaryAddTime).reversed());
QuestionLogSummary questionLogSummary = list.get(0);
//这里的正确率默认就是百分比不需要再除以100
BigDecimal questionLogSummarySuccessRate = questionLogSummary.getQuestionLogSummarySuccessRate();
if (questionLogSummarySuccessRate != null) {
allSuccessRate = allSuccessRate.add(questionLogSummarySuccessRate);
}
}
//平均正确率得出分数
BigDecimal avgSuccessRate = allSuccessRate.divide(BigDecimal.valueOf(baseSize), 1, RoundingMode.HALF_UP);
scoreDashboard.setCourseScore(avgSuccessRate);
} else if ("2".equals(weight.getCoursePracticeResultSetting())) {
//按完成进度计分:完成进度*100
//总章节练习数
int baseSize = teacherOpenCourseQuestionSettingIdList.size();
int successSize = questionLogSummaryList.size();
BigDecimal avgSuccessCount = BigDecimal.valueOf(successSize).divide(BigDecimal.valueOf(baseSize), 3, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
scoreDashboard.setCourseScore(avgSuccessCount);
}
scoreDashboard.setCourseScore(b);
}
}
//实操成绩
List<StudentHandsOnTaskVideo> single = videoService.createLambdaQuery()
.andEq(StudentHandsOnTaskVideo::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(StudentHandsOnTaskVideo::getStudentId, studentId).select();
List<StudentHandsOnTaskPpt> single2 = pptService.createLambdaQuery()
.andEq(StudentHandsOnTaskPpt::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(StudentHandsOnTaskPpt::getStudentId, studentId).select();
List<StudentHandsOnTaskStep> single3 = stepService.createLambdaQuery()
.andEq(StudentHandsOnTaskStep::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(StudentHandsOnTaskStep::getStudentId, studentId).select();
List<StudentHandsOnTaskReport> single4 = reportService.createLambdaQuery()
.andEq(StudentHandsOnTaskReport::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(StudentHandsOnTaskReport::getStudentId, studentId).select();
List<StudentHandsOnTaskTheory> single5 = theoryService.createLambdaQuery()
.andEq(StudentHandsOnTaskTheory::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(StudentHandsOnTaskTheory::getStudentId, studentId).select();
BigDecimal realOperationScore = BigDecimal.ZERO;
if (CollectionUtil.isNotEmpty(single)) {
for (StudentHandsOnTaskVideo studentHandsOnTaskVideo : single) {
try {
realOperationScore = NumberUtil.add(realOperationScore,
NumberUtil.toBigDecimal(studentHandsOnTaskVideo.getVideoScore()));
} catch (Exception ee) {
ee.printStackTrace();
}
{
scoreDashboard.setRealOperationScore(BigDecimal.ZERO);
if (CollectionUtil.isNotEmpty(teacherOpenCourseHandsOnSimulationTasksList)) {
}
}
if (CollectionUtil.isNotEmpty(single2)) {
for (StudentHandsOnTaskPpt studentHandsOnTaskPpt : single2) {
try {
realOperationScore = NumberUtil.add(realOperationScore,
NumberUtil.toBigDecimal(studentHandsOnTaskPpt.getPptScore()));
} catch (Exception ee) {
ee.printStackTrace();
}
Map<Long, List<TeacherOpenCourseHandsOnSimulationTasks>> teacherOpenCourseHandsOnSimulationTasksMap = teacherOpenCourseHandsOnSimulationTasksList.stream().collect(Collectors.groupingBy(TeacherOpenCourseHandsOnSimulationTasks::getHandsOnId));
}
}
if (CollectionUtil.isNotEmpty(single3)) {
for (StudentHandsOnTaskStep studentHandsOnTaskStep : single3) {
try {
realOperationScore = NumberUtil.add(realOperationScore,
NumberUtil.toBigDecimal(studentHandsOnTaskStep.getTheoryScore()));
} catch (Exception ee) {
ee.printStackTrace();
}
List<StudentHandsOnTaskVideo> studentHandsOnTaskVideoList = videoDao.createLambdaQuery()
.andEq(StudentHandsOnTaskVideo::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(StudentHandsOnTaskVideo::getStudentId, studentId).select();
}
}
if (CollectionUtil.isNotEmpty(single4)) {
for (StudentHandsOnTaskReport studentHandsOnTaskReport : single4) {
try {
realOperationScore = NumberUtil.add(realOperationScore,
NumberUtil.toBigDecimal(studentHandsOnTaskReport.getReportScore()));
} catch (Exception ee) {
ee.printStackTrace();
}
Map<Long, List<StudentHandsOnTaskVideo>> studentHandsOnTaskVideoMap = studentHandsOnTaskVideoList.stream().collect(Collectors.groupingBy(StudentHandsOnTaskVideo::getHandsOnTaskId));
}
}
if (CollectionUtil.isNotEmpty(single5)) {
for (StudentHandsOnTaskTheory studentHandsOnTaskTheory : single5) {
try {
realOperationScore = NumberUtil.add(realOperationScore,
NumberUtil.toBigDecimal(studentHandsOnTaskTheory.getTheoryScore()));
} catch (Exception ee) {
ee.printStackTrace();
}
List<StudentHandsOnTaskPpt> studentHandsOnTaskPptList = pptDao.createLambdaQuery()
.andEq(StudentHandsOnTaskPpt::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(StudentHandsOnTaskPpt::getStudentId, studentId).select();
Map<Long, List<StudentHandsOnTaskPpt>> studentHandsOnTaskPptMap = studentHandsOnTaskPptList.stream().collect(Collectors.groupingBy(StudentHandsOnTaskPpt::getHandsOnTaskId));
List<StudentHandsOnTaskStep> studentHandsOnTaskStepList = stepDao.createLambdaQuery()
.andEq(StudentHandsOnTaskStep::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(StudentHandsOnTaskStep::getStudentId, studentId).select();
Map<Long, List<StudentHandsOnTaskStep>> studentHandsOnTaskStepMap = studentHandsOnTaskStepList.stream().collect(Collectors.groupingBy(StudentHandsOnTaskStep::getHandsOnTaskId));
List<StudentHandsOnTaskReport> studentHandsOnTaskReportList = reportDao.createLambdaQuery()
.andEq(StudentHandsOnTaskReport::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(StudentHandsOnTaskReport::getStudentId, studentId).select();
Map<Long, List<StudentHandsOnTaskReport>> studentHandsOnTaskReportMap = studentHandsOnTaskReportList.stream().collect(Collectors.groupingBy(StudentHandsOnTaskReport::getHandsOnTaskId));
List<StudentHandsOnTaskTheory> studentHandsOnTaskTheoryList = theoryDao.createLambdaQuery()
.andEq(StudentHandsOnTaskTheory::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(StudentHandsOnTaskTheory::getStudentId, studentId).select();
Map<Long, List<StudentHandsOnTaskTheory>> studentHandsOnTaskTheoryMap = studentHandsOnTaskTheoryList.stream().collect(Collectors.groupingBy(StudentHandsOnTaskTheory::getHandsOnTaskId));
//1平均分2平均完成进度
if (weight == null || "1".equals(weight.getCoursePracticeResultSetting())) {
BigDecimal allHandOnScore = BigDecimal.ZERO;
for (Long handOnId : handOnIdList) {
//获取这个实操任务的所有子项,并算出总分
List<TeacherOpenCourseHandsOnSimulationTasks> list = teacherOpenCourseHandsOnSimulationTasksMap.get(handOnId);
if (CollectionUtil.isEmpty(list)) {
continue;
}
BigDecimal handOnTaskScoreSum = BigDecimal.ZERO;
for (TeacherOpenCourseHandsOnSimulationTasks item : list) {
BigDecimal taskScore = new BigDecimal(ObjectUtil.defaultIfBlank(item.getTaskScore(), "0"));
handOnTaskScoreSum = handOnTaskScoreSum.add(taskScore);
}
//得到这个学生的分数,一个学生一个实操任务只有一条记录
HandsOnAchievement handsOnAchievement = new HandsOnAchievement();
handsOnAchievement.setHandOnId(handOnId);
handsOnAchievement.setStudentId(studentId);
handsOnAchievement.setHandOnAchievementStatus(1);
HandsOnAchievement handsOnAchievementRes = handsOnAchievementService.queryObject(handsOnAchievement);
if (handsOnAchievementRes != null) {
String totalScore = handsOnAchievementRes.getTotalScore();
if (StringUtils.isNotBlank(totalScore)) {
//转换为百分制
BigDecimal formatScore = new BigDecimal(totalScore).multiply(new BigDecimal(100)).divide(handOnTaskScoreSum, 1, RoundingMode.HALF_UP);
allHandOnScore = allHandOnScore.add(formatScore);
}
}
}
BigDecimal avgScore = allHandOnScore.divide(new BigDecimal(handOnIdList.size()), 1, RoundingMode.HALF_UP);
scoreDashboard.setRealOperationScore(avgScore);
} else if ("2".equals(weight.getCoursePracticeResultSetting())) {
BigDecimal allDoStepSuccessProportion = BigDecimal.ZERO;
for (Long handOnId : handOnIdList) {
//获取这个实操任务的所有子项
List<TeacherOpenCourseHandsOnSimulationTasks> list = teacherOpenCourseHandsOnSimulationTasksMap.get(handOnId);
if (CollectionUtil.isNotEmpty(list)) {
//得出这个实操任务的完成率
int doStepTimes = 0;
for (TeacherOpenCourseHandsOnSimulationTasks task : list) {
if (studentHandsOnTaskVideoMap.containsKey(task.getTaskId())
|| studentHandsOnTaskPptMap.containsKey(task.getTaskId())
|| studentHandsOnTaskStepMap.containsKey(task.getTaskId())
|| studentHandsOnTaskReportMap.containsKey(task.getTaskId())
|| studentHandsOnTaskTheoryMap.containsKey(task.getTaskId())) {
doStepTimes++;
}
}
//计算完成率
BigDecimal divide = new BigDecimal(doStepTimes).divide(new BigDecimal(list.size()), 5, RoundingMode.HALF_UP);
if (divide.compareTo(BigDecimal.ONE) > 0) {
divide = BigDecimal.ONE;
}
allDoStepSuccessProportion = allDoStepSuccessProportion.add(divide);
}
}
//计算平均完成率并乘以100得出分数
BigDecimal avgScore = allDoStepSuccessProportion.multiply(new BigDecimal(100)).divide(new BigDecimal(handOnIdList.size()), 1, RoundingMode.HALF_UP);
scoreDashboard.setRealOperationScore(avgScore);
}
}
}
scoreDashboard.setRealOperationScore(realOperationScore);
//作业
List<TeacherOpenCourseQuestionSetting> select2 = teacherOpenCourseQuestionSettingDao.createLambdaQuery()
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingType, ResourcesQuestionSnapshotFromTypeEnum.HOMEWORK_QUESTION).select();
if (CollectionUtil.isEmpty(select2)) {
{
//查询题目类型作业和文件类型作业
scoreDashboard.setQuestionHomeworkScore(BigDecimal.ZERO);
} else {
List<Long> collect = select2.stream().map(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingId).collect(Collectors.toList());
List<QuestionLogSummary> select1 = questionLogSummaryService.createLambdaQuery()
.andEq(QuestionLogSummary::getPersonId, studentId)
.andIn(QuestionLogSummary::getQuestionSettingId, collect).select();
if (CollectionUtil.isEmpty(select1)) {
scoreDashboard.setQuestionHomeworkScore(BigDecimal.ZERO);
} else {
BigDecimal b = BigDecimal.ZERO;
for (QuestionLogSummary questionLogSummary : select1) {
b = b.add(questionLogSummary.getQuestionLogSummaryStudentTotalScore());
if (!CollectionUtil.isEmpty(homeworkList)) {
List<Long> settingIdList = homeworkList.stream().map(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingId).collect(Collectors.toList());
List<QuestionLogSummary> questionLogSummaryList = questionLogSummaryDao.createLambdaQuery()
.andEq(QuestionLogSummary::getPersonId, studentId)
.andIn(QuestionLogSummary::getQuestionSettingId, settingIdList)
.andEq(QuestionLogSummary::getQuestionLogSummaryStatus, 1).select();
if (!CollectionUtil.isEmpty(questionLogSummaryList)) {
Map<Long, List<QuestionLogSummary>> questionLogSummaryMap = questionLogSummaryList.stream().collect(Collectors.groupingBy(QuestionLogSummary::getQuestionSettingId));
BigDecimal b = BigDecimal.ZERO;
for (Map.Entry<Long, List<QuestionLogSummary>> entry : questionLogSummaryMap.entrySet()) {
List<QuestionLogSummary> value = entry.getValue();
//以防万一有多条记录,取最近的一条
value.sort(Comparator.comparing(QuestionLogSummary::getQuestionLogSummaryAddTime).reversed());
QuestionLogSummary questionLogSummary = value.get(0);
if (ResourcesQuestionSnapshotFromTypeEnum.HOMEWORK_FILE.equals(questionLogSummary.getQuestionSettingType())) {
//文件作业类型 没有最大分数,直接取学生得分
b = b.add(ObjectUtil.defaultIfNull(questionLogSummary.getQuestionLogSummaryStudentTotalScore(), BigDecimal.ZERO));
} else {
//题目类型作业 有最大分数,需要转换为百分制
BigDecimal questionSettingTotalScore = ObjectUtil.defaultIfNull(questionLogSummary.getQuestionSettingTotalScore(), BigDecimal.valueOf(100));
BigDecimal questionLogSummaryStudentTotalScore = ObjectUtil.defaultIfNull(questionLogSummary.getQuestionLogSummaryStudentTotalScore(), BigDecimal.ZERO);
//转为百分制
b = b.add(questionLogSummaryStudentTotalScore.multiply(new BigDecimal(100)).divide(questionSettingTotalScore, 1, RoundingMode.HALF_UP));
}
}
//总分除以总作业数得出平均分
b = b.divide(new BigDecimal(homeworkList.size()), 1, RoundingMode.HALF_UP);
scoreDashboard.setQuestionHomeworkScore(b);
}
scoreDashboard.setQuestionHomeworkScore(b);
}
}
//考试
List<TeacherOpenCourseQuestionSetting> select3 = teacherOpenCourseQuestionSettingDao.createLambdaQuery()
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseId, teacherOpenCourseId)
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingType, ResourcesQuestionSnapshotFromTypeEnum.EXAM).select();
if (CollectionUtil.isEmpty(select3)) {
{
scoreDashboard.setExamScore(BigDecimal.ZERO);
} else {
if (weight == null || "1".equals(weight.getCoursePracticeResultSetting())) {
List<Long> collect = select3.stream().map(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingId).collect(Collectors.toList());
List<QuestionLogSummary> select1 = questionLogSummaryService.createLambdaQuery()
.andEq(QuestionLogSummary::getPersonId, studentId)
.andIn(QuestionLogSummary::getQuestionSettingId, collect).select();
if (CollectionUtil.isEmpty(select1)) {
scoreDashboard.setExamScore(BigDecimal.ZERO);
} else {
BigDecimal b = BigDecimal.ZERO;
for (QuestionLogSummary questionLogSummary : select1) {
b = b.add(questionLogSummary.getQuestionLogSummaryStudentTotalScore());
if (!CollectionUtil.isEmpty(examList)) {
if (weight == null || "1".equals(weight.getExaminationResultSetting())) {
List<Long> settingIdList = examList.stream().map(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingId).collect(Collectors.toList());
//查询学生考试记录
List<QuestionLogSummary> questionLogSummaryList = questionLogSummaryDao.createLambdaQuery()
.andEq(QuestionLogSummary::getPersonId, studentId)
.andIn(QuestionLogSummary::getQuestionSettingId, settingIdList)
.andEq(QuestionLogSummary::getQuestionLogSummaryStatus, 1)
.select();
if (!CollectionUtil.isEmpty(questionLogSummaryList)) {
Map<Long, List<QuestionLogSummary>> questionLogSummaryMap = questionLogSummaryList.stream().collect(Collectors.groupingBy(QuestionLogSummary::getQuestionSettingId));
BigDecimal b = BigDecimal.ZERO;
for (Map.Entry<Long, List<QuestionLogSummary>> entry : questionLogSummaryMap.entrySet()) {
List<QuestionLogSummary> value = entry.getValue();
//以防万一有多条记录,取最近的一条
value.sort(Comparator.comparing(QuestionLogSummary::getQuestionLogSummaryAddTime).reversed());
QuestionLogSummary questionLogSummary = value.get(0);
BigDecimal questionSettingTotalScore = ObjectUtil.defaultIfNull(questionLogSummary.getQuestionSettingTotalScore(), BigDecimal.valueOf(100));
BigDecimal questionLogSummaryStudentTotalScore = ObjectUtil.defaultIfNull(questionLogSummary.getQuestionLogSummaryStudentTotalScore(), BigDecimal.ZERO);
//转为百分制
b = b.add(questionLogSummaryStudentTotalScore.multiply(new BigDecimal(100)).divide(questionSettingTotalScore, 1, RoundingMode.HALF_UP));
}
//总分除以总作业数得出平均分
b = b.divide(new BigDecimal(examList.size()), 1, RoundingMode.HALF_UP);
scoreDashboard.setQuestionHomeworkScore(b);
}
scoreDashboard.setExamScore(b);
}
}
}
//互动
List<TeacherOpenCourseChatLog> chatLogList = courseChatLogDao.createLambdaQuery()
.andEq(TeacherOpenCourseChatLog::getStudentId, studentId)
.andEq(TeacherOpenCourseChatLog::getTeacherOpenCourseId, teacherOpenCourseId).select();
//提问次数
long count = chatLogList.stream().filter(v -> v.getChatLogSendType().equals(ChatLogSendTypeEnum.student_ask)
|| v.getChatLogSendType().equals(ChatLogSendTypeEnum.specify_ask)).count();
//回复次数
long count2 = chatLogList.stream().filter(v ->
v.getChatLogSendType().equals(ChatLogSendTypeEnum.normal)).count();
//答题次数
long count3 = chatLogList.stream().filter(v ->
v.getChatLogSendType().equals(ChatLogSendTypeEnum.normal)
&& v.getStudentScore() != null
).count();
BigDecimal chatScore = BigDecimal.ZERO;
if (weight != null && StringUtils.isNotEmpty(weight.getInteractionResultSetting())) {
String interactionResultSetting = weight.getInteractionResultSetting();
if (interactionResultSetting.contains("1")) {
chatScore = NumberUtil.mul(count2, NumberUtil.toBigDecimal(weight.getInteractionResultMessageScore()));
}
if (interactionResultSetting.contains("2")) {
chatScore = NumberUtil.mul(count, NumberUtil.toBigDecimal(weight.getInteractionResultQuestionScore()));
}
if (interactionResultSetting.contains("3")) {
chatScore = NumberUtil.mul(count3, NumberUtil.toBigDecimal(weight.getInteractionResultAnswerScore()));
//互动分数
{
scoreDashboard.setChatScore(BigDecimal.ZERO);
if (CollectionUtil.isNotEmpty(teacherOpenCourseChatLogList) && weight != null && StringUtils.isNotBlank(weight.getInteractionResultSetting())) {
BigDecimal totalChatScore = BigDecimal.ZERO;
//1留言2提问3回答
String interactionResultSetting = weight.getInteractionResultSetting();
//回答分数处理
{
if (interactionResultSetting.contains("3")) {
//老师提问该学生
List<Long> teacherAskIds = teacherOpenCourseChatLogList.stream().filter(v -> {
return (ChatLogSendTypeEnum.random_ask.equals(v.getChatLogSendType()) || ChatLogSendTypeEnum.specify_ask.equals(v.getChatLogSendType()))
&& ObjectUtil.equals(studentId, v.getStudentId());
}).map(TeacherOpenCourseChatLog::getTeacherOpenCourseChatLogId).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(teacherAskIds)) {
//学生回答的次数,回答多次也只算一次
long count = teacherOpenCourseChatLogList.stream().filter(v -> {
return ObjectUtil.equals(studentId, v.getStudentId())
&& teacherAskIds.contains(v.getTeacherOpenCourseChatLogParentId());
}).map(TeacherOpenCourseChatLog::getTeacherOpenCourseChatLogParentId).distinct().count();
BigDecimal interactionResultAnswerScore = new BigDecimal(ObjectUtil.defaultIfBlank(weight.getInteractionResultAnswerScore(), "0"));
totalChatScore = totalChatScore.add(interactionResultAnswerScore.multiply(new BigDecimal(count)));
}
}
}
//提问分数处理
{
if (interactionResultSetting.contains("2")) {
//学生提问老师
List<Long> studentAskIds = teacherOpenCourseChatLogList.stream().filter(v -> {
return ChatLogSendTypeEnum.student_ask.equals(v.getChatLogSendType())
&& ObjectUtil.equals(studentId, v.getStudentId());
}).map(TeacherOpenCourseChatLog::getTeacherOpenCourseChatLogId).collect(Collectors.toList());
long count = studentAskIds.size();
BigDecimal interactionResultQuestionScore = new BigDecimal(ObjectUtil.defaultIfBlank(weight.getInteractionResultQuestionScore(), "0"));
BigDecimal multiply = interactionResultQuestionScore.multiply(new BigDecimal(count));
if (multiply.compareTo(new BigDecimal(TeacherOpenCourseScoreDashboardConstant.STUDENT_ASK_MAX_SCORE)) > 0) {
multiply = new BigDecimal(TeacherOpenCourseScoreDashboardConstant.STUDENT_ASK_MAX_SCORE);
}
totalChatScore = totalChatScore.add(multiply);
}
}
//留言分数处理
{
if (interactionResultSetting.contains("1")) {
//老师发起的讨论,学生的班级在讨论的班级中
List<Long> discussionIdList = teacherOpenCourseChatLogList.stream().filter(v -> {
return ChatLogSendTypeEnum.discuss.equals(v.getChatLogSendType())
&& (
StringUtils.isBlank(v.getSchoolClassIds())
|| Arrays.asList(v.getSchoolClassIds().split(",")).contains(student.getClassId().toString())
);
}).map(TeacherOpenCourseChatLog::getTeacherOpenCourseChatLogId).collect(Collectors.toList());
//学生回复的讨论的次数
long count = teacherOpenCourseChatLogList.stream().filter(v -> {
return (
ObjectUtil.equals(studentId, v.getStudentId())
&& ChatLogSendTypeEnum.normal.equals(v.getChatLogSendType())
&& StringUtils.isNotBlank(v.getChatLogFullId())
&& discussionIdList.contains(Long.valueOf(v.getChatLogFullId().split("_")[0]))
);
}).count();
BigDecimal interactionResultMessageScore = new BigDecimal(ObjectUtil.defaultIfBlank(weight.getInteractionResultMessageScore(), "0"));
BigDecimal multiply = interactionResultMessageScore.multiply(new BigDecimal(count));
if (multiply.compareTo(new BigDecimal(TeacherOpenCourseScoreDashboardConstant.DISCUSS_MAX_SCORE)) > 0) {
multiply = new BigDecimal(TeacherOpenCourseScoreDashboardConstant.DISCUSS_MAX_SCORE);
}
totalChatScore = totalChatScore.add(multiply);
}
}
scoreDashboard.setChatScore(totalChatScore);
}
} else {
chatScore = BigDecimal.valueOf(count2);
}
scoreDashboard.setChatScore(chatScore);
BigDecimal totalScore = scoreDashboard.getSigninScore()
.add(scoreDashboard.getCourseScore())
.add(scoreDashboard.getRealOperationScore())
.add(scoreDashboard.getQuestionHomeworkScore())
.add(scoreDashboard.getExamScore())
.add(scoreDashboard.getChatScore());
scoreDashboard.setTotalScore(totalScore);
if (weight != null) {
lastStatus(weight, totalScore, scoreDashboard);
//总分
{
scoreDashboard.setTotalScore(BigDecimal.ZERO);
if (weight != null) {
BigDecimal totalScore = BigDecimal.ZERO;
BigDecimal formatSignScore = scoreDashboard.getSigninScore().multiply(new BigDecimal(ObjectUtil.defaultIfBlank(weight.getSignInResult(), "0")));
BigDecimal formatCourseScore = scoreDashboard.getCourseScore().multiply(new BigDecimal(ObjectUtil.defaultIfBlank(weight.getChapterContactResult(), "0")));
BigDecimal formatRealOperationScore = scoreDashboard.getRealOperationScore().multiply(new BigDecimal(ObjectUtil.defaultIfBlank(weight.getCoursePracticeResult(), "0")));
BigDecimal formatQuestionHomeworkScore = scoreDashboard.getQuestionHomeworkScore().multiply(new BigDecimal(ObjectUtil.defaultIfBlank(weight.getHomeworkResult(), "0")));
BigDecimal formatExamScore = scoreDashboard.getExamScore().multiply(new BigDecimal(ObjectUtil.defaultIfBlank(weight.getExaminationResult(), "0")));
BigDecimal formatChatScore = scoreDashboard.getChatScore().multiply(new BigDecimal(ObjectUtil.defaultIfBlank(weight.getInteractionResult(), "0")));
totalScore = totalScore.add(formatSignScore).add(formatCourseScore).add(formatRealOperationScore).add(formatQuestionHomeworkScore).add(formatExamScore).add(formatChatScore);
//加上手动的分数
totalScore = totalScore.add(ObjectUtil.defaultIfNull(teacherOpenCourseScoreDashboard.getManualScore(), BigDecimal.ZERO));
totalScore = totalScore.setScale(1, RoundingMode.HALF_UP);
scoreDashboard.setTotalScore(totalScore);
//成绩状态
lastStatus(weight, totalScore, scoreDashboard);
}
}
scoreDashboard.setTeacherOpenCourseId(teacherOpenCourseId);
studentScores.add(scoreDashboard);
updateTemplate(scoreDashboard);
}
//通过课程id删除存量数据
teacherOpenCourseScoreDashboardDao.deleteByTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseScoreDashboardDao.insertBatch(studentScores);
return true;
}
@ -779,4 +1046,70 @@ public class TeacherOpenCourseScoreDashboardService extends CoreBaseService<Teac
String filename = StrUtil.format("成绩-导出 {}.xlsx", System.currentTimeMillis());
write(response, filename, "Sheet1", header.values(), convertData(header.keySet(), maps));
}
public void updateManualScore(Long teacherOpenCourseScoreDashboardId, Long studentId, Long teacherOpenCourseId, BigDecimal manualScore) {
TeacherOpenCourseScoreDashboard teacherOpenCourseScoreDashboard = null;
if (teacherOpenCourseScoreDashboardId != null) {
teacherOpenCourseScoreDashboard = this.queryById(teacherOpenCourseScoreDashboardId);
if (teacherOpenCourseScoreDashboard == null) {
throw new PlatformException("参数错误!");
}
}else {
if (studentId==null||teacherOpenCourseId==null){
throw new PlatformException("参数错误!");
}
TeacherOpenCourseScoreDashboard param = new TeacherOpenCourseScoreDashboard();
param.setStudentId(studentId);
param.setTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseScoreDashboard = this.queryObject(param);
if (teacherOpenCourseScoreDashboard == null) {
Student student = studentService.queryById(studentId);
if (student == null) {
throw new PlatformException("参数错误!");
}
teacherOpenCourseScoreDashboard = new TeacherOpenCourseScoreDashboard();
teacherOpenCourseScoreDashboard.setTeacherOpenCourseId(teacherOpenCourseId);
teacherOpenCourseScoreDashboard.setStudentId(studentId);
teacherOpenCourseScoreDashboard.setOrgId(student.getOrgId());
teacherOpenCourseScoreDashboard.setStudentSn(student.getStudentSn());
teacherOpenCourseScoreDashboard.setStudentName(student.getStudentName());
teacherOpenCourseScoreDashboard.setExamScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setCourseScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setChatScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setSigninScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setRealOperationScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setQuestionHomeworkScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setTotalScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setManualScore(BigDecimal.ZERO);
teacherOpenCourseScoreDashboard.setUserId(student.getUserId());
teacherOpenCourseScoreDashboard.setCreateTime(new Date());
teacherOpenCourseScoreDashboardDao.insert(teacherOpenCourseScoreDashboard);
}
}
teacherOpenCourseScoreDashboard.setManualScore(ObjectUtil.defaultIfNull(manualScore, BigDecimal.ZERO));
teacherOpenCourseScoreDashboard.setTotalScore(ObjectUtil.defaultIfNull(teacherOpenCourseScoreDashboard.getTotalScore(), BigDecimal.ZERO).add(ObjectUtil.defaultIfNull(manualScore, BigDecimal.ZERO)).setScale(1, RoundingMode.HALF_UP));
updateTemplate(teacherOpenCourseScoreDashboard);
}
}

@ -288,4 +288,8 @@ public class TeacherOpenCourseStudentSigninSettingService extends CoreBaseServic
.select(String.class, "teacher_open_course_student_signin_setting_session_time");
return CollectionUtil.emptyIfNull(list).stream().sorted().collect(Collectors.toList());
}
public List<TeacherOpenCourseStudentSigninSetting> getByClassId(Long classId) {
return teacherOpenCourseStudentSigninSettingDao.getByClassId(classId);
}
}

@ -5,11 +5,12 @@ import cn.jlw.util.ToolUtils;
import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.annotation.Function;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.file.FileService;
import com.ibeetl.admin.core.util.TimeTool;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.entity.StudentHandsOnTaskReport;
import com.ibeetl.jlw.entity.TeacherOpenCourseHandsOnSimulationTasks;
import com.ibeetl.jlw.service.StudentHandsOnTaskReportService;
import com.ibeetl.jlw.service.TeacherOpenCourseHandsOnSimulationTasksService;
import com.ibeetl.jlw.web.query.StudentHandsOnTaskReportQuery;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
@ -18,6 +19,8 @@ import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -36,24 +39,29 @@ import java.util.Map;
@RestController
@Validated
public class StudentHandsOnTaskReportController{
public class StudentHandsOnTaskReportController {
private final Log log = LogFactory.getLog(this.getClass());
private static final String MODEL = "/jlw/studentHandsOnTaskReport";
private static final String API = "/api/studentHandsOnTaskReport";
@Resource private StudentHandsOnTaskReportService studentHandsOnTaskReportService;
@Resource
private StudentHandsOnTaskReportService studentHandsOnTaskReportService;
@Autowired
@Lazy
private TeacherOpenCourseHandsOnSimulationTasksService teacherOpenCourseHandsOnSimulationTasksService;
@Resource FileService fileService;
/* 前端接口 */
@PostMapping(API + "/getPageList.do")
public JsonResult<PageQuery> getPageList(StudentHandsOnTaskReportQuery condition,@SCoreUser CoreUser coreUser){
if(null == coreUser){
public JsonResult<PageQuery> getPageList(StudentHandsOnTaskReportQuery condition, @SCoreUser CoreUser coreUser) {
if (null == coreUser) {
return JsonResult.failMessage("请登录后再操作");
}else{
} else {
PageQuery page = condition.getPageQuery();
studentHandsOnTaskReportService.queryByConditionQuery(page);
return JsonResult.success(page);
@ -62,23 +70,34 @@ public class StudentHandsOnTaskReportController{
@GetMapping(API + "/getInfo.do")
public JsonResult<StudentHandsOnTaskReport>getInfo(StudentHandsOnTaskReportQuery param,@SCoreUser CoreUser coreUser) {
if(null == coreUser){
public JsonResult<StudentHandsOnTaskReport> getInfo(StudentHandsOnTaskReportQuery param, @SCoreUser CoreUser coreUser) {
if (null == coreUser) {
return JsonResult.failMessage("请登录后再操作");
}else{
} else {
StudentHandsOnTaskReport studentHandsOnTaskReport = studentHandsOnTaskReportService.getInfo(param, coreUser);
return JsonResult.success(studentHandsOnTaskReport);
if (studentHandsOnTaskReport != null) {
TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = new TeacherOpenCourseHandsOnSimulationTasks();
teacherOpenCourseHandsOnSimulationTasks.setTaskId(studentHandsOnTaskReport.getHandsOnTaskId());
TeacherOpenCourseHandsOnSimulationTasks res = teacherOpenCourseHandsOnSimulationTasksService.queryObject(teacherOpenCourseHandsOnSimulationTasks);
if (res != null) {
studentHandsOnTaskReport.set("maxScore", res.getTaskScore());
} else {
studentHandsOnTaskReport.set("maxScore", 100);
}
}
return JsonResult.success(studentHandsOnTaskReport);
}
}
@GetMapping(API + "/getList.do")
public JsonResult<List<StudentHandsOnTaskReport>>getList(StudentHandsOnTaskReportQuery param,@SCoreUser CoreUser coreUser) {
if(null == coreUser){
public JsonResult<List<StudentHandsOnTaskReport>> getList(StudentHandsOnTaskReportQuery param, @SCoreUser CoreUser coreUser) {
if (null == coreUser) {
return JsonResult.failMessage("请登录后再操作");
}else{
List<StudentHandsOnTaskReport>list = studentHandsOnTaskReportService.getValuesByQuery(param);
return JsonResult.success(list);
} else {
List<StudentHandsOnTaskReport> list = studentHandsOnTaskReportService.getValuesByQuery(param);
return JsonResult.success(list);
}
}
@ -88,7 +107,7 @@ public class StudentHandsOnTaskReportController{
@GetMapping(MODEL + "/index.do")
@Function("studentHandsOnTaskReport.query")
public ModelAndView index() {
ModelAndView view = new ModelAndView("/jlw/studentHandsOnTaskReport/index.html") ;
ModelAndView view = new ModelAndView("/jlw/studentHandsOnTaskReport/index.html");
view.addObject("search", StudentHandsOnTaskReportQuery.class.getName());
return view;
}
@ -106,10 +125,10 @@ public class StudentHandsOnTaskReportController{
@Function("studentHandsOnTaskReport.add")
public ModelAndView add(Long studentHandsOnTaskReportId) {
ModelAndView view = new ModelAndView("/jlw/studentHandsOnTaskReport/add.html");
if(null != studentHandsOnTaskReportId){
if (null != studentHandsOnTaskReportId) {
StudentHandsOnTaskReport studentHandsOnTaskReport = studentHandsOnTaskReportService.queryById(studentHandsOnTaskReportId);
view.addObject("studentHandsOnTaskReport", studentHandsOnTaskReport);
}else {
} else {
view.addObject("studentHandsOnTaskReport", new StudentHandsOnTaskReport());
}
return view;
@ -119,7 +138,7 @@ public class StudentHandsOnTaskReportController{
@PostMapping(MODEL + "/list.json")
@Function("studentHandsOnTaskReport.query")
public JsonResult<PageQuery> list(StudentHandsOnTaskReportQuery condition){
public JsonResult<PageQuery> list(StudentHandsOnTaskReportQuery condition) {
PageQuery page = condition.getPageQuery();
studentHandsOnTaskReportService.queryByCondition(page);
return JsonResult.success(page);
@ -127,29 +146,29 @@ public class StudentHandsOnTaskReportController{
@PostMapping(MODEL + "/addAll.json")
@Function("studentHandsOnTaskReport.add")
public JsonResult addAll(StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery,@SCoreUser CoreUser coreUser){
if(null == coreUser){
public JsonResult addAll(StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery, @SCoreUser CoreUser coreUser) {
if (null == coreUser) {
return JsonResult.failMessage("请登录后再操作");
}else{
studentHandsOnTaskReportQuery.setUserId(coreUser.getId());
studentHandsOnTaskReportQuery.setOrgId(coreUser.getOrgId());
} else {
studentHandsOnTaskReportQuery.setUserId(coreUser.getId());
studentHandsOnTaskReportQuery.setOrgId(coreUser.getOrgId());
String msg = studentHandsOnTaskReportService.addAll(studentHandsOnTaskReportQuery);
if (StringUtils.isBlank(msg)) {
return JsonResult.success();
} else {
return JsonResult.failMessage("新增失败,"+msg);
return JsonResult.failMessage("新增失败," + msg);
}
}
}
@PostMapping(MODEL + "/add.json")
@Function("studentHandsOnTaskReport.add")
public JsonResult add(@Validated(ValidateConfig.ADD.class) StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery, BindingResult result,@SCoreUser CoreUser coreUser){
if(result.hasErrors()){
public JsonResult add(@Validated(ValidateConfig.ADD.class) StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery, BindingResult result, @SCoreUser CoreUser coreUser) {
if (result.hasErrors()) {
return JsonResult.failMessage(result);
}else{
studentHandsOnTaskReportQuery.setUserId(coreUser.getId());
studentHandsOnTaskReportQuery.setOrgId(coreUser.getOrgId());
} else {
studentHandsOnTaskReportQuery.setUserId(coreUser.getId());
studentHandsOnTaskReportQuery.setOrgId(coreUser.getOrgId());
return studentHandsOnTaskReportService.add(studentHandsOnTaskReportQuery, coreUser);
}
}
@ -157,16 +176,16 @@ public class StudentHandsOnTaskReportController{
@PostMapping(MODEL + "/edit.json")
@Function("studentHandsOnTaskReport.edit")
public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery, @SCoreUser CoreUser coreUser, BindingResult result) {
if(result.hasErrors()){
if (result.hasErrors()) {
return JsonResult.failMessage(result);
}else {
studentHandsOnTaskReportQuery.setUserId(coreUser.getId());
studentHandsOnTaskReportQuery.setOrgId(coreUser.getOrgId());
} else {
studentHandsOnTaskReportQuery.setUserId(coreUser.getId());
studentHandsOnTaskReportQuery.setOrgId(coreUser.getOrgId());
String msg = studentHandsOnTaskReportService.edit(studentHandsOnTaskReportQuery, coreUser);
if (StringUtils.isBlank(msg)) {
return JsonResult.success();
} else {
return JsonResult.failMessage("更新失败,"+msg);
return JsonResult.failMessage("更新失败," + msg);
}
}
}
@ -174,16 +193,16 @@ public class StudentHandsOnTaskReportController{
@GetMapping(MODEL + "/view.json")
@Function("studentHandsOnTaskReport.query")
public JsonResult<StudentHandsOnTaskReport>queryInfo(Long studentHandsOnTaskReportId) {
StudentHandsOnTaskReport studentHandsOnTaskReport = studentHandsOnTaskReportService.queryById( studentHandsOnTaskReportId);
return JsonResult.success(studentHandsOnTaskReport);
public JsonResult<StudentHandsOnTaskReport> queryInfo(Long studentHandsOnTaskReportId) {
StudentHandsOnTaskReport studentHandsOnTaskReport = studentHandsOnTaskReportService.queryById(studentHandsOnTaskReportId);
return JsonResult.success(studentHandsOnTaskReport);
}
@GetMapping(MODEL + "/getValues.json")
@Function("studentHandsOnTaskReport.query")
public JsonResult<List<StudentHandsOnTaskReport>>getValues(StudentHandsOnTaskReportQuery param) {
List<StudentHandsOnTaskReport>list = studentHandsOnTaskReportService.getValuesByQuery(param);
return JsonResult.success(list);
public JsonResult<List<StudentHandsOnTaskReport>> getValues(StudentHandsOnTaskReportQuery param) {
List<StudentHandsOnTaskReport> list = studentHandsOnTaskReportService.getValuesByQuery(param);
return JsonResult.success(list);
}
@ -196,10 +215,10 @@ public class StudentHandsOnTaskReportController{
}
@PostMapping(API + "/add.do")
public JsonResult addStudentHandsOnTaskReport(@RequestBody @Validated(ValidateConfig.ADD.class) StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery, BindingResult result,@SCoreUser CoreUser coreUser){
if(result.hasErrors()){
public JsonResult addStudentHandsOnTaskReport(@RequestBody @Validated(ValidateConfig.ADD.class) StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery, BindingResult result, @SCoreUser CoreUser coreUser) {
if (result.hasErrors()) {
return JsonResult.failMessage(result);
}else{
} else {
studentHandsOnTaskReportQuery.setUserId(coreUser.getId());
studentHandsOnTaskReportQuery.setOrgId(coreUser.getOrgId());
return studentHandsOnTaskReportService.add(studentHandsOnTaskReportQuery, coreUser);
@ -207,26 +226,26 @@ public class StudentHandsOnTaskReportController{
}
@PostMapping(API + "/edit.do")
public JsonResult<String> editStudentHandsOnTaskReport(@RequestBody @Validated(ValidateConfig.UPDATE.class) StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery,@SCoreUser CoreUser coreUser, BindingResult result) {
if(result.hasErrors()){
return JsonResult.failMessage(result);
}else {
studentHandsOnTaskReportQuery.setUserId(coreUser.getId());
studentHandsOnTaskReportQuery.setOrgId(coreUser.getOrgId());
String msg = studentHandsOnTaskReportService.edit(studentHandsOnTaskReportQuery, coreUser);
if (StringUtils.isBlank(msg)) {
return JsonResult.success();
} else {
return JsonResult.failMessage("更新失败,"+msg);
}
public JsonResult<String> editStudentHandsOnTaskReport(@RequestBody StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery, @SCoreUser CoreUser coreUser, BindingResult result) {
if(studentHandsOnTaskReportQuery.getStudentHandsOnTaskReportId()==null){
return JsonResult.failMessage("未完成实操任务");
}
studentHandsOnTaskReportQuery.setUserId(coreUser.getId());
studentHandsOnTaskReportQuery.setOrgId(coreUser.getOrgId());
String msg = studentHandsOnTaskReportService.edit(studentHandsOnTaskReportQuery, coreUser);
if (StringUtils.isBlank(msg)) {
return JsonResult.success();
} else {
return JsonResult.failMessage("更新失败," + msg);
}
}
//导出信息
@GetMapping(MODEL + "/excel/export.json")
@Function("studentHandsOnTaskReport.exportDocument")
public void export(HttpServletRequest request,HttpServletResponse response,StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery,@SCoreUser CoreUser coreUser) {
if(null == coreUser){
public void export(HttpServletRequest request, HttpServletResponse response, StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery, @SCoreUser CoreUser coreUser) {
if (null == coreUser) {
return;
}
HSSFWorkbook workbook = null;
@ -288,7 +307,7 @@ public class StudentHandsOnTaskReportController{
//设置表格特定的列宽度
if (null != widthMap.get(headerCode[i])) {
String width = widthMap.get(headerCode[i]).toString().split("\\.")[0];
Integer w = Integer.parseInt(width) > header[i].length()*3?Integer.parseInt(width):header[i].length()*3;
Integer w = Integer.parseInt(width) > header[i].length() * 3 ? Integer.parseInt(width) : header[i].length() * 3;
sheet.setColumnWidth(i, w * 190);
}
//创建一个单元格
@ -303,7 +322,7 @@ public class StudentHandsOnTaskReportController{
//遍历结果集,把内容加入表格
for (int i = 0; i < mapList.size(); i++) {
HSSFRow row = sheet.createRow(i + 1);
row.setHeight((short) (50*10));
row.setHeight((short) (50 * 10));
Map<String, Object> map = mapList.get(i);
for (int j = 0; j < headerCode.length; j++) {
HSSFCell cell = row.createCell(j);
@ -316,13 +335,13 @@ public class StudentHandsOnTaskReportController{
//八进制输出流
response.setContentType("application/octet-stream");
//这后面可以设置导出Excel的名称此例中名为student.xls
String fileName = ToolUtils.web2fileName(request,"studentHandsOnTaskReport(" + TimeTool.getNowTime("YMD") + ").xls");
response.setHeader("Content-disposition", "attachment;filename="+fileName);
String fileName = ToolUtils.web2fileName(request, "studentHandsOnTaskReport(" + TimeTool.getNowTime("YMD") + ").xls");
response.setHeader("Content-disposition", "attachment;filename=" + fileName);
//刷新缓冲
response.flushBuffer();
//workbook将Excel写入到response的输出流中供页面下载
workbook.write(response.getOutputStream());
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
@ -332,14 +351,15 @@ public class StudentHandsOnTaskReportController{
if (null != response && null != response.getOutputStream()) {
response.getOutputStream().close();
}
} catch (Exception e) { }
} catch (Exception e) {
}
}
}
//导出信息
@GetMapping(MODEL + "/excel/export.do")
public void exportDo(HttpServletRequest request,HttpServletResponse response,StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery,@SCoreUser CoreUser coreUser) {
if(null == coreUser){
public void exportDo(HttpServletRequest request, HttpServletResponse response, StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery, @SCoreUser CoreUser coreUser) {
if (null == coreUser) {
return;
}
HSSFWorkbook workbook = null;
@ -401,7 +421,7 @@ public class StudentHandsOnTaskReportController{
//设置表格特定的列宽度
if (null != widthMap.get(headerCode[i])) {
String width = widthMap.get(headerCode[i]).toString().split("\\.")[0];
Integer w = Integer.parseInt(width) > header[i].length()*3?Integer.parseInt(width):header[i].length()*3;
Integer w = Integer.parseInt(width) > header[i].length() * 3 ? Integer.parseInt(width) : header[i].length() * 3;
sheet.setColumnWidth(i, w * 190);
}
//创建一个单元格
@ -416,7 +436,7 @@ public class StudentHandsOnTaskReportController{
//遍历结果集,把内容加入表格
for (int i = 0; i < mapList.size(); i++) {
HSSFRow row = sheet.createRow(i + 1);
row.setHeight((short) (50*10));
row.setHeight((short) (50 * 10));
Map<String, Object> map = mapList.get(i);
for (int j = 0; j < headerCode.length; j++) {
HSSFCell cell = row.createCell(j);
@ -429,13 +449,13 @@ public class StudentHandsOnTaskReportController{
//八进制输出流
response.setContentType("application/octet-stream");
//这后面可以设置导出Excel的名称此例中名为student.xls
String fileName = ToolUtils.web2fileName(request,"studentHandsOnTaskReport(" + TimeTool.getNowTime("YMD") + ").xls");
response.setHeader("Content-disposition", "attachment;filename="+fileName);
String fileName = ToolUtils.web2fileName(request, "studentHandsOnTaskReport(" + TimeTool.getNowTime("YMD") + ").xls");
response.setHeader("Content-disposition", "attachment;filename=" + fileName);
//刷新缓冲
response.flushBuffer();
//workbook将Excel写入到response的输出流中供页面下载
workbook.write(response.getOutputStream());
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
@ -445,7 +465,8 @@ public class StudentHandsOnTaskReportController{
if (null != response && null != response.getOutputStream()) {
response.getOutputStream().close();
}
} catch (Exception e) { }
} catch (Exception e) {
}
}
}

@ -14,7 +14,6 @@ import com.ibeetl.jlw.dao.StudentDao;
import com.ibeetl.jlw.entity.FileEntity;
import com.ibeetl.jlw.entity.Student;
import com.ibeetl.jlw.entity.TeacherOpenCourseScoreDashboard;
import com.ibeetl.jlw.job.TeacherOpenCourseScoreDashboardJob;
import com.ibeetl.jlw.service.TeacherOpenCourseScoreDashboardService;
import com.ibeetl.jlw.web.query.TeacherOpenCourseScoreDashboardQuery;
import org.apache.commons.collections4.MapUtils;
@ -22,6 +21,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.beetl.ext.fn.Json;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
@ -283,12 +283,12 @@ public class TeacherOpenCourseScoreDashboardController {
//导出信息
@RequestMapping(MODEL + "/excel/export.json")
public void export( HttpServletResponse response, TeacherOpenCourseScoreDashboardQuery teacherOpenCourseScoreDashboardQuery, @SCoreUser CoreUser coreUser) throws IOException {
public void export(HttpServletResponse response, TeacherOpenCourseScoreDashboardQuery teacherOpenCourseScoreDashboardQuery, @SCoreUser CoreUser coreUser) throws IOException {
if (null == coreUser) {
throw new PlatformException("请登录后再操作");
}
teacherOpenCourseScoreDashboardService.export( response, teacherOpenCourseScoreDashboardQuery, coreUser);
teacherOpenCourseScoreDashboardService.export(response, teacherOpenCourseScoreDashboardQuery, coreUser);
}
@ -338,4 +338,14 @@ public class TeacherOpenCourseScoreDashboardController {
}
}
@PostMapping(API + "/updateManualScore")
public JsonResult<String> updateManualScore(TeacherOpenCourseScoreDashboardQuery teacherOpenCourseScoreDashboardQuery) {
teacherOpenCourseScoreDashboardService.updateManualScore(teacherOpenCourseScoreDashboardQuery.getTeacherOpenCourseScoreDashboardId(),
teacherOpenCourseScoreDashboardQuery.getStudentId(),
teacherOpenCourseScoreDashboardQuery.getTeacherOpenCourseId(),
teacherOpenCourseScoreDashboardQuery.getManualScore());
return JsonResult.success();
}
}

@ -46,6 +46,16 @@ public class TeacherOpenCourseHandsOnQuery extends PageParam {
private String _given;//指定更新的特定字段,多个逗号隔开
/**
*
*/
private Date startTime;
/**
*
*/
private Date endTime;
public Long getHandsOnId(){
return handsOnId;
}
@ -152,4 +162,20 @@ public class TeacherOpenCourseHandsOnQuery extends PageParam {
public void set_given(String _given) {
this._given = _given;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
}

@ -4,9 +4,11 @@ import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.web.query.PageParam;
import com.ibeetl.jlw.entity.TeacherOpenCourseMergeCourseInfo;
import org.beetl.sql.annotation.entity.InsertIgnore;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
*
@ -78,6 +80,20 @@ public class TeacherOpenCourseMergeCourseInfoQuery extends PageParam {
private Boolean innerJoin;
//新增时间
@InsertIgnore
private Date addTime;
/**
*
*/
private Date startTime;
/**
*
*/
private Date endTime;
public Long getTeacherOpenCourseMergeCourseInfoId(){
return teacherOpenCourseMergeCourseInfoId;
}
@ -207,6 +223,7 @@ public class TeacherOpenCourseMergeCourseInfoQuery extends PageParam {
pojo.setResourcesTrainingIds(this.getResourcesTrainingIds());
pojo.setOrgId(this.getOrgId());
pojo.setUserId(this.getUserId());
// pojo.setAddTime(this.getAddTime());
return pojo;
}
@ -291,6 +308,30 @@ public class TeacherOpenCourseMergeCourseInfoQuery extends PageParam {
this.innerJoin = innerJoin;
}
public Date getAddTime() {
return addTime;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public void setAddTime(Date addTime) {
this.addTime = addTime;
}
public Long getSystemCourseInfoId() {
return systemCourseInfoId;
}

@ -6,9 +6,11 @@ import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.web.query.PageParam;
import com.ibeetl.jlw.entity.TeacherOpenCourseMergeResourcesInfo;
import com.ibeetl.jlw.enums.GlobalUpStatusEnum;
import org.beetl.sql.annotation.entity.InsertIgnore;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import static cn.hutool.core.util.ObjectUtil.defaultIfNull;
@ -40,6 +42,12 @@ public class TeacherOpenCourseMergeResourcesInfoQuery extends PageParam implemen
@Query(name = "后台用户ID", display = false)
private Long userId;
/**
*
*/
@InsertIgnore
private Date addTime;
private String teacherOpenCourseMergeResourcesInfoIdPlural;
private String teacherOpenCourseMergeCourseInfoIdPlural;
private String teacherOpenCourseIdPlural;
@ -50,6 +58,16 @@ public class TeacherOpenCourseMergeResourcesInfoQuery extends PageParam implemen
private String _given;//指定更新的特定字段,多个逗号隔开
/**
*
*/
private Date startTime;
/**
*
*/
private Date endTime;
public Long getTeacherOpenCourseMergeResourcesInfoId(){
return teacherOpenCourseMergeResourcesInfoId;
}
@ -106,6 +124,7 @@ public class TeacherOpenCourseMergeResourcesInfoQuery extends PageParam implemen
pojo.setResourcesInfoStatus(defaultIfNull(this.getResourcesInfoStatus(), GlobalUpStatusEnum.UP));
pojo.setOrgId(this.getOrgId());
pojo.setUserId(this.getUserId());
// pojo.setAddTime(this.addTime);
return pojo;
}
@ -186,6 +205,30 @@ public class TeacherOpenCourseMergeResourcesInfoQuery extends PageParam implemen
this.resourcesInfoStatus = resourcesInfoStatus;
}
public Date getAddTime() {
return addTime;
}
public void setAddTime(Date addTime) {
this.addTime = addTime;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
@Override
public TeacherOpenCourseMergeResourcesInfoQuery clone() {
return BeanUtil.copyProperties(this, this.getClass());

@ -47,6 +47,16 @@ public class TeacherOpenCourseNoticeQuery extends PageParam {
private String _given;//指定更新的特定字段,多个逗号隔开
/**
*
*/
private Date startTime;
/**
*
*/
private Date endTime;
public Long getTeacherOpenCourseNoticeId(){
return teacherOpenCourseNoticeId;
}
@ -167,4 +177,20 @@ public class TeacherOpenCourseNoticeQuery extends PageParam {
public void setStudentId(Long studentId) {
this.studentId = studentId;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
}

@ -97,6 +97,7 @@ public class TeacherOpenCourseQuestionSettingQuery extends PageParam {
private String teacherOpenCourseQuestionSettingStatusPlural;
private String orgIdPlural;
private String userIdPlural;
private String teacherOpenCourseMergeCourseInfoIdPlural;
/**
* {@link TeacherOpenCourseQuestionSettingController#getList}

@ -80,6 +80,16 @@ public class TeacherOpenCourseStudentSigninLogQuery extends PageParam {
private String _given;//指定更新的特定字段,多个逗号隔开
/**
*
*/
private Date startTime;
/**
*
*/
private Date endTime;
public Long getTeacherOpenCourseStudentSigninLogId(){
return teacherOpenCourseStudentSigninLogId;
}
@ -233,4 +243,20 @@ public class TeacherOpenCourseStudentSigninLogQuery extends PageParam {
public void setStudentSnOrName(String studentSnOrName) {
this.studentSnOrName = studentSnOrName;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
}

@ -363,3 +363,19 @@ updateTime
* 更新日志时间
update student_hands_on_task_log t set t.last_update_time = now(),t.all_time= (IFNULL(t.all_time,0) + #text(taskLogSeconds)#) where t.student_hands_on_task_ppt_id = #studentHandsOnTaskPptId#
getPracticalOperationParticipantsNumberValues
===
* 获取实操参与人数
SELECT
a.student_id
FROM
student_hands_on_task_log a
WHERE
1=1
@if(!isEmpty(handsOnTaskIdPlural)) {
AND FIND_IN_SET(a.hands_on_task_id,#handsOnTaskIdPlural#)
@}
GROUP BY a.student_id

@ -232,6 +232,9 @@ getTeacherOpenCourseHandsOnValues
@if(!isEmpty(trainingData)){
and t.training_data =#trainingData#
@}
@if(!isEmpty(startTime) && !isEmpty(endTime)){
and t.add_time BETWEEN #startTime# AND date_add(#endTime#,interval 1 day)
@}
getValuesByQuery

@ -340,6 +340,9 @@ getTeacherOpenCourseHandsOnSimulationTasksValues
@if(!isEmpty(addTime)){
and t.add_time =#addTime#
@}
@if(!isEmpty(handsOnIdPlural)){
and find_in_set(t.hands_on_id,#handsOnIdPlural#)
@}
getValuesByQuery

@ -434,6 +434,9 @@ getTeacherOpenCourseMergeCourseInfoValues
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
@if(!isEmpty(startTime) && !isEmpty(endTime)){
and t.add_time BETWEEN #startTime# AND date_add(#endTime#,interval 1 day)
@}
getValuesByQuery

@ -307,7 +307,9 @@ getValuesByQuery
@if(!isEmpty(userIdPlural)){
and find_in_set(t.user_id,#userIdPlural#)
@}
@if(!isEmpty(startTime) && !isEmpty(endTime)){
and t.add_time BETWEEN #startTime# AND date_add(#endTime#,interval 1 day)
@}
getValuesByQueryNotWithPermission
===

@ -241,7 +241,9 @@ getTeacherOpenCourseNoticeValues
@if(!isEmpty(delFlag)){
and t.del_flag =#delFlag#
@}
@if(!isEmpty(startTime) && !isEmpty(endTime)){
and t.create_time BETWEEN #startTime# AND date_add(#endTime#,interval 1 day)
@}
getValuesByQuery
===

@ -293,7 +293,6 @@ studentScoreList
LEFT JOIN student ta ON ta.student_id = t.student_id
WHERE
1 = 1
AND t.teacher_open_course_question_log_status = 2
AND ta.student_sn IS NOT NULL
@if(!isEmpty(teacherOpenCourseQuestionLogId)){
and t.teacher_open_course_question_log_id =#teacherOpenCourseQuestionLogId#
@ -1056,4 +1055,19 @@ logicDeleteQuestionLogBySummaryQuestionIds
not find_in_set(
t.teacher_open_course_question_log_id,
( SELECT question_log_ids FROM question_log_summary a WHERE a.question_setting_id = t.teacher_open_course_question_setting_id ))
AND t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId#
AND t.teacher_open_course_question_setting_id = #teacherOpenCourseQuestionSettingId#
getChapterExerciseParticipantsValuesNumber
===
* 获取练习章节参与人数
SELECT
a.student_id
FROM
teacher_open_course_question_log a
WHERE
a.teacher_open_course_question_log_status = 1
@if(isNotEmpty(teacherOpenCourseQuestionSettingIdPlural)) {
AND FIND_IN_SET(a.teacher_open_course_question_setting_id,#teacherOpenCourseQuestionSettingIdPlural#)
@}
GROUP BY a.student_id

@ -426,6 +426,9 @@ getTeacherOpenCourseQuestionSettingValues
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
@if(!isEmpty(teacherOpenCourseMergeCourseInfoIdPlural)){
and find_in_set(t.teacher_open_course_merge_course_info_id,#teacherOpenCourseMergeCourseInfoIdPlural#)
@}
getValuesByQuery

@ -295,6 +295,9 @@ getTeacherOpenCourseStudentSigninLogValues
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
@if(!isEmpty(startTime) && !isEmpty(endTime)){
and t.teacher_open_course_student_signin_log_add_time BETWEEN #startTime# AND date_add(#endTime#,interval 1 day)
@}
getValuesByQuery

@ -473,4 +473,11 @@ getValuesByQueryNotWithPermission
@}
getByClassId
===
* 根据班级id查询签到设置
select t.*
from teacher_open_course_student_signin_setting t
where 1=1
and t.teacher_open_course_student_signin_setting_status = 1
and find_in_set(#schoolClassId#,t.school_class_ids)
Loading…
Cancel
Save