基于javaweb+mysql的springboot平行志愿管理系统(java+springboot+maven+mybatis+vue+mysql)

基于javaweb+mysql的springboot平行志愿管理系统(java+springboot+maven+mybatis+vue+mysql)

运行环境

Java≥8、MySQL≥5.7、Node.js≥10

开发工具

后端:eclipse/idea/myeclipse/sts等均可配置运行

前端:WebStorm/VSCode/HBuilderX等均可

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb+mysql的SpringBoot平行志愿管理系统(java+springboot+maven+mybatis+vue+mysql)

一、项目简述本系统功能包括: 系统管理,招生计划,学生管理,录取结果,自动分配,调剂管理等等。

二、项目运行 环境配置:

Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。

项目技术:

Springboot + Maven + mybatis+ Vue 等等组成,B/S模式 + Maven管理等等。

     * @param null
     * @return
     * @throws
     */
    @RequestMapping("/getResultByDepartment")
    @Deprecated
    public JsonResponse getResultByDepartment(int departmentId, @RequestParam(required = false, defaultValue = "1") int currentPage, @RequestParam(required = false, defaultValue = "false") boolean desc){
        return new JsonResponse(JsonResponse.OK, studentService.getResultByDepartment(departmentId, currentPage, desc), null);
    }
//    StatisticsResult getResultByMajor( String majorId, int currentPage, boolean desc);
    @RequestMapping("/getResultByMajor")
    @Deprecated
    public JsonResponse getResultByMajor(String majorId, @RequestParam(required = false, defaultValue = "1") int currentPage, @RequestParam(required = false, defaultValue = "false") boolean desc){
        return new JsonResponse(JsonResponse.OK, studentService.getResultByMajor(majorId, currentPage, desc), null);
    }

    @RequestMapping("/searchStudent")
    @Deprecated
    public JsonResponse searchStudent(@RequestParam(required = false, defaultValue = "1") int currentPage,String keyword){
        return new JsonResponse(JsonResponse.OK, studentService.searchStudent(currentPage,keyword), null);
    }

    @RequestMapping("/searchStudentByCandidate")
    public JsonResponse searchStudentByCandidate(@RequestParam(required = false, defaultValue = "1") int currentPage,String keyword){
        return new JsonResponse(JsonResponse.OK, studentService.searchStudentByCandidate(currentPage,keyword), null);
    }

    @RequestMapping("/getStudentBeforeRank")
    public JsonResponse getStudentBeforeRank(@RequestParam(required = false, defaultValue = "1") int currentPage, int rank){
        return new JsonResponse(JsonResponse.OK, studentService.getStudentBeforeRank(currentPage, rank), null);
    }

    @RequestMapping("/getStatisticsResult")
    public JsonResponse getStatisticsResult(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResult(), null);
    }
//    List<Map<String, Object>> getResultInDepartment(int departmentId);
    @RequestMapping("/getStatisticsResultInDepartment")
    public JsonResponse getStatisticsResultInDepartment(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResultInDepartment(), null);
    }
//    List<Map<String, Object>> getResultInMajor(String majorId);
    @RequestMapping("/getStatisticsResultInMajor")
    public JsonResponse getStatisticsResultInMajor(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResultInMajor(), null);
    }
    public JsonResponse getGradeDistributeByMajor(String majorId){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistributeByMajor(majorId), null);
    }
    //    Map<String, Integer> getCountDistributeInDepartment();
    @RequestMapping("/getCountDistributeInDepartment")
    public JsonResponse getCountDistributeInDepartment(){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInDepartment(), null);
    }
    //    Map<String, Integer> getCountDistributeInMajor();
    @RequestMapping("/getCountDistributeInMajor")
    public JsonResponse getCountDistributeInMajor(){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInMajor(), null);
    }
    //    Map<String, Integer> getCountDistributeInMajorByDepartment(int departmentId);
    @RequestMapping("/getCountDistributeInMajorByDepartment")
    public JsonResponse getCountDistributeInMajorByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInMajorByDepartment(departmentId), null);
    }

    @RequestMapping("/reset")
    @Deprecated
    public JsonResponse reset(){
        studentService.reset();
        return new JsonResponse(JsonResponse.OK, null, null);
    }

    @RequestMapping("/formalReady")
    @Deprecated
    public JsonResponse formalReady(){
        studentService.formallyReady();
        return new JsonResponse(JsonResponse.OK, null, null);
    }
}

    public JsonResponse getMajorPlan(){
        return new JsonResponse(JsonResponse.OK, majorService.getMajorPlan(), null);
    }

    @RequestMapping("/updateMajorPlan")
    public JsonResponse updateMajorPlan(String majorId, int count){
        if (count < 0) return new JsonResponse(JsonResponse.INVALID_REQUEST, null, "输入数字不正确");
        majorService.updateMajorPlan(majorId, count );
        return new JsonResponse(JsonResponse.OK, null, null);
    }

    @RequestMapping("/getMajors")
    public JsonResponse getMajors(){
        return new JsonResponse(JsonResponse.OK, majorService.getMajors(), null);
    }

    @RequestMapping("/getMajorsByDepartment")
    public JsonResponse getMajorsByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, majorService.getMajorsByDepartment(departmentId), null);
    }
}

@ControllerAdvice
public class GlobalExceptionHandler {

    @ResponseBody
    @ExceptionHandler({ReadExcelException.class})
    public JsonResponse handleExcelException(ReadExcelException e) {
        return new JsonResponse(JsonResponse.INVALID_REQUEST, null, "导入Excel失败,请检查文件格式");
    }

    @ResponseBody
        storage.remove("authSession");
        return new JsonResponse(JsonResponse.OK, null, "注销成功");
    }
}

@RestController
@RequestMapping("/major")
public class MajorController {

    @Autowired
    private IMajorService majorService;

    @RequestMapping("/getMajorPlan")
    public JsonResponse getMajorPlan(){
        return new JsonResponse(JsonResponse.OK, majorService.getMajorPlan(), null);
    }

    @RequestMapping("/updateMajorPlan")
    public JsonResponse updateMajorPlan(String majorId, int count){
        if (count < 0) return new JsonResponse(JsonResponse.INVALID_REQUEST, null, "输入数字不正确");
        majorService.updateMajorPlan(majorId, count );
        return new JsonResponse(JsonResponse.OK, null, null);
    }

    @RequestMapping("/getMajors")
    public JsonResponse getMajors(){
        return new JsonResponse(JsonResponse.OK, majorService.getMajors(), null);
    }

    @RequestMapping("/getMajorsByDepartment")
    public JsonResponse getMajorsByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, majorService.getMajorsByDepartment(departmentId), null);
    }
}

    @RequestMapping("/getDistributeInProvince")
    public JsonResponse getDistributeInProvince(String province){
        return new JsonResponse(JsonResponse.OK, studentService.getDistributeInProvince(province), null);
    }
    //    Map<String, Integer> getGradeDistribute();
    @RequestMapping("/getGradeDistribute")
    public JsonResponse getGradeDistribute(){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistribute(), null);
    }
    //    Map<String, Integer> getGradeDistributeByDepartment( int departmentId);
    @RequestMapping("/getGradeDistributeByDepartment")
    public JsonResponse getGradeDistributeByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistributeByDepartment(departmentId), null);
    }
    //    Map<String, Integer> getGradeDistributeByMajor(String majorId);
    @RequestMapping("/getGradeDistributeByMajor")
    public JsonResponse getGradeDistributeByMajor(String majorId){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistributeByMajor(majorId), null);
    }
    //    Map<String, Integer> getCountDistributeInDepartment();
    @RequestMapping("/getCountDistributeInDepartment")
    public JsonResponse getCountDistributeInDepartment(){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInDepartment(), null);
    }
    //    Map<String, Integer> getCountDistributeInMajor();
    @RequestMapping("/getCountDistributeInMajor")
    public JsonResponse getCountDistributeInMajor(){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInMajor(), null);
    }
    //    Map<String, Integer> getCountDistributeInMajorByDepartment(int departmentId);
    @RequestMapping("/getCountDistributeInMajorByDepartment")
    public JsonResponse getCountDistributeInMajorByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInMajorByDepartment(departmentId), null);
    }

    @RequestMapping("/reset")
    @Deprecated
    public JsonResponse reset(){
        studentService.reset();
        return new JsonResponse(JsonResponse.OK, null, null);
    }

    @RequestMapping("/formalReady")
    @Deprecated
    public JsonResponse formalReady(){
        studentService.formallyReady();

    @Autowired
    private IStatusService statusService;

    @RequestMapping("/getStatus")
    public JsonResponse getStatus(){
        return new JsonResponse(JsonResponse.OK, statusService.getStatus(), null);
    }

    @RequestMapping("/getLogList")
    public JsonResponse getLogList(){
        return new JsonResponse(JsonResponse.OK, statusService.getLogList(), null);
    }

    @RequestMapping("/reset")
    public JsonResponse reset() {
        statusService.reset();
        return new JsonResponse(JsonResponse.OK, null, null);
    }
}

@Component
public class LoginInterceptor implements HandlerInterceptor {

    @Resource(name = "globalStorage")
    Map<String, Object> storage;

    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//        if(request.getSession().equals(storage.get("authSession")))
//            return true;
        return new JsonResponse(JsonResponse.OK, studentService.getDistributeInProvince(province), null);
    }
    //    Map<String, Integer> getGradeDistribute();
    @RequestMapping("/getGradeDistribute")
    public JsonResponse getGradeDistribute(){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistribute(), null);
    }
    //    Map<String, Integer> getGradeDistributeByDepartment( int departmentId);
    @RequestMapping("/getGradeDistributeByDepartment")
    public JsonResponse getGradeDistributeByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistributeByDepartment(departmentId), null);
    }
    //    Map<String, Integer> getGradeDistributeByMajor(String majorId);
    @RequestMapping("/getGradeDistributeByMajor")
    public JsonResponse getGradeDistributeByMajor(String majorId){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistributeByMajor(majorId), null);
    }
    //    Map<String, Integer> getCountDistributeInDepartment();
    @RequestMapping("/getCountDistributeInDepartment")
    public JsonResponse getCountDistributeInDepartment(){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInDepartment(), null);
    }
    //    Map<String, Integer> getCountDistributeInMajor();
    @RequestMapping("/getCountDistributeInMajor")
    public JsonResponse getCountDistributeInMajor(){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInMajor(), null);
    }
    //    Map<String, Integer> getCountDistributeInMajorByDepartment(int departmentId);
    @RequestMapping("/getCountDistributeInMajorByDepartment")
    public JsonResponse getCountDistributeInMajorByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInMajorByDepartment(departmentId), null);
    }

    @RequestMapping("/reset")
    @Deprecated
    public JsonResponse reset(){
        studentService.reset();
        return new JsonResponse(JsonResponse.OK, null, null);
    }

    @RequestMapping("/formalReady")
    @Deprecated
    public JsonResponse formalReady(){
        studentService.formallyReady();
        return new JsonResponse(JsonResponse.OK, null, null);
    }
}
        return new JsonResponse(JsonResponse.OK, null, null);
    }

    @RequestMapping("/formalReady")
    @Deprecated
    public JsonResponse formalReady(){
        studentService.formallyReady();
        return new JsonResponse(JsonResponse.OK, null, null);
    }
}

@Controller
@RequestMapping("/file")
public class FileController {

    @Autowired
    IExcelService excelService;

    @ResponseBody
    @RequestMapping("/uploadMajor")
    public JsonResponse uploadMajorExcel(MultipartFile file) throws IOException {
        excelService.ReadMajorExcel(file);
        return new JsonResponse(JsonResponse.OK,null,null);
    }

    @ResponseBody
    @RequestMapping("/uploadStudent")
    public JsonResponse uploadStudentExcel(MultipartFile file) throws IOException {
        excelService.ReadStudentExcel(file);
        return new JsonResponse(JsonResponse.OK,null,null);
    }
    }
    //    Map<String, Integer> getDistributeInProvince(String province);
    @RequestMapping("/getDistributeInProvince")
    public JsonResponse getDistributeInProvince(String province){
        return new JsonResponse(JsonResponse.OK, studentService.getDistributeInProvince(province), null);
    }
    //    Map<String, Integer> getGradeDistribute();
    @RequestMapping("/getGradeDistribute")
    public JsonResponse getGradeDistribute(){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistribute(), null);
    }
    //    Map<String, Integer> getGradeDistributeByDepartment( int departmentId);
    @RequestMapping("/getGradeDistributeByDepartment")
    public JsonResponse getGradeDistributeByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistributeByDepartment(departmentId), null);
    }
    //    Map<String, Integer> getGradeDistributeByMajor(String majorId);
    @RequestMapping("/getGradeDistributeByMajor")
    public JsonResponse getGradeDistributeByMajor(String majorId){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistributeByMajor(majorId), null);
    }
    //    Map<String, Integer> getCountDistributeInDepartment();
    @RequestMapping("/getCountDistributeInDepartment")
    public JsonResponse getCountDistributeInDepartment(){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInDepartment(), null);
    }
    //    Map<String, Integer> getCountDistributeInMajor();
    @RequestMapping("/getCountDistributeInMajor")
    public JsonResponse getCountDistributeInMajor(){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInMajor(), null);
    }
    //    Map<String, Integer> getCountDistributeInMajorByDepartment(int departmentId);
    @RequestMapping("/getCountDistributeInMajorByDepartment")
    public JsonResponse getCountDistributeInMajorByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInMajorByDepartment(departmentId), null);
    }

    @RequestMapping("/reset")
    @Deprecated
    public JsonResponse reset(){
        studentService.reset();
        return new JsonResponse(JsonResponse.OK, null, null);
    }


@RestController
@RequestMapping("/major")
public class MajorController {

    @Autowired
    private IMajorService majorService;

    @RequestMapping("/getMajorPlan")
    public JsonResponse getMajorPlan(){
        return new JsonResponse(JsonResponse.OK, majorService.getMajorPlan(), null);
    }

    @RequestMapping("/updateMajorPlan")
    public JsonResponse updateMajorPlan(String majorId, int count){
        if (count < 0) return new JsonResponse(JsonResponse.INVALID_REQUEST, null, "输入数字不正确");
        majorService.updateMajorPlan(majorId, count );
        return new JsonResponse(JsonResponse.OK, null, null);
    }

    @RequestMapping("/getMajors")
    public JsonResponse getMajors(){
        return new JsonResponse(JsonResponse.OK, majorService.getMajors(), null);
    }

    @RequestMapping("/getMajorsByDepartment")
    public JsonResponse getMajorsByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, majorService.getMajorsByDepartment(departmentId), null);
    }
}

@ControllerAdvice
public class GlobalExceptionHandler {

    @ResponseBody
    @ExceptionHandler({ReadExcelException.class})
    public JsonResponse handleExcelException(ReadExcelException e) {
        return new JsonResponse(JsonResponse.INVALID_REQUEST, null, "导入Excel失败,请检查文件格式");
    }

    @RequestMapping("/getStudentBeforeRank")
    public JsonResponse getStudentBeforeRank(@RequestParam(required = false, defaultValue = "1") int currentPage, int rank){
        return new JsonResponse(JsonResponse.OK, studentService.getStudentBeforeRank(currentPage, rank), null);
    }

    @RequestMapping("/getStatisticsResult")
    public JsonResponse getStatisticsResult(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResult(), null);
    }
//    List<Map<String, Object>> getResultInDepartment(int departmentId);
    @RequestMapping("/getStatisticsResultInDepartment")
    public JsonResponse getStatisticsResultInDepartment(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResultInDepartment(), null);
    }
//    List<Map<String, Object>> getResultInMajor(String majorId);
    @RequestMapping("/getStatisticsResultInMajor")
    public JsonResponse getStatisticsResultInMajor(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResultInMajor(), null);
    }
    //    Map<String, Integer> getDistribute();
    @RequestMapping("/getDistribute")
    public JsonResponse getDistribute(){
        return new JsonResponse(JsonResponse.OK, studentService.getDistribute(), null);
    }
    //    Map<String, Integer> getDistributeInProvince(String province);
    @RequestMapping("/getDistributeInProvince")
    public JsonResponse getDistributeInProvince(String province){
        return new JsonResponse(JsonResponse.OK, studentService.getDistributeInProvince(province), null);
    }
    //    Map<String, Integer> getGradeDistribute();
    @RequestMapping("/getGradeDistribute")
    public JsonResponse getGradeDistribute(){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistribute(), null);
    }
    //    Map<String, Integer> getGradeDistributeByDepartment( int departmentId);
    @RequestMapping("/getGradeDistributeByDepartment")
    public JsonResponse getGradeDistributeByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistributeByDepartment(departmentId), null);
    }
    //    Map<String, Integer> getGradeDistributeByMajor(String majorId);
    @RequestMapping("/getGradeDistributeByMajor")
    public JsonResponse getGradeDistributeByMajor(String majorId){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistributeByMajor(majorId), null);
    }
    //    Map<String, Integer> getCountDistributeInDepartment();
    @RequestMapping("/getCountDistributeInDepartment")
    public JsonResponse getCountDistributeInDepartment(){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInDepartment(), null);
    //    Map<String, Integer> getDistributeInProvince(String province);
    @RequestMapping("/getDistributeInProvince")
    public JsonResponse getDistributeInProvince(String province){
        return new JsonResponse(JsonResponse.OK, studentService.getDistributeInProvince(province), null);
    }
    //    Map<String, Integer> getGradeDistribute();
    @RequestMapping("/getGradeDistribute")
    public JsonResponse getGradeDistribute(){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistribute(), null);
    }
    //    Map<String, Integer> getGradeDistributeByDepartment( int departmentId);
    @RequestMapping("/getGradeDistributeByDepartment")
    public JsonResponse getGradeDistributeByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistributeByDepartment(departmentId), null);
    }
    //    Map<String, Integer> getGradeDistributeByMajor(String majorId);
    @RequestMapping("/getGradeDistributeByMajor")
    public JsonResponse getGradeDistributeByMajor(String majorId){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistributeByMajor(majorId), null);
    }
    //    Map<String, Integer> getCountDistributeInDepartment();
    @RequestMapping("/getCountDistributeInDepartment")
    public JsonResponse getCountDistributeInDepartment(){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInDepartment(), null);
    }
    //    Map<String, Integer> getCountDistributeInMajor();
    @RequestMapping("/getCountDistributeInMajor")
    public JsonResponse getCountDistributeInMajor(){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInMajor(), null);
    }
    //    Map<String, Integer> getCountDistributeInMajorByDepartment(int departmentId);
    @RequestMapping("/getCountDistributeInMajorByDepartment")
    public JsonResponse getCountDistributeInMajorByDepartment(int departmentId){
        return new JsonResponse(JsonResponse.OK, studentService.getCountDistributeInMajorByDepartment(departmentId), null);
    }

    @RequestMapping("/reset")
    @Deprecated
    public JsonResponse reset(){
        studentService.reset();
        return new JsonResponse(JsonResponse.OK, null, null);
    }

    @RequestMapping("/doAdjust")
    public JsonResponse doAdjust(){
        studentService.doAdjust();
        return new JsonResponse(JsonResponse.OK, null, null);
    }

//    StatisticsResult getResult(int currentPage, boolean desc);
    @RequestMapping("/getResult")
    public JsonResponse getResult(@RequestParam(required = false, defaultValue = "1") int currentPage,
                                  @RequestParam(required = false, defaultValue = "false") boolean desc,
                                  QueryResultOption option){
        return new JsonResponse(JsonResponse.OK, studentService.getResult(currentPage, desc, option), null);
    }
//    StatisticsResult getResultByDepartment( int departmentId, int currentPage, boolean desc);
    /**
     * @description t通过学院、专业、排名查询已弃用,请使用上面的getResult
     * @param null
     * @return
     * @throws
     */
    @RequestMapping("/getResultByDepartment")
    @Deprecated
    public JsonResponse getResultByDepartment(int departmentId, @RequestParam(required = false, defaultValue = "1") int currentPage, @RequestParam(required = false, defaultValue = "false") boolean desc){
        return new JsonResponse(JsonResponse.OK, studentService.getResultByDepartment(departmentId, currentPage, desc), null);
    }
//    StatisticsResult getResultByMajor( String majorId, int currentPage, boolean desc);
    @RequestMapping("/getResultByMajor")
    @Deprecated
    public JsonResponse getResultByMajor(String majorId, @RequestParam(required = false, defaultValue = "1") int currentPage, @RequestParam(required = false, defaultValue = "false") boolean desc){
        return new JsonResponse(JsonResponse.OK, studentService.getResultByMajor(majorId, currentPage, desc), null);
    }

    @RequestMapping("/searchStudent")
    @Deprecated
    public JsonResponse searchStudent(@RequestParam(required = false, defaultValue = "1") int currentPage,String keyword){
        return new JsonResponse(JsonResponse.OK, studentService.searchStudent(currentPage,keyword), null);
    }

    @RequestMapping("/searchStudentByCandidate")
    public JsonResponse searchStudentByCandidate(@RequestParam(required = false, defaultValue = "1") int currentPage,String keyword){
        return new JsonResponse(JsonResponse.OK, studentService.getResult(currentPage, desc, option), null);
    }
//    StatisticsResult getResultByDepartment( int departmentId, int currentPage, boolean desc);
    /**
     * @description t通过学院、专业、排名查询已弃用,请使用上面的getResult
     * @param null
     * @return
     * @throws
     */
    @RequestMapping("/getResultByDepartment")
    @Deprecated
    public JsonResponse getResultByDepartment(int departmentId, @RequestParam(required = false, defaultValue = "1") int currentPage, @RequestParam(required = false, defaultValue = "false") boolean desc){
        return new JsonResponse(JsonResponse.OK, studentService.getResultByDepartment(departmentId, currentPage, desc), null);
    }
//    StatisticsResult getResultByMajor( String majorId, int currentPage, boolean desc);
    @RequestMapping("/getResultByMajor")
    @Deprecated
    public JsonResponse getResultByMajor(String majorId, @RequestParam(required = false, defaultValue = "1") int currentPage, @RequestParam(required = false, defaultValue = "false") boolean desc){
        return new JsonResponse(JsonResponse.OK, studentService.getResultByMajor(majorId, currentPage, desc), null);
    }

    @RequestMapping("/searchStudent")
    @Deprecated
    public JsonResponse searchStudent(@RequestParam(required = false, defaultValue = "1") int currentPage,String keyword){
        return new JsonResponse(JsonResponse.OK, studentService.searchStudent(currentPage,keyword), null);
    }

    @RequestMapping("/searchStudentByCandidate")
    public JsonResponse searchStudentByCandidate(@RequestParam(required = false, defaultValue = "1") int currentPage,String keyword){
        return new JsonResponse(JsonResponse.OK, studentService.searchStudentByCandidate(currentPage,keyword), null);
    }

    @RequestMapping("/getStudentBeforeRank")
    public JsonResponse getStudentBeforeRank(@RequestParam(required = false, defaultValue = "1") int currentPage, int rank){
        return new JsonResponse(JsonResponse.OK, studentService.getStudentBeforeRank(currentPage, rank), null);
    }

    @RequestMapping("/getStatisticsResult")
    public JsonResponse getStatisticsResult(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResult(), null);
    }
//    List<Map<String, Object>> getResultInDepartment(int departmentId);
    @RequestMapping("/getStatisticsResultInDepartment")
    public JsonResponse getStatisticsResultInDepartment(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResultInDepartment(), null);
    }
//    List<Map<String, Object>> getResultInMajor(String majorId);
    @RequestMapping("/getStatisticsResultInMajor")
    public JsonResponse getStatisticsResultInMajor(){
        return new JsonResponse(JsonResponse.INVALID_REQUEST, null, "导入Excel失败,请检查文件格式");
    }

    @ResponseBody
    @ExceptionHandler(Exception.class)
    public JsonResponse handle(Exception e){
        if(e instanceof  IllegalStateException){
            return new JsonResponse(JsonResponse.INVALID_REQUEST, null, e.getMessage());
        }
        return new JsonResponse(JsonResponse.SYSTEM_ERROR, null, e.getMessage());
    }

}

@RestController
@RequestMapping("/status")
public class StatusController {

    @Autowired
    private IStatusService statusService;

    @RequestMapping("/getStatus")
    public JsonResponse getStatus(){
        return new JsonResponse(JsonResponse.OK, statusService.getStatus(), null);
    }

    @RequestMapping("/getLogList")
    public JsonResponse getLogList(){
        return new JsonResponse(JsonResponse.OK, statusService.getLogList(), null);
    }

//    StatisticsResult getResultByDepartment( int departmentId, int currentPage, boolean desc);
    /**
     * @description t通过学院、专业、排名查询已弃用,请使用上面的getResult
     * @param null
     * @return
     * @throws
     */
    @RequestMapping("/getResultByDepartment")
    @Deprecated
    public JsonResponse getResultByDepartment(int departmentId, @RequestParam(required = false, defaultValue = "1") int currentPage, @RequestParam(required = false, defaultValue = "false") boolean desc){
        return new JsonResponse(JsonResponse.OK, studentService.getResultByDepartment(departmentId, currentPage, desc), null);
    }
//    StatisticsResult getResultByMajor( String majorId, int currentPage, boolean desc);
    @RequestMapping("/getResultByMajor")
    @Deprecated
    public JsonResponse getResultByMajor(String majorId, @RequestParam(required = false, defaultValue = "1") int currentPage, @RequestParam(required = false, defaultValue = "false") boolean desc){
        return new JsonResponse(JsonResponse.OK, studentService.getResultByMajor(majorId, currentPage, desc), null);
    }

    @RequestMapping("/searchStudent")
    @Deprecated
    public JsonResponse searchStudent(@RequestParam(required = false, defaultValue = "1") int currentPage,String keyword){
        return new JsonResponse(JsonResponse.OK, studentService.searchStudent(currentPage,keyword), null);
    }

    @RequestMapping("/searchStudentByCandidate")
    public JsonResponse searchStudentByCandidate(@RequestParam(required = false, defaultValue = "1") int currentPage,String keyword){
        return new JsonResponse(JsonResponse.OK, studentService.searchStudentByCandidate(currentPage,keyword), null);
    }

    @RequestMapping("/getStudentBeforeRank")
    public JsonResponse getStudentBeforeRank(@RequestParam(required = false, defaultValue = "1") int currentPage, int rank){
        return new JsonResponse(JsonResponse.OK, studentService.getStudentBeforeRank(currentPage, rank), null);
    }

    @RequestMapping("/getStatisticsResult")
    public JsonResponse getStatisticsResult(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResult(), null);
    }
//    List<Map<String, Object>> getResultInDepartment(int departmentId);
    @RequestMapping("/getStatisticsResultInDepartment")
    public JsonResponse getStatisticsResultInDepartment(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResultInDepartment(), null);
    }
//    List<Map<String, Object>> getResultInMajor(String majorId);
    @RequestMapping("/getStatisticsResultInMajor")
    }

    @RequestMapping("/searchStudent")
    @Deprecated
    public JsonResponse searchStudent(@RequestParam(required = false, defaultValue = "1") int currentPage,String keyword){
        return new JsonResponse(JsonResponse.OK, studentService.searchStudent(currentPage,keyword), null);
    }

    @RequestMapping("/searchStudentByCandidate")
    public JsonResponse searchStudentByCandidate(@RequestParam(required = false, defaultValue = "1") int currentPage,String keyword){
        return new JsonResponse(JsonResponse.OK, studentService.searchStudentByCandidate(currentPage,keyword), null);
    }

    @RequestMapping("/getStudentBeforeRank")
    public JsonResponse getStudentBeforeRank(@RequestParam(required = false, defaultValue = "1") int currentPage, int rank){
        return new JsonResponse(JsonResponse.OK, studentService.getStudentBeforeRank(currentPage, rank), null);
    }

    @RequestMapping("/getStatisticsResult")
    public JsonResponse getStatisticsResult(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResult(), null);
    }
//    List<Map<String, Object>> getResultInDepartment(int departmentId);
    @RequestMapping("/getStatisticsResultInDepartment")
    public JsonResponse getStatisticsResultInDepartment(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResultInDepartment(), null);
    }
//    List<Map<String, Object>> getResultInMajor(String majorId);
    @RequestMapping("/getStatisticsResultInMajor")
    public JsonResponse getStatisticsResultInMajor(){
        return new JsonResponse(JsonResponse.OK, studentService.getStatisticsResultInMajor(), null);
    }
    //    Map<String, Integer> getDistribute();
    @RequestMapping("/getDistribute")
    public JsonResponse getDistribute(){
        return new JsonResponse(JsonResponse.OK, studentService.getDistribute(), null);
    }
    //    Map<String, Integer> getDistributeInProvince(String province);
    @RequestMapping("/getDistributeInProvince")
    public JsonResponse getDistributeInProvince(String province){
        return new JsonResponse(JsonResponse.OK, studentService.getDistributeInProvince(province), null);
    }
    //    Map<String, Integer> getGradeDistribute();
    @RequestMapping("/getGradeDistribute")
    public JsonResponse getGradeDistribute(){
        return new JsonResponse(JsonResponse.OK, studentService.getGradeDistribute(), null);
    }
    //    Map<String, Integer> getGradeDistributeByDepartment( int departmentId);
    @RequestMapping("/getGradeDistributeByDepartment")
    public JsonResponse getGradeDistributeByDepartment(int departmentId){
    @ExceptionHandler(Exception.class)
    public JsonResponse handle(Exception e){
        if(e instanceof  IllegalStateException){
            return new JsonResponse(JsonResponse.INVALID_REQUEST, null, e.getMessage());
        }
        return new JsonResponse(JsonResponse.SYSTEM_ERROR, null, e.getMessage());
    }

}

@RestController
@RequestMapping("/status")
public class StatusController {

    @Autowired
    private IStatusService statusService;

    @RequestMapping("/getStatus")
    public JsonResponse getStatus(){
        return new JsonResponse(JsonResponse.OK, statusService.getStatus(), null);
    }

    @RequestMapping("/getLogList")
    public JsonResponse getLogList(){
        return new JsonResponse(JsonResponse.OK, statusService.getLogList(), null);
    }

    @RequestMapping("/reset")
    public JsonResponse reset() {
        statusService.reset();
        return new JsonResponse(JsonResponse.OK, null, null);
    }
}

请添加图片描述

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值