java web学生学籍信息管理系统ssh学籍管理系统

【242】java web学生学籍信息管理系统ssh学籍管理系统

 开发工具:idea 或eclipse

 数据库mysql5.7+

 数据库链接工具:navcat,小海豚等

 

                            中学生学籍信息管理系统

学籍信息管理系统的设计与实现是利用开发工具Java+MySQL,该系统主要包括以下3个访问权限:学生,教师,系统管理员。

学生:(前端页面登录)

学生登录模块:学生可通过学号和密码登录系统,若是学号或密

              码错误,则给出具体提示“学号错误”。

              登录成功后,跳转页面上方显示学生学号、姓名;以及修改密码、注销功能。

              除密码以外,学生不能修改其他信息。

              登陆成功后,左侧显示具体模块名称,主页面显示教务信息,显示教务公

              告、具体公告可点击查看,每一条公告后显示“教务公告”、发布公告时间

  1. 学生学籍信息模块:

 以表格的形式显示学生具体信息,表格上方有学校、年级、班级、姓名信息。

 表格中以从左到下从上到下顺序显示学生信息,分别为姓名、性别、民族、照片(4-5行)

 出生日期、籍贯、联系方式、家庭住址。

 显示家庭成员信息,姓名、性别、与本人关系、年龄、工作单位、联系方式

 接下来分别有两张表格,奖励情况(何时受奖、何地受奖、何故受奖、受何等奖)和

 处分情况(何时受处、何地受处、何故受处、受何处分)。 

2.学生课表信息模块:

  表格上方显示学生个人课表和学号、姓名信息。

 课表中显示每周的课程安排,包括课程名称、授课教师。

  1. 学生成绩查询模块:

 上方显示学号、姓名

 具体信息显示开课学期、课程编号、课程名称、成绩。

4.学生身体素质模块

上方显示学号、姓名

内容包括姓名、性别、年龄、身高、体重、血压、血型、肺活量、家族史、有无疾病、

        校医院联系方式。

教师(前端页面登录)

 教师登录过程和学生登录基本类似,通过账号、密码登录系统,若账号

 或密码错误给出具体提示,有找回密码的功能。

 登录成功后显示所教授课程,以及该课程所对应的所有学生的成绩,具有修改学生成绩的

 权限。

系统管理员:

  1. 学生学籍管理模块:点击进入该模块,可以查看所有班级对应的学生;

可以增删改查所有学生的学籍信息模块(即上述学生端的所有模块),并且设置学生的权限。

并包含所有班级管理模块:

班级信息修改、班级信息查询

通过查询班级显示该班级所有学生的信息。

2.教师管理模块:设置教师的基本信息和相应权限(相当于增加功能),并实现修改,查询, 删除功能。

java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统java web学生学籍信息管理系统ssh学籍管理系统

package com.my.pro.action;


import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.github.abel533.echarts.axis.CategoryAxis;
import com.github.abel533.echarts.axis.ValueAxis;
import com.github.abel533.echarts.code.Trigger;
import com.github.abel533.echarts.data.PieData;
import com.github.abel533.echarts.json.GsonOption;
import com.github.abel533.echarts.series.Bar;
import com.github.abel533.echarts.series.Pie;
import com.my.pro.model.Manage;
import com.my.pro.model.User;
import com.my.pro.service.ManageService;
import com.my.pro.service.UserService;
import com.my.pro.utils.Pager;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Controller("manageAction")
@Scope("prototype")
public class ManageAction extends BaseAction implements ModelDriven{
   private Manage manage;
   @Autowired
	private UserService userService;
    @Autowired
   private ManageService manageService;
    private int userId;
    private String userName;
    private int sayId;
    private String new1;
    public String getNew1() {
		return new1;
	}

	public void setNew1(String new1) {
		this.new1 = new1;
	}

	/**
	 * 登陆以后进入首页
	 * @return
	 */
	public String index(){
		Manage ma =	manageService.login(manage);
		if(ma == null){
			return "login";
		}
		HttpSession session =	ServletActionContext.getRequest().getSession();
		session.setAttribute("userName", ma.getName());
		session.setAttribute("userIdLogo", ma.getId());
		session.setAttribute("userType", ma.getType());
		session.setAttribute("userId", ma.getType());
	    return "index";
	}
	
	/**
	 * 跳到管理员页面,并且顺带查询管理员列表分页
	 * @return
	 */
	public String manage(){
		Pager pagers = manageService.list(manage);
		ActionContext.getContext().put("pagers", pagers);
		ActionContext.getContext().put("Obj", manage);
		return SUCCESS;
		
	}
    /**
     * 跳转添加页面
     * @return
     */
	public String addManage(){
		return SUCCESS;
	}
	/**
	 * 添加
	 * @return
	 * @throws IOException 
	 */
    public void manageAdd() throws IOException{
    	HttpServletResponse resp = ServletActionContext.getResponse();
		resp.setContentType("application/json;charset=UTF-8");
		PrintWriter out = null;
		manage.setType(2);
    	manageService.save(manage);
    	out = resp.getWriter();
		 out.write(JSONArray.fromObject(1).toString());
    }
    
    /**
     * 
     * @return
     */
	public String manageEdit(){
		Manage ma =	manageService.getById(1);
		ActionContext.getContext().put("ma", ma);
		return SUCCESS;
		
	}
	
	public String manageEdit2(){
		Manage ma =	manageService.getById(manage.getId());
		ActionContext.getContext().put("ma", ma);
		return SUCCESS;
		
	}
	
	public void  editmanage() throws IOException{
		HttpServletResponse resp = ServletActionContext.getResponse();
		resp.setContentType("application/json;charset=UTF-8");
		PrintWriter out = null;
		//Manage ma =	manageService.getById(manage.getId());
		/*ma.setPassWord(manage.getPassWord());
		ma.setRealName(manage.getRealName());
		ma.setName(manage.getName());
		ma.setId(manage.getId())new1;*/
		Manage byId = manageService.getById(1);
		JSONObject js = new JSONObject();
		if(!byId.getPassWord().equals(manage.getPassWord())){
			js.put("result", "输入原始密码不正确");
		}else{
			byId.setPassWord(new1);
			manageService.update(byId);
			js.put("result", "修改成功");
		}
    	out = resp.getWriter();
		 out.write(js.toString());
		
	}
	public void  editmanage2() throws IOException{
		HttpServletResponse resp = ServletActionContext.getResponse();
		resp.setContentType("application/json;charset=UTF-8");
		PrintWriter out = null;
		//Manage ma =	manageService.getById(manage.getId());
		/*ma.setPassWord(manage.getPassWord());
		ma.setRealName(manage.getRealName());
		ma.setName(manage.getName());
		ma.setId(manage.getId());*/
    	manageService.updateInfo(manage);
    	out = resp.getWriter();
		 out.write(JSONArray.fromObject(1).toString());
		
	}
    
    public String delManage(){
    	manageService.deleteInfo(manage.getId());
    	ActionContext.getContext().put("url", "/manage_manage.do");
		return "redirect";
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    //=============================================================================================================
    
    public int getSayId() {
		return sayId;
	}
	public void setSayId(int sayId) {
		this.sayId = sayId;
	}

	private File file;
    
    public File getFile() {
		return file;
	}
	public void setFile(File file) {
		this.file = file;
	}
	public String getFileFileName() {
		return fileFileName;
	}
	public void setFileFileName(String fileFileName) {
		this.fileFileName = fileFileName;
	}
	public String getFileContentType() {
		return fileContentType;
	}
	public void setFileContentType(String fileContentType) {
		this.fileContentType = fileContentType;
	}

	//提交过来的file的名字
    private String fileFileName;
    
    //提交过来的file的MIME类型
    private String fileContentType;
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public Manage getModel() {
		if(manage==null) manage = new Manage();
		return manage;
	}
   
	
	
	/**
	 * 获取用户列表
	 * @return
	 */
	public String userList(){
	Pager	pagers = userService.listAll(userName);
	//这里需要对等级进行遍历
	/*List list = gradeService.list();
	if(pagers != null && pagers.getDatas() != null && pagers.getDatas().size()>0){
		for(User u : pagers.getDatas()){
			//对这里的人 进行遍历
			for(Grade g: list){
				if(u.getJifen()>=g.getStartMin() && u.getJifen() <=g.getEndMax()){
					u.setDengji(g.getName());
				}
			}
		}
	}*/
	ActionContext.getContext().put("pagers", pagers);
	ActionContext.getContext().put("userName1", userName);
	return SUCCESS;
	}
	
	/**
	 * 根据用户id查询所有图片
	 * @return
	 */
	/*public String userPhotos(){
		Pager	pagers = sayMoodService.findAllphotosById(userId);
		ActionContext.getContext().put("pagers", pagers);
		return SUCCESS;
	}
	*/
	/**
	 * 删除照片
	 * @return
	 */
	/*public String delsay(){
		 sayMoodService.del(sayId);
		ActionContext.getContext().put("url", "/manage_userPhotos.do");
		return "redirect";
	}*/
	//删除用户
	public String delUse(){
		userService.delUse(userId);
		ActionContext.getContext().put("url", "/manage_userList.do");
		return "redirect";
	}
	
	/**
	 * 图片上传
	 * @return
	 * @throws Exception
	 */
	/*public String fileUpload() throws Exception{
		HttpSession session =	ServletActionContext.getRequest().getSession();
		if(session.getAttribute("userId") != null){
			int userId = Integer.parseInt( session.getAttribute("userId").toString());
			
			 String root = ServletActionContext.getServletContext().getRealPath("/")+"upload";
			//String root = ServletActionContext.getServletContext().getRealPath("upload"); 
			//String root = ServletActionContext.getRequest().getContextPath()+"/"+"upload";
		        InputStream is = new FileInputStream(file);
		        fileFileName = UUIDUtils.create()+fileFileName;
		        OutputStream os = new FileOutputStream(new File(root, fileFileName));
		        System.out.println("fileFileName: " + fileFileName);
		        System.out.println("file: " + file.getName());
		        System.out.println("file: " + file.getPath());
		        byte[] buffer = new byte[500];
		        int length = 0;
		        
		        while(-1 != (length = is.read(buffer, 0, buffer.length)))
		        {
		            os.write(buffer);
		        }
		        os.close();
		        is.close();
		        //接下来存到说说表中
		        SayMood sayMood = new SayMood();
		        sayMood.setContent("\\upload\\"+fileFileName);
		        sayMood.setCreateTime(new Date());
		        sayMood.setDzs(0);
		        sayMood.setIsDelete(2);
		        sayMood.setType(2);
		        User u = userService.getUser(userId);
		        sayMood.setSayUser(u);
		        sayMoodService.save(sayMood);
		        *//**
		         * 积分规则还没有做。上传图片需要加积分
		         *//*
		        //上传完毕,跳转列表action
		        ActionContext.getContext().put("url", "/user_homePage.do");
		        return "redirect";
		}else{
			return "login";
		}
	}*/
	
	public String report(){
		return SUCCESS;
	}
	//下面进行报表
	/**
	 * 查询上个月和这个月 账号注册
	 * @throws IOException 
	 */
	public void reportUser() throws IOException{
		HttpServletResponse resp = ServletActionContext.getResponse();
		resp.setContentType("application/json;charset=UTF-8");
		PrintWriter out = null;
		//首先查询本月和上个月用户总人数
		List	users = userService.findSYuser();
		List	users2 = userService.findBYuser();
		List<Map> list = new ArrayList<Map>();
		Map map1 = new HashMap();
		map1.put("NAME", getsy());
		if(users != null && users.size()>0){
			map1.put("TOTAL", users.size());
		}else{
			map1.put("TOTAL", 0);
		}
		
		Map map2 = new HashMap();
		map2.put("NAME", getBy());
		if(users2 != null && users2.size()>0){
			map2.put("TOTAL", users2.size());
		}else{
			map2.put("TOTAL", 0);
		}
		list.add(map1);
		list.add(map2);
		
		 //创建Option
	    GsonOption option = new GsonOption();
	    option.title("注册人数").tooltip(Trigger.axis).legend("数量(人)");
	    //横轴为值轴
	    option.xAxis(new ValueAxis().boundaryGap(0d, 0.01));
	    //创建类目轴
	    CategoryAxis category = new CategoryAxis();
	    //柱状数据
	    Bar bar = new Bar("月份");
	    //饼图数据
	    Pie pie = new Pie("月份");
	    //循环数据
	    for (Map objectMap : list) {
	        //设置类目
	        category.data(objectMap.get("NAME"));
	        //类目对应的柱状图
	        bar.data(objectMap.get("TOTAL"));
	        //饼图数据
	        pie.data(new PieData(objectMap.get("NAME").toString(), objectMap.get("TOTAL")));
	    }
	    //设置类目轴
	    option.yAxis(category);
	    //饼图的圆心和半径
	    pie.center(900,380).radius(100);
	    //设置数据
	    option.series(bar, pie);
	    //由于药品名字过长,图表距离左侧距离设置180,关于grid可以看ECharts的官方文档
	    option.grid().x(180);
	    //返回Option
	    out = resp.getWriter();
		 out.write(option.toString());
	}
	
	
	  public String getBy(){
		  Calendar c = Calendar.getInstance();
		   c.add(Calendar.MONTH, -0);
		  SimpleDateFormat format =  new SimpleDateFormat("yyyy-MM");
		  String time = format.format(c.getTime());
		  System.out.println(time);
		  return time;
	}
	  
	  public String getsy(){
		  Calendar c = Calendar.getInstance();
		   c.add(Calendar.MONTH, -1);
		  SimpleDateFormat format =  new SimpleDateFormat("yyyy-MM");
		  String time = format.format(c.getTime());
		  System.out.println(time);
		  return time;
	}
	  
	  
	  public void reportSay() throws IOException{/*
		  HttpServletResponse resp = ServletActionContext.getResponse();
			resp.setContentType("application/json;charset=UTF-8");
			PrintWriter out = null;
			//首先查询本月和上个月用户总人数
			List	users = sayMoodService.findSYusay();
			List	users2 = sayMoodService.findBYsay();
			List<Map> list = new ArrayList<Map>();
			Map map1 = new HashMap();
			map1.put("NAME", getsy());
			if(users != null && users.size()>0){
				map1.put("TOTAL", users.size());
			}else{
				map1.put("TOTAL", 0);
			}
			
			Map map2 = new HashMap();
			map2.put("NAME", getBy());
			if(users2 != null && users2.size()>0){
				map2.put("TOTAL", users2.size());
			}else{
				map2.put("TOTAL", 0);
			}
			list.add(map1);
			list.add(map2);
			
			 //创建Option
		    GsonOption option = new GsonOption();
		    option.title("发表图片数").tooltip(Trigger.axis).legend("数量(人)");
		    //横轴为值轴
		    option.xAxis(new ValueAxis().boundaryGap(0d, 0.01));
		    //创建类目轴
		    CategoryAxis category = new CategoryAxis();
		    //柱状数据
		    Bar bar = new Bar("月份");
		    //饼图数据
		    Pie pie = new Pie("月份");
		    //循环数据
		    for (Map objectMap : list) {
		        //设置类目
		        category.data(objectMap.get("NAME"));
		        //类目对应的柱状图
		        bar.data(objectMap.get("TOTAL"));
		        //饼图数据
		        pie.data(new PieData(objectMap.get("NAME").toString(), objectMap.get("TOTAL")));
		    }
		    //设置类目轴
		    option.yAxis(category);
		    //饼图的圆心和半径
		    pie.center(900,380).radius(100);
		    //设置数据
		    option.series(bar, pie);
		    //由于药品名字过长,图表距离左侧距离设置180,关于grid可以看ECharts的官方文档
		    option.grid().x(180);
		    //返回Option
		    out = resp.getWriter();
			 out.write(option.toString());
	  */}
	  
	  
	  public String welcome(){
		  return SUCCESS;
	  }
}

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://www.net2asp.com/56cd20844a.html