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

news2025/7/11 0:16:11

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

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

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

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

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

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

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

退出模块:

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

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

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

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

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

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

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

商品信息管理模块:

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

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

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

所有购物管理模块:

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

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

订单信息模块:

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

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

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

}

}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/109367.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

转行IT,女生学编程有前途吗?

一直以来&#xff0c;IT行业对技术的高要求让人们把这个行业标签为男生专属&#xff0c;从前只有个别女生顶着强大的压力、身边人的不理解坚守在IT岗位。 近些年随着互联网科技的发展与普及&#xff0c;很多女孩子发现原来IT技术没有自己想象中难&#xff0c;而且还可以毕业拿高…

Java项目:springboot课程自动排课系统

作者主页&#xff1a;源码空间站2022 简介&#xff1a;Java领域优质创作者、Java项目、学习资料、技术互助 文末获取源码 项目介绍 课程自动排课系统&#xff0c;该系统分两种角色&#xff1a;管理员与普通用户&#xff1b; 主要功能包括&#xff1a; 首页&#xff1a;查看分…

【运维有小邓】AD域权限报表

企业需要每天都警惕内部攻击和间谍等重大安全威胁。防范潜在的攻击者对保护组织的网络和数据大有裨益。但是&#xff0c;要实现此目标&#xff0c;还需满足几点。您必须完全了解分配给Windows Active Directory (AD)中用户和组的权限&#xff0c;它们可访问的帐户、资源和数据&…

java学习day64(乐友商城)Elasticsearch

1.Elasticsearch介绍和安装 用户访问我们的首页&#xff0c;一般都会直接搜索来寻找自己想要购买的商品。 而商品的数量非常多&#xff0c;而且分类繁杂。如何能正确的显示出用户想要的商品&#xff0c;并进行合理的过滤&#xff0c;尽快促成交易&#xff0c;是搜索系统要研究…

自己可以学习python吗?

现在还有很多小伙伴们在怀疑自学Python编程语言行不行&#xff0c;我想说Python自学是肯定行的&#xff0c;最重要的是要看自己的努力程度&#xff0c;Python是一个简单的编程语言&#xff0c;任何懂python语法规则的人都可以操作部署&#xff0c;更重要的是它是免费开源的&…

【学习笔记】前端HTML+CSS部分必懂基础内容(面试考察重点)

一、HTML 1. 什么是语义化&#xff1f;为什么要语义化&#xff1f;语义化标签有哪些 语义化&#xff1a;根据内容的结构化&#xff08;内容语义化&#xff09;&#xff0c;选择合适的标签&#xff08;代码语义化&#xff09;便于开发者阅读和写出更优雅的代码的同时让浏览器的…

试卷的安全方案

摘 要 随着互联网的飞速发展,传统的人工试卷保密措施已渐渐形成智能互联网加密保护。巨大的变革大大减少工作量&#xff0c;提升试卷质量&#xff0c;但随之而来的试卷拟定到发放以及回收的安全问题日益凸显。为了保护智能互联网试卷的保密性,认证授权加密已经成为了互联网传输…

MIUI10国际版系统自定义字体设置办法

国际版系统主题商店中没有字体设置。只有主题和壁纸 需要用到第三方主题安装工具mythemer和miui字体打包主题工具mifont maker 首先在网络上下载ttf格式的字体。 打开mifont maker&#xff0c;点击create custom font 点击pick font选择下载的字体 点击create miui font 制…

AlertDialog6种使用方法

AlertDialog 1.AlertDialog的6种创建模式 1.1setMessage 1&#xff09;Java代码 //1.创建构造器AlertDialog.Builder buildernew AlertDialog.Builder(this);//2.设置参数builder.setTitle("弹窗提示").setIcon(R.mipmap.boy).setMessage("选择你的性别&#xf…

刚毕业1年,做Python挣了60W!”网友:吹的不多..

现状揭秘 &#xff1a; Python岗位大厂50K起&#xff1f; 程序员&#xff1a; 心态崩了&#xff01; 屠杀各种榜单&#xff0c;拿下语言排行榜的Python&#xff0c;薪酬真的如同网传开挂了吗&#xff1f; 从上图看&#xff0c;Python薪酬普遍集中在 25-35k &#xff0c;也就是…

构建系列之新一代利器Esbuild(上)

What is Esbuild&#xff1f; Esbuild 是由 Figma 的 CTO 「Evan Wallace」基于 Golang 开发的一款打包工具&#xff0c;相比传统的打包工具&#xff0c;主打性能优势&#xff0c;在构建速度上可以快10~100 倍。 为什么会这么快&#xff1f; go实现&#xff0c;编译为本地代码…

Linux:阿里云服务器购买数据盘并挂载流程

1.进入ECS实例详情&#xff0c;找到‘创建云盘’按钮 2.进入购买界面并配置 3.确认订单等待自动挂载 4.返回实例&#xff0c;就能看到刚刚够买的数据盘 5.查看已挂载数据盘情况 df -lh6.查看所有数据盘包括未挂在的数据盘 fdisk -l 7.对数据盘进行分区。 fdisk /de…

maven中的pom

maven中的pompom的最低要求配置pom的默认行为packaging有哪些关于dependencytypescope关于 Dependency Management构建maven聚合工程&#xff0c;父子工程maven官方文档 !!!pom的最低要求配置 总共5个 project-根元素modelVersion -设置为4.0.0即可groupId-项目分组的idartif…

Polygon zkEVM发布公开测试网2.0

1. 引言 Polygon zkEVM发布公开测试网2.0&#xff0c;相比于10月份发布的公开测试网1.0版本&#xff0c;做了如下改进&#xff1a; 支持递归证明&#xff08;testnet1.0采用的是one batch of transactions对应one proof&#xff09;&#xff1a;从而支持多个provers并行工作&…

【架构师(第五十三篇)】 性能优化之 HTTP 缓存

ETag ETagHTTP 响应头是资源的特定版本的标识符&#xff0c;这可以让缓存更高效&#xff0c;并节省带宽&#xff0c;因为如果内容没有改变&#xff0c;web 服务器不需要发送完整的响应。 第二次请求的时候会添加一个 If-None-Match 请求头&#xff0c;去判断文件是否发生过变化…

[思维模式-11]:《如何系统思考》-7- 认识篇 - 克服片面、局部思维,转向全面思考 =》 UML

目录 第1章 全面思考概述&#xff08;空间&#xff09; 1.1 什么是全面思考&#xff08;整体思考&#xff09; 1.2 全面思考的含义 1.3 程序的局部性原理 第2章 如何做到全面思考 2.1 本位思考 》 全局思考 2.2 大局观&#xff0c;既是一种格局&#xff0c;也是一种能力…

【SpringMVC】下篇,拦截器(一步到位学会它)

✅作者简介&#xff1a;热爱Java后端开发的一名学习者&#xff0c;大家可以跟我一起讨论各种问题喔。 &#x1f34e;个人主页&#xff1a;Hhzzy99 &#x1f34a;个人信条&#xff1a;坚持就是胜利&#xff01; &#x1f49e;当前专栏&#xff1a;【Spring】 &#x1f96d;本文内…

Java项目:springboot私人牙医管理系统

作者主页&#xff1a;源码空间站2022 简介&#xff1a;Java领域优质创作者、Java项目、学习资料、技术互助 文末获取源码 项目介绍 私人牙医管理系统。该项目分为前后台&#xff0c;共三种角色&#xff1a;管理员、医生、客户&#xff1b; 前台主要功能包括&#xff1a;首页、…

【记录】Tiff图像的前处理,median blur filter 及 linear stretch

文章目录读取Tiffmedian blur filter 中值滤波器替换百分位值值域变成[0,255]从Google Earth Engine上下载的sentinel-1遥感影像(float32)。对于SAR影像在使用前可以做如下前处理&#xff1a;去除SAR噪点替换百分位2%以下及百分位98%以上的点linear stretch 将sentinel-1的值域…

【web3】使用web3.js发布并执行智能合约

前言 昨天我们学习了使用 web3.js 库查询链上区块和交易的用法&#xff0c;今天我们来介绍一下使用 web3.js 与智能合约的交互。在学习本节前&#xff0c;你应该对智能合约有一定的了解。 智能合约的生命周期包括 创建、发布、执行 以及 销毁。 创建&#xff1a;在 Remix 中…