免费分享一个SSM商城管理系统,很漂亮的

article/2025/8/26 14:36:12

大家好,我是锋哥,看到一个不错的SSM商城管理系统,分享下哈。

项目介绍

这是基于SSM框架开发的项目,前端用户界面采用 Html+css+JavaScript+Ajax开发,后台管理页面采用Easyui技术开发。

项目展示

1、主界面
在这里插入图片描述

2、商品详情页面
在这里插入图片描述

3、登陆界面
在这里插入图片描述

4、管理员登录
在这里插入图片描述

5、后台管理-菜单管理
在这里插入图片描述

6、后台管理-订单管理
在这里插入图片描述

7、后台管理-商品分类管理
在这里插入图片描述

数据库设计

在这里插入图片描述

部分代码

package com.ischoolbar.programmer.controller.admin;import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;import com.ischoolbar.programmer.entity.admin.Role;
import com.ischoolbar.programmer.entity.admin.User;
import com.ischoolbar.programmer.page.admin.Page;
import com.ischoolbar.programmer.service.admin.RoleService;
import com.ischoolbar.programmer.service.admin.UserService;/*** 用户管理控制器* @author llq**/
@RequestMapping("/admin/user")
@Controller
public class UserController {@Autowiredprivate UserService userService;@Autowiredprivate RoleService roleService;/*** 用户列表页面* @param model* @return*/@RequestMapping(value="/list",method=RequestMethod.GET)public ModelAndView list(ModelAndView model){Map<String, Object> queryMap = new HashMap<String, Object>();model.addObject("roleList", roleService.findList(queryMap));model.setViewName("user/list");return model;}/*** 获取用户列表* @param page* @param username* @param roleId* @param sex* @return*/@RequestMapping(value="/list",method=RequestMethod.POST)@ResponseBodypublic Map<String, Object> getList(Page page,@RequestParam(name="username",required=false,defaultValue="") String username,@RequestParam(name="roleId",required=false) Long roleId,@RequestParam(name="sex",required=false) Integer sex){Map<String, Object> ret = new HashMap<String, Object>();Map<String, Object> queryMap = new HashMap<String, Object>();queryMap.put("username", username);queryMap.put("roleId", roleId);queryMap.put("sex", sex);queryMap.put("offset", page.getOffset());queryMap.put("pageSize", page.getRows());ret.put("rows", userService.findList(queryMap));ret.put("total", userService.getTotal(queryMap));return ret;}/*** 添加用户* @param user* @return*/@RequestMapping(value="/add",method=RequestMethod.POST)@ResponseBodypublic Map<String, String> add(User user){Map<String, String> ret = new HashMap<String, String>();if(user == null){ret.put("type", "error");ret.put("msg", "请填写正确的用户信息!");return ret;}if(StringUtils.isEmpty(user.getUsername())){ret.put("type", "error");ret.put("msg", "请填写用户名!");return ret;}if(StringUtils.isEmpty(user.getPassword())){ret.put("type", "error");ret.put("msg", "请填写密码!");return ret;}if(user.getRoleId() == null){ret.put("type", "error");ret.put("msg", "请选择所属角色!");return ret;}if(isExist(user.getUsername(), 0l)){ret.put("type", "error");ret.put("msg", "该用户名已经存在,请重新输入!");return ret;}if(userService.add(user) <= 0){ret.put("type", "error");ret.put("msg", "用户添加失败,请联系管理员!");return ret;}ret.put("type", "success");ret.put("msg", "角色添加成功!");return ret;}/*** 编辑用户* @param user* @return*/@RequestMapping(value="/edit",method=RequestMethod.POST)@ResponseBodypublic Map<String, String> edit(User user){Map<String, String> ret = new HashMap<String, String>();if(user == null){ret.put("type", "error");ret.put("msg", "请填写正确的用户信息!");return ret;}if(StringUtils.isEmpty(user.getUsername())){ret.put("type", "error");ret.put("msg", "请填写用户名!");return ret;}
//		if(StringUtils.isEmpty(user.getPassword())){
//			ret.put("type", "error");
//			ret.put("msg", "请填写密码!");
//			return ret;
//		}if(user.getRoleId() == null){ret.put("type", "error");ret.put("msg", "请选择所属角色!");return ret;}if(isExist(user.getUsername(), user.getId())){ret.put("type", "error");ret.put("msg", "该用户名已经存在,请重新输入!");return ret;}if(userService.edit(user) <= 0){ret.put("type", "error");ret.put("msg", "用户添加失败,请联系管理员!");return ret;}ret.put("type", "success");ret.put("msg", "角色添加成功!");return ret;}/*** 批量删除用户* @param ids* @return*/@RequestMapping(value="/delete",method=RequestMethod.POST)@ResponseBodypublic Map<String, String> delete(String ids){Map<String, String> ret = new HashMap<String, String>();if(StringUtils.isEmpty(ids)){ret.put("type", "error");ret.put("msg", "选择要删除的数据!");return ret;}if(ids.contains(",")){ids = ids.substring(0,ids.length()-1);}if(userService.delete(ids) <= 0){ret.put("type", "error");ret.put("msg", "用户删除失败,请联系管理员!");return ret;}ret.put("type", "success");ret.put("msg", "用户删除成功!");return ret;}/*** 上传图片* @param photo* @param request* @return*/@RequestMapping(value="/upload_photo",method=RequestMethod.POST)@ResponseBodypublic Map<String, String> uploadPhoto(MultipartFile photo,HttpServletRequest request){Map<String, String> ret = new HashMap<String, String>();if(photo == null){ret.put("type", "error");ret.put("msg", "选择要上传的文件!");return ret;}if(photo.getSize() > 1024*1024*1024){ret.put("type", "error");ret.put("msg", "文件大小不能超过10M!");return ret;}//获取文件后缀String suffix = photo.getOriginalFilename().substring(photo.getOriginalFilename().lastIndexOf(".")+1,photo.getOriginalFilename().length());if(!"jpg,jpeg,gif,png".toUpperCase().contains(suffix.toUpperCase())){ret.put("type", "error");ret.put("msg", "请选择jpg,jpeg,gif,png格式的图片!");return ret;}String savePath = request.getServletContext().getRealPath("/") + "/resources/upload/";File savePathFile = new File(savePath);if(!savePathFile.exists()){//若不存在改目录,则创建目录savePathFile.mkdir();}String filename = new Date().getTime()+"."+suffix;try {//将文件保存至指定目录photo.transferTo(new File(savePath+filename));}catch (Exception e) {// TODO Auto-generated catch blockret.put("type", "error");ret.put("msg", "保存文件异常!");e.printStackTrace();return ret;}ret.put("type", "success");ret.put("msg", "用户删除成功!");ret.put("filepath",request.getServletContext().getContextPath() + "/resources/upload/" + filename );return ret;}/*** 判断该用户名是否存在* @param username* @param id* @return*/private boolean isExist(String username,Long id){User user = userService.findByUsername(username);if(user == null)return false;if(user.getId().longValue() == id.longValue())return false;return true;}
}
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@include file="../common/header.jsp"%>
<div class="easyui-layout" data-options="fit:true"><!-- Begin of toolbar --><div id="wu-toolbar"><div class="wu-toolbar-button"><%@include file="../common/menus.jsp"%></div><div class="wu-toolbar-search"><label>客户名称:</label><input id="search-name" class="wu-text" style="width:100px"><label>客户性别:</label><select id="search-sex" class="easyui-combobox" style="width:100px"><option value="-1">全部</option><option value="0">未知</option><option value="1"></option><option value="2"></option></select><label>客户状态:</label><select id="search-status" class="easyui-combobox" style="width:100px"><option value="-1">全部</option><option value="1">正常</option><option value="0">冻结</option></select>	<a href="#" id="search-btn" class="easyui-linkbutton" iconCls="icon-search">搜索</a></div></div><!-- End of toolbar --><table id="data-datagrid" class="easyui-datagrid" toolbar="#wu-toolbar"></table>
</div>
<!-- Begin of easyui-dialog -->
<div id="add-dialog" class="easyui-dialog" data-options="closed:true,iconCls:'icon-save'" style="width:420px; padding:10px;"><form id="add-form" method="post"><table><tr><td width="60" align="right">客户名:</td><td><input type="text" name="name" class="wu-text easyui-validatebox" data-options="required:true, missingMessage:'请填写客户名称'" /></td></tr><tr><td width="60" align="right">密码:</td><td><input type="password" name="password" class="wu-text easyui-validatebox" data-options="required:true, missingMessage:'请填写客户密码'" /></td></tr><tr><td width="60" align="right">邮箱:</td><td><input type="text" name="email" class="wu-text" /></td></tr><tr><td width="60" align="right">真实姓名:</td><td><input type="text" name="trueName" class="wu-text" /></td></tr><tr><td width="60" align="right">性别:</td><td><select name="sex" class="easyui-combobox" style="width:268px"><option value="0">未知</option><option value="1"></option><option value="2"></option></select>	</td></tr><tr><td width="60" align="right">状态:</td><td><select name="status" class="easyui-combobox" style="width:268px"><option value="1">正常</option><option value="0">冻结</option></select>	</td></tr></table></form>
</div>
<!-- 修改窗口 -->
<div id="edit-dialog" class="easyui-dialog" data-options="closed:true,iconCls:'icon-save'" style="width:450px; padding:10px;"><form id="edit-form" method="post"><input type="hidden" name="id" id="edit-id"><table><tr><td width="60" align="right">客户名:</td><td><input type="text" id="edit-name" name="name" class="wu-text easyui-validatebox" data-options="required:true, missingMessage:'请填写客户名称'" /></td></tr><tr><td width="60" align="right">密码:</td><td><input type="password" id="edit-password" name="password" class="wu-text easyui-validatebox" data-options="required:true, missingMessage:'请填写客户密码'" /></td></tr><tr><td width="60" align="right">邮箱:</td><td><input type="text" id="edit-email" name="email" class="wu-text" /></td></tr><tr><td width="60" align="right">真实姓名:</td><td><input type="text" id="edit-trueName" name="trueName" class="wu-text" /></td></tr><tr><td width="60" align="right">性别:</td><td><select id="edit-sex" name="sex" class="easyui-combobox" style="width:268px"><option value="0">未知</option><option value="1"></option><option value="2"></option></select>	</td></tr><tr><td width="60" align="right">状态:</td><td><select id="edit-status" name="status" class="easyui-combobox" style="width:268px"><option value="1">正常</option><option value="0">冻结</option></select>	</td></tr></table></form>
</div>
<%@include file="../common/footer.jsp"%><!-- End of easyui-dialog -->
<script type="text/javascript">/***  添加记录*/function add(){var validate = $("#add-form").form("validate");if(!validate){$.messager.alert("消息提醒","请检查你输入的数据!","warning");return;}var data = $("#add-form").serialize();$.ajax({url:'add',dataType:'json',type:'post',data:data,success:function(data){if(data.type == 'success'){$.messager.alert('信息提示','添加成功!','info');$('#add-dialog').dialog('close');$('#data-datagrid').datagrid('reload');}else{$.messager.alert('信息提示',data.msg,'warning');}}});}/***  添加记录*/function edit(){var validate = $("#edit-form").form("validate");if(!validate){$.messager.alert("消息提醒","请检查你输入的数据!","warning");return;}var data = $("#edit-form").serialize();$.ajax({url:'edit',dataType:'json',type:'post',data:data,success:function(data){if(data.type == 'success'){$.messager.alert('信息提示','编辑成功!','info');$('#edit-dialog').dialog('close');$('#data-datagrid').datagrid('reload');}else{$.messager.alert('信息提示',data.msg,'warning');}}});}/*** 删除记录*/function remove(){$.messager.confirm('信息提示','确定要删除该记录?', function(result){if(result){var item = $('#data-datagrid').datagrid('getSelected');if(item == null || item.length == 0){$.messager.alert('信息提示','请选择要删除的数据!','info');return;}$.ajax({url:'delete',dataType:'json',type:'post',data:{id:item.id},success:function(data){if(data.type == 'success'){$.messager.alert('信息提示','删除成功!','info');$('#data-datagrid').datagrid('reload');}else{$.messager.alert('信息提示',data.msg,'warning');}}});}	});}/*** Name 打开编辑窗口*/function openEdit(){//$('#add-form').form('clear');var item = $('#data-datagrid').datagrid('getSelected');if(item == null || item.length == 0){$.messager.alert('信息提示','请选择要编辑的数据!','info');return;}$('#edit-dialog').dialog({closed: false,modal:true,title: "编辑客户信息",buttons: [{text: '确定',iconCls: 'icon-ok',handler: edit}, {text: '取消',iconCls: 'icon-cancel',handler: function () {$('#edit-dialog').dialog('close');                    }}],onBeforeOpen:function(){//$("#add-form input").val('');$("#edit-id").val(item.id);$("#edit-sex").combobox('setValue',item.sex);$("#edit-status").combobox('setValue',item.status);$("#edit-name").val(item.name);$("#edit-password").val(item.password);$("#edit-email").val(item.email);$("#edit-trueName").val(item.trueName);}});}/*** Name 打开添加窗口*/function openAdd(){//$('#add-form').form('clear');$('#add-dialog').dialog({closed: false,modal:true,title: "添加客户信息",buttons: [{text: '确定',iconCls: 'icon-ok',handler: add}, {text: '取消',iconCls: 'icon-cancel',handler: function () {$('#add-dialog').dialog('close');                    }}],onBeforeOpen:function(){//$("#add-form input").val('');}});}//搜索按钮监听$("#search-btn").click(function(){var option = {name:$("#search-name").val()};var sex = $("#search-sex").combobox('getValue');if(sex != -1){option.sex = sex;}var status = $("#search-status").combobox('getValue');if(status != -1){option.status = status;}$('#data-datagrid').datagrid('reload',option);});function add0(m){return m<10?'0'+m:m }function format(shijianchuo){//shijianchuo是整数,否则要parseInt转换var time = new Date(shijianchuo);var y = time.getFullYear();var m = time.getMonth()+1;var d = time.getDate();var h = time.getHours();var mm = time.getMinutes();var s = time.getSeconds();return y+'-'+add0(m)+'-'+add0(d)+' '+add0(h)+':'+add0(mm)+':'+add0(s);}/** * 载入数据*/$('#data-datagrid').datagrid({url:'list',rownumbers:true,singleSelect:true,pageSize:20,           pagination:true,multiSort:true,fitColumns:true,idField:'id',treeField:'name',fit:true,columns:[[{ field:'chk',checkbox:true},{ field:'name',title:'客户名称',width:180,sortable:true},{ field:'password',title:'登录密码',width:200},{ field:'email',title:'邮箱',width:200},{ field:'trueName',title:'真实姓名',width:200},{ field:'sex',title:'性别',width:200,formatter:function(value,index,row){if(value == 0)return '未知';if(value == 1)return '男';if(value == 2)return '女';return (value);}},{ field:'status',title:'状态',width:200,formatter:function(value,index,row){if(value == 0)return '冻结';if(value == 1)return '正常';return (value);}},{ field:'createTime',title:'注册时间',width:200,formatter:function(value,index,row){return format(value);}},]]});
</script>

源码下载

(CSDN 1积分下载):https://download.csdn.net/download/caofeng891102/87302541

或者加锋哥WX: java9266(备用:java8822 ) 直接领取也行

热门推荐

我写了一套SpringBoot+SpringSecurity+Vue权限系统 实战课程,免费分享给CSDN的朋友们

我写了一套SpringBoot微信小程序电商全栈就业实战课程,免费分享给CSDN的朋友们

springboot+vue前后端音乐网系统,挺漂亮的

免费分享一个springboot+vue校园宿舍管理系统,挺漂亮的


http://chatgpt.dhexx.cn/article/dj9LSthf.shtml

相关文章

在线商城和商城后台管理系统

在线商城和商城后台管理系统 1、商城使用了vue2elementUI 实现了登录注册、浏览商品、购买商品、收藏商品、商品搜索、加入购物车、查看订单、添加收货地址、在线客服、分类查看商品的等功能 没什么难的地方&#xff0c;都很基本。随便写下功能实现。 查看商品详情把商品id传…

JavaWeb蛋糕商城管理系统(客户端+后台管理端)+ppt+万字论文

JavaWeb蛋糕商城管理系统 需要资源qq:1597720408获取 一、系统总模块 二、管理员模块流程图 三、用户登录模块 四、各功能模块 1、用户登录模块 2、用户注册模块 3、主页面模块 4、商品分类模块 5、购物车模块 6、结算模块 7、管理员登录模块 8、管理员模块主页面 9、管理员管…

Java项目-宠物商城管理系统

题目&#xff1a;基于JavaWeb宠物商城管理系统的设计与实现-Servlet_宠物店管理系统_jsp_petmall 注意&#xff1a;这里不是全部功能&#xff0c;需要全部功能的可以看评论联系我 1.系统总体设计 1.1开发环境 操作系统&#xff1a;Windows10&#xff1b; 编程语言&#xff1a…

微服务项目之电商--9.商城架构图及商城管理系统前端页面介绍及电商项目初步搭建(1)

目录 一、商城架构图 前端&#xff1a; 二、商城管理系统前端页面 1、SPA介绍 2、webpack 四个核心概念 3、vue-cli 安装 4、项目测试 三、电商项目搭建 创建父模块管理 创建子模板注册中心ly-registry 创建modul子项目ly-gateway 创建ly-item父工程&#xff08;…

计算机毕业设计java+ssm水果商城管理系统(源码+系统+mysql数据库+Lw文档)

项目介绍 小熊猫水果管理系统是水果商业贸易中的一条非常重要的道路&#xff0c;可以把其从传统的实体模式中解放中来&#xff0c;网上购物可以为消费者提供巨大的便利。通过小熊猫水果管理系统这个平台&#xff0c;可以使用户足不出户就可以了解现今的流行趋势和丰富的水果信…

基于ThinkPHP6+Layui商城管理系统开发框架

项目介绍 一款 PHP 语言基于 ThinkPhp6.x、Layui、MySQL等框架精心打造的一款模块化、插件化、高性能的前后端分离架构敏捷开发框架&#xff0c;可用于快速搭建前后端分离后台管理系统&#xff0c;本着简化开发、提升开发效率的初衷&#xff0c;框架自研了一套个性化的组件&am…

基于java springmvc+mybatis酒水商城管理系统设计和实现

&#x1f345; 作者主页&#xff1a;Java李杨勇 &#x1f345; 简介&#xff1a;Java领域优质创作者&#x1f3c6;、【java奥斯卡】公号作者✌ 简历模板、学习资料、面试题库【关注我&#xff0c;都给你】 &#x1f345;文末获取源码联系&#x1f345; 临近学期结束&#xff…

php简单的商城系统,DouPHP轻量级商城管理系统

DouPHP轻量级商城管理系统&#xff0c;基于DouPHP核心开发&#xff0c;使用PHPMYSQL架构的&#xff0c;可以使用它快速搭建一个商城系统。 操作简单 后台简约明了&#xff0c;从使用者而不是开发者的角度出发设计后台功能布局&#xff0c;完全不需要使用手册就可以轻松进行日常…

基于ASP.NET C#的服装商城管理系统

摘 要 本毕业设计的内容是设计并且实现一个基于net语言的服装商城管理系统。它是在Windows下&#xff0c;以SQL Server为数据库开发平台&#xff0c;服装商城管理系统的功能已基本实现&#xff0c;主要包括用户、服装信息、通知公告、留言板、订单信息等。 论文主要从系统的分…

基于java+SpringBoot框架蛋糕销售商城管理系统详细设计

研究背景 随着计算机技术的飞速发展&#xff0c;供应商可以利用计算机技术来完成我们以前手工完成的一些工作&#xff0c;这可以大大提高工作效率&#xff0c;节省更多的人力资源。此外&#xff0c;电脑还可以对相关数据进行统计&#xff0c;帮助卖家根据销售情况制定销售策略…

基于SpringBoot+VUE的服装销售商城管理系统

项目背景 随着科学技术的飞速发展&#xff0c;社会的方方面面、各行各业都在努力与现代的先进技术接轨&#xff0c;通过科技手段来提高自身的优势&#xff0c;服装销售商城当然也不能排除在外。服装销售商城是以实际运用为开发背景&#xff0c;运用软件工程原理和开发方法&…

基于SSM的在线商城管理系统

基于SSM的在线商城管理系统 1.摘要 我国是公认的服装生产大国和出口国&#xff0c;服装市场一直在我国经济中占据重要地位&#xff0c;并且当今随着互联网技术的快速发展和各网上销售平台的成功先例&#xff0c;使得信息化管理越来越受各行各业青睐。如果服装销售平台能加强在…

基于SSM的网上购物商城管理系统

项目背景 随着科技的飞速发展&#xff0c;计算机已经广泛的应用于各行各业当中&#xff0c;而且日趋普及。在各个领域内&#xff0c;计算机的应用已经十分广泛&#xff0c;各种智能设备都与计算机紧密结合在一起&#xff0c;主要应用于两个方面&#xff1a;一是以设备为主。另…

[附源码]java毕业设计商城管理系统

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

鲜花商城管理系统

1、项目介绍 鲜花商城管理系统拥有两种角色 管理员&#xff1a;用户管理、分类管理、商品管理、添加鲜花、订单管理、留言管理、新闻管理等 用户&#xff1a;登录注册、购物车、下单、历史订单记录、分类查询商品等 2、项目技术 后端框架&#xff1a; Servlet、mvc模式 前…

基于SSM的商城管理系统

1、项目介绍 基于SSM的商城管理系统拥有两种角色&#xff0c;用户和管理员 用户&#xff1a;商品查看、购买&#xff0c;历史订单查询、购物车功能、留言 管理员&#xff1a;商品管理、分类管理、订单管理、用户管理、留言管理 2、项目技术 后端框架&#xff1a;SSM&#…

基于SSM框架实现商城管理系统

介绍 基于ssm做的一个商城管理系统&#xff0c;学习完Spring&#xff0c;SpringMVC&#xff0c;MyBatis之后&#xff0c;想着敲一个小demo来巩固一些学到的知识&#xff0c;于是做一个手机展示作品&#xff08;不完整&#xff09;&#xff0c;还有一些功能待完善。 用到的技术…

[附源码]计算机毕业设计springboot万佳商城管理系统

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

Java毕业设计-商城管理系统

&#x1f525;作者主页&#xff1a;疯狂行者&#x1f525; &#x1f496;简介&#xff1a;Java领域新星创作者&#x1f3c6;、【计算机源码之家】公号作者✌ 简历模板、学习资料、面试题库【关注我&#xff0c;都给你】&#x1f496; &#x1f496;文末获取源码联系&#x1f…

基于javaweb的个人pc电脑商城系统(java+ssm+jsp+jquery+mysql)

基于javaweb的个人pc电脑商城系统(javassmjspjquerymysql) 运行环境 Java≥8、MySQL≥5.7、Tomcat≥8 开发工具 eclipse/idea/myeclipse/sts等均可配置运行 适用 课程设计&#xff0c;大作业&#xff0c;毕业设计&#xff0c;项目练习&#xff0c;学习演示等 功能说明 基…