基于SSH的母婴用品销售管理系统带万字文档

news2024/10/4 23:45:52

文章目录

  • 母婴商城系统
    • 一、项目演示
    • 二、项目介绍
    • 三、系统部分功能截图
    • 四、万字论文参考
    • 五、部分代码展示
    • 六、底部获取项目源码和万字论文参考(9.9¥带走)

母婴商城系统

一、项目演示

母婴商城系统

二、项目介绍

基于SSH的母婴商城系统

系统角色 : 管理员、用户

一,管理员
1、用户登陆 2、商品展示 3、会员注册 4、我的购物车 5、我的订单 6、留言反馈 7、促销信息

二,用户
1、修改登陆密码 2、商品类型管理 3、商品信息管理 4、会员信息管理 5、订单信息管理 6、留言反馈管理 7、促销信息管理

语言:java
技术栈:Spring;JSP; Struts2; hibernate
数据库:MySQL

三、系统部分功能截图

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

四、万字论文参考

在这里插入图片描述
在这里插入图片描述

五、部分代码展示

package com.itbaizhan.action;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.itbaizhan.dao.TGoodsDAO;
import com.itbaizhan.dao.TMingxiDAO;
import com.itbaizhan.dao.TOrderDAO;
import com.itbaizhan.model.TGoods;
import com.itbaizhan.model.THuiyuan;
import com.itbaizhan.model.TMingxi;
import com.itbaizhan.model.TOrder;
import com.itbaizhan.util.Cart;
import com.opensymphony.xwork2.ActionSupport;

public class buyAction extends ActionSupport
{
	private TGoodsDAO goodsDAO;
	private TOrderDAO orderDAO;
	private TMingxiDAO mingxiDAO;
	
	private String message;
	private String path;
	
	public String addToCart()
	{
		HttpServletRequest request=ServletActionContext.getRequest();
		HttpSession session=request.getSession();
		
		int goodsId=Integer.parseInt(request.getParameter("goodsId"));
		int shuliang=Integer.parseInt(request.getParameter("shuliang"));
		
		TGoods goods=goodsDAO.findById(goodsId);
		TMingxi mingxi=new TMingxi();
		mingxi.setGoods(goods);
		mingxi.setGoodsShuliang(shuliang);
		
		Cart cart = (Cart)session.getAttribute("cart");
		cart.addGoods(goodsId, mingxi);
		session.setAttribute("cart",cart);
		
		this.setMessage("成功购物");
		this.setPath("myCart.action");
		return "succeed";
	}
	
	
	
	public String myCart()
	{
		return ActionSupport.SUCCESS;
	}
	
	
	public String orderQueren()
	{
		Map request=(Map)ServletActionContext.getContext().get("request");
		
		return ActionSupport.SUCCESS;
	}
	
	
	public String orderSubmit()
	{
		HttpServletRequest request=ServletActionContext.getRequest();
		HttpSession session=request.getSession();
		
		Cart cart = (Cart)session.getAttribute("cart");
		THuiyuan huiyuan=(THuiyuan)session.getAttribute("huiyuan");
		
		TOrder order=new TOrder();
		//order.setId(id);
		order.setBianhao(new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()));
		order.setXiadanshi(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));
		order.setZt("待受理");
		
		order.setSonghuodizhi(request.getParameter("songhuodizhi"));
		order.setFukuanfangshi(request.getParameter("fukuanfangshi"));
		order.setZongjia(cart.getTotalPrice());
		order.setHuiyuanId(huiyuan.getId());
		
		
		orderDAO.save(order);
		
		for (Iterator it = cart.getItems().values().iterator(); it.hasNext();)
		{

			TMingxi mingxi = (TMingxi) it.next();
			
			mingxi.setOrderId(order.getId());
			mingxi.setGoodsId(mingxi.getGoods().getId());
			
			mingxiDAO.save(mingxi);
		}
		
		cart.getItems().clear();
		session.setAttribute("cart", cart);
		
		request.setAttribute("order", order);
		
		return ActionSupport.SUCCESS;
		
	}
	
	
	
	public String orderMine()
	{
		Map session= ServletActionContext.getContext().getSession();
		THuiyuan huiyuan=(THuiyuan)session.get("huiyuan");
		
		String sql="from TOrder where huiyuanId="+huiyuan.getId();
		List orderList=orderDAO.getHibernateTemplate().find(sql);
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("orderList", orderList);
		
		return ActionSupport.SUCCESS;
	}
	
	
	public String orderDel()
	{
		HttpServletRequest request=ServletActionContext.getRequest();
		int id=Integer.parseInt(request.getParameter("id"));
		
		TOrder order=orderDAO.findById(id);
		orderDAO.delete(order);
		
		this.setMessage("订单删除完毕");
		this.setPath("orderMine.action");
		return "succeed";
		
	}
	
	
	
	public String orderMana()
	{
		String sql="from TOrder";
		List orderList=orderDAO.getHibernateTemplate().find(sql);
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("orderList", orderList);
		return ActionSupport.SUCCESS;
	}
	
	
	
	
	public String orderShouli()
	{
		HttpServletRequest request=ServletActionContext.getRequest();
		int id=Integer.parseInt(request.getParameter("id"));
		
		TOrder order=orderDAO.findById(id);
		order.setZt("已受理");
		orderDAO.attachDirty(order);
		
		request.setAttribute("msg", "受理订单成功");
		return "msg";
	}
	
	
	
	public String orderDetail()
	{
		HttpServletRequest request=ServletActionContext.getRequest();
		int orderId=Integer.parseInt(request.getParameter("orderId"));
		
		String sql="from TMingxi where orderId="+orderId;
		List mingxiList=mingxiDAO.getHibernateTemplate().find(sql);
		for(int i=0;i<mingxiList.size();i++)
		{
			TMingxi mingxi=(TMingxi)mingxiList.get(i);
			mingxi.setGoods(goodsDAO.findById(mingxi.getGoodsId()));
		}
		request.setAttribute("mingxiList", mingxiList);
		return ActionSupport.SUCCESS;
	}



	public TGoodsDAO getGoodsDAO()
	{
		return goodsDAO;
	}



	public TMingxiDAO getMingxiDAO()
	{
		return mingxiDAO;
	}



	public void setMingxiDAO(TMingxiDAO mingxiDAO)
	{
		this.mingxiDAO = mingxiDAO;
	}



	public void setGoodsDAO(TGoodsDAO goodsDAO)
	{
		this.goodsDAO = goodsDAO;
	}



	public TOrderDAO getOrderDAO()
	{
		return orderDAO;
	}



	public void setOrderDAO(TOrderDAO orderDAO)
	{
		this.orderDAO = orderDAO;
	}



	public String getMessage()
	{
		return message;
	}



	public void setMessage(String message)
	{
		this.message = message;
	}



	public String getPath()
	{
		return path;
	}



	public void setPath(String path)
	{
		this.path = path;
	}
	
}

package com.itbaizhan.action;

import java.util.List;
import java.util.Map;

import org.apache.struts2.ServletActionContext;

import com.itbaizhan.dao.TCuxiaoDAO;
import com.itbaizhan.dao.TGoodsDAO;
import com.itbaizhan.model.TCuxiao;
import com.opensymphony.xwork2.ActionSupport;

public class cuxiaoAction extends ActionSupport
{
	private Integer id;
	private String biaoti;
	private String neirong;
	private String fabushi;
	
	private TCuxiaoDAO cuxiaoDAO;
	
	public String cuxiaoAdd()
	{
		TCuxiao cuxiao=new TCuxiao();
		
		cuxiao.setBiaoti(biaoti);
		cuxiao.setNeirong(neirong);
		cuxiao.setFabushi(fabushi);
		
		cuxiaoDAO.save(cuxiao);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("msg", "信息添加完毕");
		return "msg";
	}
	
	public String cuxiaoMana()
	{
		String sql="from TCuxiao";
		List cuxiaoList=cuxiaoDAO.getHibernateTemplate().find(sql);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("cuxiaoList", cuxiaoList);
		return ActionSupport.SUCCESS;
	}
	
	public String cuxiaoDel()
	{
		TCuxiao cuxiao=cuxiaoDAO.findById(id);
		cuxiaoDAO.delete(cuxiao);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("msg", "信息删除完毕");
		return "msg";
	}
	
	
	
	public String cuxiaoAll()
	{
		String sql="from TCuxiao";
		List cuxiaoList=cuxiaoDAO.getHibernateTemplate().find(sql);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("cuxiaoList", cuxiaoList);
		return ActionSupport.SUCCESS;
	}
	
	public String cuxiaoDetailQian()
	{
		TCuxiao cuxiao=cuxiaoDAO.findById(id);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("cuxiao", cuxiao);
		return ActionSupport.SUCCESS;
	}

	public Integer getId()
	{
		return id;
	}

	public void setId(Integer id)
	{
		this.id = id;
	}

	public String getBiaoti()
	{
		return biaoti;
	}

	public void setBiaoti(String biaoti)
	{
		this.biaoti = biaoti;
	}

	public String getNeirong()
	{
		return neirong;
	}

	public void setNeirong(String neirong)
	{
		this.neirong = neirong;
	}

	public String getFabushi()
	{
		return fabushi;
	}

	public void setFabushi(String fabushi)
	{
		this.fabushi = fabushi;
	}

	public TCuxiaoDAO getCuxiaoDAO()
	{
		return cuxiaoDAO;
	}

	public void setCuxiaoDAO(TCuxiaoDAO cuxiaoDAO)
	{
		this.cuxiaoDAO = cuxiaoDAO;
	}
	
}

package com.itbaizhan.action;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.itbaizhan.dao.TGoodsDAO;
import com.itbaizhan.model.TGoods;
import com.itbaizhan.util.Pagesize;
import com.itbaizhan.util.Pagination;
import com.opensymphony.xwork2.ActionSupport;

public class goodsAction extends ActionSupport
{
	private Integer id;
	private Integer leibieId;
	private String mingcheng;
	private String jieshao;
	
	private String fujian;
	private Integer jiage;
	private Integer tejia;
	private String shifoutejia;
	
	private String del;
	
	private TGoodsDAO goodsDAO;
	
	public String goodsAdd()
	{
		TGoods goods=new TGoods();
		
		//goods.setId(id);
		goods.setLeibieId(leibieId);
		goods.setMingcheng(mingcheng);
		goods.setJieshao(jieshao);
		
		goods.setFujian(fujian);
		goods.setJiage(jiage);
		goods.setTejia(jiage);
		goods.setShifoutejia("no");
		
		goods.setDel("no");
		
		goodsDAO.save(goods);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("msg", "信息添加成功");
		return "msg";
	}
	
	
	public String goodsMana()
	{
		String sql="from TGoods where del='no' order by leibieId";
		List goodsList=goodsDAO.getHibernateTemplate().find(sql);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("goodsList", goodsList);
		return ActionSupport.SUCCESS;
	}
	
	public String goodsDel()
	{
		TGoods goods=goodsDAO.findById(id);
		goods.setDel("yes");
		
		goodsDAO.attachDirty(goods);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("msg", "信息删除成功");
		return "msg";
	}
	
	public String goodsAll()
	{
		String sql="from TGoods where del='no' order by id desc";
		List goodsList=goodsDAO.getHibernateTemplate().find(sql);
		
		HttpServletRequest request=ServletActionContext.getRequest();
		int index=0;
		if(request.getParameter("index")==null)
		{
			index=1;
		}
		else
		{
			index=Integer.parseInt(request.getParameter("index"));
		}
		
		int fromIndex = (index - 1) * Pagesize.size;
		int toIndex = Math.min(fromIndex + Pagesize.size, goodsList.size());
		List goodsList1 = goodsList.subList(fromIndex, toIndex);
		
		Pagination p = new Pagination();
	    p.setIndex(index);
	    p.setPageSize(Pagesize.size);
	    p.setTotle(goodsList.size());
	    p.setData(goodsList1);
		
		request.setAttribute("page", p);
		return ActionSupport.SUCCESS;
	}
	
	
	public String goodsDetailQian()
	{
		TGoods goods=goodsDAO.findById(id);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("goods", goods);
		return ActionSupport.SUCCESS;
	}
	
	
	
	public String goodsByLeibie()
	{
		String sql="from TGoods where del='no' and leibieId=?";
		Object[] con={leibieId};
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		List goodsList=goodsDAO.getHibernateTemplate().find(sql,con);
		request.put("goodsList", goodsList);
		
		System.out.println(goodsList.size()+"&&");
		
		return ActionSupport.SUCCESS;
	}

	
	public String goodsRes()
	{
		String sql="from TGoods where del='no' and mingcheng like '%"+mingcheng.trim()+"%'";
		List goodsList=goodsDAO.getHibernateTemplate().find(sql);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("goodsList", goodsList);
		return ActionSupport.SUCCESS;
	}

	public Integer getLeibieId()
	{
		return leibieId;
	}


	public void setLeibieId(Integer leibieId)
	{
		this.leibieId = leibieId;
	}


	public Integer getId()
	{
		return id;
	}


	public void setId(Integer id)
	{
		this.id = id;
	}


	public String getMingcheng()
	{
		return mingcheng;
	}


	public void setMingcheng(String mingcheng)
	{
		this.mingcheng = mingcheng;
	}


	public String getJieshao()
	{
		return jieshao;
	}


	public void setJieshao(String jieshao)
	{
		this.jieshao = jieshao;
	}


	public String getFujian()
	{
		return fujian;
	}


	public void setFujian(String fujian)
	{
		this.fujian = fujian;
	}


	public Integer getJiage()
	{
		return jiage;
	}


	public void setJiage(Integer jiage)
	{
		this.jiage = jiage;
	}


	public Integer getTejia()
	{
		return tejia;
	}


	public void setTejia(Integer tejia)
	{
		this.tejia = tejia;
	}


	public String getShifoutejia()
	{
		return shifoutejia;
	}


	public void setShifoutejia(String shifoutejia)
	{
		this.shifoutejia = shifoutejia;
	}


	public String getDel()
	{
		return del;
	}


	public void setDel(String del)
	{
		this.del = del;
	}


	public TGoodsDAO getGoodsDAO()
	{
		return goodsDAO;
	}


	public void setGoodsDAO(TGoodsDAO goodsDAO)
	{
		this.goodsDAO = goodsDAO;
	}
	
}

六、底部获取项目源码和万字论文参考(9.9¥带走)

有问题,或者需要协助调试运行项目的也可以

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

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

相关文章

海外仓储管理系统:提升效率,标准化海外仓管理,科技赋能业务

海外仓作为跨境物流的关键一环&#xff0c;完全可以说海外仓的效率直接决定了后续物流的整体运作效率。 对于海外仓而言&#xff0c;一套高效&#xff0c;易用的海外仓储系统&#xff0c;无疑将成为提升企业竞争力的重要工具&#xff0c;帮助海外仓实现从野蛮生长到标准化管理…

边用边充电影响寿命吗?看看计算机指令组成与操作类型

计算机指令集体系结构之指令 指令由操作码和地址码字段组成。 操作码指明了指令要完成的操作。 长度可以固定&#xff1a;比如RISC&#xff08;reduced instruction set computer&#xff09;精简指令集计算机 与之对应的RISC&#xff08;复杂指令集计算机&#xff09;&…

【C++进阶】AVL树

0.前言 前面我们已经学习过二叉搜索树了&#xff0c;但如果我们是用二叉搜索树来封装map和set等关联式容器是有缺陷的&#xff0c;很可能会退化为单分支的情况&#xff0c;那样效率就极低了&#xff0c;那么有没有方法来弥补二叉搜索树的缺陷呢&#xff1f; 那么AVL树就出现了&…

【C++】类与对象——多态详解

目录 一、多态的定义 二、重载、覆盖(重写)、隐藏(重定义)的对比 三、析构函数重写 四、C11 override 和 final 1. final 2. override 五、抽象类 六、多态的原理 一、多态的定义 多态是在不同继承关系的类对象&#xff0c;去调用同一函数&#xff0c;产生了不同的行为…

【机器学习】机器学习与大型预训练模型的前沿探索:跨模态理解与生成的新纪元

&#x1f512;文章目录&#xff1a; &#x1f4a5;1.引言 ☔2.跨模态理解与生成技术概述 &#x1f6b2;3.大型预训练模型在跨模态理解与生成中的应用 &#x1f6f4;4.前沿探索与挑战并存 &#x1f44a;5.未来趋势与展望 &#x1f4a5;1.引言 近年来&#xff0c;机器学习领…

使用C/C++ API接口操作 Zookeeper 数据

ZooKeeper 支持 Java 和 C 的API接口。本文将介绍使用 C/C 语言客户端库的编译安装和使用入门。 一、编译安装 PS&#xff1a;就在上一篇文章还觉得安装和配置 jdk 、maven 麻烦&#xff0c;所以当时选择 apache-zookeeper-[version]-bin.tar.gz 的版本。然而&#xff0c;本文…

【C++要哮着学】类和对象

文章目录 前言面向过程和面相对象初步认识类的定义类的访问限定符及封装访问限定符封装 类的作用域类的实例化类对象模型如何计算类的大小结构体内存对齐规则类对象的存储方式1.对象中包含类的各个成员2.代码只保存一份&#xff0c;在对象中保存存放代码的地址3.只保存成员变量…

权限维持--linux

隐藏文件/夹&-开头文件 如何创建: 在文件名之前加.即可 touch .1.s 如何清除、查找&#xff1a; ls -al rm -fr -文件 已-开头的文件直接读取是不行的需要带目录 隐藏时间戳 ①用其他文件的时间 touch -r zww.php testq.txt 如何清除、查看&#xff1a; stat test…

KDE-Ambari-Metrics-Collector问题排查解决手册

文档说明 本文档是为了解决KDE平台的Ambari-Metrics-Collector服务在运行时遇到的问题而提供的问题排查和解决方法的参考文档 说明: 当前的Ambari-Metrics-Collector服务包括了ams-collector和ams-hbase两个程序,在Ambari-Metrics-Collector安装的节点执行ps -elf|grep am…

【算法】前缀和——二维前缀和模板题

本节博客是通过——二位前缀和模板题来介绍前缀和二维算法&#xff0c;有需要借鉴即可。 目录 1.题目2.暴力求解3.二维前缀和算法3.代码示例4.总结 1.题目 题目链接&#xff1a;LINK 2.暴力求解 这里我们首先想到的就是一个暴力求解的方式&#xff0c;挨个需要的进行遍历就…

基于SA模拟退火优化算法的TSP问题求解matlab仿真,并对比ACO蚁群优化算法

目录 1.程序功能描述 2.测试软件版本以及运行结果展示 3.核心程序 4.本算法原理 5.完整程序 1.程序功能描述 基于SA模拟退火优化算法的TSP问题求解matlab仿真,并对比ACO蚁群优化算法,对比两个算法的仿真时间&#xff0c;收敛曲线&#xff0c;以及路径规划的结果&#xff0…

独享IP是原生IP吗?

原生IP&#xff1a; 原生IP是指由Internet服务提供商&#xff08;ISP&#xff09;直接分配给用户的IP地址&#xff0c;这些IP地址通常反映了用户的实际地理位置和网络连接。原生IP是用户在其所在地区或国家使用的真实IP地址&#xff0c;与用户的物理位置直接相关。在跨境电商中…

从零训练yolov8

1.收集数据 2.数据标注 pip install labelimg3.划分数据集 0.2的验证机0.8的训练集 import os from shutil import copyfile from sys import exit import randomsource r"D:\Data\imgs\screenc" \\ target_train r"D:\Data\imgs\datasets\mydata\images\t…

访存优化实践之一 : CPU、GPU、DDR与访存路径介绍

一、CPU的访存路径 上图是目前主流的CPU架构介绍。可以看到,CPU的访存路径:先经过MMU,然后经过Cache,最后到达DRAM。这其中涉及到的关键内容为基于MMU的内存管理以及缓存机制。 1.1、基于MMU的内存管理 众所周知,在计算机设计之处是没有虚拟地址的概念的,CPU发出的地址即…

win中的vscode利用ssh插件,在同一台电脑的virtualbox虚拟出来的ubuntu中编译,调试设置方法

vscode中安装ssh插件virtualbox7.0中的设置&#xff1a; 在网络管理器中添加host-only网卡&#xff0c;用来主机和虚拟机双向通信。这个网卡能在win的设备管理器里面看到手动配置网卡&#xff0c;其中ip地址是另一个网段的&#xff0c;主机ip地址是192.168.1.1。这个网卡对于虚…

ELK 日志监控平台(二)- 优化日志格式

文章目录 ELK 日志监控平台&#xff08;二&#xff09;- 优化日志格式1.日志输出要点2.优化应用的日志格式2.1.确定日志输出要点来源2.1.1.服务名称2.1.2.服务环境2.1.3.日志级别2.1.4.日志输出时间2.1.5.日志内容2.1.6.日志输出对象2.1.7.线程名称 2.2.logback.xml修改日志输出…

Java网络编程之TCP协议核心机制(二)

目录 题外话 正题 滑动窗口机制 如果出现丢包问题怎么办?? 滑动窗口触发条件 流量控制 拥塞控制 小结 题外话 宿舍没有空调的感觉谁懂?!!! 人要蒸发了,八点自动热醒,直接强行学习 正题 我们继续讲解TCP协议核心机制 上篇博客讲完了,建立连接机制,确认应答机制,超时…

Boxy SVG for Mac:打造精致矢量图形的得力助手

在矢量图形设计领域&#xff0c;Boxy SVG for Mac以其出色的性能和丰富的功能&#xff0c;成为了设计师们的得力助手。 Boxy SVG for Mac(矢量图编辑器) v4.32.0免激活版下载 Boxy SVG具备强大的编辑能力&#xff0c;支持节点编辑、路径绘制、颜色填充等多种操作&#xff0c;让…

struct.unpack_from()学习笔记

struct.unpack_from(fmt,b_data,offset) 按照指定的格式fmt&#xff0c;从偏移位置offset&#xff0c;对b_data开始解包&#xff0c;返回数据格式是一个元组(v1,v2…) fmt可以有&#xff1a; _struct.py: The remaining chars indicate types of args and must match exactly;…

实现 YOLO 目标计数 | 含代码示例

点击下方卡片&#xff0c;关注“小白玩转Python”公众号 在YOLO算法的无数应用中&#xff0c;我们想聚焦于一个真实的场景&#xff1a;道路车辆计数。这个用例对于智能城市的交通规划和决策具有重要意义。在这篇文章中&#xff0c;我们将带您一步步实现YOLO目标检测和计数&…