|
@@ -1,5 +1,7 @@
|
|
|
package com.ruoyi.web.controller.learn;
|
|
package com.ruoyi.web.controller.learn;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
+import com.ruoyi.common.annotation.Anonymous;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult2;
|
|
import com.ruoyi.common.core.domain.AjaxResult2;
|
|
@@ -14,10 +16,15 @@ import com.ruoyi.web.service.LearnTeacherService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
|
|
+import java.util.Collections;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/learn/teaching")
|
|
@RequestMapping("/learn/teaching")
|
|
@@ -26,13 +33,11 @@ public class LearnTeacherController extends BaseController {
|
|
|
private final IDzControlService dzControlService;
|
|
private final IDzControlService dzControlService;
|
|
|
private final IDzSubjectService dzSubjectService;
|
|
private final IDzSubjectService dzSubjectService;
|
|
|
private final LearnTeacherService learnTeacherService;
|
|
private final LearnTeacherService learnTeacherService;
|
|
|
- private final IAMarjorPlanService marjorPlanService;
|
|
|
|
|
|
|
|
|
|
- public LearnTeacherController(IDzControlService dzControlService, IDzSubjectService dzSubjectService, LearnTeacherService learnTeacherService, IAMarjorPlanService marjorPlanService) {
|
|
|
|
|
|
|
+ public LearnTeacherController(IDzControlService dzControlService, IDzSubjectService dzSubjectService, LearnTeacherService learnTeacherService) {
|
|
|
this.dzControlService = dzControlService;
|
|
this.dzControlService = dzControlService;
|
|
|
this.dzSubjectService = dzSubjectService;
|
|
this.dzSubjectService = dzSubjectService;
|
|
|
this.learnTeacherService = learnTeacherService;
|
|
this.learnTeacherService = learnTeacherService;
|
|
|
- this.marjorPlanService = marjorPlanService;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -46,6 +51,43 @@ public class LearnTeacherController extends BaseController {
|
|
|
-- 9. 设置题型数量(预置题型要求,或人工指定,不指定时平均分配, 题型是针对院校的)
|
|
-- 9. 设置题型数量(预置题型要求,或人工指定,不指定时平均分配, 题型是针对院校的)
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping(value = "provinces")
|
|
|
|
|
+ @Anonymous
|
|
|
|
|
+ @ApiOperation("省份列表")
|
|
|
|
|
+ public AjaxResult provinces()
|
|
|
|
|
+ {
|
|
|
|
|
+ DzControl cond = new DzControl();
|
|
|
|
|
+ cond.setIsValid(1);
|
|
|
|
|
+ return AjaxResult.success(dzControlService.selectDzControlList(cond).stream().map(t -> {
|
|
|
|
|
+ JSONObject o = new JSONObject();
|
|
|
|
|
+ o.put("dictValue", t.getLocation());
|
|
|
|
|
+ o.put("dictLabel", t.getLocation());
|
|
|
|
|
+ return o;
|
|
|
|
|
+ }).collect(Collectors.toList()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @GetMapping(value = "examTypes")
|
|
|
|
|
+ @Anonymous
|
|
|
|
|
+ @ApiOperation("考生类型列表")
|
|
|
|
|
+ public AjaxResult examTypes(@RequestParam String location)
|
|
|
|
|
+ {
|
|
|
|
|
+ DzControl cond = new DzControl();
|
|
|
|
|
+ cond.setIsValid(1);
|
|
|
|
|
+ cond.setLocation(location);
|
|
|
|
|
+ List<DzControl> list = dzControlService.selectDzControlList(cond);
|
|
|
|
|
+ String examTypes;
|
|
|
|
|
+ if(CollectionUtils.isEmpty(list) || StringUtils.isBlank(examTypes = list.get(0).getExamTypes())) {
|
|
|
|
|
+ return AjaxResult.success(Collections.emptyList());
|
|
|
|
|
+ }
|
|
|
|
|
+ return AjaxResult.success(Arrays.stream(examTypes.split(",")).map(t -> {
|
|
|
|
|
+ JSONObject o = new JSONObject();
|
|
|
|
|
+ o.put("dictValue", t);
|
|
|
|
|
+ o.put("dictLabel", ExamType.valueOf(t).title());
|
|
|
|
|
+ return o;
|
|
|
|
|
+ }).collect(Collectors.toList()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@GetMapping("/classes")
|
|
@GetMapping("/classes")
|
|
|
@ApiOperation("2. 班级列表")
|
|
@ApiOperation("2. 班级列表")
|
|
|
public AjaxResult classes()
|
|
public AjaxResult classes()
|
|
@@ -55,17 +97,17 @@ public class LearnTeacherController extends BaseController {
|
|
|
|
|
|
|
|
@GetMapping("/universities")
|
|
@GetMapping("/universities")
|
|
|
@ApiOperation("院校列表")
|
|
@ApiOperation("院校列表")
|
|
|
- public AjaxResult universities()
|
|
|
|
|
|
|
+ public AjaxResult universities(@ApiParam("批次ID") Long batchId)
|
|
|
{
|
|
{
|
|
|
- return AjaxResult.success(learnTeacherService.selectUniversityList(getUserId()));
|
|
|
|
|
|
|
+ return AjaxResult.success(learnTeacherService.selectUniversityList(getUserId(), batchId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/majors")
|
|
@GetMapping("/majors")
|
|
|
@ApiOperation("专业列表")
|
|
@ApiOperation("专业列表")
|
|
|
- public AjaxResult majors(@ApiParam("省份") String location, @ApiParam("考生类型") ExamType examType, @RequestParam(required = false) @ApiParam("院校列表") Long universityId)
|
|
|
|
|
|
|
+ public AjaxResult majors(@ApiParam("省份") String location, @ApiParam("考生类型") ExamType examType, @ApiParam("批次ID") Long batchId, @RequestParam(required = false) @ApiParam("院校列表") Long universityId)
|
|
|
{
|
|
{
|
|
|
DzControl control = dzControlService.selectDzControl(location, examType);
|
|
DzControl control = dzControlService.selectDzControl(location, examType);
|
|
|
- return AjaxResult.success(learnTeacherService.selectMajorList(universityId, control.getPlanYear()));
|
|
|
|
|
|
|
+ return AjaxResult.success(learnTeacherService.selectMajorList(universityId, control.getPlanYear(), batchId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/subjects")
|
|
@GetMapping("/subjects")
|