基于javaweb的SSM茶叶售卖商场(java+ssm+jsp+jquery+mysql)(平台、卖家、买家)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

241524141003

251524141003

261524141003

271524141003

281524141003

301524141003

311524141003

321524141003

基于javaweb的SSM茶叶售卖商场(java+ssm+jsp+jquery+mysql)(平台、卖家、买家)

管理员(后台管理):
admin 123456

卖家
saler1 123456

买家
buyer1 123456

SSM的茶叶商城网站

项目介绍

该系统主要分为前台和后台两大功能模块,共包含三个角色:卖家、买家和管理员。
具体的系统功能如下:
1.前台功能
前台首页、用户注册、用户登录、新闻公告、茶叶行情、查看茶叶、茶叶详情、加入购物车、加入收藏、购买茶叶、付款结算、添加评论、留言交流、个人中心、我的订单、我的收藏、意见反馈、发布茶叶、我的销售等功能。
2.后台功能
后台系统登陆、用户管理、管理员管理、网站内容管理、茶叶类型管理、茶叶信息管理、购买订单管理、用户评价管理、意见反馈管理、留言交流管理等功能。

由于本程序规模不大,可供课程设计,毕业设计学习演示之用

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.数据库:MySql 5.7/8.0等版本均可;

技术栈

后台框架:Spring、SpringMVC、MyBatis
UI界面:JSP、jQuery
数据库:MySQL

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
46
}

// 通过主键删除数据
@RequestMapping("deleteGoods.action")
public String deleteGoods(String id) {
this.goodsService.deleteGoods(id);
return "redirect:/goods/getAllGoods.action";
}

// 批量删除数据
@RequestMapping("deleteGoodsByIds.action")
public String deleteGoodsByIds() {
String[] ids = this.getRequest().getParameterValues("goodsid");
for (String goodsid : ids) {
this.goodsService.deleteGoods(goodsid);
}
return "redirect:/goods/getAllGoods.action";
}

// 更新数据
@RequestMapping("updateGoods.action")
public String updateGoods(Goods goods) {
this.goodsService.updateGoods(goods);
return "redirect:/goods/getAllGoods.action";
}

// 显示全部数据
@RequestMapping("getAllGoods.action")
public String getAllGoods(String number) {
List<Goods> goodsList = this.goodsService.getAllGoods();
PageHelper.getPage(goodsList, "goods", null, null, 10, number, this.getRequest(), null);
return "admin/listgoods";
}

// 按条件查询数据 (模糊查询)
@RequestMapping("queryGoodsByCond.action")
public String queryGoodsByCond(String cond, String name, String number) {
Goods goods = new Goods();
if(cond != null){
if ("usersid".equals(cond)) {
goods.setUsersid(name);
}
if ("goodsname".equals(cond)) {
goods.setGoodsname(name);
}
if ("image".equals(cond)) {
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


//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/chart", produces = "text/plain;charset=utf-8")
public class ChartController extends BaseController {
@Autowired
private OrdersService ordersService;
@Autowired
private TopicService topicService;

@RequestMapping("chartline.action")
@ResponseBody
public String chartline() throws JSONException {
String start = this.getRequest().getParameter("start");
String end = this.getRequest().getParameter("end");
long days = VeDate.getDays(end, start) + 1;
JSONArray total = new JSONArray();
JSONArray count = new JSONArray();// 定义count存放数值
JSONArray day = new JSONArray(); // 存放名称
for (int i = 0; i < days; i++) {
String nxtDay = VeDate.getNextDay(start, "" + i);
System.out.println(nxtDay);
Orders orders = new Orders();
orders.setAddtime(nxtDay);
List<Orders> list = this.ordersService.getOrdersByCond(orders);
double sellTotal = 0;
double sellCount = 0;
for (Orders x : list) {
sellTotal += Double.parseDouble(x.getTotal());
}
sellCount = list.size();
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
		nameList.add(cond);
valueList.add(name);
PageHelper.getPage(this.goodsService.getGoodsByLike(goods), "goods", nameList, valueList, 10, number, this.getRequest(), "query");
name = null;
cond = null;
return "admin/querygoods";
}

// 按主键查询数据
@RequestMapping("getGoodsById.action")
public String getGoodsById(String id) {
Goods goods = this.goodsService.getGoodsById(id);
this.getRequest().setAttribute("goods", goods);
List<Users> usersList = this.usersService.getAllUsers();
this.getRequest().setAttribute("usersList", usersList);
List<Cate> cateList = this.cateService.getAllCate();
this.getRequest().setAttribute("cateList", cateList);
return "admin/editgoods";
}


}

//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/topic" , produces = "text/plain;charset=utf-8")
public class TopicController extends BaseController {
// 注入Service 由于标签的存在 所以不需要getter setter
@Autowired
private TopicService topicService;
@Autowired
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
			if ("password".equals(cond)) {
admin.setPassword(name);
}
if ("realname".equals(cond)) {
admin.setRealname(name);
}
if ("contact".equals(cond)) {
admin.setContact(name);
}
if ("addtime".equals(cond)) {
admin.setAddtime(name);
}
}

List<String> nameList = new ArrayList<String>();
List<String> valueList = new ArrayList<String>();
nameList.add(cond);
valueList.add(name);
PageHelper.getPage(this.adminService.getAdminByLike(admin), "admin", nameList, valueList, 10, number, this.getRequest(), "query");
name = null;
cond = null;
return "admin/queryadmin";
}

// 按主键查询数据
@RequestMapping("getAdminById.action")
public String getAdminById(String id) {
Admin admin = this.adminService.getAdminById(id);
this.getRequest().setAttribute("admin", admin);
return "admin/editadmin";
}


}

//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/orders" , produces = "text/plain;charset=utf-8")
public class OrdersController extends BaseController {
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
				stars2++;
}
if ("3".equals(topic.getNum())) {
stars3++;
}
if ("4".equals(topic.getNum())) {
stars4++;
}
if ("5".equals(topic.getNum())) {
stars5++;
}

}
count.put(stars5);
count.put(stars4);
count.put(stars3);
count.put(stars2);
count.put(stars1);
JSONObject json = new JSONObject();
json.put("count", count.toString());
json.put("names", names.toString().replaceAll("\"", ""));
System.out.println(json.toString());
return json.toString();
}
}

//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/banner" , produces = "text/plain;charset=utf-8")
public class BannerController extends BaseController {
// 注入Service 由于标签的存在 所以不需要getter setter
@Autowired
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

}




//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/chart", produces = "text/plain;charset=utf-8")
public class ChartController extends BaseController {
@Autowired
private OrdersService ordersService;
@Autowired
private TopicService topicService;

@RequestMapping("chartline.action")
@ResponseBody
public String chartline() throws JSONException {
String start = this.getRequest().getParameter("start");
String end = this.getRequest().getParameter("end");
long days = VeDate.getDays(end, start) + 1;
JSONArray total = new JSONArray();
JSONArray count = new JSONArray();// 定义count存放数值
JSONArray day = new JSONArray(); // 存放名称
for (int i = 0; i < days; i++) {
String nxtDay = VeDate.getNextDay(start, "" + i);
System.out.println(nxtDay);
Orders orders = new Orders();
orders.setAddtime(nxtDay);
List<Orders> list = this.ordersService.getOrdersByCond(orders);


项目链接:
https://javayms.github.io?id=231524141003201lc
https://javayms.pages.dev?id=231524141003201lc