基于javaweb的SSM儿童摄影预约系统(java+ssm+jsp+js+jquery+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

110023382402

120023382402

130023382402

140023382402

150023382402

160023382402

基于javaweb的SSM儿童摄影预约系统(java+ssm+jsp+js+jquery+mysql)

1
2
3
4
5
6
7
8
9
10

管理员:
admin 123456

用户:
user1 123456
user2 123465



项目介绍

本项目分为前后台,前台为普通用户登录,后台为管理员登录;

管理员角色包含以下功能: 管理员登录,管理员信息管理,用户信息管理,新闻公告管理,套餐类型信息管理,城市信息管理,摄影基地信息管理,套餐信息管理,订单信息管理,查看评价信息等功能。

用户角色包含以下功能: 按分类查看,用户登录,查看商品详情,加入购物车,提交订单,查看订单,修改个人信息,查看网站公告,查看摄影基地等功能。

环境需要

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版本; 6.是否Maven项目:否;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+jQuery

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中springmvc-servlet.xml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录

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
@RequestMapping("queryCartByCond.action")
public String queryCartByCond(String cond, String name, String number) {
Cart cart = new Cart();
if (cond != null) {
if ("username".equals(cond)) {
cart.setUsername(name);
}
if ("jiancainame".equals(cond)) {
cart.setJiancainame(name);
}
if ("num".equals(cond)) {
cart.setNum(name);
}
if ("price".equals(cond)) {
cart.setPrice(name);
}
}

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

// 按主键查询数据
@RequestMapping("getCartById.action")
public String getCartById(String id) {
Cart cart = this.cartService.getCartById(id);
this.getRequest().setAttribute("cart", cart);
List<Users> usersList = this.usersService.getAllUsers();
this.getRequest().setAttribute("usersList", usersList);
List<Jiancai> jiancaiList = this.jiancaiService.getAllJiancai();
this.getRequest().setAttribute("jiancaiList", jiancaiList);
return "admin/editcart";
}

public CartService getCartService() {
return cartService;
}

public void setCartService(CartService cartService) {
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
47
48
49
50
51
52

// 按条件查询数据 (模糊查询)
@RequestMapping("queryPeihuoByCond.action")
public String queryPeihuoByCond(String cond, String name, String number) {
Peihuo peihuo = new Peihuo();
if (cond != null) {
if ("peihuoname".equals(cond)) {
peihuo.setPeihuoname(name);
}
if ("cityid".equals(cond)) {
peihuo.setCityname(name);
}
if ("address".equals(cond)) {
peihuo.setAddress(name);
}
if ("contact".equals(cond)) {
peihuo.setContact(name);
}
if ("memo".equals(cond)) {
peihuo.setMemo(name);
}
}

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

// 按主键查询数据
@RequestMapping("getPeihuoById.action")
public String getPeihuoById(String id) {
Peihuo peihuo = this.peihuoService.getPeihuoById(id);
this.getRequest().setAttribute("peihuo", peihuo);
List<City> cityList = this.cityService.getAllCity();
this.getRequest().setAttribute("cityList", cityList);
return "admin/editpeihuo";
}

public PeihuoService getPeihuoService() {
return peihuoService;
}

public void setPeihuoService(PeihuoService peihuoService) {
this.peihuoService = peihuoService;
}

}
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
			buffer.append("尾页");
} else {
buffer.append("<a href=\"" + name + "/" + action + "?number=" + (maxPage - 1) + "" + path + "\">尾页</a>");
}
String html = buffer.toString();
request.setAttribute("html", html);
request.setAttribute(name + "List", objList);
}

}





@Controller
@RequestMapping("/upload")
public class UploadAction {

@RequestMapping(value = "/image.action")
public String upload(@RequestParam(value = "image", required = false) MultipartFile file,
HttpServletRequest request, ModelMap model) {
String path = request.getSession().getServletContext().getRealPath("/") + "upfiles/";
String fileName = file.getOriginalFilename();
int i = fileName.lastIndexOf(".");
String name = String.valueOf(VeDate.getStringDatex());
String type = fileName.substring(i + 1);
fileName = name + "." + type;
File targetFile = new File(path, fileName);
if (!targetFile.exists()) {
targetFile.mkdirs();
}

// 保存
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
47
48
49

//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/cate", produces = "text/plain;charset=utf-8")
public class CateAction extends BaseAction {
// 注入Service 由于标签的存在 所以不需要getter setter
@Autowired
@Resource
private CateService cateService;

// 准备添加数据
@RequestMapping("createCate.action")
public String createCate() {
return "admin/addcate";
}

// 添加数据
@RequestMapping("addCate.action")
public String addCate(Cate cate) {
cate.setAddtime(VeDate.getStringDateShort());
this.cateService.insertCate(cate);
return "redirect:/cate/createCate.action";
}

// 通过主键删除数据
@RequestMapping("deleteCate.action")
public String deleteCate(String id) {
this.cateService.deleteCate(id);
return "redirect:/cate/getAllCate.action";
}

// 批量删除数据
@RequestMapping("deleteCateByIds.action")
public String deleteCateByIds() {
String[] ids = this.getRequest().getParameterValues("cateid");
for (String cateid : ids) {
this.cateService.deleteCate(cateid);
}
return "redirect:/cate/getAllCate.action";
}

// 更新数据
@RequestMapping("updateCate.action")
public String updateCate(Cate cate) {
this.cateService.updateCate(cate);
return "redirect:/cate/getAllCate.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
		return "admin/listpeihuo";
}

// 显示全部数据
@RequestMapping("getNetWork.action")
public String getNetWork(String number) {
List<Peihuo> peihuoList = this.peihuoService.getAllPeihuo();
PageHelper.getPage(peihuoList, "peihuo", null, null, 10, number, this.getRequest(), null);

return "users/network";
}

// 按条件查询数据 (模糊查询)
@RequestMapping("queryPeihuoByCond.action")
public String queryPeihuoByCond(String cond, String name, String number) {
Peihuo peihuo = new Peihuo();
if (cond != null) {
if ("peihuoname".equals(cond)) {
peihuo.setPeihuoname(name);
}
if ("cityid".equals(cond)) {
peihuo.setCityname(name);
}
if ("address".equals(cond)) {
peihuo.setAddress(name);
}
if ("contact".equals(cond)) {
peihuo.setContact(name);
}
if ("memo".equals(cond)) {
peihuo.setMemo(name);
}
}

List<String> nameList = new ArrayList<String>();
List<String> valueList = new ArrayList<String>();
nameList.add(cond);
valueList.add(name);
PageHelper.getPage(this.peihuoService.getPeihuoByLike(peihuo), "peihuo", nameList, valueList, 10, number, this.getRequest(), "query");
name = null;
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
	public void setCartService(CartService cartService) {
this.cartService = cartService;
}

}

//定义为控制器
@Controller
// 设置路径
@RequestMapping(value = "/orders" , produces = "text/plain;charset=utf-8")
public class OrdersAction extends BaseAction {
// 注入Service 由于标签的存在 所以不需要getter setter
@Autowired
@Resource
private OrdersService ordersService;
@Autowired
@Resource
private UsersService usersService;

// 准备添加数据
@RequestMapping("createOrders.action")
public String createOrders() {
List<Users> usersList = this.usersService.getAllUsers();
this.getRequest().setAttribute("usersList", usersList);
return "admin/addorders";
}
// 添加数据
@RequestMapping("addOrders.action")
public String addOrders(Orders orders) {
this.ordersService.insertOrders(orders);
return "redirect:/orders/createOrders.action";
}

// 通过主键删除数据


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