增加一些接口

beetlsql3-dev
xuliangtong 2 years ago
parent 99374a5276
commit ef2e6cba7e

@ -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<StudentHandsOnTaskLog>{
PageQuery<StudentHandsOnTaskLog> queryByCondition(PageQuery query);
PageQuery<StudentHandsOnTaskLog> queryByConditionQuery(PageQuery query);
@Update
void deleteStudentHandsOnTaskLogByIds(String ids);
@Update
int updateGivenByIds(StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery);
List<StudentHandsOnTaskLog> getByIds(String ids);
List<StudentHandsOnTaskLog> getValuesByQuery(StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery);
List<StudentHandsOnTaskLog> getValuesByQueryNotWithPermission(StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery);
}

@ -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;
}
}

@ -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;
}

@ -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<HandsOnTaskScoreVO> handsOnTaskScores;
}

@ -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;

@ -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<StudentHandsOnTaskLog>{
@Autowired private StudentHandsOnTaskLogDao studentHandsOnTaskLogDao;
public PageQuery<StudentHandsOnTaskLog>queryByCondition(PageQuery query){
PageQuery ret = studentHandsOnTaskLogDao.queryByCondition(query);
queryListAfter(ret.getList());
return ret;
}
public PageQuery<StudentHandsOnTaskLog>queryByConditionQuery(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<list.size();i++){
ids += list.get(i).toString()+(i==list.size()-1?"":",");
}
if(StringUtils.isNotBlank(ids)){
studentHandsOnTaskLogDao.deleteStudentHandsOnTaskLogByIds(ids);
}
}
public void deleteStudentHandsOnTaskLog(String ids){
try {
studentHandsOnTaskLogDao.deleteStudentHandsOnTaskLogByIds(ids);
} catch (Exception e) {
throw new PlatformException("批量删除学生实操日志失败", e);
}
}
public String addAll(StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery){
String msg = "";
List<StudentHandsOnTaskLog> 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<studentHandsOnTaskLogList.size();i++){
StudentHandsOnTaskLog studentHandsOnTaskLog = studentHandsOnTaskLogList.get(i);
studentHandsOnTaskLog.setUserId(studentHandsOnTaskLogQuery.getUserId());
studentHandsOnTaskLog.setOrgId(studentHandsOnTaskLogQuery.getOrgId());
}
insertBatch(studentHandsOnTaskLogList);
}
return msg;
}
public JsonResult add(StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery){
String msg = "";
StudentHandsOnTaskLog studentHandsOnTaskLog = studentHandsOnTaskLogQuery.pojo();
studentHandsOnTaskLogDao.insert(studentHandsOnTaskLog);
studentHandsOnTaskLogQuery.setStudentHandsOnTaskPptId(studentHandsOnTaskLog.getStudentHandsOnTaskPptId());
JsonResult jsonResult = new JsonResult();
jsonResult.setData(studentHandsOnTaskLog.getStudentHandsOnTaskPptId());//自增的ID丢进去
jsonResult.setCode(JsonReturnCode.SUCCESS.getCode());
jsonResult.setMsg(msg);
return jsonResult;
}
public String edit(StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery){
String msg = "";
StudentHandsOnTaskLog studentHandsOnTaskLog = studentHandsOnTaskLogQuery.pojo();
studentHandsOnTaskLogDao.updateTemplateById(studentHandsOnTaskLog);
return msg;
}
public String updateGivenByIds(StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery){
String msg = "";
if(StringUtils.isNotBlank(studentHandsOnTaskLogQuery.get_given())){
boolean flag = studentHandsOnTaskLogDao.updateGivenByIds(studentHandsOnTaskLogQuery) > 0;
if(!flag){
msg = "更新指定参数失败";
}
}else{
msg = "指定参数为空";
}
return msg;
}
public List<StudentHandsOnTaskLog> getValues (Object paras){
return sqlManager.select(SqlId.of("jlw.studentHandsOnTaskLog.getStudentHandsOnTaskLogValues"), StudentHandsOnTaskLog.class, paras);
}
public List<StudentHandsOnTaskLog> getValuesByQuery (StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery){
return studentHandsOnTaskLogDao.getValuesByQuery(studentHandsOnTaskLogQuery);
}
public List<StudentHandsOnTaskLog> getValuesByQueryNotWithPermission (StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery){
return studentHandsOnTaskLogDao.getValuesByQueryNotWithPermission(studentHandsOnTaskLogQuery);
}
public StudentHandsOnTaskLog getInfo (Long studentHandsOnTaskPptId){
StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery = new StudentHandsOnTaskLogQuery();
studentHandsOnTaskLogQuery.setStudentHandsOnTaskPptId(studentHandsOnTaskPptId);
List<StudentHandsOnTaskLog> list = studentHandsOnTaskLogDao.getValuesByQuery(studentHandsOnTaskLogQuery);
if(null != list && list.size()>0){
return list.get(0);
}else{
return null;
}
}
public StudentHandsOnTaskLog getInfo (StudentHandsOnTaskLogQuery studentHandsOnTaskLogQuery){
List<StudentHandsOnTaskLog> 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<StudentHandsOnTaskLog> 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;
}
}

@ -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<TeacherOpen
BigDecimal decimal = BigDecimal.ZERO;
for (TeacherOpenCourseHandsOnSimulationTasks task : tasks) {
Long taskId = task.getTaskId();
if ("1".equals(task.getTaskType())) {
if (HandsOnTaskEnum.TASK_VIDEO.status.equals(task.getTaskType())) {
StudentHandsOnTaskVideoQuery videoQuery = new StudentHandsOnTaskVideoQuery();
videoQuery.setHandsOnTaskId(taskId);
videoQuery.setStudentId(studentId);
@ -355,7 +356,7 @@ public class TeacherOpenCourseHandsOnService extends CoreBaseService<TeacherOpen
bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO:videoScore);
decimal = decimal.add(BigDecimal.ONE);
}
}else if("2".equals(task.getTaskType())) {
}else if(HandsOnTaskEnum.TASK_PPT.status.equals(task.getTaskType())) {
StudentHandsOnTaskPptQuery pptQuery = new StudentHandsOnTaskPptQuery();
pptQuery.setHandsOnTaskId(taskId);
pptQuery.setStudentId(studentId);
@ -366,7 +367,7 @@ public class TeacherOpenCourseHandsOnService extends CoreBaseService<TeacherOpen
bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO: videoScore);
decimal = decimal.add(BigDecimal.ONE);
}
}else if("3".equals(task.getTaskType())) {
}else if(HandsOnTaskEnum.TASK_THEORY.status.equals(task.getTaskType())) {
StudentHandsOnTaskTheoryQuery theoryQuery = new StudentHandsOnTaskTheoryQuery();
theoryQuery.setHandsOnTaskId(taskId);
theoryQuery.setStudentId(studentId);
@ -376,7 +377,7 @@ public class TeacherOpenCourseHandsOnService extends CoreBaseService<TeacherOpen
bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO: videoScore);
decimal = decimal.add(BigDecimal.ONE);
}
}else if("4".equals(task.getTaskType())) {
}else if(HandsOnTaskEnum.TASK_PRACTICAL_TRAINING.status.equals(task.getTaskType())) {
StudentHandsOnTaskStepQuery stepQuery = new StudentHandsOnTaskStepQuery();
stepQuery.setHandsOnTaskId(taskId);
stepQuery.setStudentId(studentId);
@ -387,7 +388,7 @@ public class TeacherOpenCourseHandsOnService extends CoreBaseService<TeacherOpen
bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO: videoScore);
decimal = decimal.add(BigDecimal.ONE);
}
}else if("5".equals(task.getTaskType())) {
}else if(HandsOnTaskEnum.TASK_REPORT_WRITING.status.equals(task.getTaskType())) {
StudentHandsOnTaskReportQuery reportQuery = new StudentHandsOnTaskReportQuery();
reportQuery.setHandsOnTaskId(taskId);
reportQuery.setStudentId(studentId);

@ -1,6 +1,8 @@
package com.ibeetl.jlw.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.jlw.Interceptor.SCoreUser;
import cn.jlw.util.ToolUtils;
import com.alibaba.fastjson.JSON;
@ -15,6 +17,8 @@ import com.ibeetl.jlw.dao.TeacherOpenCourseHandsOnSimulationTasksDao;
import com.ibeetl.jlw.dao.TeacherOpenCourseMergeResourcesQuestionDao;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.entity.vo.HandsOnTaskProblemVO;
import com.ibeetl.jlw.entity.vo.HandsOnTaskScoreVO;
import com.ibeetl.jlw.entity.vo.StudentHandsOnScoreVO;
import com.ibeetl.jlw.enums.HandsOnTaskEnum;
import com.ibeetl.jlw.web.query.*;
import lombok.extern.slf4j.Slf4j;
@ -30,6 +34,7 @@ import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -43,49 +48,63 @@ import java.util.stream.Collectors;
@Transactional
@Validated
@Slf4j
public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseService<TeacherOpenCourseHandsOnSimulationTasks> implements DeleteResourcesBy{
public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseService<TeacherOpenCourseHandsOnSimulationTasks> 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 PageQuery<TeacherOpenCourseHandsOnSimulationTasks>queryByCondition(PageQuery query){
PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByCondition(query);
@Autowired
private StudentHandsOnTaskLogService logService;
public PageQuery<TeacherOpenCourseHandsOnSimulationTasks> queryByCondition(PageQuery query) {
PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByCondition(query);
queryListAfter(ret.getList());
return ret;
}
public PageQuery<TeacherOpenCourseHandsOnSimulationTasks>queryByConditionQuery(PageQuery query){
PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByConditionQuery(query);
public PageQuery<TeacherOpenCourseHandsOnSimulationTasks> 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<list.size();i++){
ids += list.get(i).toString()+(i==list.size()-1?"":",");
for (int i = 0; null != list && i < list.size(); i++) {
ids += list.get(i).toString() + (i == list.size() - 1 ? "" : ",");
}
if(StringUtils.isNotBlank(ids)){
if (StringUtils.isNotBlank(ids)) {
teacherOpenCourseHandsOnSimulationTasksDao.deleteTeacherOpenCourseHandsOnSimulationTasksByIds(ids);
}
}
public void deleteTeacherOpenCourseHandsOnSimulationTasks(String ids){
public void deleteTeacherOpenCourseHandsOnSimulationTasks(String ids) {
try {
teacherOpenCourseHandsOnSimulationTasksDao.deleteTeacherOpenCourseHandsOnSimulationTasksByIds(ids);
} catch (Exception e) {
@ -93,7 +112,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
}
}
public String addAll(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){
public String addAll(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) {
String msg = "";
List<TeacherOpenCourseHandsOnSimulationTasks> 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<teacherOpenCourseHandsOnSimulationTasksList.size();i++){
if (null != teacherOpenCourseHandsOnSimulationTasksList && teacherOpenCourseHandsOnSimulationTasksList.size() > 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<TeacherOpenCourseHandsOnSimulationTasks> getValues (Object paras){
public List<TeacherOpenCourseHandsOnSimulationTasks> getValues(Object paras) {
return sqlManager.select(SqlId.of("jlw.teacherOpenCourseHandsOnSimulationTasks.getTeacherOpenCourseHandsOnSimulationTasksValues"), TeacherOpenCourseHandsOnSimulationTasks.class, paras);
}
public List<TeacherOpenCourseHandsOnSimulationTasks> getValuesByQuery (TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){
public List<TeacherOpenCourseHandsOnSimulationTasks> getValuesByQuery(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) {
return teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQuery(teacherOpenCourseHandsOnSimulationTasksQuery);
}
public List<TeacherOpenCourseHandsOnSimulationTasks> getValuesByQueryNotWithPermission (TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){
public List<TeacherOpenCourseHandsOnSimulationTasks> 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<TeacherOpenCourseHandsOnSimulationTasks> list = teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQuery(teacherOpenCourseHandsOnSimulationTasksQuery);
if(null != list && list.size()>0){
if (null != list && list.size() > 0) {
// for (TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks : list) {
// List<HandsOnTaskProblemVO> 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<TeacherOpenCourseHandsOnSimulationTasks> list = teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQuery(teacherOpenCourseHandsOnSimulationTasksQuery);
if(null != list && list.size()>0){
if (null != list && list.size() > 0) {
TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = list.get(0);
List<HandsOnTaskProblemVO> 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<TeacherOpenCourseMergeResourcesQuestion> resourcesQuestions = StringUtils.isNotEmpty(problemIds) ? mergeResourcesQuestionService.getByIds(problemIds) : null;
Map<Integer, List<TeacherOpenCourseMergeResourcesQuestion>> questions = resourcesQuestions.stream().collect(Collectors.groupingBy(TeacherOpenCourseMergeResourcesQuestion::getQuestionType));
List<HandsOnTaskProblemVO> 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<StudentHandsOnTaskPpt> 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<StudentHandsOnTaskTheory> 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<StudentHandsOnTaskStep> 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<StudentHandsOnTaskReport> 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<StudentHandsOnScoreVO> 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<TeacherOpenCourseHandsOnSimulationTasks> handsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQueryNotWithPermission(tasksQuery);
//总分
BigDecimal bigDecimal = BigDecimal.ZERO;
List<HandsOnTaskScoreVO> 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<StudentHandsOnTaskVideo> 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<StudentHandsOnTaskPpt> 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<StudentHandsOnTaskTheory> 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<StudentHandsOnTaskStep> 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<StudentHandsOnTaskReport> 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<StudentHandsOnTaskLog> 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);
}
}

@ -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<PageQuery> 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 JsonResult<StudentHandsOnTaskLog>getInfo(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<List<StudentHandsOnTaskLog>>getList(StudentHandsOnTaskLogQuery param,@SCoreUser CoreUser coreUser) {
if(null == coreUser){
return JsonResult.failMessage("请登录后再操作");
}else{
List<StudentHandsOnTaskLog>list = 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<PageQuery> 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<String> 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 JsonResult<StudentHandsOnTaskLog>queryInfo(Long studentHandsOnTaskPptId) {
StudentHandsOnTaskLog studentHandsOnTaskLog = studentHandsOnTaskLogService.queryById( studentHandsOnTaskPptId);
return JsonResult.success(studentHandsOnTaskLog);
}
@GetMapping(MODEL + "/getValues.json")
@Function("studentHandsOnTaskLog.query")
public JsonResult<List<StudentHandsOnTaskLog>>getValues(StudentHandsOnTaskLogQuery param) {
List<StudentHandsOnTaskLog>list = 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);
}
}
}

@ -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<StudentHandsOnScoreVO> getScoreByHandsOnId(Long handsOnId, @SCoreUser CoreUser coreUser) {
return teacherOpenCourseHandsOnSimulationTasksService.getScoreByHandsOnId(handsOnId, coreUser);
}
}

@ -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;
}
}

@ -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#)
@}

@ -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);
});

@ -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);
});

@ -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);
});

@ -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 = '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</button>';
htm += '<button type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</button>';
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);
});

@ -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);
});

@ -0,0 +1,78 @@
<!--# layout("/common/layout.html",{"jsBase":"/js/jlw/studentHandsOnTaskLog/"}){ -->
<form class="layui-form" id="addForm">
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">课程开课ID</label>
<div class="layui-input-inline">
<input type="text" id="teacherOpenCourseId" name="teacherOpenCourseId" value="${studentHandsOnTaskLog.teacherOpenCourseId}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">课程实操ID</label>
<div class="layui-input-inline">
<input type="text" id="handsOnId" name="handsOnId" value="${studentHandsOnTaskLog.handsOnId}" class="layui-input" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">课程实操任务ID</label>
<div class="layui-input-inline">
<input type="text" id="handsOnTaskId" name="handsOnTaskId" value="${studentHandsOnTaskLog.handsOnTaskId}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">创建时间</label>
<div class="layui-input-inline">
<input type="text" id="createTime" name="createTime" value="${studentHandsOnTaskLog.createTime,"yyyy-MM-dd"}" class="layui-input input-date" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">组织ID</label>
<div class="layui-input-inline">
<input type="text" id="orgId" name="orgId" value="${studentHandsOnTaskLog.orgId}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">用户ID</label>
<div class="layui-input-inline">
<input type="text" id="userId" name="userId" value="${studentHandsOnTaskLog.userId}" class="layui-input" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">最后更新时间</label>
<div class="layui-input-inline">
<input type="text" id="lastUpdateTime" name="lastUpdateTime" value="${studentHandsOnTaskLog.lastUpdateTime}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">学生ID</label>
<div class="layui-input-inline">
<input type="text" id="studentId" name="studentId" value="${studentHandsOnTaskLog.studentId}" class="layui-input" >
</div>
</div>
</div>
</div>
<!-- 业务对象须有hidden字段保存delFlag和version字段-->
<input type="hidden" name="studentHandsOnTaskPptId" value="${studentHandsOnTaskLog.studentHandsOnTaskPptId}" />
<layui:submitButtons id="addButton" buttonType="" showExamine="2" />
</form>
<!--#} -->
<script>
layui.use(['add'], function(){
var studentHandsOnTaskLogAdd = layui.add
studentHandsOnTaskLogAdd.init();
});
</script>

@ -0,0 +1,78 @@
<!--# layout("/common/layout.html",{"jsBase":"/js/jlw/studentHandsOnTaskLog/"}){ -->
<form class="layui-form" id="updateForm">
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">课程开课ID</label>
<div class="layui-input-inline">
<input type="text" id="teacherOpenCourseId" name="teacherOpenCourseId" value="${studentHandsOnTaskLog.teacherOpenCourseId}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">课程实操ID</label>
<div class="layui-input-inline">
<input type="text" id="handsOnId" name="handsOnId" value="${studentHandsOnTaskLog.handsOnId}" class="layui-input" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">课程实操任务ID</label>
<div class="layui-input-inline">
<input type="text" id="handsOnTaskId" name="handsOnTaskId" value="${studentHandsOnTaskLog.handsOnTaskId}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">创建时间</label>
<div class="layui-input-inline">
<input type="text" id="createTime" name="createTime" value="${studentHandsOnTaskLog.createTime,"yyyy-MM-dd"}" class="layui-input input-date" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">组织ID</label>
<div class="layui-input-inline">
<input type="text" id="orgId" name="orgId" value="${studentHandsOnTaskLog.orgId}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">用户ID</label>
<div class="layui-input-inline">
<input type="text" id="userId" name="userId" value="${studentHandsOnTaskLog.userId}" class="layui-input" >
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">最后更新时间</label>
<div class="layui-input-inline">
<input type="text" id="lastUpdateTime" name="lastUpdateTime" value="${studentHandsOnTaskLog.lastUpdateTime}" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">学生ID</label>
<div class="layui-input-inline">
<input type="text" id="studentId" name="studentId" value="${studentHandsOnTaskLog.studentId}" class="layui-input" >
</div>
</div>
</div>
</div>
<!-- 业务对象须有hidden字段保存delFlag和version字段-->
<input type="hidden" name="studentHandsOnTaskPptId" value="${studentHandsOnTaskLog.studentHandsOnTaskPptId}" />
<layui:submitButtons id="updateButton" buttonType="" showExamine="2" />
</form>
<!--#} -->
<script>
layui.use(['edit'], function(){
var studentHandsOnTaskLogEdit = layui.edit
studentHandsOnTaskLogEdit.init();
});
</script>

@ -0,0 +1,29 @@
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/studentHandsOnTaskLog/"}){ -->
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
</layui:searchForm>
<table id="studentHandsOnTaskLogTable" lay-filter="studentHandsOnTaskLogTable"></table>
<!--#} -->
<script type="text/html" id="toolbar_studentHandsOnTaskLog">
<div class="layui-btn-container">
<div class="layui-btn-group" >
<!--# if(core.searchIsShow(search)) {-->
<layui:accessButton function="studentHandsOnTaskLog.query" id="searchFormSearch" action="search"><i class="layui-icon">&#xe615;</i>搜索</layui:accessButton>
<!--# }-->
<layui:accessButton function="studentHandsOnTaskLog.add" action="add">添加</layui:accessButton>
<layui:accessButton function="studentHandsOnTaskLog.edit" action="edit">修改</layui:accessButton>
<layui:accessButton function="studentHandsOnTaskLog.del" action="del">删除</layui:accessButton>
<!--# if(!isEmpty(search)) {-->
<layui:accessButton function="studentHandsOnTaskLog.query" action="refresh"><i class="layui-icon">&#xe669;</i>刷新</layui:accessButton>
<!--# }-->
</div>
</div>
</script>
<script>
layui.use(['index'], function(){
var index = layui.index;
index.init();
});
</script>
Loading…
Cancel
Save