代码编织梦想

您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。

开发环境

开发语言:Java
框架:springboot
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql 5.7(一定要5.7版本)
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器

项目介绍

随着信息技术和网络技术的飞速发展,人类已进入全新信息化时代,传统管理技术已无法高效,便捷地管理信息。为了迎合时代需求,优化管理效率,各种各样的管理系统应运而生,各行各业相继进入信息管理时代,学生成绩管理系统就是信息时代变革中的产物之一。

任何系统都要遵循系统设计的基本流程,本系统也不例外,同样需要经过市场调研,需求分析,概要设计,详细设计,编码,测试这些步骤,基于java语言设计并实现了学生成绩管理系统。该系统基于B/S即所谓浏览器/服务器模式,应用java技术,选择MySQL作为后台数据库。系统主要包括首页、个人中心、学生管理、教师管理、班级管理、综合成绩管理、专业管理、课程信息管理等功能模块。

功能介绍

本课题要求实现一套学生成绩管理系统,系统主要包括管理员模块、学生模块和教师等功能模块。

这个系统的功能结构设计如图所示。

6cff05a992fa42e286a141978e4e984d.png

系统功能模块图

效果图

917f3aeccc5540b79e09621037167421.png
7c3daf45169c477db1b686bdc400cd8c.png
d81ae473ccda47d689abd8c9499e5c56.png
a5cd15b99c63449ca3353a5f84ac845f.png
2f6a7aebc24a4d588549029302100b09.png

部分核心代码


package com.controller;


import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;

/**
 * 登录相关
 */
@RequestMapping("users")
@RestController
public class UserController{
    
    @Autowired
    private UserService userService;
    
    @Autowired
    private TokenService tokenService;

    /**
     * 登录
     */
    @IgnoreAuth
    @PostMapping(value = "/login")
    public R login(String username, String password, String captcha, HttpServletRequest request) {
        UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
        if(user==null || !user.getPassword().equals(password)) {
            return R.error("账号或密码不正确");
        }
        String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
        return R.ok().put("token", token);
    }
    
    /**
     * 注册
     */
    @IgnoreAuth
    @PostMapping(value = "/register")
    public R register(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);
        if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
            return R.error("用户已存在");
        }
        userService.insert(user);
        return R.ok();
    }

    /**
     * 退出
     */
    @GetMapping(value = "logout")
    public R logout(HttpServletRequest request) {
        request.getSession().invalidate();
        return R.ok("退出成功");
    }
    
    /**
     * 密码重置
     */
    @IgnoreAuth
    @RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
        UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
        if(user==null) {
            return R.error("账号不存在");
        }
        user.setPassword("123456");
        userService.update(user,null);
        return R.ok("密码已重置为:123456");
    }
    
    /**
     * 列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,UserEntity user){
        EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
        PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
        return R.ok().put("data", page);
    }

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list( UserEntity user){
           EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
          ew.allEq(MPUtil.allEQMapPre( user, "user")); 
        return R.ok().put("data", userService.selectListView(ew));
    }

    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
        Long id = (Long)request.getSession().getAttribute("userId");
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }

    /**
     * 保存
     */
    @PostMapping("/save")
    public R save(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);
        if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
            return R.error("用户已存在");
        }
        userService.insert(user);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);
        UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));
        if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
            return R.error("用户名已存在。");
        }
        userService.updateById(user);//全部更新
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        userService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}
package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.ZonghechengjiEntity;
import com.entity.view.ZonghechengjiView;

import com.service.ZonghechengjiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;

/**
 * 综合成绩
 * 后端接口
 * @author 
 * @email 
 * @date 2022-04-16 16:14:23
 */
@RestController
@RequestMapping("/zonghechengji")
public class ZonghechengjiController {
    @Autowired
    private ZonghechengjiService zonghechengjiService;


    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,ZonghechengjiEntity zonghechengji,
        HttpServletRequest request){
        String tableName = request.getSession().getAttribute("tableName").toString();
        if(tableName.equals("xuesheng")) {
            zonghechengji.setXuehao((String)request.getSession().getAttribute("username"));
        }
        if(tableName.equals("jiaoshi")) {
            zonghechengji.setJiaoshigonghao((String)request.getSession().getAttribute("username"));
        }
        EntityWrapper<ZonghechengjiEntity> ew = new EntityWrapper<ZonghechengjiEntity>();
        PageUtils page = zonghechengjiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zonghechengji), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,ZonghechengjiEntity zonghechengji, 
        HttpServletRequest request){
        EntityWrapper<ZonghechengjiEntity> ew = new EntityWrapper<ZonghechengjiEntity>();
        PageUtils page = zonghechengjiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zonghechengji), params), params));
        return R.ok().put("data", page);
    }

    /**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( ZonghechengjiEntity zonghechengji){
           EntityWrapper<ZonghechengjiEntity> ew = new EntityWrapper<ZonghechengjiEntity>();
          ew.allEq(MPUtil.allEQMapPre( zonghechengji, "zonghechengji")); 
        return R.ok().put("data", zonghechengjiService.selectListView(ew));
    }

     /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(ZonghechengjiEntity zonghechengji){
        EntityWrapper< ZonghechengjiEntity> ew = new EntityWrapper< ZonghechengjiEntity>();
         ew.allEq(MPUtil.allEQMapPre( zonghechengji, "zonghechengji")); 
        ZonghechengjiView zonghechengjiView =  zonghechengjiService.selectView(ew);
        return R.ok("查询综合成绩成功").put("data", zonghechengjiView);
    }
    
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        ZonghechengjiEntity zonghechengji = zonghechengjiService.selectById(id);
        return R.ok().put("data", zonghechengji);
    }

    /**
     * 前端详情
     */
    @IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        ZonghechengjiEntity zonghechengji = zonghechengjiService.selectById(id);
        return R.ok().put("data", zonghechengji);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody ZonghechengjiEntity zonghechengji, HttpServletRequest request){
        zonghechengji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
        //ValidatorUtils.validateEntity(zonghechengji);
        zonghechengjiService.insert(zonghechengji);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody ZonghechengjiEntity zonghechengji, HttpServletRequest request){
        zonghechengji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
        //ValidatorUtils.validateEntity(zonghechengji);
        zonghechengjiService.insert(zonghechengji);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ZonghechengjiEntity zonghechengji, HttpServletRequest request){
        //ValidatorUtils.validateEntity(zonghechengji);
        zonghechengjiService.updateById(zonghechengji);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        zonghechengjiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
    @RequestMapping("/remind/{columnName}/{type}")
    public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
                         @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
        map.put("column", columnName);
        map.put("type", type);
        
        if(type.equals("2")) {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            Calendar c = Calendar.getInstance();
            Date remindStartDate = null;
            Date remindEndDate = null;
            if(map.get("remindstart")!=null) {
                Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
                c.setTime(new Date()); 
                c.add(Calendar.DAY_OF_MONTH,remindStart);
                remindStartDate = c.getTime();
                map.put("remindstart", sdf.format(remindStartDate));
            }
            if(map.get("remindend")!=null) {
                Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
                c.setTime(new Date());
                c.add(Calendar.DAY_OF_MONTH,remindEnd);
                remindEndDate = c.getTime();
                map.put("remindend", sdf.format(remindEndDate));
            }
        }
        
        Wrapper<ZonghechengjiEntity> wrapper = new EntityWrapper<ZonghechengjiEntity>();
        if(map.get("remindstart")!=null) {
            wrapper.ge(columnName, map.get("remindstart"));
        }
        if(map.get("remindend")!=null) {
            wrapper.le(columnName, map.get("remindend"));
        }

        String tableName = request.getSession().getAttribute("tableName").toString();
        if(tableName.equals("xuesheng")) {
            wrapper.eq("xuehao", (String)request.getSession().getAttribute("username"));
        }
        if(tableName.equals("jiaoshi")) {
            wrapper.eq("jiaoshigonghao", (String)request.getSession().getAttribute("username"));
        }

        int count = zonghechengjiService.selectCount(wrapper);
        return R.ok().put("count", count);
    }
    







}

如需对应的源码,可以评论或者下方联系我,私信都可以。

ea6c8dc8f4a842188872ef580e90357c.png
93336082fca74a0e924b18f6e65ad56a.png

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/m0_46388260/article/details/129676020

从零开始学python编程之print函数结束符-爱代码爱编程

Python中的print函数结束符 在Python中,print函数是一种非常基本的输出函数,可以在控制台上输出数据。其中,print函数的结束符是为了格式化输出数据而使用的。如果设置了print的结束符号,可以控制格式化输出数据的不同展示方式。这篇文章将为大家详细介绍Python中的print函数结束符。 两个print默认换行 在Pytho

从零开始学python编程之输入的实现-爱代码爱编程

Python 中的输入功能 在工作场景中,我们经常需要用户输入数据。Python 中,我们可以使用输入功能实现这个需求。在本文中,我们将介绍 Python 中输入功能的语法和特点。 输入功能的语法 在 Python 中,输入功能的语法非常简单,就是一个小函数,函数名是 input。小括号里面,我们可以写一个字符串,作为提示信息,提示用户输入。下面

chatgpt从入门到精通(附pdf文档)-爱代码爱编程

相关学习文档下载: https://download.csdn.net/download/m0_46388260/87586329 ChatGPT 是一种强大的自然语言处理模型,其应用前景广泛,可以应用于自然语言生成、对话系统、推荐系统、知识图谱构建、智能家居、人工智能教育、语音识别、机器人等多个领域。本书从入门到精通,介绍了 ChatGPT

java练习实例(11)-爱代码爱编程

全部48个实例,免费供大家下载学习: https://download.csdn.net/download/m0_46388260/87587984 【程序1】 题目:古典问题:有一对兔子,从出生后第3 个月起每个月都生一对兔子,小兔子长到第三个月后每个月 又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少? //这是一个菲波拉契数列

java练习实例(12)-爱代码爱编程

我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 总共48个JAVA的实例,可以保存后慢慢练习: https://download.csdn.net/download/m0_46388260/87587984 【程序3】 题目:打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和 等于该数本身。例如:153 是一

java练习实例(13)-爱代码爱编程

我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 总共48个JAVA的实例,可以保存后慢慢练习: https://download.csdn.net/download/m0_46388260/87587984 【程序5】 题目:利用条件运算符的嵌套来完成此题:学习成绩> =90 分的同学用A 表示,60-89 分之 间的用B 表

java练习实例(14)-爱代码爱编程

我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 总共48个JAVA的实例,可以保存后慢慢练习: https://download.csdn.net/download/m0_46388260/87587984 题目:输入两个正整数m 和n,求其最大公约数和最小公倍数。 在循环中,只要除数不等于0,用较大数除以较小的数,将小的一个数作为下

java练习实例(15)-爱代码爱编程

您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 总共48个JAVA的实例,可以保存后慢慢练习: https://download.csdn.net/download/m0_46388260/87587984 题目:输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数。 import java.util.*; publ

java练习实例(16)-爱代码爱编程

我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 总共48个JAVA的实例,可以保存后慢慢练习: https://download.csdn.net/download/m0_46388260/87587984 题目:求s=a+aa+aaa+aaaa+aa...a 的值,其中a 是一个数字。例如2+22+222+2222+22222(此

java练习实例(17)-爱代码爱编程

您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 总共48个JAVA的实例,可以保存后慢慢练习: https://download.csdn.net/download/m0_46388260/87587984 题目:一个数如果恰好等于它的因子之和,这个数就称为"完数"。例如6=1+2+3.编 程找出1000 以内的所有完数。 p

java练习实例(18)-爱代码爱编程

您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 总共48个JAVA的实例,可以保存后慢慢练习: https://download.csdn.net/download/m0_46388260/87587984 题目:一球从100 米高度自由落下,每次落地后反跳回原高度的一半;再落下,求它在第 10 次落地时,共经过多少米?第10

java练习实例(19)-爱代码爱编程

您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 总共48个JAVA的实例,可以保存后慢慢练习: https://download.csdn.net/download/m0_46388260/87587984 题目:有1、2、3、4 四个数字,能组成多少个互不相同且无重复数字的三位数?都是多少? public class lian

java练习实例(20)-爱代码爱编程

您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 总共48个JAVA的实例,可以保存后慢慢练习: https://download.csdn.net/download/m0_46388260/87587984 题目:企业发放的奖金根据利润提成。利润(I)低于或等于10 万元时,奖金可提10%;利润 高于10 万元,低于20 万元时

java 基础知识总结(附pdf文档)-爱代码爱编程

您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 这篇基础知识总结包括六个章节,可以下载保存后慢慢看,希望对您有帮助! https://download.csdn.net/download/m0_46388260/87589202 第一章 Java 入门 第二章标示符,运算符 第三章表达式,语句 第四章数据类型,字符串,数组

智慧食堂点餐系统设计与实现【java毕业设计】-爱代码爱编程

您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 项目介绍 随着Internet的发展,人们的日常生活已经离不开网络。未来人们的生活与工作将变得越来越数字化,网络化和电子化。网上管理,它将是直接管理“智慧食堂”系统的最新形式。本论文是以构建“智慧食堂”系统为目标,使用java技术制作,由管理员和用户两大部分组成。着重论述了系统设计分析,系统主

(java毕业设计)4s店车辆管理系统(基于java+springboot)-爱代码爱编程

您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 项目介绍 随着信息技术和网络技术的飞速发展,人类已进入全新信息化时代,传统管理技术已无法高效,便捷地管理信息。为了迎合时代需求,优化管理效率,各种各样的管理系统应运而生,各行各业相继进入信息管理时代,4S店车辆系统就是信息时代变革中的产物之一。 任何系统都要遵循系统设计的基本流程,本系统也不

(java毕业设计)学生综合测评系统(基于java+springboot)-爱代码爱编程

您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 项目介绍 随着信息化时代的到来,管理系统都趋向于智能化、系统化,学生综合测评系统也不例外,但目前国内仍都使用人工管理,学校规模越来越大,同时信息量也越来越庞大,人工管理显然已无法应对时代的变化,而学生综合测评系统能很好地解决这一问题,轻松应对学生综合测评平时的工作,既能提高人力物力财力,又能加

(java毕业设计)车辆充电桩系统(基于java+springboot)-爱代码爱编程

项目介绍 随着信息化时代的到来,管理系统都趋向于智能化、系统化,车辆充电桩管理系统也不例外,但目前国内仍都使用人工管理,市场规模越来越大,同时信息量也越来越庞大,人工管理显然已无法应对时代的变化,而车辆充电桩管理系统能很好地解决这一问题,轻松应对车辆充电桩平时的工作,既能提高人力物力财力,又能加快工作的效率,取代人工管理是必然趋势。 本车辆充电桩管

(java毕业设计)漫画之家系统(基于java+springboot)-爱代码爱编程

您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 项目介绍 随着信息技术和网络技术的飞速发展,人类已进入全新信息化时代,传统管理技术已无法高效,便捷地管理信息。为了迎合时代需求,优化管理效率,各种各样的管理系统应运而生,各行各业相继进入信息管理时代,“漫画之家”系统就是信息时代变革中的产物之一。 任何系统都要遵循系统设计的基本流程,本系统也

(java毕业设计)大学生体质测试管理系统(基于java+springboot)-爱代码爱编程

您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。 开发环境 开发语言:Java 框架:springboot JDK版本:JDK1.8 服务器:tomcat7 数据库:mysql 5.7(一定要5.7版本) 数据库工具:Navicat11 开发软件:eclipse/myeclipse/idea Maven包:M