Java+MySQL基于SSM的二手玩具交换网站

60 篇文章 1 订阅

本二手玩具交换网站主要包括系统用户管理模块、商品信息管理模块、所有购买记录、订单信息、登录模块、和退出模块等多个模块。它帮助二手玩具交换实现了信息化、网络化,通过测试,实现了系统设计目标,相比传统的管理模式,本系统合理的利用了二手玩具交换数据资源,有效的减少了二手玩具交换的经济投入,大大提高了二手玩具交换的效率。 请添加图片描述
用户模块:

资料管理:用户登录本系统。可以对自己的个人主页进行查看。

系统信息:用户可以查看自己的系统提示信息。

修改资料:用户可以修改自己的账号密码。

信息搜索:用户可以通过关键字搜索站内信息。

密码修改:用户可以修改个人登录密码。

系统管理模块:包括数据备份。

退出模块:

管理员退出:管理员用来退出系统。

用户退出:用户用来退出系统。
请添加图片描述

本系统主要包含了等系统用户管理、优惠劵管理、所有购物管理、所有购物管理多个功能模块。下面分别简单阐述一下这几个功能模块需求。

管理员的登录模块:管理员登录系统对本系统其他管理模块进行管理。

用户的登录模块:用户登录本系统,对个人的信息等进行查询,操作可使用的功能。

用户注册模块:用户可以进行用户注册,系统会反馈是否注册成功。

添加管理员模块:向本系统中添加更多的管理人员,管理员包括普通管理员和超级管理员。

商品信息管理模块:

商品信息列表:将数据库的商品信息表以列表的形式呈现给管理员。

添加商品信息:实现管理员添加商品信息。

修改商品信息:实现管理员修改商品信息。

所有购物管理模块:

所有购物列表:显示系统的所有所有购物,可以通过关键字查询。

所有购物删除:对输入错误或过期的所有购物删除。

订单信息模块:

新闻列表:显示系统的所有新闻,可以通过关键字查询。

新闻删除:对输入错误或过期的新闻删除。

请添加图片描述
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(pagenull||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(pwdnull||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 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";
	}

}

}

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值