项目介绍 随着信息技术和网络技术的飞速发展,人类已进入全新信息化时代,传统管理技术已无法高效,便捷地管理信息。为了迎合时代需求,优化管理效率,各种各样的管理系统应运而生,各行各业相继进入信息管理时代,在线电影评论投票系统就是信息时代变革中的产物之一。 任何系统都要遵循系统设计的基本流程,本系统也不例外,同样需要经过市场调研,需求分析,概要设计,详细设计,编码,测试这些步骤,基于Java语言设计并实现了在线电影评论投票系统。该系统基于B/S即所谓浏览器/服务器模式,应用Java技术,选择MySQL作为后台数据库。系统主要包括个人中心、用户管理、电影类型管理、上映电影管理、投票信息管理、电影公告管理、用户反馈、电影分享、管理员管理、我的收藏管理、系统管理等功能模块。

java实现投票系统 java简单的投票系统_spring boot


使用说明

使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;

使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;

将项目中applicationContext.xml配置文件中的数据库配置改为自己的配置,然后运行;

运行成功后,在浏览器中输入:http://localhost:8080/项目名

开发工具:idea/eclipse、navicat for mysql

开发语言:java、jdk1.8、mysql

硬件环境:Win10系统、Google等。

主要技术:spring家族,springboot springmvc、mybatis、vue 、java等

java实现投票系统 java简单的投票系统_java_02


java实现投票系统 java简单的投票系统_开发语言_03

说明

本系统为ssm 可免费升级为springboot

java实现投票系统 java简单的投票系统_开发语言_04

java实现投票系统 java简单的投票系统_java实现投票系统_05


java实现投票系统 java简单的投票系统_spring boot_06

package com.controller;

import java.io.File;
import java.io.IOException;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.PrintWriter;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import com.entity.Allusers;
//import com.chengxusheji.po.News;
import com.server.AllusersServer;
import com.util.PageBean;
import net.sf.json.JSONObject;

@Controller
public class AllusersController {
	@Resource
	private AllusersServer allusersService;


//	
   @RequestMapping("showAllusers.do")
   public String showAllusers(int id,ModelMap map,HttpSession session){
	 /*  Map<String,Object> bmap=new HashMap<String,Object>();
	   bmap.put("uid", id);*/
	  // map.put("blist", allusersService.getAll(bmap));
	   map.put("allusers", allusersService.getById(id));
	   return "read";
   }
   
	@RequestMapping("addAllusers.do")
	public String addAllusers(HttpServletRequest request,Allusers allusers,HttpSession session){
		Timestamp time=new Timestamp(System.currentTimeMillis());
		//Users u=(Users)session.getAttribute("user");
		/*if(u==null||u.equals("")){
			return "redirect:showIndex.do";
		}else{*/
			//bbs.setUid(u.getId());
			/*bbs.setPubtime(time.toString());
			bbs.setIsdel("1");*/
		    allusers.setAddtime(time.toString().substring(0, 19));
			allusersService.add(allusers);
			return "redirect:allusersList.do";
		/*}*/
		
		
	}
 
//	处理编辑
	@RequestMapping("doUpdateAllusers.do")
	public String doUpdateAllusers(int id,ModelMap map,Allusers allusers){
		allusers=allusersService.getById(id);
		map.put("allusers", allusers);
		return "allusers_updt";
	}
//	
	@RequestMapping("updateAllusers.do")
	public String updateAllusers(int id,ModelMap map,Allusers allusers){
		allusersService.update(allusers);
		return "redirect:allusersList.do";
	}
//	所有List
//	@RequestMapping("allusersList.do")
//	public String allusersList(ModelMap map,HttpSession session){
//		map.put("list", allusersService.getAll(null));
//		map.put("clist", allusersService.getAll(null));
//		return "allusers";
//	}
//	分页查询
	@RequestMapping("allusersList.do")
	public String goodList(@RequestParam(value="page",required=false)String page,
			ModelMap map,HttpSession session,Allusers allusers, String username, String pwd, String cx){
		/*if(session.getAttribute("user")==null){
			return "login";
		}*/
		if(page==null||page.equals("")){
			page="1";
		}
		PageBean pageBean=new PageBean(Integer.parseInt(page), 15);
		Map<String, Object> pmap=new HashMap<String,Object>();
		pmap.put("pageno", pageBean.getStart());
		pmap.put("pageSize", 15);
		Map<String, Object> bmap=new HashMap<String, Object>();
		Map<String,Object> cmap=new HashMap<String,Object>();
		/*pmap.put("uid",  ((Users)session.getAttribute("user")).getId());
		bmap.put("uid", ((Users)session.getAttribute("user")).getId());*/
		if(username==null||username.equals("")){pmap.put("username", null);cmap.put("username", null);}else{pmap.put("username", username);cmap.put("username", username);}
		if(pwd==null||pwd.equals("")){pmap.put("pwd", null);cmap.put("pwd", null);}else{pmap.put("pwd", pwd);cmap.put("pwd", pwd);}
		if(cx==null||cx.equals("")){pmap.put("cx", null);cmap.put("cx", null);}else{pmap.put("cx", cx);cmap.put("cx", cx);}
		
		int total=allusersService.getCount(bmap);
		pageBean.setTotal(total);
		List<Allusers> list=allusersService.getByPage(pmap);
		map.put("page", pageBean);
		map.put("list", list);
		session.setAttribute("p", 1);
		return "allusers_list";
	}
//   分页模糊查询
	@RequestMapping("vagueAllusersList.do")
	public String vagueAllusersList(@RequestParam(value="page",required=false)String page,
			ModelMap map,HttpSession session){
		if(page==null||page.equals("")){
			page="1";
		}
		PageBean pageBean=new PageBean(Integer.parseInt(page),PageBean.PAGESIZE);
		Map<String, Object> pmap=new HashMap<String,Object>();
		pmap.put("pageno", pageBean.getStart());
		pmap.put("pageSize", pageBean.getPageSize());
		Map<String, Object> bmap=new HashMap<String, Object>();
		/*pmap.put("uid",  ((Users)session.getAttribute("user")).getId());
		bmap.put("uid",  ((Users)session.getAttribute("user")).getId());*/
		int total=allusersService.getCount(bmap);
		pageBean.setTotal(total);
		List<Allusers> list=allusersService.getByPage(pmap);
		map.put("page", pageBean);
		map.put("list", list);
		session.setAttribute("p", 2);
		return "queryallusers";
	}
	@RequestMapping("deleteAllusers.do")
	public String deleteAllusers(int id){
		allusersService.delete(id);
		return "redirect:allusersList.do";
	}
	
	@RequestMapping("quchongAllusers.do")
	public void quchongAllusers(Allusers allusers,HttpServletResponse response){
		   Map<String,Object> map=new HashMap<String,Object>();
		   map.put("username", allusers.getUsername());
		   System.out.println("username==="+allusers.getUsername());
		   System.out.println("username222==="+allusersService.quchongAllusers(map));
		   JSONObject obj=new JSONObject();
		   if(allusersService.quchongAllusers(map)!=null){
				 obj.put("info", "ng");
			   }else{
				   obj.put("info", "username可以用!");
				  
			   }
		   response.setContentType("text/html;charset=utf-8");
		   PrintWriter out=null;
		   try {
			out=response.getWriter();
			out.print(obj);
			out.flush();
		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			out.close();
		}
	}
	
	@RequestMapping("Alluserslogin.do")
	public String checkAllusersLogin(Allusers allusers, HttpSession session) {
		Map<String,Object> u=new HashMap<String,Object>();
		System.out.println("name===" + allusers.getUsername());
		u.put("username",allusers.getUsername());
		//u.put("utype", "用户");
		//Md5.MD5HexEncode(user.getPassword())
		u.put("pwd",allusers.getPwd());
		allusers = allusersService.allusersLogin(u);
		if (allusers != null) {
			session.setAttribute("username", allusers);
			System.out.println("username=" + allusers);
			session.removeAttribute("suc");
			return "redirect:index.do";
		} else {
			System.out.println("usernafwfwwme=");
			session.setAttribute("suc", "登录失败!用户名或密码错误!");
			return "login";
		}

	}
}

目录
1 绪论 1
1.1课题背景 1
1.2课题研究现状 1
1.3初步设计方法与实施方案 2
1.4本文研究内容 2
2 系统开发环境 4
2.1 使用工具简介 4
2.2 环境配置 4
2.3 B/S结构简介 4
2.4 MySQL数据库 5
2.5 框架介绍 5
3 系统分析 6
3.1系统可行性分析 6
3.1.1经济可行性 6
3.1.2技术可行性 6
3.1.3运行可行性 6
3.2系统现状分析 6
3.3功能需求分析 7
3.4系统设计规则与运行环境 8
3.5系统流程分析 8
3.5.1操作流程 8
3.5.2添加信息流程 9
3.5.3删除信息流程 10
4 系统设计 11
4.1系统设计主要功能 11
4.2数据库设计 11
4.2.1数据库设计规范 11
4.2.2 E/R图 11
4.2.3数据表 12
5 系统实现 25
5.1系统功能模块 25
5.2后台模块 27
5.2.1管理员功能模块 27
5.2.2用户功能模块 30
6 系统测试 33
6.1功能测试 33
6.2可用性测试 33
6.3性能测试 34
6.4测试结果分析 34
7结 论 35
参考文献 36
致 谢 37