|
@@ -0,0 +1,105 @@
|
|
|
+package com.qmth.paper.library.api;
|
|
|
+
|
|
|
+
|
|
|
+import com.qmth.boot.api.annotation.Aac;
|
|
|
+import com.qmth.boot.api.annotation.BOOL;
|
|
|
+import com.qmth.boot.api.constant.ApiConstant;
|
|
|
+import com.qmth.paper.library.business.bean.result.EditResult;
|
|
|
+import com.qmth.paper.library.business.bean.result.SelectResult;
|
|
|
+import com.qmth.paper.library.business.service.PaperArchivesService;
|
|
|
+import com.qmth.paper.library.business.service.PaperArchivesTypeService;
|
|
|
+import com.qmth.paper.library.business.service.PaperScanTaskService;
|
|
|
+import com.qmth.paper.library.common.entity.BasicSemester;
|
|
|
+import com.qmth.paper.library.common.service.BasicSemesterService;
|
|
|
+import com.qmth.paper.library.common.util.Result;
|
|
|
+import com.qmth.paper.library.common.util.ResultUtil;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 查询 前端控制器
|
|
|
+ * </p>
|
|
|
+ */
|
|
|
+@Api(tags = "查询条件Controller")
|
|
|
+@RestController
|
|
|
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.common}")
|
|
|
+@Validated
|
|
|
+@Aac(strict = BOOL.FALSE, auth = BOOL.FALSE)
|
|
|
+public class ConditionController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ PaperArchivesService paperArchivesService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ BasicSemesterService basicSemesterService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ PaperArchivesTypeService paperArchivesTypeService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ PaperScanTaskService paperScanTaskService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "查询条件-学期")
|
|
|
+ @PostMapping("/semester/query")
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
|
|
|
+ public Result querySemester() {
|
|
|
+ List<BasicSemester> semesters = basicSemesterService.querySemester();
|
|
|
+ List<SelectResult> resultList = semesters.stream().map(m -> {
|
|
|
+ SelectResult result = new SelectResult();
|
|
|
+ result.setId(m.getId());
|
|
|
+ result.setCode(m.getCode());
|
|
|
+ result.setName(m.getName());
|
|
|
+ return result;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ return ResultUtil.ok(resultList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "查询条件-档案")
|
|
|
+ @PostMapping("/archives/query")
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
|
|
|
+ public Result queryArchives(@ApiParam(value = "学期ID") @RequestParam(required = false) Long semesterId) {
|
|
|
+ return ResultUtil.ok(paperArchivesService.queryArchives(semesterId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "查询条件-档案管理部门")
|
|
|
+ @PostMapping("/_manager_org/query")
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
|
|
|
+ public Result queryManagerOrg(@RequestParam(value = "semesterId", required = false) Long semesterId) {
|
|
|
+ return ResultUtil.ok(paperArchivesService.queryManagerOrg(semesterId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "查询条件-档案类型")
|
|
|
+ @PostMapping("/archives_type/query")
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
|
|
|
+ public Result queryArchivesType() {
|
|
|
+ return ResultUtil.ok(paperArchivesTypeService.queryArchivesType());
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "查询条件-课程")
|
|
|
+ @PostMapping("/course/query")
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = EditResult.class)})
|
|
|
+ public Result queryCourse(@ApiParam(value = "档案id") @RequestParam Long paperArchivesId,
|
|
|
+ @ApiParam(value = "学期id") @RequestParam Long semesterId) {
|
|
|
+ List<SelectResult> courseList = paperScanTaskService.queryCourse(paperArchivesId, semesterId);
|
|
|
+ return ResultUtil.ok(courseList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "查询条件-教学班")
|
|
|
+ @PostMapping("/teach_clazz/query")
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = EditResult.class)})
|
|
|
+ public Result queryTeachClazz(@ApiParam(value = "档案id") @RequestParam Long paperArchivesId,
|
|
|
+ @ApiParam(value = "课程id") @RequestParam String courseName) {
|
|
|
+ List<SelectResult> teachClazzList = paperScanTaskService.queryDataTeachClazz(paperArchivesId, courseName);
|
|
|
+ return ResultUtil.ok(teachClazzList);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|