评价规则bug修改

This commit is contained in:
joylink_zhangsai 2021-03-30 13:05:25 +08:00
parent 2b0cb91e55
commit 0333bb4a2d
7 changed files with 37 additions and 26 deletions

View File

@ -2,9 +2,9 @@ alter table exam_definition modify lesson_id bigint null comment '所属课程ID
add map_id bigint not null comment '地图id' after id;
-- 更新exam_definition的map_id字段
UPDATE exam_definition SET map_id =( SELECT map_id FROM ls_lesson WHERE exam_definition.lesson_id = ls_lesson.id)
UPDATE exam_definition SET map_id =( SELECT map_id FROM ls_lesson WHERE exam_definition.lesson_id = ls_lesson.id);
-- 更新exam_definition的type字段
UPDATE exam_definition SET type =( SELECT prd_type FROM ls_lesson WHERE exam_definition.lesson_id = ls_lesson.id)
UPDATE exam_definition SET type =( SELECT prd_type FROM ls_lesson WHERE exam_definition.lesson_id = ls_lesson.id);
alter table org_exam
modify org_id bigint not null,

View File

@ -36,12 +36,12 @@ public class ExamController {
return iExamService.checkScore(examDefinitionVO);
}
@Deprecated
@ApiOperation(value = "查询课程所属产品下有实训的实训类型")
@GetMapping(path = "/{lessonId}/trainingTypes")
public List<String> queryTrainingTypes(@PathVariable Long lessonId) {
return iExamService.queryTrainingTypes(lessonId);
}
// @Deprecated
// @ApiOperation(value = "查询课程所属产品下有实训的实训类型")
// @GetMapping(path = "/{lessonId}/trainingTypes")
// public List<String> queryTrainingTypes(@PathVariable Long lessonId) {
// return iExamService.queryTrainingTypes(lessonId);
// }
@ApiOperation(value = "查询试题信息及规则信息")
@GetMapping(path = "/{id}")
@ -49,11 +49,11 @@ public class ExamController {
return iExamService.queryExamInfo(id);
}
@ApiOperation(value = "查询课程信息及课程下的试题列表信息")
@GetMapping(path = "/{lessonId}/list")
public ExamsLessonVO queryExamList(@PathVariable Long lessonId, @ApiIgnore @RequestAttribute UserVO user) {
return iExamService.queryExamList(lessonId, user);
}
// @ApiOperation(value = "查询课程信息及课程下的试题列表信息")
// @GetMapping(path = "/{lessonId}/list")
// public ExamsLessonVO queryExamList(@PathVariable Long lessonId, @ApiIgnore @RequestAttribute UserVO user) {
// return iExamService.queryExamList(lessonId, user);
// }
@ApiOperation(value = "查询试题列表信息")
@GetMapping(path = "/list")
@ -67,11 +67,11 @@ public class ExamController {
iExamService.deleteExam(id, user);
}
@ApiOperation(value = "根据课程和实训类型查询实训数量")
@GetMapping(path = "/trainingNum/{lessonId}/{trainingType}")
public Long queryTrainingNum(@PathVariable Long lessonId, @PathVariable String trainingType, String operateType) {
return iExamService.queryTrainingNum(lessonId, trainingType, operateType);
}
// @ApiOperation(value = "根据课程和实训类型查询实训数量")
// @GetMapping(path = "/trainingNum/{lessonId}/{trainingType}")
// public Long queryTrainingNum(@PathVariable Long lessonId, @PathVariable String trainingType, String operateType) {
// return iExamService.queryTrainingNum(lessonId, trainingType, operateType);
// }
@ApiOperation(value = "试题上线")
@PutMapping(value = "/{id}/onLine")

View File

@ -27,6 +27,7 @@ import java.util.List;
@RequestMapping("/api/lesson")
public class LessonController {
@Autowired
private ILessonService iLessonService;
@Autowired

View File

@ -67,7 +67,7 @@ public interface UserTrainingStatsMapper {
"ut.user_id AS userId " +
"FROM user_training_stats ut " +
"LEFT JOIN sys_user u ON u.id = ut.user_id " +
"WHERE u.id = #{userId} AND finishTime &gt;= #{startTime} AND finishTime &lt;= #{endTime} " +
"WHERE u.id = #{userId} AND ut.finish_time &gt;= #{startTime} AND ut.finish_time &lt;= #{endTime} " +
"AND ut.lesson_id IN" +
"<foreach collection='lessonIds' item='lessonId' open='(' separator=',' close=')'>" +
"#{lessonId}" +

View File

@ -251,12 +251,12 @@ public class ExamService implements IExamService {
SysUserExample sysUserExample = new SysUserExample();
sysUserExample.createCriteria().andNameLike(String.format("%%%s%%", queryVO.getCreatorName()));
sysUserExample.or().andNicknameLike(String.format("%%%s%%", queryVO.getCreatorName()));
List<Long> createrIdList = sysUserMapper.selectByExample(sysUserExample).stream()
List<Long> creatorIdList = sysUserMapper.selectByExample(sysUserExample).stream()
.map(SysUser::getId).collect(Collectors.toList());
if (createrIdList.size() == 0) {
createrIdList.add(null);
if (creatorIdList.size() == 0) {
creatorIdList.add(null);
}
criteria.andCreatorIdIn(createrIdList);
criteria.andCreatorIdIn(creatorIdList);
}
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
Page<ExamDefinition> examDefinitionList = (Page<ExamDefinition>) examDefinitionDAO.selectByExample(examDefinitionExample);
@ -422,6 +422,8 @@ public class ExamService implements IExamService {
criteria.andCreatorIdIn(creatorIds);
if (StringUtils.hasText(queryVO.getName()))
criteria.andNameLike(String.format("%%%s%%", queryVO.getName()));
if (StringUtils.hasText(queryVO.getStatus()))
criteria.andStatusEqualTo(queryVO.getStatus());
PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize());
Page<ExamDefinition> page = (Page<ExamDefinition>) examDefinitionDAO.selectByExample(example);
creatorIds = page.stream().map(ExamDefinition::getCreatorId).collect(Collectors.toList());
@ -459,7 +461,10 @@ public class ExamService implements IExamService {
List<Long> mapIds = iMapService.findOnlineMapByProjectCode(loginInfo.getProject().name())
.stream().map(MapVO::getId).collect(Collectors.toList());
ExamDefinitionExample example = new ExamDefinitionExample();
example.createCriteria().andMapIdIn(mapIds);
ExamDefinitionExample.Criteria criteria = example.createCriteria().andMapIdIn(mapIds);
if (StringUtils.hasText(queryVO.getStatus())) {
criteria.andStatusEqualTo(queryVO.getStatus());
}
return ExamDefinitionVO.convert(examDefinitionDAO.selectByExample(example));
}

View File

@ -536,10 +536,13 @@ public class LessonService implements ILessonService {
List<Long> mapIds = maps.stream().map(MapVO::getId).collect(Collectors.toList());
LsLessonExample example = new LsLessonExample();
Criteria criteria = example.createCriteria();
criteria.andMapIdIn(mapIds).andSysfaultEqualTo(false).andStatusEqualTo(BusinessConsts.STATUS_USE);
criteria.andMapIdIn(mapIds).andSysfaultEqualTo(false);
if (StringUtils.hasText(queryVO.getName())) {
criteria.andNameLike(String.format("%%%s%%", queryVO.getName()));
}
if (StringUtils.hasText(queryVO.getStatus())) {
criteria.andStatusEqualTo(queryVO.getStatus());
}
if (StringUtils.hasText(queryVO.getCreatorName())) {
List<Long> creatorIds = iSysUserService.findUserByName(queryVO.getCreatorName()).stream().map(UserVO::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(creatorIds)) {
@ -552,7 +555,7 @@ public class LessonService implements ILessonService {
Page<LsLesson> page = (Page<LsLesson>) lessonDAO.selectByExample(example);
Map<Long, SysUser> creators = iSysUserService.findEntity(page.stream().map(LsLesson::getCreatorId).collect(Collectors.toList()), null)
.stream().collect(Collectors.toMap(SysUser::getId, Function.identity()));
List<LessonVO> lessonVOList = LessonVO.convert(page.getResult(), creators);
List<LessonVO> lessonVOList = LessonVO.convert(page, creators);
return PageVO.convert(page, lessonVOList);
}
}

View File

@ -18,4 +18,6 @@ public class LessonQueryVO extends PageQueryVO {
private String creatorName;
private String status;
}