大赛管理功能方法注释
This commit is contained in:
parent
902a2e78b1
commit
4a1316e1bd
@ -1 +1 @@
|
|||||||
Subproject commit 71cf9d49fb9dbe951b43a482b7649b5f7bf58a3b
|
Subproject commit 64053645db2ecf352e7fdf8e4d19ec607d03c887
|
@ -40,6 +40,13 @@ public class RacePaperController {
|
|||||||
racePaperService.create(createVO, user);
|
racePaperService.create(createVO, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新试卷内容
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param updateVO
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
@PostMapping("/{id}")
|
@PostMapping("/{id}")
|
||||||
public void update(@PathVariable("id") Long id, @RequestBody RacePaperCreateVO updateVO, @RequestAttribute AccountVO user) {
|
public void update(@PathVariable("id") Long id, @RequestBody RacePaperCreateVO updateVO, @RequestAttribute AccountVO user) {
|
||||||
this.racePaperService.update(id, updateVO, user);
|
this.racePaperService.update(id, updateVO, user);
|
||||||
@ -53,16 +60,35 @@ public class RacePaperController {
|
|||||||
return racePaperService.pageQuery(queryVO);
|
return racePaperService.pageQuery(queryVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试卷配置
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param moduleVO
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
@PostMapping("/{id}/config")
|
@PostMapping("/{id}/config")
|
||||||
public void configSeting(@PathVariable("id") Long id, @RequestBody RacePaperModuleVO moduleVO, @RequestAttribute AccountVO user) {
|
public void configSeting(@PathVariable("id") Long id, @RequestBody RacePaperModuleVO moduleVO, @RequestAttribute AccountVO user) {
|
||||||
this.racePaperService.configSeting(id, moduleVO, user);
|
this.racePaperService.configSeting(id, moduleVO, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取明细
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public RacePaperDetailVO detail(@PathVariable("id") Long id) {
|
public RacePaperDetailVO detail(@PathVariable("id") Long id) {
|
||||||
return this.racePaperService.detail(id);
|
return this.racePaperService.detail(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拷贝功能
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
@PutMapping("/{id}/copy")
|
@PutMapping("/{id}/copy")
|
||||||
public void copy(@PathVariable("id") Long id, @RequestAttribute AccountVO user) {
|
public void copy(@PathVariable("id") Long id, @RequestAttribute AccountVO user) {
|
||||||
this.racePaperService.copy(id, user);
|
this.racePaperService.copy(id, user);
|
||||||
@ -77,6 +103,14 @@ public class RacePaperController {
|
|||||||
racePaperService.delete(id);
|
racePaperService.delete(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取试卷对应模块的模块任务树
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param moduleId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
@GetMapping("/{paperId}/module/{moduleId}/task")
|
@GetMapping("/{paperId}/module/{moduleId}/task")
|
||||||
public RacePaperSingleModuleGroupTask paperModuleTask(@PathVariable("paperId") Long id, @PathVariable("moduleId") Integer moduleId) {
|
public RacePaperSingleModuleGroupTask paperModuleTask(@PathVariable("paperId") Long id, @PathVariable("moduleId") Integer moduleId) {
|
||||||
return this.racePaperService.singlePaperModuleTask(id, moduleId);
|
return this.racePaperService.singlePaperModuleTask(id, moduleId);
|
||||||
|
@ -27,23 +27,45 @@ public class RaceSceneController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RaceSceneService sceneService;
|
private RaceSceneService sceneService;
|
||||||
|
|
||||||
//草稿实训发布到场景
|
/**
|
||||||
|
* 草稿实训发布到场景
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
@PostMapping("/publish/training")
|
@PostMapping("/publish/training")
|
||||||
public void publishHere(@RequestBody RaceScenePublishVO vo, @RequestAttribute AccountVO user) {
|
public void publishHere(@RequestBody RaceScenePublishVO vo, @RequestAttribute AccountVO user) {
|
||||||
this.sceneService.publishHere(vo, user);
|
this.sceneService.publishHere(vo, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取明细
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public RaceSceneVO detail(@PathVariable("id") Long id) {
|
public RaceSceneVO detail(@PathVariable("id") Long id) {
|
||||||
return this.sceneService.detail(id);
|
return this.sceneService.detail(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public PageVO<RaceSceneListVO> page(RaceSceneQueryVO query) {
|
public PageVO<RaceSceneListVO> page(RaceSceneQueryVO query) {
|
||||||
return this.sceneService.page(query);
|
return this.sceneService.page(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public void delete(@PathVariable("id") Long id) {
|
public void delete(@PathVariable("id") Long id) {
|
||||||
this.sceneService.delete(id);
|
this.sceneService.delete(id);
|
||||||
|
@ -28,31 +28,58 @@ public class RaceScoreRuleController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RaceScoreRuleService scoreRuleService;
|
private RaceScoreRuleService scoreRuleService;
|
||||||
|
|
||||||
|
/**
|
||||||
//任务评分的大致流程
|
* 1.创建基础信息
|
||||||
//1.创建基础信息
|
*
|
||||||
//2.编辑评分具体的内容
|
* @param nameMap
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public void saveBasic(@RequestBody Map<String, String> nameMap, @RequestAttribute AccountVO user) {
|
public void saveBasic(@RequestBody Map<String, String> nameMap, @RequestAttribute AccountVO user) {
|
||||||
this.scoreRuleService.saveBasic(nameMap.get("name"), user);
|
this.scoreRuleService.saveBasic(nameMap.get("name"), user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评分配置
|
||||||
|
*
|
||||||
|
* @param ruleId
|
||||||
|
* @param rule
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
@PostMapping("/edit/rule/{ruleId}")
|
@PostMapping("/edit/rule/{ruleId}")
|
||||||
public void editRule(@PathVariable("ruleId") Long ruleId, @RequestBody Rule rule, @RequestAttribute AccountVO user) {
|
public void editRule(@PathVariable("ruleId") Long ruleId, @RequestBody Rule rule, @RequestAttribute AccountVO user) {
|
||||||
this.scoreRuleService.editRule(ruleId, rule, user);
|
this.scoreRuleService.editRule(ruleId, rule, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public RaceScoringRuleVO detail(@PathVariable("id") Long id) {
|
public RaceScoringRuleVO detail(@PathVariable("id") Long id) {
|
||||||
return this.scoreRuleService.detail(id);
|
return this.scoreRuleService.detail(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public PageVO<RaceScoringRuleListVO> page(TaskRuleQueryVO query) {
|
public PageVO<RaceScoringRuleListVO> page(TaskRuleQueryVO query) {
|
||||||
return this.scoreRuleService.page(query);
|
return this.scoreRuleService.page(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
|
||||||
@DeleteMapping("{id}")
|
@DeleteMapping("{id}")
|
||||||
public void delete(@PathVariable("id") Long id) {
|
public void delete(@PathVariable("id") Long id) {
|
||||||
this.scoreRuleService.delete(id);
|
this.scoreRuleService.delete(id);
|
||||||
|
@ -28,7 +28,7 @@ public class RaceSeasonController {
|
|||||||
private RaceSeasonService raceSeasonService;
|
private RaceSeasonService raceSeasonService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加编辑
|
* 添加
|
||||||
*
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @param user
|
* @param user
|
||||||
@ -38,6 +38,13 @@ public class RaceSeasonController {
|
|||||||
this.raceSeasonService.save(dto, user);
|
this.raceSeasonService.save(dto, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param dto
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
@PostMapping("/{id}")
|
@PostMapping("/{id}")
|
||||||
public void update(@PathVariable("id") Long id, @RequestBody RaceSeasonCreateVO dto, @RequestAttribute AccountVO user) {
|
public void update(@PathVariable("id") Long id, @RequestBody RaceSeasonCreateVO dto, @RequestAttribute AccountVO user) {
|
||||||
this.raceSeasonService.update(id, dto, user);
|
this.raceSeasonService.update(id, dto, user);
|
||||||
@ -55,6 +62,11 @@ public class RaceSeasonController {
|
|||||||
return raceSeasonService.page(query);
|
return raceSeasonService.page(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
//绑定过的数据不能删除,没有绑定的可以删除(物理删除)
|
//绑定过的数据不能删除,没有绑定的可以删除(物理删除)
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public void delete(@PathVariable("id") Long id) {
|
public void delete(@PathVariable("id") Long id) {
|
||||||
|
@ -47,23 +47,44 @@ public class RaceTaskController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//返回基本信息id,name
|
/**
|
||||||
|
* 返回任务数据以"树"的结构
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping("/tree")
|
@GetMapping("/tree")
|
||||||
public List<RaceTaskTreeVO> tree() {
|
public List<RaceTaskTreeVO> tree() {
|
||||||
return this.taskService.tree();
|
return this.taskService.tree();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public void delete(@PathVariable("id") Long id) {
|
public void delete(@PathVariable("id") Long id) {
|
||||||
this.taskService.delete(id);
|
this.taskService.delete(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一个节点下的所有数据
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping("/{id}/children")
|
@GetMapping("/{id}/children")
|
||||||
public List<RaceTaskTreeVO> childList(@PathVariable("id") Long id) {
|
public List<RaceTaskTreeVO> childList(@PathVariable("id") Long id) {
|
||||||
return this.taskService.findChildren(id);
|
return this.taskService.findChildren(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一个节点的明细
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public RaceTaskDetailVO detail(@PathVariable("id") Long id) {
|
public RaceTaskDetailVO detail(@PathVariable("id") Long id) {
|
||||||
return this.taskService.detail(id);
|
return this.taskService.detail(id);
|
||||||
|
@ -205,6 +205,13 @@ public class RacePaperService {
|
|||||||
return modultTask.build();
|
return modultTask.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模块下的所有数据包括"树"
|
||||||
|
*
|
||||||
|
* @param groupList
|
||||||
|
* @param allTaskMapList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
private List<RaceTaskChildVO> singleTreeConvertModuleGroup(List<RacePaperModuleVO.Group> groupList, Map<Long, List<RaceTaskDetailDTO>> allTaskMapList) {
|
private List<RaceTaskChildVO> singleTreeConvertModuleGroup(List<RacePaperModuleVO.Group> groupList, Map<Long, List<RaceTaskDetailDTO>> allTaskMapList) {
|
||||||
List<RaceTaskChildVO> groups = new ArrayList<>();
|
List<RaceTaskChildVO> groups = new ArrayList<>();
|
||||||
for (RacePaperModuleVO.Group group : groupList) {
|
for (RacePaperModuleVO.Group group : groupList) {
|
||||||
@ -224,43 +231,13 @@ public class RacePaperService {
|
|||||||
return groups;
|
return groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* public RacePaperModuleTask paperModuleTask(Long paperId, Integer moduleId) {
|
/**
|
||||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(moduleId), "请选择对应的模型");
|
* 获取任务树的根节点
|
||||||
RacePaperDetailVO detailVO = this.detail(paperId);
|
*
|
||||||
RacePaperModuleVO moduleVO = detailVO.getModuleVo();
|
* @param taskId
|
||||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(!CollectionUtils.isEmpty(moduleVO.getModulesList()), "此试卷没有模块数据");
|
* @param allTaskMapList
|
||||||
PaperModule pm = moduleVO.getModulesList().stream().filter(d -> d.getCustomModuleId() == moduleId).findFirst().orElse(null);
|
* @return
|
||||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(pm), "没有找到对应的模块");
|
*/
|
||||||
|
|
||||||
List<Long> allGroupTaskIds = this.collectAllTaskIds(pm.getGroupList());
|
|
||||||
Map<Long, List<RaceTaskDetailDTO>> taskMapList = this.taskService.recursiveFindTask(allGroupTaskIds);
|
|
||||||
RacePaperModuleTask.Builder modultTask = RacePaperModuleTask.newBuilder();
|
|
||||||
modultTask.setCustomModuleId(pm.getCustomModuleId());
|
|
||||||
List<PaperModuleGroup> convertGroupList = this.convertModuleGroup(pm.getGroupList(), taskMapList);
|
|
||||||
modultTask.addAllModuleGroup(convertGroupList);
|
|
||||||
return modultTask.build();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
private List<PaperModuleGroup> convertModuleGroup(List<RacePaperModuleVO.Group> groupList, Map<Long, List<RaceTaskDetailDTO>> allTaskMapList) {
|
|
||||||
List<PaperModuleGroup> groups = new ArrayList<>();
|
|
||||||
for (RacePaperModuleVO.Group group : groupList) {
|
|
||||||
PaperModuleGroup.Builder groupBuilder = PaperModuleGroup.newBuilder();
|
|
||||||
groupBuilder.setGroupName(group.getName());
|
|
||||||
for (Long taskId : group.getTaskIdsList()) {
|
|
||||||
RaceTaskChildVO taskVO = this.findTask(taskId, allTaskMapList);
|
|
||||||
groupBuilder.addTreeData(taskVO);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(group.getGroupList())) {
|
|
||||||
List<PaperModuleGroup> childGroup = this.convertModuleGroup(group.getGroupList(), allTaskMapList);
|
|
||||||
groupBuilder.addAllModuleGroup(childGroup);
|
|
||||||
}
|
|
||||||
groups.add(groupBuilder.build());
|
|
||||||
}
|
|
||||||
return groups;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
private RaceTaskChildVO findTask(Long taskId, Map<Long, List<RaceTaskDetailDTO>> allTaskMapList) {
|
private RaceTaskChildVO findTask(Long taskId, Map<Long, List<RaceTaskDetailDTO>> allTaskMapList) {
|
||||||
List<RaceTaskDetailDTO> dtoList = allTaskMapList.get(RaceTaskService.TASK_ROOT_ID);
|
List<RaceTaskDetailDTO> dtoList = allTaskMapList.get(RaceTaskService.TASK_ROOT_ID);
|
||||||
RaceTaskDetailDTO taskDto = dtoList.stream().filter(d -> Objects.equals(d.getId(), taskId)).findFirst().orElse(null);
|
RaceTaskDetailDTO taskDto = dtoList.stream().filter(d -> Objects.equals(d.getId(), taskId)).findFirst().orElse(null);
|
||||||
@ -270,6 +247,13 @@ public class RacePaperService {
|
|||||||
return vo.build();
|
return vo.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任务树的所有子节点
|
||||||
|
*
|
||||||
|
* @param vob
|
||||||
|
* @param allTaskMapList
|
||||||
|
*/
|
||||||
|
|
||||||
private void findChildTask(RaceTaskChildVO.Builder vob, Map<Long, List<RaceTaskDetailDTO>> allTaskMapList) {
|
private void findChildTask(RaceTaskChildVO.Builder vob, Map<Long, List<RaceTaskDetailDTO>> allTaskMapList) {
|
||||||
List<RaceTaskDetailDTO> childDto = allTaskMapList.get(vob.getId());
|
List<RaceTaskDetailDTO> childDto = allTaskMapList.get(vob.getId());
|
||||||
if (!CollectionUtils.isEmpty(childDto)) {
|
if (!CollectionUtils.isEmpty(childDto)) {
|
||||||
@ -307,6 +291,12 @@ public class RacePaperService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收集模块及子模块所有的任务id
|
||||||
|
*
|
||||||
|
* @param groupList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
private List<Long> collectAllTaskIds(List<RacePaperModuleVO.Group> groupList) {
|
private List<Long> collectAllTaskIds(List<RacePaperModuleVO.Group> groupList) {
|
||||||
List<Long> allTaskIds = Lists.newArrayList();
|
List<Long> allTaskIds = Lists.newArrayList();
|
||||||
for (RacePaperModuleVO.Group group : groupList) {
|
for (RacePaperModuleVO.Group group : groupList) {
|
||||||
@ -315,6 +305,12 @@ public class RacePaperService {
|
|||||||
return allTaskIds.stream().distinct().collect(Collectors.toList());
|
return allTaskIds.stream().distinct().collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收集所有子级任务ID
|
||||||
|
*
|
||||||
|
* @param group
|
||||||
|
* @param collectorList
|
||||||
|
*/
|
||||||
private void collectTaskIds(RacePaperModuleVO.Group group, List<Long> collectorList) {
|
private void collectTaskIds(RacePaperModuleVO.Group group, List<Long> collectorList) {
|
||||||
collectorList.addAll(group.getTaskIdsList());
|
collectorList.addAll(group.getTaskIdsList());
|
||||||
if (!CollectionUtils.isEmpty(group.getGroupList())) {
|
if (!CollectionUtils.isEmpty(group.getGroupList())) {
|
||||||
@ -322,6 +318,5 @@ public class RacePaperService {
|
|||||||
this.collectTaskIds(group1, collectorList);
|
this.collectTaskIds(group1, collectorList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -180,6 +180,12 @@ public class RaceTaskService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归查找taskId下相关的所有数据
|
||||||
|
*
|
||||||
|
* @param taskIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public Map<Long, List<RaceTaskDetailDTO>> recursiveFindTask(List<Long> taskIds) {
|
public Map<Long, List<RaceTaskDetailDTO>> recursiveFindTask(List<Long> taskIds) {
|
||||||
List<RaceTaskDetailDTO> taskDtoList = this.raceTaskDAO.recursiveFindTask(taskIds);
|
List<RaceTaskDetailDTO> taskDtoList = this.raceTaskDAO.recursiveFindTask(taskIds);
|
||||||
Map<Long, List<RaceTaskDetailDTO>> dtoMapList = taskDtoList.stream().collect(Collectors.groupingBy(RaceTaskDetailDTO::getParentId));
|
Map<Long, List<RaceTaskDetailDTO>> dtoMapList = taskDtoList.stream().collect(Collectors.groupingBy(RaceTaskDetailDTO::getParentId));
|
||||||
|
Loading…
Reference in New Issue
Block a user