• 大小: 44.34MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-24
  • 语言: Java
  • 标签: Java  

资源简介

完整前后端代码:微信小程序端源代码+后台管理端以及小程序界面所需的接口源代码
博客地址:https://blog.csdn.net/qq_38285537/article/details/91056177

资源截图

代码片段和文件信息

package com.system.controller;

import com.system.exception.CustomException;
import com.system.po.*;
import com.system.service.*;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import java.util.List;


@Controller
@RequestMapping(“/admin“)
public class AdminController {

    @Resource(name = “studentServiceImpl“)
    private StudentService studentService;

    @Resource(name = “teacherServiceImpl“)
    private TeacherService teacherService;

    @Resource(name = “courseServiceImpl“)
    private CourseService courseService;

    @Resource(name = “collegeServiceImpl“)
    private CollegeService collegeService;

    @Resource(name = “userloginServiceImpl“)
    private UserloginService userloginService;

    /*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<学生操作>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/

    @RequestMapping(“/showStudent“)
    public String showStudent(Model model Integer page) throws Exception {

        List list = null;
        //页码对象
        PagingVO pagingVO = new PagingVO();
        //设置总页数
        pagingVO.setTotalCount(this.studentService.getCountStudent());
        if (page == null || page == 0) {
            pagingVO.setToPageNo(1);
            list = studentService.findByPaging(1);
        } else {
            pagingVO.setToPageNo(page);
            list = studentService.findByPaging(page);
        }
      /*  if (page != null && page.intValue() != 0){
            pagingVO.setToPageNo(page);
            list = this.studentService.findByPaging(1);
        }else{
            pagingVO.setToPageNo(Integer.valueOf(1));
            list = this.studentService.findByPaging(Integer.valueOf(1));
        }*/

        model.addAttribute(“studentList“ list);
        model.addAttribute(“pagingVO“ pagingVO);

        return “/admin/showStudent“;

    }

    //  添加学生信息页面显示
    @RequestMapping(value = “/addStudent“ method = {RequestMethod.GET})
    public String addStudentUI(Model model) throws Exception {

        List list = collegeService.finAll();

        model.addAttribute(“collegeList“ list);

        return “/admin/addStudent“;
    }

     // 添加学生信息操作
    @RequestMapping(value = “/addStudent“ method = {RequestMethod.POST})
    public String addStudent(StudentCustom studentCustom Model model) throws Exception {

        Boolean result = studentService.save(studentCustom);

        if (!result) {
            model.addAttribute(“message“ “学号重复“);
            return “error“;
        }
        //添加成功后,也添加到登录表
        Userlogin userlogin = new Userlogin();
        userlogin.setUsername(studentCustom.getUserid().toString());
        userlogin.setPassword(“123“);
        userlogin.setRole(2);
        userloginService.save(userlogin);

        //重定向
        return “redirect:/admin/showStudent“;
    }

    // 修改学生信息页面显示
    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-12-07 13:43  Java后台\
     文件       13516  2019-06-06 22:41  Java后台\examination_system.sql
     目录           0  2019-12-07 13:43  Java后台\Examination_System\
     目录           0  2019-12-07 13:43  Java后台\Examination_System\.idea\
     目录           0  2019-12-07 13:43  Java后台\Examination_System\.idea\codestyles\
     文件         153  2019-03-01 22:21  Java后台\Examination_System\.idea\codestyles\codestyleConfig.xml
     文件         551  2019-04-12 14:25  Java后台\Examination_System\.idea\compiler.xml
     文件         332  2019-03-01 22:22  Java后台\Examination_System\.idea\encodings.xml
     目录           0  2019-12-07 13:43  Java后台\Examination_System\.idea\inspectionProfiles\
     文件        3404  2019-03-07 14:13  Java后台\Examination_System\.idea\inspectionProfiles\Project_Default.xml
     文件         656  2019-03-01 22:22  Java后台\Examination_System\.idea\misc.xml
     文件       53123  2019-04-12 19:34  Java后台\Examination_System\.idea\workspace.xml
     目录           0  2019-12-07 13:43  Java后台\Examination_System\.settings\
     文件         555  2018-04-16 18:28  Java后台\Examination_System\.settings\.jsdtscope
     文件         723  2018-04-16 18:28  Java后台\Examination_System\.settings\org.eclipse.jdt.core.prefs
     文件         591  2018-04-16 18:28  Java后台\Examination_System\.settings\org.eclipse.wst.common.component
     文件         245  2018-04-16 18:28  Java后台\Examination_System\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-04-16 18:28  Java后台\Examination_System\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-04-16 18:28  Java后台\Examination_System\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件          48  2018-04-16 18:28  Java后台\Examination_System\.settings\org.eclipse.wst.validation.prefs
     文件        6422  2019-05-18 15:00  Java后台\Examination_System\pom.xml
     目录           0  2019-12-07 13:43  Java后台\Examination_System\src\
     目录           0  2019-12-07 13:43  Java后台\Examination_System\src\main\
     目录           0  2019-12-07 13:43  Java后台\Examination_System\src\main\java\
     目录           0  2019-12-07 13:43  Java后台\Examination_System\src\main\java\com\
     目录           0  2019-12-07 13:43  Java后台\Examination_System\src\main\java\com\system\
     目录           0  2019-12-07 13:43  Java后台\Examination_System\src\main\java\com\system\controller\
     文件       13326  2019-06-04 22:56  Java后台\Examination_System\src\main\java\com\system\controller\AdminController.java
     目录           0  2019-12-07 13:43  Java后台\Examination_System\src\main\java\com\system\controller\converter\
     文件         798  2018-04-16 18:28  Java后台\Examination_System\src\main\java\com\system\controller\converter\CustomDateConverter.java
     文件        3109  2019-06-06 09:39  Java后台\Examination_System\src\main\java\com\system\controller\LoginController.java
............此处省略1465个文件信息

评论

共有 条评论