——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明



基于javaweb的SSH水果销售系统(java+ssh+mysql+tomcat+jsp)
一、项目简述
功能: 区分为管理员用户和普通用户,普通用户:用户注册登 录,首页水果展示,商品分类展示,购物车添加,下单, 订单查询,个人信息修改,管理员用户:包括水果基本信 息维护增删改查,分类管理,订单管理,用户管理等等功 能。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + Mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP + Struts + Spring + Hibernate + html + css + JavaScript + JQuery等等。
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| { 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;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| 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; }
public String getPingFlag() { return pingFlag; }
public void setPingFlag(String pingFlag) { this.pingFlag = pingFlag; } } package com.action;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| 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)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| session.setAttribute("admin", admin); return "yes"; } public void userLogout() { WebContext ctx = WebContextFactory.get(); HttpSession session=ctx.getSession(); session.setAttribute("userType", null); session.setAttribute("user", null); } public List leibieSelect() { String sql="from TLeibie where Del='no'"; List leibieList=leibieDAO.getHibernateTemplate().find(sql); return leibieList; } } package com.service;
public class cartService { public String modiNum(int goodsId,int quantity) { try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace();
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| } else { THuiyuan huiyuan=new THuiyuan(); huiyuan.setLoginname(loginname); huiyuan.setLoginpw(loginname); huiyuan.setXingming(xingming); huiyuan.setXingbie(xingbie); huiyuan.setNianling(nianling); huiyuan.setAddress(address); huiyuan.setDianhua(dianhua); huiyuan.setYue(0); huiyuan.setDel("no"); huiyuanDAO.save(huiyuan); this.setMessage("注册成功,请登录"); this.setPath("site/userreg/userreg.jsp"); } return "succeed"; }
public String huiyuanMana() { String sql="from THuiyuan where del='no'"; List huiyuanList=huiyuanDAO.getHibernateTemplate().find(sql); Map request=(Map)ServletActionContext.getContext().get("request"); request.put("huiyuanList", huiyuanList); return ActionSupport.SUCCESS; }
public String huiyuanDel() { THuiyuan huiyuan=huiyuanDAO.findById(id); huiyuan.setDel("yes"); huiyuanDAO.attachDirty(huiyuan);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| private String loginpw; private String xingming;
private String xingbie; private String nianling; private String address; private String dianhua;
private Integer yue; private String del;
private String message; private String path;
private THuiyuanDAO huiyuanDAO; public SweetnessDAO sweetnessDAO;
public String huiyuanReg() { HttpServletRequest request=ServletActionContext.getRequest(); String sql="from THuiyuan where loginname=?"; Object[] c={loginname.trim()}; List huiyuanList=huiyuanDAO.getHibernateTemplate().find(sql,c); if(huiyuanList.size()>0) { this.setMessage("账号已被占用,请重新注册"); this.setPath("site/userreg/userreg.jsp"); } else { THuiyuan huiyuan=new THuiyuan(); huiyuan.setLoginname(loginname); huiyuan.setLoginpw(loginname); huiyuan.setXingming(xingming); huiyuan.setXingbie(xingbie); huiyuan.setNianling(nianling);
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=101422292105200el
https://javayms.pages.dev?id=101422292105200el