【新增】监控管理试卷任务级别监控,试卷任务编号,试卷分数
This commit is contained in:
@@ -30,7 +30,7 @@ import pc.exam.pp.module.exam.service.monitor.MonitorService;
|
||||
import static pc.exam.pp.module.infra.enums.ErrorCodeConstants.DEMO03_MONITOR_SESSION_EXISTS;
|
||||
import static pc.exam.pp.module.infra.enums.ErrorCodeConstants.DEMO03_MONITOR_TIME_EXISTS;
|
||||
|
||||
@Tag(name = "管理后台 - 监控管理")
|
||||
@Tag(name = "管理后台 - 学生监控管理")
|
||||
@RestController
|
||||
@RequestMapping("/exam/monitor")
|
||||
@Validated
|
||||
|
@@ -0,0 +1,41 @@
|
||||
package pc.exam.pp.module.exam.controller.admin.monitor;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import pc.exam.pp.framework.common.pojo.CommonResult;
|
||||
import pc.exam.pp.framework.common.pojo.PageResult;
|
||||
import pc.exam.pp.framework.common.util.object.BeanUtils;
|
||||
import pc.exam.pp.module.exam.controller.admin.monitor.vo.MonitorPageReqVO;
|
||||
import pc.exam.pp.module.exam.controller.admin.monitor.vo.MonitorRespVO;
|
||||
import pc.exam.pp.module.exam.controller.admin.paper.vo.PaperTaskPageVo;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorDO;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorTaskDO;
|
||||
import pc.exam.pp.module.exam.service.monitor.MonitorTaskService;
|
||||
|
||||
import static pc.exam.pp.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 考试任务监控管理")
|
||||
@RestController
|
||||
@RequestMapping("/exam/monitorTask")
|
||||
@Validated
|
||||
public class MonitorTaskController {
|
||||
|
||||
@Resource
|
||||
private MonitorTaskService monitorTaskService;
|
||||
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得监控管理分页")
|
||||
public CommonResult<PageResult<MonitorTaskDO>> getMonitorPage(@Valid PaperTaskPageVo educationPaperTask ) {
|
||||
PageResult<MonitorTaskDO> pageResult = monitorTaskService.getMonitorPage(educationPaperTask);
|
||||
return success(BeanUtils.toBean(pageResult, MonitorTaskDO.class));
|
||||
}
|
||||
|
||||
}
|
@@ -39,6 +39,8 @@ private String paperNum;
|
||||
@Schema(description = "场次", example = "赵六")
|
||||
private String taskName;
|
||||
|
||||
private String taskId;
|
||||
|
||||
private String taskType;
|
||||
|
||||
@Schema(description = "机器ip")
|
||||
|
@@ -101,7 +101,6 @@ public class EducationPaperPersonController
|
||||
@GetMapping(value = "/getSessionStu")
|
||||
public CommonResult<PageResult<PersonRepDto>> getSessionStu(ExamPersonVo examPersonVo) {
|
||||
PageResult<PersonRepDto> list = educationPaperPersonService.selectEducationPaperPersonBySessionId(examPersonVo.getSessionId());
|
||||
|
||||
return CommonResult.success(BeanUtils.toBean(list, PersonRepDto.class));
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,8 @@ public class PaperTaskPageVo extends PageParam {
|
||||
//@Excel(name = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
private String taskNum;
|
||||
|
||||
/** 专业 */
|
||||
//@Excel(name = "专业")
|
||||
private String taskSpecialty;
|
||||
|
@@ -48,5 +48,7 @@ public class EducationPaper extends TenantBaseDO
|
||||
// @Excel(name = "0启用1不启")
|
||||
private String status;
|
||||
|
||||
private String paperScore;
|
||||
|
||||
}
|
||||
|
||||
|
@@ -8,6 +8,7 @@ import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
import java.sql.Time;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -45,7 +46,8 @@ public class EducationPaperSession
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
//@Excel(name = "考试结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
@JsonFormat(pattern = "HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private Time answerTime;
|
||||
/** 开始考试前分钟,允许入场 */
|
||||
// @Excel(name = "开始考试前分钟,允许入场")
|
||||
private String allowEntry;
|
||||
|
@@ -29,6 +29,8 @@ public class EducationPaperTask extends TenantBaseDO
|
||||
@TableId
|
||||
private String taskId;
|
||||
|
||||
private String taskNum;
|
||||
|
||||
/** 任务名称 */
|
||||
//@Excel(name = "任务名称")
|
||||
private String taskName;
|
||||
|
@@ -0,0 +1,43 @@
|
||||
package pc.exam.pp.module.exam.dal.dataobject.monitor;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class MonitorTaskDO {
|
||||
|
||||
/** 主键ID */
|
||||
private String taskId;
|
||||
|
||||
private String taskNum;
|
||||
|
||||
/** 任务名称 */
|
||||
private String taskName;
|
||||
|
||||
/** 专业 */
|
||||
private String taskSpecialty;
|
||||
|
||||
/** 试卷任务模式 */
|
||||
private String taskType;
|
||||
|
||||
private String status;
|
||||
|
||||
private String paperCount;
|
||||
|
||||
private String paperScore;
|
||||
|
||||
private String queNum;
|
||||
//参数人数
|
||||
private String joinCount;
|
||||
//未考人数
|
||||
private String notReadCount;
|
||||
//考试人数
|
||||
private String haveReadCount;
|
||||
//完成人数
|
||||
private String passCount;
|
||||
|
||||
}
|
@@ -6,6 +6,7 @@ import pc.exam.pp.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import pc.exam.pp.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import pc.exam.pp.module.exam.controller.admin.monitor.vo.MonitorPageReqVO;
|
||||
import pc.exam.pp.module.exam.controller.admin.paper.vo.DeleteRequestVo;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorDO;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -16,24 +17,36 @@ import java.util.Optional;
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface MonitorMapper extends BaseMapperX<MonitorDO> {
|
||||
@Mapper
|
||||
public interface MonitorMapper extends BaseMapperX<MonitorDO> {
|
||||
|
||||
default PageResult<MonitorDO> selectPage(MonitorPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MonitorDO>()
|
||||
.inIfPresent(MonitorDO::getMonitorId, Optional.ofNullable(reqVO.getMonitorId()).map(Arrays::asList).orElse(null))
|
||||
.likeIfPresent(MonitorDO::getUsername, reqVO.getUsername())
|
||||
.likeIfPresent(MonitorDO::getNickname, reqVO.getNickname())
|
||||
.likeIfPresent(MonitorDO::getClassName, reqVO.getClassName())
|
||||
.eqIfPresent(MonitorDO::getExamStatus, reqVO.getExamStatus())
|
||||
.eqIfPresent(MonitorDO::getTaskType, reqVO.getTaskType())
|
||||
.eqIfPresent(MonitorDO::getScore, reqVO.getScore())
|
||||
.eqIfPresent(MonitorDO::getPaperNum, reqVO.getPaperNum())
|
||||
.likeIfPresent(MonitorDO::getTaskName, reqVO.getTaskName())
|
||||
.eqIfPresent(MonitorDO::getIp, reqVO.getIp())
|
||||
.betweenIfPresent(MonitorDO::getRemainingTime, reqVO.getRemainingTime())
|
||||
.betweenIfPresent(MonitorDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MonitorDO::getCreateTime));
|
||||
default PageResult<MonitorDO> selectPage(MonitorPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MonitorDO>()
|
||||
.inIfPresent(MonitorDO::getMonitorId, Optional.ofNullable(reqVO.getMonitorId()).map(Arrays::asList).orElse(null))
|
||||
.likeIfPresent(MonitorDO::getUsername, reqVO.getUsername())
|
||||
.likeIfPresent(MonitorDO::getTaskId, reqVO.getTaskId())
|
||||
.likeIfPresent(MonitorDO::getNickname, reqVO.getNickname())
|
||||
.likeIfPresent(MonitorDO::getClassName, reqVO.getClassName())
|
||||
.eqIfPresent(MonitorDO::getExamStatus, reqVO.getExamStatus())
|
||||
.eqIfPresent(MonitorDO::getTaskType, reqVO.getTaskType())
|
||||
.eqIfPresent(MonitorDO::getScore, reqVO.getScore())
|
||||
.eqIfPresent(MonitorDO::getPaperNum, reqVO.getPaperNum())
|
||||
.likeIfPresent(MonitorDO::getTaskName, reqVO.getTaskName())
|
||||
.eqIfPresent(MonitorDO::getIp, reqVO.getIp())
|
||||
.betweenIfPresent(MonitorDO::getRemainingTime, reqVO.getRemainingTime())
|
||||
.betweenIfPresent(MonitorDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MonitorDO::getCreateTime));
|
||||
}
|
||||
|
||||
default void removeMonitorByStuIdAndTaskId(DeleteRequestVo vo) {
|
||||
if (vo.getStudentIds() == null || vo.getStudentIds().isEmpty() || vo.getTaskId() == null) {
|
||||
return;
|
||||
}
|
||||
LambdaQueryWrapperX<MonitorDO> query = new LambdaQueryWrapperX<MonitorDO>()
|
||||
.in(MonitorDO::getStuId, vo.getStudentIds())
|
||||
.eq(MonitorDO::getTaskId, vo.getTaskId());
|
||||
delete(query);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
package pc.exam.pp.module.exam.dal.mysql.monitor;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface MonitorTaskMapper {
|
||||
}
|
@@ -42,6 +42,7 @@ public interface EducationPaperTaskMapper extends BaseMapperX<EducationPaperTask
|
||||
.likeIfPresent(EducationPaperTask::getTaskType, pageReqVO.getTaskType())
|
||||
.likeIfPresent(EducationPaperTask::getTaskName , pageReqVO.getTaskName())
|
||||
.likeIfPresent(EducationPaperTask::getStatus , pageReqVO.getStatus())
|
||||
.likeIfPresent(EducationPaperTask::getTaskNum , pageReqVO.getTaskNum())
|
||||
.likeIfPresent(EducationPaperTask::getTaskSpecialty , pageReqVO.getTaskSpecialty())
|
||||
.likeIfPresent(EducationPaperTask::getIsTemplate , pageReqVO.getIsTemplate())
|
||||
.betweenIfPresent(EducationPaperTask::getCreateTime, pageReqVO.getCreateTime())
|
||||
|
@@ -0,0 +1,13 @@
|
||||
package pc.exam.pp.module.exam.service.monitor;
|
||||
|
||||
import pc.exam.pp.framework.common.pojo.PageResult;
|
||||
import pc.exam.pp.module.exam.controller.admin.monitor.vo.MonitorPageReqVO;
|
||||
import pc.exam.pp.module.exam.controller.admin.paper.vo.PaperTaskPageVo;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorDO;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorTaskDO;
|
||||
|
||||
public interface MonitorTaskService {
|
||||
|
||||
PageResult<MonitorTaskDO> getMonitorPage(PaperTaskPageVo pageReqVO);
|
||||
|
||||
}
|
@@ -0,0 +1,130 @@
|
||||
package pc.exam.pp.module.exam.service.monitor;
|
||||
|
||||
import com.alibaba.excel.util.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import pc.exam.pp.framework.common.pojo.PageResult;
|
||||
import pc.exam.pp.module.exam.controller.admin.monitor.vo.MonitorPageReqVO;
|
||||
import pc.exam.pp.module.exam.controller.admin.paper.vo.PaperTaskPageVo;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.EducationPaper;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.EducationPaperQu;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.EducationPaperTask;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorDO;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorTaskDO;
|
||||
import pc.exam.pp.module.exam.dal.mysql.monitor.MonitorMapper;
|
||||
import pc.exam.pp.module.exam.dal.mysql.monitor.MonitorTaskMapper;
|
||||
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperMapper;
|
||||
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperPersonMapper;
|
||||
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperQuMapper;
|
||||
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperTaskMapper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class MonitorTaskServiceImpl implements MonitorTaskService{
|
||||
@Resource
|
||||
private MonitorMapper monitorMapper;
|
||||
@Resource
|
||||
private EducationPaperTaskMapper educationPaperTaskMapper;
|
||||
@Resource
|
||||
private EducationPaperMapper educationPaperMapper;
|
||||
@Resource
|
||||
private MonitorTaskMapper monitorTaskMapper;
|
||||
@Resource
|
||||
private EducationPaperPersonMapper educationPaperPersonMapper;
|
||||
@Resource
|
||||
private EducationPaperQuMapper educationPaperQuMapper;
|
||||
@Override
|
||||
public PageResult<MonitorTaskDO> getMonitorPage(PaperTaskPageVo pageReqVO) {
|
||||
|
||||
PageResult<EducationPaperTask> educationPaperTasks = educationPaperTaskMapper.selectEducationPaperTaskList(pageReqVO);
|
||||
List<EducationPaperTask> list = educationPaperTasks.getList();
|
||||
List<MonitorTaskDO> monitorTaskDOList=new ArrayList<>();
|
||||
if (list!=null&&list.size()>0){
|
||||
for (EducationPaperTask educationPaperTask : list) {
|
||||
MonitorTaskDO monitorTaskDO=new MonitorTaskDO();
|
||||
|
||||
monitorTaskDO.setTaskId( educationPaperTask.getTaskId());
|
||||
monitorTaskDO.setTaskType(educationPaperTask.getTaskType());
|
||||
monitorTaskDO.setTaskName(educationPaperTask.getTaskName());
|
||||
monitorTaskDO.setTaskNum(educationPaperTask.getTaskNum());
|
||||
monitorTaskDO.setStatus(educationPaperTask.getStatus());
|
||||
monitorTaskDO.setTaskSpecialty(educationPaperTask.getTaskSpecialty());
|
||||
|
||||
List<EducationPaper> educationPapers = educationPaperMapper.selectPaperListByTaskId(educationPaperTask.getTaskId());
|
||||
if (educationPapers!=null&&educationPapers.size()>0){
|
||||
monitorTaskDO.setPaperCount(String.valueOf(educationPapers.size()));
|
||||
int totalScore = 0;
|
||||
int totalQueNum = 0;
|
||||
//todo 根据试卷
|
||||
for (EducationPaper educationPaper : educationPapers) {
|
||||
//累加分数 和 试题个数
|
||||
String paperScore = educationPaper.getPaperScore();
|
||||
if (StringUtils.isNotBlank(paperScore)) {
|
||||
try {
|
||||
totalScore += Integer.parseInt(paperScore);
|
||||
} catch (NumberFormatException e) {
|
||||
// 可以记录日志或跳过
|
||||
}
|
||||
}
|
||||
List<EducationPaperQu> educationPaperQus = educationPaperQuMapper.selectPaperQuListByPaperId(educationPaper.getPaperId());
|
||||
|
||||
if (educationPaperQus != null) {
|
||||
totalQueNum += educationPaperQus.size();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
monitorTaskDO.setPaperScore(String.valueOf(totalScore));
|
||||
monitorTaskDO.setQueNum(String.valueOf(totalQueNum));
|
||||
}else {
|
||||
monitorTaskDO.setPaperCount("0");
|
||||
monitorTaskDO.setQueNum("0");
|
||||
monitorTaskDO.setPaperScore("0");
|
||||
}
|
||||
|
||||
List<MonitorDO> monitorDOList = monitorMapper.selectList(
|
||||
new LambdaQueryWrapper<MonitorDO>()
|
||||
.eq(MonitorDO::getTaskId, educationPaperTask.getTaskId())
|
||||
);
|
||||
if (monitorDOList!=null&&monitorDOList.size()>0){
|
||||
//参数
|
||||
monitorTaskDO.setJoinCount(String.valueOf(monitorDOList.size()));
|
||||
// 已考人数(exam_status == 1)
|
||||
String haveReadCount = String.valueOf(monitorDOList.stream()
|
||||
.filter(monitor -> monitor.getExamStatus() != null && "1".equals(monitor.getExamStatus()))
|
||||
.count());
|
||||
monitorTaskDO.setHaveReadCount(haveReadCount);
|
||||
//未考
|
||||
String NothaveReadCount = String.valueOf(monitorDOList.stream()
|
||||
.filter(monitor -> monitor.getExamStatus() != null &&"0".equals(monitor.getExamStatus()))
|
||||
.count());
|
||||
monitorTaskDO.setNotReadCount(NothaveReadCount);
|
||||
//完成
|
||||
String PassCount = String.valueOf(monitorDOList.stream()
|
||||
.filter(monitor -> monitor.getExamStatus() != null && "2".equals(monitor.getExamStatus()))
|
||||
.count());
|
||||
|
||||
monitorTaskDO.setPassCount(PassCount);
|
||||
}else {
|
||||
monitorTaskDO.setJoinCount("0");
|
||||
monitorTaskDO.setHaveReadCount("0");
|
||||
monitorTaskDO.setNotReadCount("0");
|
||||
monitorTaskDO.setPassCount("0");
|
||||
}
|
||||
monitorTaskDOList.add(monitorTaskDO);
|
||||
}
|
||||
}
|
||||
|
||||
PageResult pageResult=new PageResult();
|
||||
pageResult.setList(monitorTaskDOList);
|
||||
pageResult.setTotal((long) monitorTaskDOList.size());
|
||||
|
||||
|
||||
return pageResult;
|
||||
}
|
||||
}
|
@@ -251,6 +251,10 @@ public class EducationPaperPersonServiceImpl implements IEducationPaperPersonSer
|
||||
String key = "userCache:" + reqVO.getTaskId()+":"+studentId;
|
||||
redisTemplate.delete(key);
|
||||
}
|
||||
DeleteRequestVo deleteRequestVo=new DeleteRequestVo();
|
||||
deleteRequestVo.setStudentIds(reqVO.getStudentIds());
|
||||
deleteRequestVo.setTaskId(reqVO.getTaskId());
|
||||
monitorMapper.removeMonitorByStuIdAndTaskId(deleteRequestVo);
|
||||
return educationPaperPersonMapper.removeSessionStu(reqVO);
|
||||
}
|
||||
|
||||
@@ -261,6 +265,9 @@ public class EducationPaperPersonServiceImpl implements IEducationPaperPersonSer
|
||||
String key = "userCache:" + deleteRequestVo.getTaskId()+":"+studentId;
|
||||
redisTemplate.delete(key);
|
||||
}
|
||||
|
||||
monitorMapper.removeMonitorByStuIdAndTaskId(deleteRequestVo);
|
||||
|
||||
return educationPaperPersonMapper.removeTaskStu(deleteRequestVo);
|
||||
}
|
||||
|
||||
|
@@ -86,17 +86,17 @@ public class EducationPaperSchemeServiceImpl implements IEducationPaperSchemeSer
|
||||
public int updateEducationPaperScheme(EducationPaperScheme educationPaperScheme)
|
||||
{
|
||||
|
||||
// 将 List<String> 转换为逗号分隔的字符串
|
||||
List<String> keyword = educationPaperScheme.getKeyword();
|
||||
String keywordStr = String.join(",", keyword);
|
||||
// 将 List<Integer> 转换为逗号分隔的字符串
|
||||
List<Integer> pointName = educationPaperScheme.getPointName();
|
||||
String pointNameStr = pointName.stream()
|
||||
.map(String::valueOf) // 将 Integer 转换为 String
|
||||
.collect(Collectors.joining(",")); // 使用逗号连接
|
||||
|
||||
educationPaperScheme.setKeywords(keywordStr);
|
||||
educationPaperScheme.setPointNames(pointNameStr);
|
||||
// // 将 List<String> 转换为逗号分隔的字符串
|
||||
// List<String> keyword = educationPaperScheme.getKeyword();
|
||||
// String keywordStr = String.join(",", keyword);
|
||||
// // 将 List<Integer> 转换为逗号分隔的字符串
|
||||
// List<Integer> pointName = educationPaperScheme.getPointName();
|
||||
// String pointNameStr = pointName.stream()
|
||||
// .map(String::valueOf) // 将 Integer 转换为 String
|
||||
// .collect(Collectors.joining(",")); // 使用逗号连接
|
||||
//
|
||||
// educationPaperScheme.setKeywords(keywordStr);
|
||||
// educationPaperScheme.setPointNames(pointNameStr);
|
||||
|
||||
return educationPaperSchemeMapper.updateEducationPaperScheme(educationPaperScheme);
|
||||
}
|
||||
|
@@ -106,7 +106,7 @@ public class EducationPaperServiceImpl implements IEducationPaperService
|
||||
public int deleteEducationPaperByPaperIds(String[] paperIds)
|
||||
{
|
||||
|
||||
|
||||
educationPaperQuMapper.deleteEducationPaperQuByPaperIds(paperIds);
|
||||
return educationPaperMapper.deleteEducationPaperByPaperIds(paperIds);
|
||||
}
|
||||
|
||||
@@ -369,17 +369,18 @@ public class EducationPaperServiceImpl implements IEducationPaperService
|
||||
|
||||
//构建试卷试题对象
|
||||
List<EducationPaperQu> educationPaperQus=new ArrayList<>();
|
||||
int sort = 1; // 从1开始
|
||||
if (examQuestionIds!=null&& examQuestionIds.size()>0){
|
||||
for (String examQuestionId : examQuestionIds) {
|
||||
EducationPaperQu educationPaperQu=new EducationPaperQu();
|
||||
educationPaperQu.setPaperId(uuid);
|
||||
educationPaperQu.setQuId(examQuestionId);
|
||||
educationPaperQu.setSort(String.valueOf(sort++));
|
||||
educationPaperQus.add(educationPaperQu);
|
||||
}
|
||||
educationPaperQuMapper.insertEducationPaperQuList(educationPaperQus);
|
||||
}
|
||||
|
||||
|
||||
List<String> quIds =educationPaperQuMapper.selectPaperQuByPaperId(uuid);
|
||||
List<ExamQuestion> examQuestionList=examQuestionMapper.selectExamQuestionListByQuIds(quIds);
|
||||
|
||||
|
@@ -173,7 +173,6 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService
|
||||
*/
|
||||
@Override
|
||||
public int deleteEducationPaperTaskByTaskIds(String[] taskIds) {
|
||||
System.out.println(taskIds);
|
||||
return educationPaperTaskMapper.deleteEducationPaperTaskByTaskIds(taskIds);
|
||||
}
|
||||
|
||||
|
@@ -9,6 +9,7 @@
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="num" column="num" />
|
||||
<result property="counts" column="counts" />
|
||||
<result property="paperScore" column="paper_score" />
|
||||
<result property="rollUp" column="roll_up" />
|
||||
<result property="isAb" column="is_ab" />
|
||||
<result property="status" column="status" />
|
||||
@@ -48,11 +49,10 @@
|
||||
|
||||
|
||||
<sql id="selectEducationPaperVo">
|
||||
select paper_id, task_id, num,counts, roll_up, is_ab, status ,create_time,update_time,creator,updater ,deleted from education_paper
|
||||
select paper_id, task_id, num,counts, paper_score,roll_up, is_ab, status ,create_time,update_time,creator,updater ,deleted from education_paper
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<select id="selectEducationPaperByPaperId" parameterType="String" resultMap="EducationPaperResult">
|
||||
<include refid="selectEducationPaperVo"/>
|
||||
where paper_id = #{paperId}
|
||||
@@ -128,6 +128,7 @@ select task_id from education_paper where paper_id=#{paperId}
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="num != null">num,</if>
|
||||
<if test="counts != null">counts,</if>
|
||||
<if test="paperScore != null">paper_score,</if>
|
||||
<if test="rollUp != null">roll_up,</if>
|
||||
<if test="isAb != null">is_ab,</if>
|
||||
<if test="status != null">status,</if>
|
||||
@@ -143,6 +144,7 @@ select task_id from education_paper where paper_id=#{paperId}
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="num != null">#{num},</if>
|
||||
<if test="counts != null">#{counts},</if>
|
||||
<if test="paperScore != null">#{paperScore},</if>
|
||||
<if test="rollUp != null">#{rollUp},</if>
|
||||
<if test="isAb != null">#{isAb},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
@@ -155,10 +157,10 @@ select task_id from education_paper where paper_id=#{paperId}
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertEducationPaperList">
|
||||
INSERT INTO education_paper (paper_id, task_id,num ,counts, roll_up, is_ab, status ) VALUES
|
||||
INSERT INTO education_paper (paper_id, task_id,num ,counts,paper_score, roll_up, is_ab, status ) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.paperId}, #{item.taskId}, #{item.num},#{item.counts}, #{item.rollUp}, #{item.isAb}, #{item.status}
|
||||
#{item.paperId}, #{item.taskId}, #{item.num},#{item.counts},#{item.paperScore}, #{item.rollUp}, #{item.isAb}, #{item.status}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -168,6 +170,7 @@ select task_id from education_paper where paper_id=#{paperId}
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="counts != null">counts = #{counts},</if>
|
||||
<if test="paperScore != null">paper_score = #{paperScore},</if>
|
||||
<if test="rollUp != null">roll_up = #{rollUp},</if>
|
||||
<if test="isAb != null">is_ab = #{isAb},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
|
@@ -86,16 +86,7 @@
|
||||
<update id="updateEducationPaperScheme" parameterType="EducationPaperScheme">
|
||||
update education_paper_scheme
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="quTitle != null">qu_title = #{quTitle},</if>
|
||||
<if test="spName != null">sp_name = #{spName},</if>
|
||||
<if test="quLevel != null">qu_level = #{quLevel},</if>
|
||||
<if test="keywords != null">keywords = #{keywords},</if>
|
||||
<if test="pointNames != null">point_names = #{pointNames},</if>
|
||||
<if test="quNumbers != null">qu_numbers = #{quNumbers},</if>
|
||||
<if test="quScores != null">qu_scores = #{quScores},</if>
|
||||
<if test="subtotalScore != null">subtotal_score = #{subtotalScore},</if>
|
||||
<if test="subtotalScore != null">sort = #{sort},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
</trim>
|
||||
where scheme_id = #{schemeId}
|
||||
</update>
|
||||
|
@@ -10,6 +10,7 @@
|
||||
<result property="batch" column="batch" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="answerTime" column="answer_time" />
|
||||
<result property="allowEntry" column="allow_entry" />
|
||||
<result property="endAllowEntry" column="end_allow_entry" />
|
||||
<result property="allowSubmission" column="allow_submission" />
|
||||
@@ -40,6 +41,7 @@
|
||||
<if test="batch != null">batch,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="answerTime != null">answer_time,</if>
|
||||
<if test="allowEntry != null">allow_entry,</if>
|
||||
<if test="endAllowEntry != null">end_allow_entry,</if>
|
||||
<if test="allowSubmission != null">allow_submission,</if>
|
||||
@@ -52,6 +54,7 @@
|
||||
<if test="batch != null">#{batch},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="answerTime != null">#{answerTime},</if>
|
||||
<if test="allowEntry != null">#{allowEntry},</if>
|
||||
<if test="endAllowEntry != null">#{endAllowEntry},</if>
|
||||
<if test="allowSubmission != null">#{allowSubmission},</if>
|
||||
@@ -60,10 +63,10 @@
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertEducationPaperSessionList">
|
||||
INSERT INTO education_paper_session (session_id, task_id, batch, start_time, end_time, allow_entry, end_allow_entry, allow_submission, status, paper_id) VALUES
|
||||
INSERT INTO education_paper_session (session_id, task_id, batch, start_time, end_time,answer_time, allow_entry, end_allow_entry, allow_submission, status, paper_id) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.sessionId}, #{item.taskId}, #{item.batch}, #{item.startTime}, #{item.endTime}, #{item.allowEntry}, #{item.endAllowEntry}, #{item.allowSubmission}, #{item.status}, #{item.paperId}
|
||||
#{item.sessionId}, #{item.taskId}, #{item.batch}, #{item.startTime}, #{item.endTime},#{item.answerTime}, #{item.allowEntry}, #{item.endAllowEntry}, #{item.allowSubmission}, #{item.status}, #{item.paperId}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -75,6 +78,7 @@
|
||||
<if test="batch != null">batch = #{batch},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="answerTime != null">answer_time = #{answerTime},</if>
|
||||
<if test="allowEntry != null">allow_entry = #{allowEntry},</if>
|
||||
<if test="endAllowEntry != null">end_allow_entry = #{endAllowEntry},</if>
|
||||
<if test="allowSubmission != null">allow_submission = #{allowSubmission},</if>
|
||||
|
@@ -7,6 +7,7 @@
|
||||
<resultMap type="EducationPaperTask" id="EducationPaperTaskResult">
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="taskName" column="task_name" />
|
||||
<result property="taskNum" column="task_num" />
|
||||
<result property="taskSpecialty" column="task_specialty" />
|
||||
<result property="taskType" column="task_type" />
|
||||
<result property="isOne" column="is_one" />
|
||||
@@ -30,7 +31,7 @@
|
||||
<result property="treeNum" column="tree_num" />
|
||||
</resultMap>
|
||||
<sql id="selectEducationPaperTaskVo">
|
||||
select task_id, task_name, task_specialty, task_type,is_one, is_template, status, create_time, update_time, creator, updater, deleted,tenant_id from education_paper_task
|
||||
select task_id, task_name,task_num, task_specialty, task_type,is_one, is_template, status, create_time, update_time, creator, updater, deleted,tenant_id from education_paper_task
|
||||
</sql>
|
||||
|
||||
|
||||
@@ -135,9 +136,11 @@
|
||||
insert into education_paper_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="taskNum != null">task_num,</if>
|
||||
<if test="taskName != null">task_name,</if>
|
||||
<if test="taskSpecialty != null">task_specialty,</if>
|
||||
<if test="taskType != null">task_type,</if>
|
||||
<if test="isOne != null">is_one,</if>
|
||||
<if test="isTemplate != null">is_template,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
@@ -149,9 +152,11 @@
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="taskNum != null">#{taskNum},</if>
|
||||
<if test="taskName != null">#{taskName},</if>
|
||||
<if test="taskSpecialty != null">#{taskSpecialty},</if>
|
||||
<if test="taskType != null">#{taskType},</if>
|
||||
<if test="isOne != null">#{isOne},</if>
|
||||
<if test="isTemplate != null">#{isTemplate},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
|
Reference in New Issue
Block a user