diff --git a/web/src/main/java/com/ibeetl/jlw/dao/StudentHandsOnTaskLogDao.java b/web/src/main/java/com/ibeetl/jlw/dao/StudentHandsOnTaskLogDao.java new file mode 100644 index 00000000..32b14319 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/dao/StudentHandsOnTaskLogDao.java @@ -0,0 +1,32 @@ +package com.ibeetl.jlw.dao; + +import java.util.List; +import java.util.Map; + +import com.ibeetl.jlw.entity.*; +import com.ibeetl.jlw.web.query.StudentHandsOnTaskLogQuery; + +import org.beetl.sql.mapper.annotation.SqlResource; +import org.springframework.stereotype.Repository; +import org.springframework.stereotype.Component; +import org.beetl.sql.mapper.BaseMapper; +import org.beetl.sql.core.engine.PageQuery; +import org.beetl.sql.mapper.annotation.Update; + +/** + * 学生实操日志 Dao + */ +// 实际可以不用加Repository注解,调用的地方注入时候,Idea会报红,看着难受 +@Repository +@SqlResource("jlw.studentHandsOnTaskLog") +public interface StudentHandsOnTaskLogDao extends BaseMapper{ + PageQuery queryByCondition(PageQuery query); + PageQuery queryByConditionQuery(PageQuery query); + @Update + void deleteStudentHandsOnTaskLogByIds(String ids); + @Update + int updateGivenByIds(StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery); + List getByIds(String ids); + List getValuesByQuery(StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery); + List getValuesByQueryNotWithPermission(StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery); +} diff --git a/web/src/main/java/com/ibeetl/jlw/entity/StudentHandsOnTaskLog.java b/web/src/main/java/com/ibeetl/jlw/entity/StudentHandsOnTaskLog.java new file mode 100644 index 00000000..661cf6d1 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/entity/StudentHandsOnTaskLog.java @@ -0,0 +1,181 @@ +package com.ibeetl.jlw.entity; + +import javax.validation.constraints.NotNull; + +import com.ibeetl.admin.core.entity.BaseEntity; +import org.beetl.sql.annotation.entity.*; + +import com.ibeetl.admin.core.util.ValidateConfig; + +import com.ibeetl.admin.core.annotation.Dict; + +import java.math.BigDecimal; +import java.util.Date; + +/* +* 学生-课程实操-时长日志 +* gen by Spring Boot2 Admin 2022-12-26 +*/ +public class StudentHandsOnTaskLog extends BaseEntity{ + + //ID + @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) + // @SeqID(name = ORACLE_CORE_SEQ_NAME) + @AssignID(value = "maskAutoID",param = "com.ibeetl.jlw.entity.StudentHandsOnTaskLog") + + private Long studentHandsOnTaskPptId ; + + //课程开课ID + + private Long teacherOpenCourseId ; + + //课程实操ID + + private Long handsOnId ; + + //课程实操任务ID + + private Long handsOnTaskId ; + + //创建时间 + + private Date createTime ; + + //组织ID + + private Long orgId ; + + //用户ID + + private Long userId ; + + //最后更新时间 + + private Date lastUpdateTime ; + + //学生ID + + private Long studentId ; + + public StudentHandsOnTaskLog(){ + } + + /**ID + *@return + */ + public Long getStudentHandsOnTaskPptId(){ + return studentHandsOnTaskPptId; + } + /**ID + *@param studentHandsOnTaskPptId + */ + public void setStudentHandsOnTaskPptId(Long studentHandsOnTaskPptId){ + this.studentHandsOnTaskPptId = studentHandsOnTaskPptId; + } + + /**课程开课ID + *@return + */ + public Long getTeacherOpenCourseId(){ + return teacherOpenCourseId; + } + /**课程开课ID + *@param teacherOpenCourseId + */ + public void setTeacherOpenCourseId(Long teacherOpenCourseId){ + this.teacherOpenCourseId = teacherOpenCourseId; + } + + /**课程实操ID + *@return + */ + public Long getHandsOnId(){ + return handsOnId; + } + /**课程实操ID + *@param handsOnId + */ + public void setHandsOnId(Long handsOnId){ + this.handsOnId = handsOnId; + } + + /**课程实操任务ID + *@return + */ + public Long getHandsOnTaskId(){ + return handsOnTaskId; + } + /**课程实操任务ID + *@param handsOnTaskId + */ + public void setHandsOnTaskId(Long handsOnTaskId){ + this.handsOnTaskId = handsOnTaskId; + } + + /**创建时间 + *@return + */ + public Date getCreateTime(){ + return createTime; + } + /**创建时间 + *@param createTime + */ + public void setCreateTime(Date createTime){ + this.createTime = createTime; + } + + /**组织ID + *@return + */ + public Long getOrgId(){ + return orgId; + } + /**组织ID + *@param orgId + */ + public void setOrgId(Long orgId){ + this.orgId = orgId; + } + + /**用户ID + *@return + */ + public Long getUserId(){ + return userId; + } + /**用户ID + *@param userId + */ + public void setUserId(Long userId){ + this.userId = userId; + } + + /**最后更新时间 + *@return + */ + public Date getLastUpdateTime(){ + return lastUpdateTime; + } + /**最后更新时间 + *@param lastUpdateTime + */ + public void setLastUpdateTime(Date lastUpdateTime){ + this.lastUpdateTime = lastUpdateTime; + } + + /**学生ID + *@return + */ + public Long getStudentId(){ + return studentId; + } + /**学生ID + *@param studentId + */ + public void setStudentId(Long studentId){ + this.studentId = studentId; + } + + +} diff --git a/web/src/main/java/com/ibeetl/jlw/entity/vo/HandsOnTaskScoreVO.java b/web/src/main/java/com/ibeetl/jlw/entity/vo/HandsOnTaskScoreVO.java new file mode 100644 index 00000000..05dbef41 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/entity/vo/HandsOnTaskScoreVO.java @@ -0,0 +1,27 @@ +package com.ibeetl.jlw.entity.vo; + +import lombok.Data; + +/** + * 类功能说明 + * + * @Version 0.0.1 + * @Author 许良彤 + * @Date 2022/12/26 20:47 + */ +@Data +public class HandsOnTaskScoreVO { + + private Long handsOnTaskId; + + /** + * 分数 + */ + private Double score; + + /** + * 时长 + */ + private Long time; + +} \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/entity/vo/StudentHandsOnScoreVO.java b/web/src/main/java/com/ibeetl/jlw/entity/vo/StudentHandsOnScoreVO.java new file mode 100644 index 00000000..78669ae4 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/entity/vo/StudentHandsOnScoreVO.java @@ -0,0 +1,26 @@ +package com.ibeetl.jlw.entity.vo; + +import lombok.Data; + +import java.util.List; + +/** + * 类功能说明 + * + * @Version 0.0.1 + * @Author 许良彤 + * @Date 2022/12/26 20:45 + */ +@Data +public class StudentHandsOnScoreVO { + + private Long handsOnId; + + /** + * 总分 + */ + private Double sumScore; + + private List handsOnTaskScores; + +} \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/enums/HandsOnTaskEnum.java b/web/src/main/java/com/ibeetl/jlw/enums/HandsOnTaskEnum.java index 8025c144..15715ca1 100644 --- a/web/src/main/java/com/ibeetl/jlw/enums/HandsOnTaskEnum.java +++ b/web/src/main/java/com/ibeetl/jlw/enums/HandsOnTaskEnum.java @@ -10,15 +10,15 @@ package com.ibeetl.jlw.enums; public enum HandsOnTaskEnum { //视频 - TASK_VIDEO("0", "视频"), + TASK_VIDEO("1", "视频"), //PPT - TASK_PPT("1", "PPT"), + TASK_PPT("2", "PPT"), //理论 - TASK_THEORY("2", "理论"), + TASK_THEORY("3", "理论"), //实操 - TASK_PRACTICAL_TRAINING("3", "实操"), + TASK_PRACTICAL_TRAINING("4", "实操"), //报告 - TASK_REPORT_WRITING("4", "报告"); + TASK_REPORT_WRITING("5", "报告"); HandsOnTaskEnum(String status, String desc) { this.status = status; diff --git a/web/src/main/java/com/ibeetl/jlw/service/StudentHandsOnTaskLogService.java b/web/src/main/java/com/ibeetl/jlw/service/StudentHandsOnTaskLogService.java new file mode 100644 index 00000000..995bdef7 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/service/StudentHandsOnTaskLogService.java @@ -0,0 +1,201 @@ +package com.ibeetl.jlw.service; + +import java.io.*; +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.math.BigDecimal; + +import cn.hutool.core.collection.CollectionUtil; +import cn.jlw.util.ToolUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.ibeetl.admin.core.entity.CoreUser; +import com.ibeetl.admin.core.util.TimeTool; +import com.ibeetl.admin.core.web.JsonResult; +import com.ibeetl.admin.core.web.JsonReturnCode; +import com.ibeetl.jlw.dao.StudentHandsOnTaskLogDao; +import com.ibeetl.jlw.entity.StudentHandsOnTaskLog; +import com.ibeetl.jlw.web.query.StudentHandsOnTaskLogQuery; +import com.ibeetl.jlw.entity.FileEntity; + +import com.ibeetl.admin.core.service.CoreBaseService; +import com.ibeetl.admin.core.util.PlatformException; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.beetl.sql.core.engine.PageQuery; +import org.beetl.sql.core.SqlId; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; + +import org.springframework.beans.factory.annotation.Autowired; + +import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue; + +/** + * 学生实操日志 Service + * 当分布式ID开启后请勿使用insert(*,true) + */ + +@Service +@Transactional +@Validated +public class StudentHandsOnTaskLogService extends CoreBaseService{ + + @Autowired private StudentHandsOnTaskLogDao studentHandsOnTaskLogDao; + + public PageQueryqueryByCondition(PageQuery query){ + PageQuery ret = studentHandsOnTaskLogDao.queryByCondition(query); + queryListAfter(ret.getList()); + return ret; + } + + public PageQueryqueryByConditionQuery(PageQuery query){ + PageQuery ret = studentHandsOnTaskLogDao.queryByConditionQuery(query); + queryListAfter(ret.getList()); + return ret; + } + + public void deleteByList(List list){ + String ids = ""; + ToolUtils.deleteNullList(list); + for(int i=0;null != list && i studentHandsOnTaskLogList = new ArrayList<>(); + try { + studentHandsOnTaskLogList = JSON.parseArray(studentHandsOnTaskLogQuery.getStudentHandsOnTaskLogJsonStr(), StudentHandsOnTaskLog.class); + } catch (Exception e) { + try { + studentHandsOnTaskLogList.add(JSONObject.parseObject(studentHandsOnTaskLogQuery.getStudentHandsOnTaskLogJsonStr(), StudentHandsOnTaskLog.class)); + } catch (Exception e1) {} + } + ToolUtils.deleteNullList(studentHandsOnTaskLogList); + if(null != studentHandsOnTaskLogList && studentHandsOnTaskLogList.size()>0){ + for(int i=0;i 0; + if(!flag){ + msg = "更新指定参数失败"; + } + }else{ + msg = "指定参数为空"; + } + return msg; + } + + public List getValues (Object paras){ + return sqlManager.select(SqlId.of("jlw.studentHandsOnTaskLog.getStudentHandsOnTaskLogValues"), StudentHandsOnTaskLog.class, paras); + } + + public List getValuesByQuery (StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery){ + return studentHandsOnTaskLogDao.getValuesByQuery(studentHandsOnTaskLogQuery); + } + + public List getValuesByQueryNotWithPermission (StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery){ + return studentHandsOnTaskLogDao.getValuesByQueryNotWithPermission(studentHandsOnTaskLogQuery); + } + + public StudentHandsOnTaskLog getInfo (Long studentHandsOnTaskPptId){ + StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery = new StudentHandsOnTaskLogQuery(); + studentHandsOnTaskLogQuery.setStudentHandsOnTaskPptId(studentHandsOnTaskPptId); + List list = studentHandsOnTaskLogDao.getValuesByQuery(studentHandsOnTaskLogQuery); + if(null != list && list.size()>0){ + return list.get(0); + }else{ + return null; + } + } + + public StudentHandsOnTaskLog getInfo (StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery){ + List list = studentHandsOnTaskLogDao.getValuesByQuery(studentHandsOnTaskLogQuery); + if(null != list && list.size()>0){ + return list.get(0); + }else{ + return null; + } + } + + public JsonResult addDo(StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery) { + String msg = ""; + StudentHandsOnTaskLog studentHandsOnTaskLog = studentHandsOnTaskLogQuery.pojo(); + Long studentId = studentHandsOnTaskLog.getStudentId(); + Long handsOnTaskId = studentHandsOnTaskLog.getHandsOnTaskId(); + StudentHandsOnTaskLogQuery logQuery = new StudentHandsOnTaskLogQuery(); + logQuery.setStudentId(studentId); + logQuery.setHandsOnTaskId(handsOnTaskId); + JsonResult jsonResult = new JsonResult(); + List valuesByQueryNotWithPermission = getValuesByQueryNotWithPermission(logQuery); + if (CollectionUtil.isNotEmpty(valuesByQueryNotWithPermission)) { + StudentHandsOnTaskLog studentHandsOnTaskLog1 = valuesByQueryNotWithPermission.get(0); + studentHandsOnTaskLog1.setLastUpdateTime(new Date()); + studentHandsOnTaskLogDao.updateById(studentHandsOnTaskLog1); + }else { + studentHandsOnTaskLog.setCreateTime(new Date()); + studentHandsOnTaskLog.setLastUpdateTime(new Date()); + studentHandsOnTaskLogDao.insert(studentHandsOnTaskLog); + jsonResult.setData(studentHandsOnTaskLog.getStudentHandsOnTaskPptId());//自增的ID丢进去 + } + + studentHandsOnTaskLogQuery.setStudentHandsOnTaskPptId(studentHandsOnTaskLog.getStudentHandsOnTaskPptId()); + + + jsonResult.setCode(JsonReturnCode.SUCCESS.getCode()); + jsonResult.setMsg(msg); + return jsonResult; + + } +} diff --git a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseHandsOnService.java b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseHandsOnService.java index d000965b..ec5d3545 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseHandsOnService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/TeacherOpenCourseHandsOnService.java @@ -14,6 +14,7 @@ import com.ibeetl.admin.core.web.JsonReturnCode; import com.ibeetl.jlw.dao.TeacherOpenCourseHandsOnDao; import com.ibeetl.jlw.entity.*; import com.ibeetl.jlw.entity.vo.StudentHandsOnVO; +import com.ibeetl.jlw.enums.HandsOnTaskEnum; import com.ibeetl.jlw.web.query.*; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -344,7 +345,7 @@ public class TeacherOpenCourseHandsOnService extends CoreBaseService implements DeleteResourcesBy{ +public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseService implements DeleteResourcesBy { - @Autowired private TeacherOpenCourseHandsOnSimulationTasksDao teacherOpenCourseHandsOnSimulationTasksDao; + @Autowired + private TeacherOpenCourseHandsOnSimulationTasksDao teacherOpenCourseHandsOnSimulationTasksDao; - @Autowired private TeacherOpenCourseHandsOnSimulationTasksFileService teacherOpenCourseHandsOnSimulationTasksFileService; - @Autowired private TeacherOpenCourseHandsOnSimulationTasksAssessmentService teacherOpenCourseHandsOnSimulationTasksAssessmentService; + @Autowired + private TeacherOpenCourseHandsOnSimulationTasksFileService teacherOpenCourseHandsOnSimulationTasksFileService; + @Autowired + private TeacherOpenCourseHandsOnSimulationTasksAssessmentService teacherOpenCourseHandsOnSimulationTasksAssessmentService; - @Autowired private StudentService studentService; + @Autowired + private StudentService studentService; - @Autowired private ResourcesQuestionService resourcesQuestionService; + @Autowired + private ResourcesQuestionService resourcesQuestionService; - @Autowired private TeacherOpenCourseMergeResourcesQuestionDao mergeResourcesQuestionService; + @Autowired + private TeacherOpenCourseMergeResourcesQuestionDao mergeResourcesQuestionService; - @Autowired private StudentHandsOnTaskVideoService studentHandsOnTaskVideoService; - @Autowired private StudentHandsOnTaskPptService studentHandsOnTaskPptService; - @Autowired private StudentHandsOnTaskTheoryService studentHandsOnTaskTheoryService; - @Autowired private StudentHandsOnTaskStepService studentHandsOnTaskStepService; - @Autowired private StudentHandsOnTaskReportService studentHandsOnTaskReportService; + @Autowired + private StudentHandsOnTaskVideoService studentHandsOnTaskVideoService; + @Autowired + private StudentHandsOnTaskPptService studentHandsOnTaskPptService; + @Autowired + private StudentHandsOnTaskTheoryService studentHandsOnTaskTheoryService; + @Autowired + private StudentHandsOnTaskStepService studentHandsOnTaskStepService; + @Autowired + private StudentHandsOnTaskReportService studentHandsOnTaskReportService; - public PageQueryqueryByCondition(PageQuery query){ - PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByCondition(query); + @Autowired + private StudentHandsOnTaskLogService logService; + + public PageQuery queryByCondition(PageQuery query) { + PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByCondition(query); queryListAfter(ret.getList()); return ret; } - public PageQueryqueryByConditionQuery(PageQuery query){ - PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByConditionQuery(query); + public PageQuery queryByConditionQuery(PageQuery query) { + PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByConditionQuery(query); queryListAfter(ret.getList()); return ret; } - public void deleteByList(List list){ + public void deleteByList(List list) { String ids = ""; ToolUtils.deleteNullList(list); - for(int i=0;null != list && i teacherOpenCourseHandsOnSimulationTasksList = new ArrayList<>(); try { @@ -101,11 +120,12 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ } catch (Exception e) { try { teacherOpenCourseHandsOnSimulationTasksList.add(JSONObject.parseObject(teacherOpenCourseHandsOnSimulationTasksQuery.getTeacherOpenCourseHandsOnSimulationTasksJsonStr(), TeacherOpenCourseHandsOnSimulationTasks.class)); - } catch (Exception e1) {} + } catch (Exception e1) { + } } ToolUtils.deleteNullList(teacherOpenCourseHandsOnSimulationTasksList); - if(null != teacherOpenCourseHandsOnSimulationTasksList && teacherOpenCourseHandsOnSimulationTasksList.size()>0){ - for(int i=0;i 0) { + for (int i = 0; i < teacherOpenCourseHandsOnSimulationTasksList.size(); i++) { TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksList.get(i); teacherOpenCourseHandsOnSimulationTasks.setUserId(teacherOpenCourseHandsOnSimulationTasksQuery.getUserId()); teacherOpenCourseHandsOnSimulationTasks.setOrgId(teacherOpenCourseHandsOnSimulationTasksQuery.getOrgId()); @@ -115,7 +135,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ return msg; } - public JsonResult add(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){ + public JsonResult add(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) { String msg = ""; TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksQuery.pojo(); @@ -126,17 +146,23 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ for (HandsOnTaskProblemVO handsOnTaskProblemVO : list) { Integer questionType = handsOnTaskProblemVO.getQuestionType(); switch (questionType) { - case 1: teacherOpenCourseHandsOnSimulationTasks.setSingleScore(handsOnTaskProblemVO.getQuestionScore()); + case 1: + teacherOpenCourseHandsOnSimulationTasks.setSingleScore(handsOnTaskProblemVO.getQuestionScore()); break; - case 2: teacherOpenCourseHandsOnSimulationTasks.setMultipleScore(handsOnTaskProblemVO.getQuestionScore()); + case 2: + teacherOpenCourseHandsOnSimulationTasks.setMultipleScore(handsOnTaskProblemVO.getQuestionScore()); break; - case 3: teacherOpenCourseHandsOnSimulationTasks.setJudgeScore(handsOnTaskProblemVO.getQuestionScore()); + case 3: + teacherOpenCourseHandsOnSimulationTasks.setJudgeScore(handsOnTaskProblemVO.getQuestionScore()); break; - case 4: teacherOpenCourseHandsOnSimulationTasks.setFillScore(handsOnTaskProblemVO.getQuestionScore()); + case 4: + teacherOpenCourseHandsOnSimulationTasks.setFillScore(handsOnTaskProblemVO.getQuestionScore()); break; - case 5: teacherOpenCourseHandsOnSimulationTasks.setAnalysisScore(handsOnTaskProblemVO.getQuestionScore()); + case 5: + teacherOpenCourseHandsOnSimulationTasks.setAnalysisScore(handsOnTaskProblemVO.getQuestionScore()); break; - default: teacherOpenCourseHandsOnSimulationTasks.setSingleScore(BigDecimal.ZERO); + default: + teacherOpenCourseHandsOnSimulationTasks.setSingleScore(BigDecimal.ZERO); } } } @@ -175,7 +201,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ return jsonResult; } - public String edit(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){ + public String edit(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) { String msg = ""; TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksQuery.pojo(); String handsOnTaskProblemVo = teacherOpenCourseHandsOnSimulationTasksQuery.getHandsOnTaskProblemVo(); @@ -184,17 +210,23 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ for (HandsOnTaskProblemVO handsOnTaskProblemVO : list) { Integer questionType = handsOnTaskProblemVO.getQuestionType(); switch (questionType) { - case 1: teacherOpenCourseHandsOnSimulationTasks.setSingleScore(handsOnTaskProblemVO.getQuestionScore()); + case 1: + teacherOpenCourseHandsOnSimulationTasks.setSingleScore(handsOnTaskProblemVO.getQuestionScore()); break; - case 2: teacherOpenCourseHandsOnSimulationTasks.setMultipleScore(handsOnTaskProblemVO.getQuestionScore()); + case 2: + teacherOpenCourseHandsOnSimulationTasks.setMultipleScore(handsOnTaskProblemVO.getQuestionScore()); break; - case 3: teacherOpenCourseHandsOnSimulationTasks.setJudgeScore(handsOnTaskProblemVO.getQuestionScore()); + case 3: + teacherOpenCourseHandsOnSimulationTasks.setJudgeScore(handsOnTaskProblemVO.getQuestionScore()); break; - case 4: teacherOpenCourseHandsOnSimulationTasks.setFillScore(handsOnTaskProblemVO.getQuestionScore()); + case 4: + teacherOpenCourseHandsOnSimulationTasks.setFillScore(handsOnTaskProblemVO.getQuestionScore()); break; - case 5: teacherOpenCourseHandsOnSimulationTasks.setAnalysisScore(handsOnTaskProblemVO.getQuestionScore()); + case 5: + teacherOpenCourseHandsOnSimulationTasks.setAnalysisScore(handsOnTaskProblemVO.getQuestionScore()); break; - default: teacherOpenCourseHandsOnSimulationTasks.setSingleScore(BigDecimal.ZERO); + default: + teacherOpenCourseHandsOnSimulationTasks.setSingleScore(BigDecimal.ZERO); } } } @@ -231,49 +263,49 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ return msg; } - public String updateGivenByIds(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){ + public String updateGivenByIds(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) { String msg = ""; - if(StringUtils.isNotBlank(teacherOpenCourseHandsOnSimulationTasksQuery.get_given())){ + if (StringUtils.isNotBlank(teacherOpenCourseHandsOnSimulationTasksQuery.get_given())) { boolean flag = teacherOpenCourseHandsOnSimulationTasksDao.updateGivenByIds(teacherOpenCourseHandsOnSimulationTasksQuery) > 0; - if(!flag){ + if (!flag) { msg = "更新指定参数失败"; } - }else{ + } else { msg = "指定参数为空"; } return msg; } - public List getValues (Object paras){ + public List getValues(Object paras) { return sqlManager.select(SqlId.of("jlw.teacherOpenCourseHandsOnSimulationTasks.getTeacherOpenCourseHandsOnSimulationTasksValues"), TeacherOpenCourseHandsOnSimulationTasks.class, paras); } - public List getValuesByQuery (TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){ + public List getValuesByQuery(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) { return teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQuery(teacherOpenCourseHandsOnSimulationTasksQuery); } - public List getValuesByQueryNotWithPermission (TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){ + public List getValuesByQueryNotWithPermission(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) { return teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQueryNotWithPermission(teacherOpenCourseHandsOnSimulationTasksQuery); } - public TeacherOpenCourseHandsOnSimulationTasks getInfo (Long taskId){ + public TeacherOpenCourseHandsOnSimulationTasks getInfo(Long taskId) { TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery(); teacherOpenCourseHandsOnSimulationTasksQuery.setTaskId(taskId); List list = teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQuery(teacherOpenCourseHandsOnSimulationTasksQuery); - if(null != list && list.size()>0){ + if (null != list && list.size() > 0) { // for (TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks : list) { // List objectiveProblem = getObjectiveProblem(teacherOpenCourseHandsOnSimulationTasks.getTaskList(), teacherOpenCourseHandsOnSimulationTasks.getTaskId()); // teacherOpenCourseHandsOnSimulationTasks.setHandsOnTaskProblemVo(objectiveProblem); // } return list.get(0); - }else{ + } else { return null; } } - public TeacherOpenCourseHandsOnSimulationTasks getInfo (TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){ + public TeacherOpenCourseHandsOnSimulationTasks getInfo(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) { List list = teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQuery(teacherOpenCourseHandsOnSimulationTasksQuery); - if(null != list && list.size()>0){ + if (null != list && list.size() > 0) { TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = list.get(0); List objectiveProblem = getObjectiveProblem(teacherOpenCourseHandsOnSimulationTasks.getTaskList(), teacherOpenCourseHandsOnSimulationTasks.getTaskId()); teacherOpenCourseHandsOnSimulationTasks.setHandsOnTaskProblemVo(objectiveProblem); @@ -294,7 +326,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ teacherOpenCourseHandsOnSimulationTasks.setTeacherOpenCourseHandsOnSimulationTasksFile(JSONArray.toJSONString(valuesByQuery)); } return teacherOpenCourseHandsOnSimulationTasks; - }else{ + } else { return null; } } @@ -313,26 +345,32 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ List resourcesQuestions = StringUtils.isNotEmpty(problemIds) ? mergeResourcesQuestionService.getByIds(problemIds) : null; Map> questions = resourcesQuestions.stream().collect(Collectors.groupingBy(TeacherOpenCourseMergeResourcesQuestion::getQuestionType)); List list = new ArrayList<>(); - questions.forEach((k,v) -> { + questions.forEach((k, v) -> { HandsOnTaskProblemVO handsOnTaskProblemVo = new HandsOnTaskProblemVO(); handsOnTaskProblemVo.setQuestionType(k); handsOnTaskProblemVo.setQuestionNum(v.size()); if (info == null) { handsOnTaskProblemVo.setQuestionScore(BigDecimal.ZERO); - }else { + } else { BigDecimal bigDecimal = BigDecimal.ZERO; switch (k) { - case 1: bigDecimal = info.getSingleScore(); + case 1: + bigDecimal = info.getSingleScore(); break; - case 2: bigDecimal = info.getMultipleScore(); + case 2: + bigDecimal = info.getMultipleScore(); break; - case 3: bigDecimal = info.getJudgeScore(); + case 3: + bigDecimal = info.getJudgeScore(); break; - case 4: bigDecimal = info.getFillScore(); + case 4: + bigDecimal = info.getFillScore(); break; - case 5: bigDecimal = info.getAnalysisScore(); + case 5: + bigDecimal = info.getAnalysisScore(); break; - default: bigDecimal = BigDecimal.ZERO; + default: + bigDecimal = BigDecimal.ZERO; } handsOnTaskProblemVo.setQuestionScore(bigDecimal); } @@ -360,7 +398,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ StudentHandsOnTaskPptQuery studentHandsOnTaskPptQuery = new StudentHandsOnTaskPptQuery(); studentHandsOnTaskPptQuery.setStudentId(student.getStudentId()); List valuesByQuery = studentHandsOnTaskPptService.getValuesByQuery(studentHandsOnTaskPptQuery); - double sum = valuesByQuery.stream().mapToDouble(v -> v.getPptScore() == null ? 0 :v.getPptScore().doubleValue()).sum(); + double sum = valuesByQuery.stream().mapToDouble(v -> v.getPptScore() == null ? 0 : v.getPptScore().doubleValue()).sum(); student.set("sumScore", sum); } } @@ -369,7 +407,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ StudentHandsOnTaskTheoryQuery studentHandsOnTaskTheoryQuery = new StudentHandsOnTaskTheoryQuery(); studentHandsOnTaskTheoryQuery.setStudentId(student.getStudentId()); List valuesByQuery = studentHandsOnTaskTheoryService.getValuesByQuery(studentHandsOnTaskTheoryQuery); - double sum = valuesByQuery.stream().mapToDouble(v -> v.getTheoryScore() == null ? 0 :v.getTheoryScore().doubleValue()).sum(); + double sum = valuesByQuery.stream().mapToDouble(v -> v.getTheoryScore() == null ? 0 : v.getTheoryScore().doubleValue()).sum(); student.set("sumScore", sum); } } @@ -378,7 +416,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ StudentHandsOnTaskStepQuery studentHandsOnTaskStepQuery = new StudentHandsOnTaskStepQuery(); studentHandsOnTaskStepQuery.setStudentId(student.getStudentId()); List valuesByQuery = studentHandsOnTaskStepService.getValuesByQuery(studentHandsOnTaskStepQuery); - double sum = valuesByQuery.stream().mapToDouble(v -> v.getTheoryScore() == null ? 0 :v.getTheoryScore().doubleValue()).sum(); + double sum = valuesByQuery.stream().mapToDouble(v -> v.getTheoryScore() == null ? 0 : v.getTheoryScore().doubleValue()).sum(); student.set("sumScore", sum); } } @@ -387,7 +425,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery = new StudentHandsOnTaskReportQuery(); studentHandsOnTaskReportQuery.setStudentId(student.getStudentId()); List valuesByQuery = studentHandsOnTaskReportService.getValuesByQuery(studentHandsOnTaskReportQuery); - double sum = valuesByQuery.stream().mapToDouble(v -> v.getReportScore() == null ? 0 :v.getReportScore().doubleValue()).sum(); + double sum = valuesByQuery.stream().mapToDouble(v -> v.getReportScore() == null ? 0 : v.getReportScore().doubleValue()).sum(); student.set("sumScore", sum); } } @@ -424,4 +462,108 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ return JsonResult.success(tasksQuery); } + + public JsonResult getScoreByHandsOnId(Long handsOnId, CoreUser coreUser) { + StudentHandsOnScoreVO studentHandsOnScoreVO = new StudentHandsOnScoreVO(); + studentHandsOnScoreVO.setHandsOnId(handsOnId); + if (coreUser.isStudent()) { + Student student = studentService.getByUserId(coreUser.getId()); + TeacherOpenCourseHandsOnSimulationTasksQuery tasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery(); + tasksQuery.setHandsOnId(handsOnId); + List handsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQueryNotWithPermission(tasksQuery); + //总分 + BigDecimal bigDecimal = BigDecimal.ZERO; + List hands = new ArrayList<>(); + for (TeacherOpenCourseHandsOnSimulationTasks task : handsOnSimulationTasks) { + HandsOnTaskScoreVO handsOnTaskScoreVO = new HandsOnTaskScoreVO(); + Long taskId = task.getTaskId(); + handsOnTaskScoreVO.setHandsOnTaskId(taskId); + Long studentId = student.getStudentId(); + if (HandsOnTaskEnum.TASK_VIDEO.status.equals(task.getTaskType())) { + StudentHandsOnTaskVideoQuery videoQuery = new StudentHandsOnTaskVideoQuery(); + videoQuery.setHandsOnTaskId(taskId); + videoQuery.setStudentId(studentId); + List videoList = studentHandsOnTaskVideoService.getValuesByQueryNotWithPermission(videoQuery); + if (CollectionUtils.isNotEmpty(videoList)) { + StudentHandsOnTaskVideo studentHandsOnTaskVideo = videoList.get(0); + BigDecimal videoScore = studentHandsOnTaskVideo.getVideoScore(); + handsOnTaskScoreVO.setScore(videoScore == null ? 0 : videoScore.doubleValue()); + bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO:videoScore); + }else { + handsOnTaskScoreVO.setScore(0D); + } + + }else if(HandsOnTaskEnum.TASK_PPT.status.equals(task.getTaskType())) { + StudentHandsOnTaskPptQuery pptQuery = new StudentHandsOnTaskPptQuery(); + pptQuery.setHandsOnTaskId(taskId); + pptQuery.setStudentId(studentId); + List pptList = studentHandsOnTaskPptService.getValuesByQueryNotWithPermission(pptQuery); + if (CollectionUtils.isNotEmpty(pptList)) { + StudentHandsOnTaskPpt studentHandsOnTaskPpt = pptList.get(0); + BigDecimal videoScore = studentHandsOnTaskPpt.getPptScore(); + handsOnTaskScoreVO.setScore(videoScore == null ? 0 : videoScore.doubleValue()); + bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO: videoScore); + }else { + handsOnTaskScoreVO.setScore(0D); + } + }else if(HandsOnTaskEnum.TASK_THEORY.status.equals(task.getTaskType())) { + StudentHandsOnTaskTheoryQuery theoryQuery = new StudentHandsOnTaskTheoryQuery(); + theoryQuery.setHandsOnTaskId(taskId); + theoryQuery.setStudentId(studentId); + List taskTheoryList = studentHandsOnTaskTheoryService.getValuesByQueryNotWithPermission(theoryQuery); + if (CollectionUtils.isNotEmpty(taskTheoryList)) { + BigDecimal videoScore = taskTheoryList.stream().map(StudentHandsOnTaskTheory::getTheoryScore).reduce(BigDecimal.ZERO, BigDecimal::add); + handsOnTaskScoreVO.setScore(videoScore == null ? 0 : videoScore.doubleValue()); + bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO: videoScore); + }else { + handsOnTaskScoreVO.setScore(0D); + } + }else if(HandsOnTaskEnum.TASK_PRACTICAL_TRAINING.status.equals(task.getTaskType())) { + StudentHandsOnTaskStepQuery stepQuery = new StudentHandsOnTaskStepQuery(); + stepQuery.setHandsOnTaskId(taskId); + stepQuery.setStudentId(studentId); + List stepList = studentHandsOnTaskStepService.getValuesByQueryNotWithPermission(stepQuery); + if (CollectionUtils.isNotEmpty(stepList)) { + StudentHandsOnTaskStep taskTheory = stepList.get(0); + BigDecimal videoScore = taskTheory.getTheoryScore(); + handsOnTaskScoreVO.setScore(videoScore == null ? 0 : videoScore.doubleValue()); + bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO: videoScore); + }else { + handsOnTaskScoreVO.setScore(0D); + } + }else if(HandsOnTaskEnum.TASK_REPORT_WRITING.status.equals(task.getTaskType())) { + StudentHandsOnTaskReportQuery reportQuery = new StudentHandsOnTaskReportQuery(); + reportQuery.setHandsOnTaskId(taskId); + reportQuery.setStudentId(studentId); + List reportList =studentHandsOnTaskReportService.getValuesByQueryNotWithPermission(reportQuery); + if (CollectionUtils.isNotEmpty(reportList)) { + StudentHandsOnTaskReport taskTheory = reportList.get(0); + BigDecimal videoScore = taskTheory.getReportScore(); + handsOnTaskScoreVO.setScore(videoScore == null ? 0 : videoScore.doubleValue()); + bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO: videoScore); + }else { + handsOnTaskScoreVO.setScore(0D); + } + } + StudentHandsOnTaskLogQuery logQuery = new StudentHandsOnTaskLogQuery(); + logQuery.setHandsOnTaskId(taskId); + logQuery.setStudentId(studentId); + List handsOnTaskLogs = logService.getValuesByQueryNotWithPermission(logQuery); + if (CollectionUtil.isNotEmpty(handsOnTaskLogs)) { + StudentHandsOnTaskLog studentHandsOnTaskLog = handsOnTaskLogs.get(0); + Date createTime = studentHandsOnTaskLog.getCreateTime(); + Date lastUpdateTime = studentHandsOnTaskLog.getLastUpdateTime(); + long between = DateUtil.between(createTime, lastUpdateTime, DateUnit.MINUTE); + handsOnTaskScoreVO.setTime(between); + }else { + handsOnTaskScoreVO.setTime(0L); + } + + hands.add(handsOnTaskScoreVO); + } + studentHandsOnScoreVO.setHandsOnTaskScores(hands); + studentHandsOnScoreVO.setSumScore(bigDecimal.doubleValue()); + } + return JsonResult.success(studentHandsOnScoreVO); + } } diff --git a/web/src/main/java/com/ibeetl/jlw/web/StudentHandsOnTaskLogController.java b/web/src/main/java/com/ibeetl/jlw/web/StudentHandsOnTaskLogController.java new file mode 100644 index 00000000..acdd9234 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/web/StudentHandsOnTaskLogController.java @@ -0,0 +1,243 @@ +package com.ibeetl.jlw.web; + +import cn.hutool.core.lang.Assert; +import cn.jlw.Interceptor.RFile; +import cn.jlw.Interceptor.SCoreUser; +import cn.jlw.Interceptor.GetFile; +import cn.jlw.util.ToolUtils; +import cn.jlw.validate.ValidateConfig; +import com.ibeetl.admin.core.entity.CoreUser; +import com.ibeetl.admin.core.file.FileService; +import com.ibeetl.admin.core.util.ConvertUtil; +import com.ibeetl.admin.core.util.PlatformException; +import com.ibeetl.admin.core.util.TimeTool; +import com.ibeetl.admin.core.web.JsonResult; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.beetl.sql.core.engine.PageQuery; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.validation.annotation.Validated; + +import com.ibeetl.admin.console.web.dto.DictExcelImportData; +import com.ibeetl.admin.console.web.query.UserQuery; +import com.ibeetl.admin.core.annotation.Function; +import com.ibeetl.jlw.entity.*; +import com.ibeetl.jlw.service.*; +import com.ibeetl.jlw.web.query.*; + +import org.springframework.beans.factory.annotation.Autowired; +import javax.servlet.http.HttpServletRequest; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.math.BigDecimal; + +import org.springframework.beans.factory.annotation.Autowired; + +import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser; + +/** + * 学生实操日志 学生-课程实操-时长日志 接口 + * 切记不要对非线程安全的静态变量进行写操作 + */ + +@RestController +@Validated +public class StudentHandsOnTaskLogController{ + + private final Log log = LogFactory.getLog(this.getClass()); + private static final String MODEL = "/jlw/studentHandsOnTaskLog"; + private static final String API = "/api/studentHandsOnTaskLog"; + + + @Autowired private StudentHandsOnTaskLogService studentHandsOnTaskLogService; + + @Autowired FileService fileService; + + /* 前端接口 */ + + @PostMapping(API + "/getPageList.do") + public JsonResult getPageList(StudentHandsOnTaskLogQuery condition,@SCoreUser CoreUser coreUser){ + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + PageQuery page = condition.getPageQuery(); + studentHandsOnTaskLogService.queryByConditionQuery(page); + return JsonResult.success(page); + } + } + + + @GetMapping(API + "/getInfo.do") + public JsonResultgetInfo(StudentHandsOnTaskLogQuery param,@SCoreUser CoreUser coreUser) { + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + StudentHandsOnTaskLog studentHandsOnTaskLog = studentHandsOnTaskLogService.getInfo(param); + return JsonResult.success(studentHandsOnTaskLog); + } + } + + + @GetMapping(API + "/getList.do") + public JsonResult>getList(StudentHandsOnTaskLogQuery param,@SCoreUser CoreUser coreUser) { + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + Listlist = studentHandsOnTaskLogService.getValuesByQuery(param); + return JsonResult.success(list); + } + } + + + /* 后台页面 */ + + @GetMapping(MODEL + "/index.do") + @Function("studentHandsOnTaskLog.query") + public ModelAndView index() { + ModelAndView view = new ModelAndView("/jlw/studentHandsOnTaskLog/index.html") ; + view.addObject("search", StudentHandsOnTaskLogQuery.class.getName()); + return view; + } + + @GetMapping(MODEL + "/edit.do") + @Function("studentHandsOnTaskLog.edit") + public ModelAndView edit(Long studentHandsOnTaskPptId) { + ModelAndView view = new ModelAndView("/jlw/studentHandsOnTaskLog/edit.html"); + StudentHandsOnTaskLog studentHandsOnTaskLog = studentHandsOnTaskLogService.queryById(studentHandsOnTaskPptId); + view.addObject("studentHandsOnTaskLog", studentHandsOnTaskLog); + return view; + } + + @GetMapping(MODEL + "/add.do") + @Function("studentHandsOnTaskLog.add") + public ModelAndView add(Long studentHandsOnTaskPptId) { + ModelAndView view = new ModelAndView("/jlw/studentHandsOnTaskLog/add.html"); + if(null != studentHandsOnTaskPptId){ + StudentHandsOnTaskLog studentHandsOnTaskLog = studentHandsOnTaskLogService.queryById(studentHandsOnTaskPptId); + view.addObject("studentHandsOnTaskLog", studentHandsOnTaskLog); + }else { + view.addObject("studentHandsOnTaskLog", new StudentHandsOnTaskLog()); + } + return view; + } + + /* 后台接口 */ + + @PostMapping(MODEL + "/list.json") + @Function("studentHandsOnTaskLog.query") + public JsonResult list(StudentHandsOnTaskLogQuery condition){ + PageQuery page = condition.getPageQuery(); + studentHandsOnTaskLogService.queryByCondition(page); + return JsonResult.success(page); + } + + @PostMapping(MODEL + "/addAll.json") + @Function("studentHandsOnTaskLog.add") + public JsonResult addAll(StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery,@SCoreUser CoreUser coreUser){ + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + studentHandsOnTaskLogQuery.setUserId(coreUser.getId()); + studentHandsOnTaskLogQuery.setOrgId(coreUser.getOrgId()); + String msg = studentHandsOnTaskLogService.addAll(studentHandsOnTaskLogQuery); + if (StringUtils.isBlank(msg)) { + return JsonResult.success(); + } else { + return JsonResult.failMessage("新增失败,"+msg); + } + } + } + + @PostMapping(MODEL + "/add.json") + @Function("studentHandsOnTaskLog.add") + public JsonResult add(@Validated(ValidateConfig.ADD.class) StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery, BindingResult result,@SCoreUser CoreUser coreUser){ + if(result.hasErrors()){ + return JsonResult.failMessage(result); + }else{ + + studentHandsOnTaskLogQuery.setUserId(coreUser.getId()); + studentHandsOnTaskLogQuery.setOrgId(coreUser.getOrgId()); + return studentHandsOnTaskLogService.add(studentHandsOnTaskLogQuery); + } + } + + @PostMapping(MODEL + "/edit.json") + @Function("studentHandsOnTaskLog.edit") + public JsonResult update(@Validated(ValidateConfig.UPDATE.class) StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery, BindingResult result) { + if(result.hasErrors()){ + return JsonResult.failMessage(result); + }else { + Assert.notNull(getUser(), "请登录后再操作"); + studentHandsOnTaskLogQuery.setUserId(null); + studentHandsOnTaskLogQuery.setOrgId(null); + String msg = studentHandsOnTaskLogService.edit(studentHandsOnTaskLogQuery); + if (StringUtils.isBlank(msg)) { + return JsonResult.success(); + } else { + return JsonResult.failMessage("更新失败,"+msg); + } + } + } + + + @GetMapping(MODEL + "/view.json") + @Function("studentHandsOnTaskLog.query") + public JsonResultqueryInfo(Long studentHandsOnTaskPptId) { + StudentHandsOnTaskLog studentHandsOnTaskLog = studentHandsOnTaskLogService.queryById( studentHandsOnTaskPptId); + return JsonResult.success(studentHandsOnTaskLog); + } + + @GetMapping(MODEL + "/getValues.json") + @Function("studentHandsOnTaskLog.query") + public JsonResult>getValues(StudentHandsOnTaskLogQuery param) { + Listlist = studentHandsOnTaskLogService.getValuesByQuery(param); + return JsonResult.success(list); + } + + + @PostMapping(MODEL + "/delete.json") + @Function("studentHandsOnTaskLog.delete") + @ResponseBody + public JsonResult delete(String ids) { + studentHandsOnTaskLogService.deleteStudentHandsOnTaskLog(ids); + return JsonResult.success(); + } + + + @PostMapping(API + "/add.do") + public JsonResult addDo(@Validated(ValidateConfig.ADD.class) StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery, BindingResult result,@SCoreUser CoreUser coreUser){ + if(result.hasErrors()){ + return JsonResult.failMessage(result); + }else{ + + studentHandsOnTaskLogQuery.setUserId(coreUser.getId()); + studentHandsOnTaskLogQuery.setOrgId(coreUser.getOrgId()); + return studentHandsOnTaskLogService.addDo(studentHandsOnTaskLogQuery); + } + } + + +} diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseHandsOnSimulationTasksController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseHandsOnSimulationTasksController.java index c0457b23..00b0ff06 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseHandsOnSimulationTasksController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseHandsOnSimulationTasksController.java @@ -9,6 +9,7 @@ import com.ibeetl.admin.core.web.JsonResult; import com.ibeetl.jlw.entity.TaskTypeParam; import com.ibeetl.jlw.entity.TeacherOpenCourseHandsOnSimulationTasks; import com.ibeetl.jlw.entity.vo.HandsOnTaskProblemVO; +import com.ibeetl.jlw.entity.vo.StudentHandsOnScoreVO; import com.ibeetl.jlw.service.TeacherOpenCourseHandsOnSimulationTasksService; import com.ibeetl.jlw.web.query.StudentScoreParam; import com.ibeetl.jlw.web.query.TeacherOpenCourseHandsOnSimulationTasksQuery; @@ -292,4 +293,12 @@ public class TeacherOpenCourseHandsOnSimulationTasksController{ return teacherOpenCourseHandsOnSimulationTasksService.getTaskList(handsOnId, coreUser); } + /** + * 获取答题分数及答题时长 + */ + @GetMapping(API + "/getScoreByHandsOnId") + public JsonResult getScoreByHandsOnId(Long handsOnId, @SCoreUser CoreUser coreUser) { + return teacherOpenCourseHandsOnSimulationTasksService.getScoreByHandsOnId(handsOnId, coreUser); + } + } diff --git a/web/src/main/java/com/ibeetl/jlw/web/query/StudentHandsOnTaskLogQuery.java b/web/src/main/java/com/ibeetl/jlw/web/query/StudentHandsOnTaskLogQuery.java new file mode 100644 index 00000000..1d9f53fb --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/web/query/StudentHandsOnTaskLogQuery.java @@ -0,0 +1,174 @@ +package com.ibeetl.jlw.web.query; + +import cn.jlw.validate.ValidateConfig; +import com.ibeetl.jlw.entity.StudentHandsOnTaskLog; +import org.apache.commons.lang3.StringUtils; +import com.ibeetl.admin.core.annotation.Query; +import com.ibeetl.admin.core.util.Tool; +import com.ibeetl.admin.core.util.enums.CoreDictType; +import com.ibeetl.admin.core.web.query.PageParam; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.util.Date; + +/** + *学生实操日志查询 + */ +public class StudentHandsOnTaskLogQuery extends PageParam { + @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) + @Query(name = "ID", display = false) + private Long studentHandsOnTaskPptId; + @Query(name = "课程开课ID", display = false) + private Long teacherOpenCourseId; + @Query(name = "课程实操ID", display = false) + private Long handsOnId; + @Query(name = "课程实操任务ID", display = false) + private Long handsOnTaskId; + @Query(name = "创建时间", display = false) + private Date createTime; + @Query(name = "组织ID", display = false) + private Long orgId; + @Query(name = "用户ID", display = false) + private Long userId; + @Query(name = "最后更新时间", display = false) + private Date lastUpdateTime; + @Query(name = "学生ID", display = false) + private Long studentId; + + private String studentHandsOnTaskPptIdPlural; + private String teacherOpenCourseIdPlural; + private String handsOnIdPlural; + private String handsOnTaskIdPlural; + private String orgIdPlural; + private String userIdPlural; + private String studentIdPlural; + + private String studentHandsOnTaskLogJsonStr;//json格式 + + private String _given;//指定更新的特定字段,多个逗号隔开 + + public Long getStudentHandsOnTaskPptId(){ + return studentHandsOnTaskPptId; + } + public void setStudentHandsOnTaskPptId(Long studentHandsOnTaskPptId ){ + this.studentHandsOnTaskPptId = studentHandsOnTaskPptId; + } + public Long getTeacherOpenCourseId(){ + return teacherOpenCourseId; + } + public void setTeacherOpenCourseId(Long teacherOpenCourseId ){ + this.teacherOpenCourseId = teacherOpenCourseId; + } + public Long getHandsOnId(){ + return handsOnId; + } + public void setHandsOnId(Long handsOnId ){ + this.handsOnId = handsOnId; + } + public Long getHandsOnTaskId(){ + return handsOnTaskId; + } + public void setHandsOnTaskId(Long handsOnTaskId ){ + this.handsOnTaskId = handsOnTaskId; + } + public Date getCreateTime(){ + return createTime; + } + public void setCreateTime(Date createTime ){ + this.createTime = createTime; + } + public Long getOrgId(){ + return orgId; + } + public void setOrgId(Long orgId ){ + this.orgId = orgId; + } + public Long getUserId(){ + return userId; + } + public void setUserId(Long userId ){ + this.userId = userId; + } + public Date getLastUpdateTime(){ + return lastUpdateTime; + } + public void setLastUpdateTime(Date lastUpdateTime ){ + this.lastUpdateTime = lastUpdateTime; + } + public Long getStudentId(){ + return studentId; + } + public void setStudentId(Long studentId ){ + this.studentId = studentId; + } + + public StudentHandsOnTaskLog pojo(){ + StudentHandsOnTaskLog pojo = new StudentHandsOnTaskLog(); + pojo.setStudentHandsOnTaskPptId(this.getStudentHandsOnTaskPptId()); + pojo.setTeacherOpenCourseId(this.getTeacherOpenCourseId()); + pojo.setHandsOnId(this.getHandsOnId()); + pojo.setHandsOnTaskId(this.getHandsOnTaskId()); + pojo.setCreateTime(this.getCreateTime()); + pojo.setOrgId(this.getOrgId()); + pojo.setUserId(this.getUserId()); + pojo.setLastUpdateTime(this.getLastUpdateTime()); + pojo.setStudentId(this.getStudentId()); + return pojo; + } + + public String getStudentHandsOnTaskPptIdPlural(){ + return studentHandsOnTaskPptIdPlural; + } + public void setStudentHandsOnTaskPptIdPlural(String studentHandsOnTaskPptIdPlural){ + this.studentHandsOnTaskPptIdPlural = studentHandsOnTaskPptIdPlural; + } + public String getTeacherOpenCourseIdPlural(){ + return teacherOpenCourseIdPlural; + } + public void setTeacherOpenCourseIdPlural(String teacherOpenCourseIdPlural){ + this.teacherOpenCourseIdPlural = teacherOpenCourseIdPlural; + } + public String getHandsOnIdPlural(){ + return handsOnIdPlural; + } + public void setHandsOnIdPlural(String handsOnIdPlural){ + this.handsOnIdPlural = handsOnIdPlural; + } + public String getHandsOnTaskIdPlural(){ + return handsOnTaskIdPlural; + } + public void setHandsOnTaskIdPlural(String handsOnTaskIdPlural){ + this.handsOnTaskIdPlural = handsOnTaskIdPlural; + } + public String getOrgIdPlural(){ + return orgIdPlural; + } + public void setOrgIdPlural(String orgIdPlural){ + this.orgIdPlural = orgIdPlural; + } + public String getUserIdPlural(){ + return userIdPlural; + } + public void setUserIdPlural(String userIdPlural){ + this.userIdPlural = userIdPlural; + } + public String getStudentIdPlural(){ + return studentIdPlural; + } + public void setStudentIdPlural(String studentIdPlural){ + this.studentIdPlural = studentIdPlural; + } + public String getStudentHandsOnTaskLogJsonStr(){ + return studentHandsOnTaskLogJsonStr; + } + public void setStudentHandsOnTaskLogJsonStr(String studentHandsOnTaskLogJsonStr ){ + this.studentHandsOnTaskLogJsonStr = studentHandsOnTaskLogJsonStr; + } + public String get_given() { + return _given; + } + public void set_given(String _given) { + this._given = _given; + } +} diff --git a/web/src/main/resources/sql/jlw/studentHandsOnTaskLog.md b/web/src/main/resources/sql/jlw/studentHandsOnTaskLog.md new file mode 100644 index 00000000..76835cc0 --- /dev/null +++ b/web/src/main/resources/sql/jlw/studentHandsOnTaskLog.md @@ -0,0 +1,361 @@ +queryByCondition +=== +* 根据不为空的参数进行分页查询 + + select + @pageTag(){ + t.* + @} + from student_hands_on_task_log t + where 1=1 + @//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行 + and #function("studentHandsOnTaskLog.query")# + @if(!isEmpty(studentHandsOnTaskPptId)){ + and t.student_hands_on_task_ppt_id =#studentHandsOnTaskPptId# + @} + @if(!isEmpty(studentHandsOnTaskPptIdPlural)){ + and find_in_set(t.student_hands_on_task_ppt_id,#studentHandsOnTaskPptIdPlural#) + @} + @if(!isEmpty(teacherOpenCourseId)){ + and t.teacher_open_course_id =#teacherOpenCourseId# + @} + @if(!isEmpty(teacherOpenCourseIdPlural)){ + and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) + @} + @if(!isEmpty(handsOnId)){ + and t.hands_on_id =#handsOnId# + @} + @if(!isEmpty(handsOnIdPlural)){ + and find_in_set(t.hands_on_id,#handsOnIdPlural#) + @} + @if(!isEmpty(handsOnTaskId)){ + and t.hands_on_task_id =#handsOnTaskId# + @} + @if(!isEmpty(handsOnTaskIdPlural)){ + and find_in_set(t.hands_on_task_id,#handsOnTaskIdPlural#) + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + @if(!isEmpty(lastUpdateTime)){ + and t.last_update_time =#lastUpdateTime# + @} + @if(!isEmpty(studentId)){ + and t.student_id =#studentId# + @} + @if(!isEmpty(studentIdPlural)){ + and find_in_set(t.student_id,#studentIdPlural#) + @} + + +queryByConditionQuery +=== +* 根据不为空的参数进行分页查询(无权限) + + select + @pageTag(){ + t.* + @} + from student_hands_on_task_log t + where 1=1 + @if(!isEmpty(studentHandsOnTaskPptId)){ + and t.student_hands_on_task_ppt_id =#studentHandsOnTaskPptId# + @} + @if(!isEmpty(studentHandsOnTaskPptIdPlural)){ + and find_in_set(t.student_hands_on_task_ppt_id,#studentHandsOnTaskPptIdPlural#) + @} + @if(!isEmpty(teacherOpenCourseId)){ + and t.teacher_open_course_id =#teacherOpenCourseId# + @} + @if(!isEmpty(teacherOpenCourseIdPlural)){ + and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) + @} + @if(!isEmpty(handsOnId)){ + and t.hands_on_id =#handsOnId# + @} + @if(!isEmpty(handsOnIdPlural)){ + and find_in_set(t.hands_on_id,#handsOnIdPlural#) + @} + @if(!isEmpty(handsOnTaskId)){ + and t.hands_on_task_id =#handsOnTaskId# + @} + @if(!isEmpty(handsOnTaskIdPlural)){ + and find_in_set(t.hands_on_task_id,#handsOnTaskIdPlural#) + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + @if(!isEmpty(lastUpdateTime)){ + and t.last_update_time =#lastUpdateTime# + @} + @if(!isEmpty(studentId)){ + and t.student_id =#studentId# + @} + @if(!isEmpty(studentIdPlural)){ + and find_in_set(t.student_id,#studentIdPlural#) + @} + + + + +deleteStudentHandsOnTaskLogByIds +=== + +* 批量删除 + + delete from student_hands_on_task_log where find_in_set(student_hands_on_task_ppt_id,#ids#) + + + +getByIds +=== + +select * from student_hands_on_task_log where find_in_set(student_hands_on_task_ppt_id,#ids#) + + +updateGivenByIds +=== + +* 批量更新指定字段,无论此字段是否有值 + + update student_hands_on_task_log + set + @if(contain("teacherOpenCourseId",_given)){ + @if(isEmpty(teacherOpenCourseId)){ + teacher_open_course_id = null , + @}else{ + teacher_open_course_id = #teacherOpenCourseId# , + @} + @} + @if(contain("handsOnId",_given)){ + @if(isEmpty(handsOnId)){ + hands_on_id = null , + @}else{ + hands_on_id = #handsOnId# , + @} + @} + @if(contain("handsOnTaskId",_given)){ + @if(isEmpty(handsOnTaskId)){ + hands_on_task_id = null , + @}else{ + hands_on_task_id = #handsOnTaskId# , + @} + @} + @if(contain("createTime",_given)){ + @if(isEmpty(createTime)){ + create_time = null , + @}else{ + create_time = #createTime# , + @} + @} + @if(contain("orgId",_given)){ + @if(isEmpty(orgId)){ + org_id = null , + @}else{ + org_id = #orgId# , + @} + @} + @if(contain("userId",_given)){ + @if(isEmpty(userId)){ + user_id = null , + @}else{ + user_id = #userId# , + @} + @} + @if(contain("lastUpdateTime",_given)){ + @if(isEmpty(lastUpdateTime)){ + last_update_time = null , + @}else{ + last_update_time = #lastUpdateTime# , + @} + @} + @if(contain("studentId",_given)){ + @if(isEmpty(studentId)){ + student_id = null , + @}else{ + student_id = #studentId# , + @} + @} + student_hands_on_task_ppt_id = student_hands_on_task_ppt_id + where find_in_set(student_hands_on_task_ppt_id,#studentHandsOnTaskPptIdPlural#) + + + +getStudentHandsOnTaskLogValues +=== + +* 根据不为空的参数进行查询 + + select t.* + from student_hands_on_task_log t + where 1=1 + @if(!isEmpty(studentHandsOnTaskPptId)){ + and t.student_hands_on_task_ppt_id =#studentHandsOnTaskPptId# + @} + @if(!isEmpty(teacherOpenCourseId)){ + and t.teacher_open_course_id =#teacherOpenCourseId# + @} + @if(!isEmpty(handsOnId)){ + and t.hands_on_id =#handsOnId# + @} + @if(!isEmpty(handsOnTaskId)){ + and t.hands_on_task_id =#handsOnTaskId# + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(lastUpdateTime)){ + and t.last_update_time =#lastUpdateTime# + @} + @if(!isEmpty(studentId)){ + and t.student_id =#studentId# + @} + + +getValuesByQuery +=== + +* 根据不为空的参数进行查询 + + select t.* + from student_hands_on_task_log t + where 1=1 and #function("studentHandsOnTaskLog.query")# + @if(!isEmpty(studentHandsOnTaskPptId)){ + and t.student_hands_on_task_ppt_id =#studentHandsOnTaskPptId# + @} + @if(!isEmpty(studentHandsOnTaskPptIdPlural)){ + and find_in_set(t.student_hands_on_task_ppt_id,#studentHandsOnTaskPptIdPlural#) + @} + @if(!isEmpty(teacherOpenCourseId)){ + and t.teacher_open_course_id =#teacherOpenCourseId# + @} + @if(!isEmpty(teacherOpenCourseIdPlural)){ + and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) + @} + @if(!isEmpty(handsOnId)){ + and t.hands_on_id =#handsOnId# + @} + @if(!isEmpty(handsOnIdPlural)){ + and find_in_set(t.hands_on_id,#handsOnIdPlural#) + @} + @if(!isEmpty(handsOnTaskId)){ + and t.hands_on_task_id =#handsOnTaskId# + @} + @if(!isEmpty(handsOnTaskIdPlural)){ + and find_in_set(t.hands_on_task_id,#handsOnTaskIdPlural#) + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + @if(!isEmpty(lastUpdateTime)){ + and t.last_update_time =#lastUpdateTime# + @} + @if(!isEmpty(studentId)){ + and t.student_id =#studentId# + @} + @if(!isEmpty(studentIdPlural)){ + and find_in_set(t.student_id,#studentIdPlural#) + @} + + +getValuesByQueryNotWithPermission +=== + +* 根据不为空的参数进行查询(不包含权限) + + select t.* + from student_hands_on_task_log t + where 1=1 + @if(!isEmpty(studentHandsOnTaskPptId)){ + and t.student_hands_on_task_ppt_id =#studentHandsOnTaskPptId# + @} + @if(!isEmpty(studentHandsOnTaskPptIdPlural)){ + and find_in_set(t.student_hands_on_task_ppt_id,#studentHandsOnTaskPptIdPlural#) + @} + @if(!isEmpty(teacherOpenCourseId)){ + and t.teacher_open_course_id =#teacherOpenCourseId# + @} + @if(!isEmpty(teacherOpenCourseIdPlural)){ + and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) + @} + @if(!isEmpty(handsOnId)){ + and t.hands_on_id =#handsOnId# + @} + @if(!isEmpty(handsOnIdPlural)){ + and find_in_set(t.hands_on_id,#handsOnIdPlural#) + @} + @if(!isEmpty(handsOnTaskId)){ + and t.hands_on_task_id =#handsOnTaskId# + @} + @if(!isEmpty(handsOnTaskIdPlural)){ + and find_in_set(t.hands_on_task_id,#handsOnTaskIdPlural#) + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + @if(!isEmpty(lastUpdateTime)){ + and t.last_update_time =#lastUpdateTime# + @} + @if(!isEmpty(studentId)){ + and t.student_id =#studentId# + @} + @if(!isEmpty(studentIdPlural)){ + and find_in_set(t.student_id,#studentIdPlural#) + @} + + + diff --git a/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/add.js b/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/add.js new file mode 100644 index 00000000..1f026824 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/add.js @@ -0,0 +1,38 @@ +layui.define([ 'form', 'laydate', 'table','studentHandsOnTaskLogApi'], function(exports) { + var form = layui.form; + var studentHandsOnTaskLogApi = layui.studentHandsOnTaskLogApi; + var index = layui.index; + var view = { + init:function(){ + Lib.initGenrealForm($("#addForm"),form); + this.initSubmit(); + }, + initSubmit:function(){ + $("#addButton").click(function(){ + form.on('submit(form)', function(){ + var studentHandsOnTaskPptId = $("#addForm input[name='studentHandsOnTaskPptId']").val(); + if(!$.isEmpty(studentHandsOnTaskPptId)){ + studentHandsOnTaskLogApi.updateStudentHandsOnTaskLog($('#addForm'),function(){ + parent.window.dataReload(); + Common.info("更新成功"); + Lib.closeFrame(); + }); + }else{ + studentHandsOnTaskLogApi.addStudentHandsOnTaskLog($('#addForm'),function(){ + parent.window.dataReload(); + Common.info("添加成功"); + Lib.closeFrame(); + }); + } + + }); + }); + + $("#addButton-cancel").click(function(){ + Lib.closeFrame(); + }); + } + + } + exports('add',view); +}); diff --git a/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/del.js b/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/del.js new file mode 100644 index 00000000..09b24626 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/del.js @@ -0,0 +1,23 @@ +layui.define(['table', 'studentHandsOnTaskLogApi'], function(exports) { + var studentHandsOnTaskLogApi = layui.studentHandsOnTaskLogApi; + var table=layui.table; + var view = { + init:function(){ + }, + delBatch:function(){ + var data = Common.getMoreDataFromTable(table,"studentHandsOnTaskLogTable"); + if(data==null){ + return ; + } + Common.openConfirm("确认要删除这些学生实操日志?",function(){ + var ids =Common.concatBatchId(data,"studentHandsOnTaskPptId"); + studentHandsOnTaskLogApi.del(ids,function(){ + Common.info("删除成功"); + dataReload(); + }) + }) + } + } + exports('del',view); + +}); \ No newline at end of file diff --git a/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/edit.js b/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/edit.js new file mode 100644 index 00000000..8596c4f8 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/edit.js @@ -0,0 +1,28 @@ +layui.define([ 'form', 'laydate', 'table','studentHandsOnTaskLogApi'], function(exports) { + var form = layui.form; + var studentHandsOnTaskLogApi = layui.studentHandsOnTaskLogApi; + var index = layui.index; + var view = { + init:function(){ + Lib.initGenrealForm($("#updateForm"),form); + this.initSubmit(); + }, + initSubmit:function(){ + $("#updateButton").click(function(){ + form.on('submit(form)', function(){ + studentHandsOnTaskLogApi.updateStudentHandsOnTaskLog($('#updateForm'),function(){ + parent.window.dataReload(); + Common.info("更新成功"); + Lib.closeFrame(); + }); + }); + }); + $("#updateButton-cancel").click(function(){ + Lib.closeFrame(); + }); + } + + } + exports('edit',view); + +}); \ No newline at end of file diff --git a/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/index.js b/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/index.js new file mode 100644 index 00000000..b39ec5e4 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/index.js @@ -0,0 +1,185 @@ +layui.define([ 'form', 'laydate', 'table' ], function(exports) { + var form = layui.form; + var laydate = layui.laydate; + var table = layui.table; + var studentHandsOnTaskLogTable = null; + var view ={ + init:function(){ + var that = this + this.initTable(); + this.initSearchForm(); + this.initToolBar(); + window.dataReload = function(){ + Lib.doSearchForm($("#searchForm"),studentHandsOnTaskLogTable) + that.initToolBar(); + } + }, + initTable:function(){ + var sx_ = localStorage.getItem("studentHandsOnTaskLogTable_field_"+Common.userInfoId); //筛选值显示、隐藏缓存 + if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);} + studentHandsOnTaskLogTable = table.render({ + elem : '#studentHandsOnTaskLogTable', + height : Lib.getTableHeight(1), + cellMinWidth: 100, + method : 'post', + url : Common.ctxPath + '/jlw/studentHandsOnTaskLog/list.json' // 数据接口 + ,page : Lib.tablePage // 开启分页 + ,toolbar: '#toolbar_studentHandsOnTaskLog' //自定义头部左侧工具栏 + ,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏 + ,limit : 10, + cols : [ [ // 表头 + { + type : 'checkbox', + + }, + { + field : 'studentHandsOnTaskPptId', + title : 'ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['studentHandsOnTaskPptId'])?false:sx_['studentHandsOnTaskPptId'], + + width : 60, + }, + { + field : 'teacherOpenCourseId', + title : '课程开课ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['teacherOpenCourseId'])?false:sx_['teacherOpenCourseId'], + }, + { + field : 'handsOnId', + title : '课程实操ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['handsOnId'])?false:sx_['handsOnId'], + }, + { + field : 'handsOnTaskId', + title : '课程实操任务ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['handsOnTaskId'])?false:sx_['handsOnTaskId'], + }, + { + field : 'createTime', + title : '创建时间', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['createTime'])?false:sx_['createTime'], + }, + { + field : 'orgId', + title : '组织ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['orgId'])?false:sx_['orgId'], + }, + { + field : 'userId', + title : '用户ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['userId'])?false:sx_['userId'], + }, + { + field : 'lastUpdateTime', + title : '最后更新时间', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['lastUpdateTime'])?false:sx_['lastUpdateTime'], + }, + { + field : 'studentId', + title : '学生ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['studentId'])?false:sx_['studentId'], + } + ,{ + field : 'operation_',title : '操作',align:"center", templet: function (d) { + var htm = ''; + htm += ''; + return htm; + } + } + + ] ] + + }); + + table.on('checkbox(studentHandsOnTaskLogTable)', function(obj){ + var studentHandsOnTaskLog = obj.data; + if(obj.checked){ + //按钮逻辑Lib.buttonEnable() + }else{ + + } + }) + }, + + initSearchForm:function(){ + Lib.initSearchForm( $("#searchForm"),studentHandsOnTaskLogTable,form); + }, + + initToolBar:function(){ + toolbar = { + add: function () { + var url = "/jlw/studentHandsOnTaskLog/add.do"; + Common.openDlg(url,"学生实操日志管理>新增"); + }, + edit: function () { + var data = Common.getOneFromTable(table,"studentHandsOnTaskLogTable"); + if(data==null){ + return ; + } + var url = "/jlw/studentHandsOnTaskLog/add.do?studentHandsOnTaskPptId="+data.studentHandsOnTaskPptId; + Common.openDlg(url,"学生实操日志管理>"+data.studentHandsOnTaskPptId+">编辑"); + }, + del: function () { + layui.use(['del'], function(){ + var delView = layui.del + delView.delBatch(); + }); + }, + search: function () { + Lib.doSearchForm($("#searchForm"), studentHandsOnTaskLogTable, 1); + view.initToolBar() + }, + refresh: function () { + searchForm.reset(); + Lib.doSearchForm($("#searchForm"), studentHandsOnTaskLogTable, 1); + view.initToolBar() + }, + } + //触发事件 + $('.ext-toolbar').on('click', function() { + var type = $(this).data('type'); + toolbar[type] ? toolbar[type].call(this) : ''; + }); + + }, initTableTool: table.on('tool(studentHandsOnTaskLogTable)', function (obj) { + var data = obj.data; + if (obj.event === 'edit') { + var url = "/jlw/studentHandsOnTaskLog/add.do?studentHandsOnTaskPptId="+data.studentHandsOnTaskPptId; + Common.openDlg(url,"学生实操日志管理>"+data.studentHandsOnTaskPptId+">编辑"); + }else if(obj.event === "del"){ + layer.confirm('是否确定删除该信息?', function (index) { + var ret = Common.postAjax("/jlw/studentHandsOnTaskLog/delete.json",{ids:data.studentHandsOnTaskPptId}); + layer.msg(ret.code == 0?"删除成功!":ret.msg, { + offset: ['50%'], + icon: ret.code == 0?1:2, + time: 1500 //2秒关闭(如果不配置,默认是3秒) + },function (){ + if(ret.code == 0){ + Lib.tableRefresh(); + } + }); + }); + } + }) + } + exports('index',view); + +}); diff --git a/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/studentHandsOnTaskLogApi.js b/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/studentHandsOnTaskLogApi.js new file mode 100644 index 00000000..1d5bbc9f --- /dev/null +++ b/web/src/main/resources/static/js/jlw/studentHandsOnTaskLog/studentHandsOnTaskLogApi.js @@ -0,0 +1,18 @@ +/*访问后台的代码*/ +layui.define([], function(exports) { + var api={ + updateStudentHandsOnTaskLog:function(form,callback){ + Lib.submitForm("/jlw/studentHandsOnTaskLog/edit.json",form,{},callback) + }, + addStudentHandsOnTaskLog:function(form,callback){ + Lib.submitForm("/jlw/studentHandsOnTaskLog/add.json",form,{},callback) + }, + del:function(ids,callback){ + Common.post("/jlw/studentHandsOnTaskLog/delete.json",{"ids":ids},function(){ + callback(); + }) + } + + }; + exports('studentHandsOnTaskLogApi',api); +}); \ No newline at end of file diff --git a/web/src/main/resources/templates/studentHandsOnTaskLog/add.html b/web/src/main/resources/templates/studentHandsOnTaskLog/add.html new file mode 100644 index 00000000..fe843dd2 --- /dev/null +++ b/web/src/main/resources/templates/studentHandsOnTaskLog/add.html @@ -0,0 +1,78 @@ + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + + diff --git a/web/src/main/resources/templates/studentHandsOnTaskLog/edit.html b/web/src/main/resources/templates/studentHandsOnTaskLog/edit.html new file mode 100644 index 00000000..e558e9ee --- /dev/null +++ b/web/src/main/resources/templates/studentHandsOnTaskLog/edit.html @@ -0,0 +1,78 @@ + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + + diff --git a/web/src/main/resources/templates/studentHandsOnTaskLog/index.html b/web/src/main/resources/templates/studentHandsOnTaskLog/index.html new file mode 100644 index 00000000..47a40515 --- /dev/null +++ b/web/src/main/resources/templates/studentHandsOnTaskLog/index.html @@ -0,0 +1,29 @@ + + + +
+ + + +