├── .gitignore ├── README.md ├── WebContent ├── META-INF │ └── MANIFEST.MF ├── WEB-INF │ ├── lib │ │ ├── commons-beanutils-1.8.3.jar │ │ ├── commons-fileupload-1.2.2.jar │ │ ├── commons-io-2.2.jar │ │ ├── commons-logging-1.1.1.jar │ │ ├── javax.servlet.jar │ │ ├── jstl-1.2.jar │ │ └── mysql-connector-java-8.0.16.jar │ └── web.xml ├── admin │ ├── addAdmin.jsp │ ├── addBook.jsp │ ├── addCategory.jsp │ ├── booksList.jsp │ ├── categorysList.jsp │ ├── editBook.jsp │ ├── editCategory.jsp │ ├── manager.jsp │ ├── managerHeader.jsp │ ├── managerIndex.jsp │ ├── managerInformation.jsp │ ├── managerLogin.jsp │ ├── managerOrder.jsp │ ├── managerPassword.jsp │ ├── managerUsers.jsp │ ├── message.jsp │ ├── navigation.jsp │ └── sales.jsp ├── buyNow.jsp ├── css │ ├── bootstrap.min.css │ ├── fonts │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── header.css │ └── normalize.css ├── favorite.jsp ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── footer.jsp ├── fraheader.jsp ├── header.jsp ├── header1.jsp ├── img │ ├── books │ │ ├── c6cf2402-c04a-426d-a339-8ea029bd5689.jpg │ │ ├── f6ed178e-b3bf-49c0-a30e-1692330ffa75.jpg │ │ └── src=http___www.5jjc.net_tu5jJDEwLmFsaWNkbi5jb20vdGZzY29tL2kxLzI1OTk0NDA2NTAvVEIxRVNrcGRqZ3lfdUpqU1pMZVhYYVBsRlhhXyEhJDM.jpg&refer=http___www.5jjc.jpg │ ├── duigou.png │ ├── gerenzx.png │ ├── gwc.gif │ ├── icon-1.png │ ├── icon-10.png │ ├── icon-11.png │ ├── icon-12.png │ ├── icon-13.png │ ├── icon-14.png │ ├── icon-15.png │ ├── icon-16.png │ ├── icon-2.png │ ├── icon-3.png │ ├── icon-4.png │ ├── icon-5.png │ ├── icon-6.png │ ├── icon-7.png │ ├── icon-8.png │ ├── icon-9.png │ ├── lb_01.jpg │ ├── lb_02.jpg │ ├── lb_03.jpg │ ├── lb_04.jpg │ ├── lb_05.jpg │ ├── logo.png │ ├── personIndex.jpg │ ├── seckilling.png │ ├── shoucang.png │ └── zfb.png ├── index.jsp ├── js │ ├── bootstrap.min.js │ ├── jquery-2.0.3.min.js │ └── util.js ├── message.jsp ├── order.jsp ├── particulars.jsp ├── person │ ├── navigation.jsp │ ├── personIndex.jsp │ ├── personInformation.jsp │ ├── personOrder.jsp │ └── personPassword.jsp ├── personalCenter.jsp ├── redirect.jsp ├── showBook.jsp ├── showCart.jsp └── test.jsp ├── config └── jdbcConfig.properties └── src └── cn └── xh ├── dao ├── ClientDao.java ├── ManagerDao.java ├── OrdetrDao.java └── impl │ ├── ClientDaoImpl.java │ ├── ManagerDaoImpl.java │ └── OrderDaoImpl.java ├── domain ├── Administrator.java ├── Book.java ├── Category.java ├── Favorite.java ├── Order.java ├── Orderitem.java └── User.java ├── service ├── ClientService.java ├── ManagerService.java ├── OrderService.java └── impl │ ├── ClientServiceImpl.java │ ├── ManagerServiceImpl.java │ └── OrderServiceImpl.java ├── util └── JDBCUtil.java └── web ├── controller ├── ClientServlet.java ├── ManagerServlet.java └── OrderServlet.java └── formbean ├── Cart.java └── CartItem.java /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | /classes 3 | /.idea 4 | build/ 5 | picture/ 6 | webLibrary.iml 7 | doc/ 8 | .settings 9 | .classpath 10 | .project 11 | xinhua-Library.iml -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JavaWeb图书销售管理系统/网上书店 2 | 3 | Javaweb_bookstore,一个基于servlet+jsp+bootstrap 的MVC图书销售管理系统。 4 | 5 | - 可以直接运行 6 | - 可以用做大作业、毕业设计 7 | - 有完整的代码注释 8 | 9 | ## 1、开发环境: 10 | Tomcat版本:v8.5 11 | MySQL版本:v8.0 12 | JDK:1.8.0_171 13 | 14 | (后端没有用到任何框架,都是servlet,比较简单,前端是JSP+bootstrap) 15 | 16 | ## 2、功能模块 17 | 18 | ![](https://cdn.jsdelivr.net/gh/DogerRain/image@main/Home/image-20210509175643885.png) 19 | 20 | ## 3、本地开发 21 | 22 | ### 1、导入sql 23 | 24 | 找到sql文件,导入到数据库,并且在下一步导入代码后,修改数据库的用户名和密码。 25 | 26 | ### 2、使用IDEA导入代码 27 | 28 | 第一步先导入项目,使用eclipse的方式导入,如果不是,那么接下来会复杂,还需要设置src和resources目录。 29 | 30 | #### 2.1、清除原来的eclipse信息 31 | 32 | ![](https://cdn.jsdelivr.net/gh/DogerRain/image@main/Home/image-20210507225206166.png) 33 | 34 | #### 2.2、导入包 35 | 36 | 如果你不是通过eclipse导入的方式导入项目,这里需要把这些jar手动右击 添加到 library 即可: 37 | 38 | ![](https://cdn.jsdelivr.net/gh/DogerRain/image@main/Home/image-20210507225623540.png) 39 | 40 | #### 2.3、设置Modules的web.xml文件 41 | 42 | ![](https://cdn.jsdelivr.net/gh/DogerRain/image@main/Home/image-20210507230128552.png) 43 | 44 | 这里主注意两个地方: 45 | 46 | - 上方,设置Path的目录,`web.xml`文件要正确 47 | - 下方,设置Web Resource Dictory 是正确的WebRoot 路径,也就是WebContent。 48 | 49 | `web.xml` 可以配置首页地址,具体请看文件,修改你需要的首页,第一个是没有自动加载数据的,第二个是加载数据的。 50 | 51 | #### 2.4、生成Artifact包 52 | 53 | ![](https://cdn.jsdelivr.net/gh/DogerRain/image@main/Home/image-20210507230032298.png) 54 | 55 | #### 2.5、配置Tomcat 56 | 57 | 我这里Tomcat8.0版本有乱码,可以设置一下为`-Dfile.encoding=UTF-8` 58 | 59 | ![](https://cdn.jsdelivr.net/gh/DogerRain/image@main/Home/image-20210507230334986.png) 60 | 61 | Deployment 不要设置Application context! 62 | 63 | 64 | 65 | ### 3、eclipse 66 | 67 | 项目带有eclipse 标识,基本上按照以上配置即可。 68 | 69 | 但是不要使用默认的 context 路径 70 | 71 | ## 4、功能页面 72 | 73 | ### 用户端: 74 | 75 | 首页: 76 | 77 | ![](https://cdn.jsdelivr.net/gh/DogerRain/image@main/Home/image-20210509175143151.png) 78 | 79 | 商品详情: 80 | 81 | ![](https://cdn.jsdelivr.net/gh/DogerRain/image@main/Home/image-20210509175249476.png) 82 | 83 | 购物车: 84 | 85 | ![](https://cdn.jsdelivr.net/gh/DogerRain/image@main/Home/image-20210509175226003.png) 86 | 87 | ### 管理员端: 88 | 89 | 功能见左侧导航栏: 90 | 91 | ![](https://cdn.jsdelivr.net/gh/DogerRain/image@main/Home/image-20210509175911434.png) 92 | 93 | ![](https://cdn.jsdelivr.net/gh/DogerRain/image@main/Home/image-20210509175835182.png) 94 | 95 | 96 | 97 | 98 | 99 | 用户账号密码:HaC / 123 100 | 101 | 102 | 103 | 管理员账号密码:admin / 123 104 | 105 | ## 5、A&Q 106 | 107 | 1、项目是从其他地方copy过来的二开的,刚拿到这个项目的时候,一堆bug,经过了一系列的重构,功能也比之前多了。 108 | 109 | 但是`立即购买`的这个模块就没有做了(先通过加入购物车再立即购买就可以了)。。。。,大家可以自己完善一下功能,比如说: 110 | 111 | - 用户查看订单 112 | - 立即购买跳转 113 | - 区分是否收藏过 114 | 115 | 116 | 117 | 2、关于图片的路径 118 | 119 | 说实话我现在也搞不懂,大家可以参考`addBook()`的代码实现,什么相对路径、绝对路径,我暂时还不明白,大家可以去看看如何自定义设置自己的图片路径。 120 | 121 | 122 | 123 | ## 6、声明|费用 124 | 125 | 本项目存在文件缺少,且不再提供免费使用,有偿出售39块钱,酌情购买,需要请联系wx: HaC200 126 | 127 | 更多毕设参考: 128 | 129 | [毕设项目 | HelloCoder (baimuxym.cn)](https://learnjava.baimuxym.cn/pages/JavaWeb图书销售管理系统-网上书店/) -------------------------------------------------------------------------------- /WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /WebContent/WEB-INF/lib/commons-beanutils-1.8.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/WEB-INF/lib/commons-beanutils-1.8.3.jar -------------------------------------------------------------------------------- /WebContent/WEB-INF/lib/commons-fileupload-1.2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/WEB-INF/lib/commons-fileupload-1.2.2.jar -------------------------------------------------------------------------------- /WebContent/WEB-INF/lib/commons-io-2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/WEB-INF/lib/commons-io-2.2.jar -------------------------------------------------------------------------------- /WebContent/WEB-INF/lib/commons-logging-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/WEB-INF/lib/commons-logging-1.1.1.jar -------------------------------------------------------------------------------- /WebContent/WEB-INF/lib/javax.servlet.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/WEB-INF/lib/javax.servlet.jar -------------------------------------------------------------------------------- /WebContent/WEB-INF/lib/jstl-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/WEB-INF/lib/jstl-1.2.jar -------------------------------------------------------------------------------- /WebContent/WEB-INF/lib/mysql-connector-java-8.0.16.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/WEB-INF/lib/mysql-connector-java-8.0.16.jar -------------------------------------------------------------------------------- /WebContent/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | xinhua_library 4 | 5 | 6 | redirect.jsp 7 | 8 | 9 | -------------------------------------------------------------------------------- /WebContent/admin/addAdmin.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 添加工作人员 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

添加工作人员

22 |
23 |
25 |
26 |
29 |
30 | 34 |
35 |
36 | 40 |
41 |
42 | 45 |
46 | 47 | 男 48 |         女 50 |
51 | 54 |
55 |
56 | 58 | 61 |
62 |
63 | 64 | -------------------------------------------------------------------------------- /WebContent/admin/addBook.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 添加书籍信息 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

添加书籍信息

22 |
23 |
25 |
28 |
29 | 32 |
33 |
34 | 37 |
38 |
39 | 42 |
43 |
44 | 51 |
52 |
53 | 55 |
56 |
57 | 58 | 60 |
61 |
62 | 65 |
66 |
67 | 70 |
71 |
72 | 74 | 77 |
78 | 79 | -------------------------------------------------------------------------------- /WebContent/admin/addCategory.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 添加书籍信息 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

添加书籍分类

22 |
23 |
25 |
28 |
29 | 32 |
33 |
34 | 35 | 37 |
38 |
39 | 41 | 44 |
45 | 46 | -------------------------------------------------------------------------------- /WebContent/admin/booksList.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 书籍信息维护 14 | 15 | 16 | 17 | 18 | 19 | 20 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 85 | 86 |
书籍编号书籍图片书籍名称书籍类型书籍作者书籍出版社书籍价格销量操作
${vs.index+1} 72 | 《${s.book_name}》${s.category.category_name}${s.book_author}${s.book_press}¥${s.book_price}${s.book_xiaonumber}编辑      81 | 删除 84 |
87 |
88 | 89 | -------------------------------------------------------------------------------- /WebContent/admin/categorysList.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 书籍分类维护 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 37 | 38 |
序号分类名称分类描述操作
${vs.index+1}${s.category_name}${s.category_desc}编辑      33 | 删除 36 |
39 | 40 | -------------------------------------------------------------------------------- /WebContent/admin/editBook.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 编辑书籍信息 14 | 15 | 16 | 17 | 18 | 19 |
20 |

编辑书籍信息

21 |
22 |
24 | 25 |
26 |
28 |
29 | 31 |
32 |
33 | 36 |
37 |
38 | 41 |
42 |
43 | 46 |
47 |
48 | 55 |
56 |
57 | 61 |
62 |
63 | 64 | 66 |
67 |
68 | 71 |
72 |
73 | 76 |
77 |
78 | 80 | 82 |
83 |
84 | 85 | -------------------------------------------------------------------------------- /WebContent/admin/editCategory.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 编辑分类信息 14 | 15 | 16 | 17 | 18 | 19 |
20 |

编辑书籍分类信息

21 |
22 |
24 |
25 |
27 |
28 | 31 |
32 |
33 | 36 |
37 |
38 | 41 |
42 |
43 | 45 | 47 |
48 |
49 | 50 | -------------------------------------------------------------------------------- /WebContent/admin/manager.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | <% 7 | String path = request.getContextPath(); 8 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 9 | ; 10 | %> 11 | 12 | 管理系统后台 13 | 14 | 15 | 17 | 18 | 20 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /WebContent/admin/managerHeader.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | 管理系统后台 8 | <% 9 | String path = request.getContextPath(); 10 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 11 | ; 12 | %> 13 | 14 | 15 | 16 | 17 | 18 | 19 | 51 | 52 | -------------------------------------------------------------------------------- /WebContent/admin/managerIndex.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | <% 7 | String path = request.getContextPath(); 8 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 9 | ; 10 | %> 11 | 12 | 新华书店管理后台 13 | 14 | 15 | 16 | 17 | 18 |
19 | 后台 20 |
21 | 22 | -------------------------------------------------------------------------------- /WebContent/admin/managerInformation.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 14 | 15 | 管理员个人信息修改 16 | 17 | 18 | 19 | 20 |
21 |

修改个人信息

22 |
23 |
25 |
26 |
29 |
30 | 34 |
35 |
36 | 39 |
40 | 41 | 42 | 男 44 |         女 46 | 47 | 48 | 男 50 |         女 52 |
53 |
54 | 57 |
58 |
59 | 61 | 64 |
65 |
66 | 67 | -------------------------------------------------------------------------------- /WebContent/admin/managerLogin.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | 管理后台登陆 8 | 9 | 10 | 203 | 204 | 205 | 206 |
207 |

管理后台登录

208 |
211 | 214 | 215 |
216 |
217 | 218 | 219 | -------------------------------------------------------------------------------- /WebContent/admin/managerOrder.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 订单管理 14 | 15 | 16 | 17 | 18 | 19 | 26 |
27 |

订单管理

28 |
29 |
31 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
序号订单编号创建时间客户账号商品数量支付金额订单状态操作
${vs.index+1}${os.ordernum}${os.time}${os.user.username}${os.quantity}${os.money}未发货发货已发货删除
62 | 63 | -------------------------------------------------------------------------------- /WebContent/admin/managerPassword.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 修改管理员密码 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

修改登录密码

22 |
23 |
25 |
26 |
28 |
29 | 32 |
33 |
34 | 37 |
38 |
39 | 42 |
43 |
44 | 46 | 49 |
50 |
51 | 52 | -------------------------------------------------------------------------------- /WebContent/admin/managerUsers.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 用户管理 14 | 15 | 16 | 17 | 18 | 19 |
20 |

用户管理

21 |
22 |
24 | 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 |
序号用户ID用户名密码姓名性别电话号码地址操作
${vs.index+1}${u.id}${u.username}${u.password}${u.name}${u.sex}${u.tel}${u.address}编辑
51 | 52 | -------------------------------------------------------------------------------- /WebContent/admin/message.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | <% 7 | String path = request.getContextPath(); 8 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 9 | ; 10 | %> 11 | 12 | 跳转 13 | 14 | 15 |     ${message} 16 | 3秒后跳转到主页面,若没有跳转请点击这里 18 | <% 19 | response.setHeader("refresh", "3;URL=/admin/manager.jsp"); 20 | %> 21 | 22 | -------------------------------------------------------------------------------- /WebContent/admin/navigation.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | <% 7 | String path = request.getContextPath(); 8 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 9 | ; 10 | %> 11 | 12 | Insert title here 13 | 14 | 15 |
16 | 17 |
18 |
19 |
20 |

23 | 24 | 修改个人信息 25 |

26 |
27 |

30 | 31 | 修改登录密码 32 |

33 |
34 |

37 | 38 | 书籍信息维护 39 |

40 |
41 |

44 | 45 | 书籍分类维护 46 |

47 |
48 |

51 | 52 | 添加书籍分类 53 |

54 |
55 |

59 | 60 | 添加图书信息 61 |

62 |
63 |

67 | 68 | 销售订单管理 69 |

70 |
71 |

75 | 76 | 用户信息管理 77 |

78 |
79 |

82 | 83 | 添加工作人员 84 |

85 |
86 |

90 | 91 | 书籍销售情况 92 |

93 |
94 |
95 | 96 | -------------------------------------------------------------------------------- /WebContent/admin/sales.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 14 | 15 | 书籍销售情况 16 | 17 | 18 | 19 | 20 |
21 |

书籍销售情况

22 |
23 |
25 |
26 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
书籍编号书籍图片书籍名称书籍类型书籍作者书籍出版社销量
${vs.index+1} 42 | 《${s.book_name}》${s.category.category_name}${s.book_author}${s.book_press}${s.book_xiaonumber}
51 |
52 | 53 | -------------------------------------------------------------------------------- /WebContent/buyNow.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="cn.xh.domain.Book" %> 2 | <%@ page import="cn.xh.web.formbean.Cart" %> 3 | <%@ page language="java" contentType="text/html; charset=UTF-8" 4 | pageEncoding="UTF-8"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | 7 | 8 | 9 | <% 10 | String path = request.getContextPath(); 11 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 12 | ; 13 | 14 | Cart cart = (Cart) session.getAttribute("buyNowBook"); 15 | 16 | %> 17 | 18 | 下单 19 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 71 | 72 | 73 | 结算功能有bug,不做了 74 |
序号书籍图片书籍名称书籍类型书籍作者书籍出版社书籍单价购买数量小计操作
${vs.index+1} 44 | ${c.value.book.book_name}${c.value.book.category.category_name}${c.value.book.book_author}${c.value.book.book_press}¥${c.value.book.book_price}¥${c.value.money}删除
总数量:${sessionScope.cart.totalQuantity}     合计: 64 | ¥${sessionScope.cart.totalMoney} 66 |
75 | 76 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /WebContent/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /WebContent/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /WebContent/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /WebContent/css/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/css/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /WebContent/css/header.css: -------------------------------------------------------------------------------- 1 | #logo { 2 | float: left; 3 | height: 115px; 4 | width: 1536px; 5 | background-image: url("../img/personIndex.jpg"); 6 | } 7 | 8 | #daohang { 9 | clear: both; 10 | height: 52px; 11 | } -------------------------------------------------------------------------------- /WebContent/css/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */ 2 | html { 3 | font-family: sans-serif; 4 | -ms-text-size-adjust: 100%; 5 | -webkit-text-size-adjust: 100% 6 | } 7 | 8 | body { 9 | margin: 0 10 | } 11 | 12 | article, aside, details, figcaption, figure, footer, header, hgroup, 13 | main, menu, nav, section, summary { 14 | display: block 15 | } 16 | 17 | audio, canvas, progress, video { 18 | display: inline-block; 19 | vertical-align: baseline 20 | } 21 | 22 | audio:not ([controls] ){ 23 | display: none; 24 | height: 0 25 | } 26 | 27 | [hidden], template { 28 | display: none 29 | } 30 | 31 | a { 32 | background-color: transparent 33 | } 34 | 35 | a:active, a:hover { 36 | outline: 0 37 | } 38 | 39 | abbr[title] { 40 | border-bottom: 1px dotted 41 | } 42 | 43 | b, strong { 44 | font-weight: bold 45 | } 46 | 47 | dfn { 48 | font-style: italic 49 | } 50 | 51 | h1 { 52 | font-size: 2em; 53 | margin: 0.67em 0 54 | } 55 | 56 | mark { 57 | background: #ff0; 58 | color: #000 59 | } 60 | 61 | small { 62 | font-size: 80% 63 | } 64 | 65 | sub, sup { 66 | font-size: 75%; 67 | line-height: 0; 68 | position: relative; 69 | vertical-align: baseline 70 | } 71 | 72 | sup { 73 | top: -0.5em 74 | } 75 | 76 | sub { 77 | bottom: -0.25em 78 | } 79 | 80 | img { 81 | border: 0 82 | } 83 | 84 | svg:not (:root ){ 85 | overflow: hidden 86 | } 87 | 88 | figure { 89 | margin: 1em 40px 90 | } 91 | 92 | hr { 93 | -moz-box-sizing: content-box; 94 | -webkit-box-sizing: content-box; 95 | box-sizing: content-box; 96 | height: 0 97 | } 98 | 99 | pre { 100 | overflow: auto 101 | } 102 | 103 | code, kbd, pre, samp { 104 | font-family: monospace, monospace; 105 | font-size: 1em 106 | } 107 | 108 | button, input, optgroup, select, textarea { 109 | color: inherit; 110 | font: inherit; 111 | margin: 0 112 | } 113 | 114 | button { 115 | overflow: visible 116 | } 117 | 118 | button, select { 119 | text-transform: none 120 | } 121 | 122 | button, html input[type="button"], input[type="reset"], input[type="submit"] 123 | { 124 | -webkit-appearance: button; 125 | cursor: pointer 126 | } 127 | 128 | button[disabled], html input[disabled] { 129 | cursor: default 130 | } 131 | 132 | button::-moz-focus-inner, input::-moz-focus-inner { 133 | border: 0; 134 | padding: 0 135 | } 136 | 137 | input { 138 | line-height: normal 139 | } 140 | 141 | input[type="checkbox"], input[type="radio"] { 142 | -webkit-box-sizing: border-box; 143 | -moz-box-sizing: border-box; 144 | box-sizing: border-box; 145 | padding: 0 146 | } 147 | 148 | input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button 149 | { 150 | height: auto 151 | } 152 | 153 | input[type="search"] { 154 | -webkit-appearance: textfield; 155 | -moz-box-sizing: content-box; 156 | -webkit-box-sizing: content-box; 157 | box-sizing: content-box 158 | } 159 | 160 | input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration 161 | { 162 | -webkit-appearance: none 163 | } 164 | 165 | fieldset { 166 | border: 1px solid #c0c0c0; 167 | margin: 0 2px; 168 | padding: 0.35em 0.625em 0.75em 169 | } 170 | 171 | legend { 172 | border: 0; 173 | padding: 0 174 | } 175 | 176 | textarea { 177 | overflow: auto 178 | } 179 | 180 | optgroup { 181 | font-weight: bold 182 | } 183 | 184 | table { 185 | border-collapse: collapse; 186 | border-spacing: 0 187 | } 188 | 189 | td, th { 190 | padding: 0 191 | } -------------------------------------------------------------------------------- /WebContent/favorite.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 收藏夹 14 | 15 | 16 | 17 | 18 | 19 | 29 | 30 | 31 |
32 | 33 |

34 | 空空如也!快去把喜欢的宝贝添加进收藏夹吧!!! 返回主页 36 |

37 |
38 |
39 | 40 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 |
序号书籍图片书籍名称书籍类型书籍作者书籍出版社书籍单价操作
${vs.index+1} 57 | 《${f.book.book_name}》${f.book.category.category_name}${f.book.book_author}${f.book.book_press}¥${f.book.book_price}删除
67 |
68 | 69 | -------------------------------------------------------------------------------- /WebContent/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /WebContent/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /WebContent/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /WebContent/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /WebContent/footer.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 17 |
18 |
19 | <%----%> 30 | 34 |
35 |
36 | Copyright © 2018-2021 新华书店 版权所有
37 |
-------------------------------------------------------------------------------- /WebContent/fraheader.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 新华书店图书销售管理系统 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 170 |
171 | 172 | -------------------------------------------------------------------------------- /WebContent/header.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 新华书店图书销售管理系统 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 179 |
180 | 181 |
182 | 183 |
184 | 241 |
242 |
243 | 244 | 245 | 246 | -------------------------------------------------------------------------------- /WebContent/header1.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | 8 | 导航条 9 | <% 10 | String path = request.getContextPath(); 11 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 12 | ; 13 | %> 14 | 15 | 16 | 17 | 18 | 19 | 20 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /WebContent/img/books/c6cf2402-c04a-426d-a339-8ea029bd5689.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/books/c6cf2402-c04a-426d-a339-8ea029bd5689.jpg -------------------------------------------------------------------------------- /WebContent/img/books/f6ed178e-b3bf-49c0-a30e-1692330ffa75.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/books/f6ed178e-b3bf-49c0-a30e-1692330ffa75.jpg -------------------------------------------------------------------------------- /WebContent/img/books/src=http___www.5jjc.net_tu5jJDEwLmFsaWNkbi5jb20vdGZzY29tL2kxLzI1OTk0NDA2NTAvVEIxRVNrcGRqZ3lfdUpqU1pMZVhYYVBsRlhhXyEhJDM.jpg&refer=http___www.5jjc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/books/src=http___www.5jjc.net_tu5jJDEwLmFsaWNkbi5jb20vdGZzY29tL2kxLzI1OTk0NDA2NTAvVEIxRVNrcGRqZ3lfdUpqU1pMZVhYYVBsRlhhXyEhJDM.jpg&refer=http___www.5jjc.jpg -------------------------------------------------------------------------------- /WebContent/img/duigou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/duigou.png -------------------------------------------------------------------------------- /WebContent/img/gerenzx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/gerenzx.png -------------------------------------------------------------------------------- /WebContent/img/gwc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/gwc.gif -------------------------------------------------------------------------------- /WebContent/img/icon-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-1.png -------------------------------------------------------------------------------- /WebContent/img/icon-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-10.png -------------------------------------------------------------------------------- /WebContent/img/icon-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-11.png -------------------------------------------------------------------------------- /WebContent/img/icon-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-12.png -------------------------------------------------------------------------------- /WebContent/img/icon-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-13.png -------------------------------------------------------------------------------- /WebContent/img/icon-14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-14.png -------------------------------------------------------------------------------- /WebContent/img/icon-15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-15.png -------------------------------------------------------------------------------- /WebContent/img/icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-16.png -------------------------------------------------------------------------------- /WebContent/img/icon-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-2.png -------------------------------------------------------------------------------- /WebContent/img/icon-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-3.png -------------------------------------------------------------------------------- /WebContent/img/icon-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-4.png -------------------------------------------------------------------------------- /WebContent/img/icon-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-5.png -------------------------------------------------------------------------------- /WebContent/img/icon-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-6.png -------------------------------------------------------------------------------- /WebContent/img/icon-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-7.png -------------------------------------------------------------------------------- /WebContent/img/icon-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-8.png -------------------------------------------------------------------------------- /WebContent/img/icon-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/icon-9.png -------------------------------------------------------------------------------- /WebContent/img/lb_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/lb_01.jpg -------------------------------------------------------------------------------- /WebContent/img/lb_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/lb_02.jpg -------------------------------------------------------------------------------- /WebContent/img/lb_03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/lb_03.jpg -------------------------------------------------------------------------------- /WebContent/img/lb_04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/lb_04.jpg -------------------------------------------------------------------------------- /WebContent/img/lb_05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/lb_05.jpg -------------------------------------------------------------------------------- /WebContent/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/logo.png -------------------------------------------------------------------------------- /WebContent/img/personIndex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/personIndex.jpg -------------------------------------------------------------------------------- /WebContent/img/seckilling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/seckilling.png -------------------------------------------------------------------------------- /WebContent/img/shoucang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/shoucang.png -------------------------------------------------------------------------------- /WebContent/img/zfb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/WebContent/img/zfb.png -------------------------------------------------------------------------------- /WebContent/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 新华书店图书销售管理系统 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /WebContent/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.7 (http://getbootstrap.com) 3 | * Copyright 2011-2016 Twitter, Inc. 4 | * Licensed under the MIT license 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); -------------------------------------------------------------------------------- /WebContent/js/util.js: -------------------------------------------------------------------------------- 1 | function getXhr() { 2 | var xmlHttp; 3 | try { 4 | // Firefox, Opera 8.0+, Safari 5 | xmlHttp = new XMLHttpRequest(); 6 | } catch (e) { 7 | // Internet Explorer 8 | try { 9 | xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); 10 | } catch (e) { 11 | try { 12 | xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 13 | } catch (e) { 14 | alert("您的浏览器不支持ajax!"); 15 | return null; 16 | } 17 | } 18 | } 19 | return xmlHttp; 20 | } 21 | -------------------------------------------------------------------------------- /WebContent/message.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | 跳转 8 | 9 | 10 |     ${message} 11 | 3秒后跳转到主页面,若没有跳转请点击这里 12 | <% 13 | response.setHeader("refresh", "3;URL=/client/ClientServlet?op=category"); 14 | %> 15 | 16 | -------------------------------------------------------------------------------- /WebContent/order.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 支付 14 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 32 | 33 |
订单编号:${order.ordernum}创建时间:${order.time}
34 |
35 | 36 |
37 |




38 |
39 | ${order.money} 41 |
42 |
43 | 44 | -------------------------------------------------------------------------------- /WebContent/particulars.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | 8 | 书籍详情 9 | <% 10 | String path = request.getContextPath(); 11 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort(); 12 | %> 13 | 14 | 15 | 16 | 18 | 19 | 20 | 68 | 69 |
71 |
72 | 《${book.book_name}》返回 75 |
76 | 77 |
78 |
80 |
82 | 85 |
86 |
87 | 88 |
89 | 《${book.book_name}》 91 |
92 | 93 |
94 | ${book.book_press} 95 |      ${book.book_author} 97 |   98 |
99 | 100 |
102 | bg——img 103 |
104 | 所属分类:   ${book.category.category_name}
105 | 书籍描述: 106 | 109 | 书籍单价:  ¥${book.book_price}
111 | 书籍库存:   ${book.book_kunumber} 本
112 | 书籍销量:   ${book.book_xiaonumber} 本
113 |
114 |
115 | 116 | 117 |
118 | 添加收藏 122 |
123 |
124 | 125 |
126 | 添加收藏 130 |
131 |
132 | 133 |
134 | 135 | 140 | 144 | 145 | 146 | 151 | 156 | 157 | 158 |
159 |
160 |
161 | 192 | 193 | -------------------------------------------------------------------------------- /WebContent/person/navigation.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 导航条 13 | 14 | 15 |
16 |

17 |   修改个人资料 21 |

22 |

23 |   修改密码 27 | 28 |

29 |

30 |   我的订单 34 |

35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /WebContent/person/personIndex.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | <% 7 | String path = request.getContextPath(); 8 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 9 | ; 10 | %> 11 | 12 | 个人中心首页 13 | 14 | 15 |
16 | 个人中心 17 |
18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /WebContent/person/personInformation.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 个人资料 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

个人资料修改

22 |
23 |
25 |
26 |
28 |
29 | 33 |
34 |
35 | 38 |
39 | 40 | 41 | 男 42 |          43 | 女 44 | 45 | 46 | 男 47 |          48 | 女 49 | 50 |
51 |
52 | 55 |
56 |
57 | 60 |
61 |
62 | 64 | 67 |
68 |
69 | 70 | -------------------------------------------------------------------------------- /WebContent/person/personOrder.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 个人订单 14 | 15 | 16 | 17 | 18 | 19 |
20 |

我的订单

21 |
22 |
24 | 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 |
序号订单编号创建时间商品数量支付金额订单状态操作
${vs.index+1}${os.ordernum}${os.time}${os.quantity}${os.money}等待发货已发货删除
52 | 53 | -------------------------------------------------------------------------------- /WebContent/person/personPassword.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 修改密码 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

修改密码

22 |
23 |
25 |
26 |
28 |
29 | 32 |
33 |
34 | 37 |
38 |
39 | 43 |
44 |
45 | 47 | 50 |
51 |
52 | 53 | -------------------------------------------------------------------------------- /WebContent/personalCenter.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | <% 7 | String path = request.getContextPath(); 8 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 9 | ; 10 | %> 11 | 12 | 个人中心 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /WebContent/redirect.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 新华书店图书销售管理系统 14 | 15 | 16 | 17 | <% 18 | response.sendRedirect(request.getContextPath()+"/client/ClientServlet?op=category"); 19 | %> 20 | 21 | -------------------------------------------------------------------------------- /WebContent/showBook.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 新华书店图书销售管理系统 9 | <% 10 | String path = request.getContextPath(); 11 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 12 | ; 13 | %> 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 58 | 59 | 60 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 87 | 88 | 89 |
书籍编号书籍图片书籍名称书籍类型书籍作者书籍出版社书籍价格销量操作
${vs.index+1} 78 | 《${s.book_name}》${s.category.category_name}${s.book_author}${s.book_press}¥${s.book_price}${s.book_xiaonumber}详情
90 | 91 | 92 | -------------------------------------------------------------------------------- /WebContent/showCart.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | <% 8 | String path = request.getContextPath(); 9 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 10 | ; 11 | %> 12 | 13 | 购物车 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 |

24 | 空空如也!快去把喜欢的宝贝添加进购物车吧!!! 返回主页 25 |

26 |
27 |
28 | 29 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 74 | 75 | 76 |
序号书籍图片书籍名称书籍类型书籍作者书籍出版社书籍单价购买数量小计操作
${vs.index+1} 48 | 《${c.value.book.book_name}》${c.value.book.category.category_name}${c.value.book.book_author}${c.value.book.book_press}¥${c.value.book.book_price}¥${c.value.money}删除
总数量:${sessionScope.cart.totalQuantity}     合计: 67 | ¥${sessionScope.cart.totalMoney} 69 |
77 | 78 |
79 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /WebContent/test.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /config/jdbcConfig.properties: -------------------------------------------------------------------------------- 1 | driverManager = com.mysql.cj.jdbc.Driver 2 | url = jdbc:mysql://localhost:3306/xinhua_library?useSSL=false&serverTimezone=UTC 3 | user=root 4 | password=root -------------------------------------------------------------------------------- /src/cn/xh/dao/ClientDao.java: -------------------------------------------------------------------------------- 1 | package cn.xh.dao; 2 | 3 | import java.util.List; 4 | 5 | import cn.xh.domain.Book; 6 | import cn.xh.domain.Favorite; 7 | import cn.xh.domain.User; 8 | 9 | public interface ClientDao { 10 | 11 | User login(String username, String password); 12 | 13 | boolean register(User user); 14 | 15 | List getCategoryBook(String cid); 16 | 17 | List rwsk(); 18 | 19 | List sets(); 20 | 21 | List jjjr(); 22 | 23 | List kxjs(); 24 | 25 | List jyks(); 26 | 27 | void personInformation(User user); 28 | 29 | void personPassword(User user); 30 | 31 | List search(String search); 32 | 33 | Book findBookById(String book_id); 34 | 35 | void addfavorite(String string, String user_id, String book_id); 36 | 37 | List findFavoriteByUserId(User user); 38 | 39 | boolean findFavorite(String user_id, String book_id); 40 | 41 | void delFavorite(String book_id); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/cn/xh/dao/ManagerDao.java: -------------------------------------------------------------------------------- 1 | package cn.xh.dao; 2 | 3 | import java.util.List; 4 | 5 | import cn.xh.domain.Administrator; 6 | import cn.xh.domain.Book; 7 | import cn.xh.domain.Category; 8 | import cn.xh.domain.User; 9 | 10 | public interface ManagerDao { 11 | 12 | Administrator login(String username, String password); 13 | 14 | void managerInformation(Administrator admin); 15 | 16 | void managerPassword(Administrator admin); 17 | 18 | List findAllCategory(); 19 | 20 | Category findCategoryById(String categoryid); 21 | 22 | void addBook(Book book); 23 | 24 | void addCategory(Category category); 25 | 26 | List getCategoryBook(String cid); 27 | 28 | 29 | Book findBookById(String book_id); 30 | 31 | void delBook(String book_id); 32 | 33 | void editBook(String book_id, String book_name, String book_author, String book_press, String book_desc, 34 | double book_price, String book_kunumber); 35 | 36 | void editCategory(Category category); 37 | 38 | void delCategory(String category_id); 39 | 40 | List findUsers(); 41 | 42 | void addAdmin(Administrator admin); 43 | 44 | List sales(); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/cn/xh/dao/OrdetrDao.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/dao/OrdetrDao.java -------------------------------------------------------------------------------- /src/cn/xh/dao/impl/ClientDaoImpl.java: -------------------------------------------------------------------------------- 1 | package cn.xh.dao.impl; 2 | 3 | import cn.xh.dao.ClientDao; 4 | import cn.xh.domain.Book; 5 | import cn.xh.domain.Category; 6 | import cn.xh.domain.Favorite; 7 | import cn.xh.domain.User; 8 | import cn.xh.util.JDBCUtil; 9 | 10 | import java.sql.*; 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | public class ClientDaoImpl implements ClientDao { 15 | 16 | // ??? 17 | @Override 18 | public User login(String username, String password) { 19 | User user = new User(); 20 | try { 21 | Connection connection = JDBCUtil.getConnection(); 22 | PreparedStatement preparedStatement = connection 23 | .prepareStatement("select * from user where user_username=? and user_password=?"); 24 | preparedStatement.setString(1, username); 25 | preparedStatement.setString(2, password); 26 | ResultSet executeQuery = preparedStatement.executeQuery(); 27 | if (executeQuery.next()) { 28 | user.setUsername(executeQuery.getString("user_username")); 29 | user.setPassword(executeQuery.getString("user_password")); 30 | user.setName(executeQuery.getString("user_name")); 31 | user.setSex(executeQuery.getString("user_sex")); 32 | user.setTel(executeQuery.getString("user_tel")); 33 | user.setAddress(executeQuery.getString("user_address")); 34 | user.setId(executeQuery.getString("user_id")); 35 | } else { 36 | } 37 | } catch (Exception e) { 38 | } 39 | return user; 40 | } 41 | 42 | // ??? 43 | @Override 44 | public boolean register(User user) { 45 | Connection connection = JDBCUtil.getConnection(); 46 | try { 47 | Statement statement = connection.createStatement(); 48 | ResultSet resultSet = statement 49 | .executeQuery("select * from user where user_username='" + user.getUsername() + "'"); 50 | if (resultSet.next() == true) { 51 | return true; 52 | } else { 53 | try { 54 | PreparedStatement preparedStatement = connection.prepareStatement( 55 | "insert into user (user_id,user_username,user_password,user_name,user_sex,user_tel,user_address) values(?,?,?,?,?,?,?)"); 56 | preparedStatement.setString(1, user.getId()); 57 | preparedStatement.setString(2, user.getUsername()); 58 | preparedStatement.setString(3, user.getPassword()); 59 | preparedStatement.setString(4, user.getName()); 60 | preparedStatement.setString(5, user.getSex()); 61 | preparedStatement.setString(6, user.getTel()); 62 | preparedStatement.setString(7, user.getAddress()); 63 | 64 | // ?? 65 | preparedStatement.executeUpdate(); 66 | } catch (Exception e) { 67 | e.printStackTrace(); 68 | } 69 | return false; 70 | } 71 | } catch (Exception e) { 72 | e.printStackTrace(); 73 | } 74 | return false; 75 | } 76 | 77 | @Override 78 | public List getCategoryBook(String cid) { 79 | try { 80 | Connection connection = JDBCUtil.getConnection(); 81 | PreparedStatement preparedStatement = null; 82 | 83 | if (cid==null){ 84 | preparedStatement= connection.prepareStatement( 85 | "select * from bookdb"); 86 | }else { 87 | preparedStatement = connection.prepareStatement( 88 | "select * from bookdb where book_category = (select category_id from category where category_id = '"+cid+"')"); 89 | } 90 | 91 | 92 | 93 | ResultSet rs = preparedStatement.executeQuery(); 94 | 95 | 96 | List list = new ArrayList(); 97 | while (rs.next()) { 98 | Book books = new Book(); 99 | books.setBook_id(rs.getString("book_id")); 100 | books.setBook_name(rs.getString("book_name")); 101 | books.setBook_author(rs.getString("book_author")); 102 | books.setBook_press(rs.getString("book_press")); 103 | Category category = findCategoryById(rs.getString("book_category")); 104 | books.setCategory(category); 105 | books.setFilename(rs.getString("filename")); 106 | books.setPath(rs.getString("path")); 107 | books.setBook_desc(rs.getString("book_desc")); 108 | books.setBook_kunumber(rs.getInt("book_kunumber")); 109 | books.setBook_xiaonumber(rs.getInt("book_xiaonumber")); 110 | books.setBook_price(rs.getDouble("book_price")); 111 | list.add(books); 112 | } 113 | return list; 114 | } catch (Exception e) { 115 | e.printStackTrace(); 116 | } 117 | throw new RuntimeException("?????????"); 118 | } 119 | 120 | // ????鼮????id????鼮?????????? 121 | private Category findCategoryById(String book_category) { 122 | Category category = new Category(); 123 | try { 124 | Connection connection = JDBCUtil.getConnection(); 125 | PreparedStatement preparedStatement = connection 126 | .prepareStatement("select * from category where category_id=?"); 127 | preparedStatement.setString(1, book_category); 128 | ResultSet resultSet = preparedStatement.executeQuery(); 129 | while (resultSet.next()) { 130 | category.setCategory_id(resultSet.getString("category_id")); 131 | category.setCategory_name(resultSet.getString("category_name")); 132 | category.setCategory_desc(resultSet.getString("category_desc")); 133 | return category; 134 | } 135 | } catch (Exception e) { 136 | e.printStackTrace(); 137 | } 138 | throw new RuntimeException(""); 139 | } 140 | 141 | // ??????????鼮?б? 142 | @Override 143 | public List rwsk() { 144 | try { 145 | Connection connection = JDBCUtil.getConnection(); 146 | PreparedStatement preparedStatement = connection.prepareStatement( 147 | "select * from bookdb where book_category = (select category_id from category where category_name = '???????')"); 148 | ResultSet rs = preparedStatement.executeQuery(); 149 | 150 | List list = new ArrayList(); 151 | while (rs.next()) { 152 | Book books = new Book(); 153 | books.setBook_id(rs.getString("book_id")); 154 | books.setBook_name(rs.getString("book_name")); 155 | books.setBook_author(rs.getString("book_author")); 156 | books.setBook_press(rs.getString("book_press")); 157 | Category category = findCategoryById(rs.getString("book_category")); 158 | books.setCategory(category); 159 | books.setFilename(rs.getString("filename")); 160 | books.setPath(rs.getString("path")); 161 | books.setBook_desc(rs.getString("book_desc")); 162 | books.setBook_kunumber(rs.getInt("book_kunumber")); 163 | books.setBook_xiaonumber(rs.getInt("book_xiaonumber")); 164 | books.setBook_price(rs.getDouble("book_price")); 165 | list.add(books); 166 | } 167 | return list; 168 | } catch (Exception e) { 169 | e.printStackTrace(); 170 | } 171 | throw new RuntimeException("?????????"); 172 | } 173 | 174 | // ?????????鼮?б? 175 | @Override 176 | public List sets() { 177 | try { 178 | Connection connection = JDBCUtil.getConnection(); 179 | PreparedStatement preparedStatement = connection.prepareStatement( 180 | "select * from bookdb where book_category = (select category_id from category where category_name = '??????')"); 181 | ResultSet rs = preparedStatement.executeQuery(); 182 | 183 | List list = new ArrayList(); 184 | while (rs.next()) { 185 | Book books = new Book(); 186 | books.setBook_id(rs.getString("book_id")); 187 | books.setBook_name(rs.getString("book_name")); 188 | books.setBook_author(rs.getString("book_author")); 189 | books.setBook_press(rs.getString("book_press")); 190 | Category category = findCategoryById(rs.getString("book_category")); 191 | books.setCategory(category); 192 | books.setFilename(rs.getString("filename")); 193 | books.setPath(rs.getString("path")); 194 | books.setBook_desc(rs.getString("book_desc")); 195 | books.setBook_kunumber(rs.getInt("book_kunumber")); 196 | books.setBook_xiaonumber(rs.getInt("book_xiaonumber")); 197 | books.setBook_price(rs.getDouble("book_price")); 198 | list.add(books); 199 | } 200 | return list; 201 | } catch (Exception e) { 202 | e.printStackTrace(); 203 | } 204 | throw new RuntimeException("?????????"); 205 | } 206 | 207 | // ??????????鼮?б? 208 | @Override 209 | public List jjjr() { 210 | try { 211 | Connection connection = JDBCUtil.getConnection(); 212 | PreparedStatement preparedStatement = connection.prepareStatement( 213 | "select * from bookdb where book_category = (select category_id from category where category_name = '???????')"); 214 | ResultSet rs = preparedStatement.executeQuery(); 215 | 216 | List list = new ArrayList(); 217 | while (rs.next()) { 218 | Book books = new Book(); 219 | books.setBook_id(rs.getString("book_id")); 220 | books.setBook_name(rs.getString("book_name")); 221 | books.setBook_author(rs.getString("book_author")); 222 | books.setBook_press(rs.getString("book_press")); 223 | Category category = findCategoryById(rs.getString("book_category")); 224 | books.setCategory(category); 225 | books.setFilename(rs.getString("filename")); 226 | books.setPath(rs.getString("path")); 227 | books.setBook_desc(rs.getString("book_desc")); 228 | books.setBook_kunumber(rs.getInt("book_kunumber")); 229 | books.setBook_xiaonumber(rs.getInt("book_xiaonumber")); 230 | books.setBook_price(rs.getDouble("book_price")); 231 | list.add(books); 232 | } 233 | return list; 234 | } catch (Exception e) { 235 | e.printStackTrace(); 236 | } 237 | throw new RuntimeException("?????????"); 238 | } 239 | 240 | // ??????????鼮?б? 241 | @Override 242 | public List kxjs() { 243 | try { 244 | Connection connection = JDBCUtil.getConnection(); 245 | PreparedStatement preparedStatement = connection.prepareStatement( 246 | "select * from bookdb where book_category = (select category_id from category where category_name = '???????')"); 247 | ResultSet rs = preparedStatement.executeQuery(); 248 | 249 | List list = new ArrayList(); 250 | while (rs.next()) { 251 | Book books = new Book(); 252 | books.setBook_id(rs.getString("book_id")); 253 | books.setBook_name(rs.getString("book_name")); 254 | books.setBook_author(rs.getString("book_author")); 255 | books.setBook_press(rs.getString("book_press")); 256 | Category category = findCategoryById(rs.getString("book_category")); 257 | books.setCategory(category); 258 | books.setFilename(rs.getString("filename")); 259 | books.setPath(rs.getString("path")); 260 | books.setBook_desc(rs.getString("book_desc")); 261 | books.setBook_kunumber(rs.getInt("book_kunumber")); 262 | books.setBook_xiaonumber(rs.getInt("book_xiaonumber")); 263 | books.setBook_price(rs.getDouble("book_price")); 264 | list.add(books); 265 | } 266 | return list; 267 | } catch (Exception e) { 268 | e.printStackTrace(); 269 | } 270 | throw new RuntimeException("?????????"); 271 | } 272 | 273 | // ???????????鼮?б? 274 | @Override 275 | public List jyks() { 276 | try { 277 | Connection connection = JDBCUtil.getConnection(); 278 | PreparedStatement preparedStatement = connection.prepareStatement( 279 | "select * from bookdb where book_category = (select category_id from category where category_name = '????????')"); 280 | ResultSet rs = preparedStatement.executeQuery(); 281 | 282 | List list = new ArrayList(); 283 | while (rs.next()) { 284 | Book books = new Book(); 285 | books.setBook_id(rs.getString("book_id")); 286 | books.setBook_name(rs.getString("book_name")); 287 | books.setBook_author(rs.getString("book_author")); 288 | books.setBook_press(rs.getString("book_press")); 289 | Category category = findCategoryById(rs.getString("book_category")); 290 | books.setCategory(category); 291 | books.setFilename(rs.getString("filename")); 292 | books.setPath(rs.getString("path")); 293 | books.setBook_desc(rs.getString("book_desc")); 294 | books.setBook_kunumber(rs.getInt("book_kunumber")); 295 | books.setBook_xiaonumber(rs.getInt("book_xiaonumber")); 296 | books.setBook_price(rs.getDouble("book_price")); 297 | list.add(books); 298 | } 299 | return list; 300 | } catch (Exception e) { 301 | e.printStackTrace(); 302 | } 303 | throw new RuntimeException("?????????"); 304 | } 305 | 306 | // ?????????? 307 | @Override 308 | public void personInformation(User user) { 309 | try { 310 | Connection connection = JDBCUtil.getConnection(); 311 | PreparedStatement prepareStatement = connection.prepareStatement( 312 | "update user set user_name=?,user_sex=?,user_tel=?,user_address=? where user_username=?"); 313 | prepareStatement.setString(1, user.getName()); 314 | prepareStatement.setString(2, user.getSex()); 315 | prepareStatement.setString(3, user.getTel()); 316 | prepareStatement.setString(4, user.getAddress()); 317 | prepareStatement.setString(5, user.getUsername()); 318 | prepareStatement.executeUpdate(); 319 | } catch (Exception e) { 320 | e.printStackTrace(); 321 | } 322 | } 323 | 324 | // ??????? 325 | @Override 326 | public void personPassword(User user) { 327 | try { 328 | Connection connection = JDBCUtil.getConnection(); 329 | PreparedStatement prepareStatement = connection 330 | .prepareStatement("update user set user_password=? where user_username=?"); 331 | prepareStatement.setString(1, user.getPassword()); 332 | prepareStatement.setString(2, user.getUsername()); 333 | prepareStatement.executeUpdate(); 334 | } catch (Exception e) { 335 | e.printStackTrace(); 336 | } 337 | } 338 | 339 | // ?????? 340 | @Override 341 | public List search(String search) { 342 | List lists = new ArrayList(); 343 | try { 344 | Connection connection = JDBCUtil.getConnection(); 345 | PreparedStatement preparedStatement = connection 346 | .prepareStatement("select * from bookdb where book_name like ?"); 347 | preparedStatement.setString(1, "%" + search + "%"); 348 | ResultSet rs = preparedStatement.executeQuery(); 349 | while (rs.next()) { 350 | Book books = new Book(); 351 | books.setBook_id(rs.getString("book_id")); 352 | books.setBook_name(rs.getString("book_name")); 353 | books.setBook_author(rs.getString("book_author")); 354 | books.setBook_press(rs.getString("book_press")); 355 | Category category = findCategoryById(rs.getString("book_category")); 356 | books.setCategory(category); 357 | books.setFilename(rs.getString("filename")); 358 | books.setPath(rs.getString("path")); 359 | books.setBook_desc(rs.getString("book_desc")); 360 | books.setBook_kunumber(rs.getInt("book_kunumber")); 361 | books.setBook_xiaonumber(rs.getInt("book_xiaonumber")); 362 | books.setBook_price(rs.getDouble("book_price")); 363 | lists.add(books); 364 | } 365 | return lists; 366 | } catch (Exception e) { 367 | e.printStackTrace(); 368 | } 369 | return null; 370 | } 371 | 372 | // ????鼮id????鼮??? 373 | @Override 374 | public Book findBookById(String book_id) { 375 | try { 376 | Book book = new Book(); 377 | Connection connection = JDBCUtil.getConnection(); 378 | PreparedStatement prepareStatement = connection.prepareStatement("select * from bookdb where book_id = ?"); 379 | prepareStatement.setString(1, book_id); 380 | ResultSet rs = prepareStatement.executeQuery(); 381 | if (rs.next()) { 382 | book.setBook_id(rs.getString("book_id")); 383 | book.setBook_name(rs.getString("book_name")); 384 | book.setBook_author(rs.getString("book_author")); 385 | book.setBook_press(rs.getString("book_press")); 386 | Category category = findCategoryById(rs.getString("book_category")); 387 | book.setCategory(category); 388 | book.setFilename(rs.getString("filename")); 389 | book.setPath(rs.getString("path")); 390 | book.setBook_desc(rs.getString("book_desc")); 391 | book.setBook_kunumber(rs.getInt("book_kunumber")); 392 | book.setBook_xiaonumber(rs.getInt("book_xiaonumber")); 393 | book.setBook_price(rs.getDouble("book_price")); 394 | } 395 | return book; 396 | } catch (Exception e) { 397 | e.printStackTrace(); 398 | } 399 | return null; 400 | } 401 | 402 | // ??????? 403 | @Override 404 | public void addfavorite(String favorite_id, String user_id, String book_id) { 405 | try { 406 | Connection connection = JDBCUtil.getConnection(); 407 | PreparedStatement prepareStatement = connection 408 | .prepareStatement("insert into favorite (favorite_id,user_id,book_id) values (?,?,?)"); 409 | prepareStatement.setString(1, favorite_id); 410 | prepareStatement.setString(2, user_id); 411 | prepareStatement.setString(3, book_id); 412 | prepareStatement.executeUpdate(); 413 | } catch (SQLException e) { 414 | e.printStackTrace(); 415 | } 416 | 417 | } 418 | 419 | // ??????? 420 | @Override 421 | public List findFavoriteByUserId(User user) { 422 | try { 423 | Connection connection = JDBCUtil.getConnection(); 424 | PreparedStatement prepareStatement = connection 425 | .prepareStatement("select * from favorite where user_id = ?"); 426 | prepareStatement.setString(1, user.getId()); 427 | ResultSet rs = prepareStatement.executeQuery(); 428 | List list = new ArrayList(); 429 | while (rs.next()) { 430 | Favorite favorite = new Favorite(); 431 | favorite.setUser(user); 432 | favorite.setFavorite_id(rs.getString("favorite_id")); 433 | Book book = findBookById(rs.getString("book_id")); 434 | favorite.setBook(book); 435 | list.add(favorite); 436 | } 437 | return list; 438 | } catch (Exception e) { 439 | e.printStackTrace(); 440 | } 441 | return null; 442 | } 443 | 444 | @Override 445 | public boolean findFavorite(String user_id, String book_id) { 446 | try { 447 | Connection connection = JDBCUtil.getConnection(); 448 | PreparedStatement prepareStatement = connection 449 | .prepareStatement("select * from favorite where user_id=? and book_id=?"); 450 | prepareStatement.setString(1, user_id); 451 | prepareStatement.setString(2, book_id); 452 | ResultSet rs = prepareStatement.executeQuery(); 453 | if (rs.next()) { 454 | return true; 455 | } 456 | return false; 457 | } catch (Exception e) { 458 | e.printStackTrace(); 459 | } 460 | throw new RuntimeException(); 461 | } 462 | 463 | @Override 464 | public void delFavorite(String book_id) { 465 | try { 466 | Connection connection = JDBCUtil.getConnection(); 467 | PreparedStatement prepareStatement = connection.prepareStatement("delete from favorite where book_id=?"); 468 | prepareStatement.setString(1, book_id); 469 | prepareStatement.executeUpdate(); 470 | } catch (Exception e) { 471 | e.printStackTrace(); 472 | } 473 | } 474 | 475 | } 476 | -------------------------------------------------------------------------------- /src/cn/xh/dao/impl/ManagerDaoImpl.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/dao/impl/ManagerDaoImpl.java -------------------------------------------------------------------------------- /src/cn/xh/dao/impl/OrderDaoImpl.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/dao/impl/OrderDaoImpl.java -------------------------------------------------------------------------------- /src/cn/xh/domain/Administrator.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/domain/Administrator.java -------------------------------------------------------------------------------- /src/cn/xh/domain/Book.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/domain/Book.java -------------------------------------------------------------------------------- /src/cn/xh/domain/Category.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/domain/Category.java -------------------------------------------------------------------------------- /src/cn/xh/domain/Favorite.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/domain/Favorite.java -------------------------------------------------------------------------------- /src/cn/xh/domain/Order.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/domain/Order.java -------------------------------------------------------------------------------- /src/cn/xh/domain/Orderitem.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/domain/Orderitem.java -------------------------------------------------------------------------------- /src/cn/xh/domain/User.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/domain/User.java -------------------------------------------------------------------------------- /src/cn/xh/service/ClientService.java: -------------------------------------------------------------------------------- 1 | package cn.xh.service; 2 | 3 | import java.util.List; 4 | 5 | import cn.xh.domain.Book; 6 | import cn.xh.domain.Favorite; 7 | import cn.xh.domain.User; 8 | 9 | public interface ClientService { 10 | 11 | public User login(String username, String password); 12 | 13 | public boolean register(String username, String password, String name, String sex, String tel, String address); 14 | 15 | public List getCategoryBook(String cid); 16 | 17 | public List rwsk(); 18 | 19 | public List sets(); 20 | 21 | public List jjjr(); 22 | 23 | public List kxjs(); 24 | 25 | public List jyks(); 26 | 27 | public void personInformation(String username, String name, String sex, String tel, String address); 28 | 29 | public void personPassword(String password, String username); 30 | 31 | public List search(String search); 32 | 33 | public Book findBookById(String book_id); 34 | 35 | public void addfavorite(String user_id, String book_id); 36 | 37 | public List findFavoriteByUserId(User user); 38 | 39 | public boolean findFavorite(String user_id, String book_id); 40 | 41 | public void delFavorite(String book_id); 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/cn/xh/service/ManagerService.java: -------------------------------------------------------------------------------- 1 | package cn.xh.service; 2 | 3 | import java.util.List; 4 | 5 | import cn.xh.domain.Administrator; 6 | import cn.xh.domain.Book; 7 | import cn.xh.domain.Category; 8 | import cn.xh.domain.User; 9 | 10 | public interface ManagerService { 11 | 12 | Administrator login(String username, String password); 13 | 14 | void managerInformation(String username, String name, String sex, String tel); 15 | 16 | void managerPassword(String username, String password); 17 | 18 | List findAllCategory(); 19 | 20 | Category findCategoryById(String categoryid); 21 | 22 | void addBook(Book book); 23 | 24 | void addCategory(Category category); 25 | 26 | List getCategoryBook(String cid); 27 | 28 | Book findBookById(String book_id); 29 | 30 | void delBook(String book_id); 31 | 32 | void editBook(String book_id, String book_name, String book_author, String book_press, String book_desc, 33 | double book_price, String book_kunumber); 34 | 35 | void editCategory(Category category); 36 | 37 | void delCategory(String category_id); 38 | 39 | List findUsers(); 40 | 41 | void addAdmin(Administrator admin); 42 | 43 | List sales(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/cn/xh/service/OrderService.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/service/OrderService.java -------------------------------------------------------------------------------- /src/cn/xh/service/impl/ClientServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.xh.service.impl; 2 | 3 | import java.util.List; 4 | import java.util.UUID; 5 | 6 | import cn.xh.dao.ClientDao; 7 | import cn.xh.dao.impl.ClientDaoImpl; 8 | import cn.xh.domain.Book; 9 | import cn.xh.domain.Favorite; 10 | import cn.xh.domain.User; 11 | import cn.xh.service.ClientService; 12 | 13 | public class ClientServiceImpl implements ClientService { 14 | 15 | private ClientDao dao = new ClientDaoImpl(); 16 | 17 | @Override 18 | public User login(String username, String password) { 19 | return dao.login(username, password); 20 | } 21 | 22 | @Override 23 | public boolean register(String username, String password, String name, String sex, String tel, String address) { 24 | User user = new User(UUID.randomUUID().toString(), username, password, name, sex, tel, address); 25 | return dao.register(user); 26 | } 27 | 28 | @Override 29 | public List getCategoryBook(String cid) { 30 | return dao.getCategoryBook(cid); 31 | } 32 | 33 | @Override 34 | public List rwsk() { 35 | return dao.rwsk(); 36 | } 37 | 38 | @Override 39 | public List sets() { 40 | return dao.sets(); 41 | } 42 | 43 | @Override 44 | public List jjjr() { 45 | return dao.jjjr(); 46 | } 47 | 48 | @Override 49 | public List kxjs() { 50 | return dao.kxjs(); 51 | } 52 | 53 | @Override 54 | public List jyks() { 55 | return dao.jyks(); 56 | } 57 | 58 | @Override 59 | public void personInformation(String username, String name, String sex, String tel, String address) { 60 | User user = new User(null, username, null, name, sex, tel, address); 61 | dao.personInformation(user); 62 | } 63 | 64 | @Override 65 | public void personPassword(String password, String username) { 66 | User user = new User(null, username, password, null, null, null, null); 67 | dao.personPassword(user); 68 | } 69 | 70 | @Override 71 | public List search(String search) { 72 | return dao.search(search); 73 | } 74 | 75 | @Override 76 | public Book findBookById(String book_id) { 77 | return dao.findBookById(book_id); 78 | } 79 | 80 | @Override 81 | public void addfavorite(String user_id, String book_id) { 82 | dao.addfavorite(UUID.randomUUID().toString(), user_id, book_id); 83 | } 84 | 85 | @Override 86 | public List findFavoriteByUserId(User user) { 87 | return dao.findFavoriteByUserId(user); 88 | } 89 | 90 | @Override 91 | public boolean findFavorite(String user_id, String book_id) { 92 | return dao.findFavorite(user_id, book_id); 93 | } 94 | 95 | @Override 96 | public void delFavorite(String book_id) { 97 | dao.delFavorite(book_id); 98 | 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /src/cn/xh/service/impl/ManagerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.xh.service.impl; 2 | 3 | import cn.xh.dao.ManagerDao; 4 | import cn.xh.dao.impl.ManagerDaoImpl; 5 | import cn.xh.domain.Administrator; 6 | import cn.xh.domain.Book; 7 | import cn.xh.domain.Category; 8 | import cn.xh.domain.User; 9 | import cn.xh.service.ManagerService; 10 | 11 | import java.util.List; 12 | import java.util.UUID; 13 | 14 | public class ManagerServiceImpl implements ManagerService { 15 | private ManagerDao dao = new ManagerDaoImpl(); 16 | 17 | @Override 18 | public Administrator login(String username, String password) { 19 | return dao.login(username, password); 20 | } 21 | 22 | @Override 23 | public void managerInformation(String username, String name, String sex, String tel) { 24 | Administrator admin = new Administrator(username, null, name, sex, tel); 25 | dao.managerInformation(admin); 26 | } 27 | 28 | @Override 29 | public void managerPassword(String username, String password) { 30 | Administrator admin = new Administrator(username, password, null, null, null); 31 | dao.managerPassword(admin); 32 | } 33 | 34 | @Override 35 | public List findAllCategory() { 36 | return dao.findAllCategory(); 37 | } 38 | 39 | @Override 40 | public Category findCategoryById(String categoryid) { 41 | return dao.findCategoryById(categoryid); 42 | } 43 | 44 | @Override 45 | public void addBook(Book book) { 46 | book.setBook_id(UUID.randomUUID().toString()); 47 | dao.addBook(book); 48 | 49 | } 50 | 51 | @Override 52 | public void addCategory(Category category) { 53 | category.setCategory_id(UUID.randomUUID().toString()); 54 | dao.addCategory(category); 55 | } 56 | 57 | @Override 58 | public List getCategoryBook(String cid) { 59 | return dao.getCategoryBook(cid); 60 | } 61 | 62 | 63 | 64 | @Override 65 | public Book findBookById(String book_id) { 66 | return dao.findBookById(book_id); 67 | } 68 | 69 | @Override 70 | public void delBook(String book_id) { 71 | dao.delBook(book_id); 72 | } 73 | 74 | @Override 75 | public void editBook(String book_id, String book_name, String book_author, String book_press, String book_desc, 76 | double book_price, String book_kunumber) { 77 | dao.editBook(book_id, book_name, book_author, book_press, book_desc, book_price, book_kunumber); 78 | } 79 | 80 | @Override 81 | public void editCategory(Category category) { 82 | dao.editCategory(category); 83 | } 84 | 85 | @Override 86 | public void delCategory(String category_id) { 87 | dao.delCategory(category_id); 88 | } 89 | 90 | @Override 91 | public List findUsers() { 92 | return dao.findUsers(); 93 | } 94 | 95 | @Override 96 | public void addAdmin(Administrator admin) { 97 | dao.addAdmin(admin); 98 | } 99 | 100 | @Override 101 | public List sales() { 102 | return dao.sales(); 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /src/cn/xh/service/impl/OrderServiceImpl.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/service/impl/OrderServiceImpl.java -------------------------------------------------------------------------------- /src/cn/xh/util/JDBCUtil.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/util/JDBCUtil.java -------------------------------------------------------------------------------- /src/cn/xh/web/controller/ClientServlet.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/web/controller/ClientServlet.java -------------------------------------------------------------------------------- /src/cn/xh/web/controller/ManagerServlet.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/web/controller/ManagerServlet.java -------------------------------------------------------------------------------- /src/cn/xh/web/controller/OrderServlet.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/web/controller/OrderServlet.java -------------------------------------------------------------------------------- /src/cn/xh/web/formbean/Cart.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/web/formbean/Cart.java -------------------------------------------------------------------------------- /src/cn/xh/web/formbean/CartItem.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HelloCoder-HaC/Javaweb_bookstore/c4747f4f254a8c608d07dc6f048a465f52a88746/src/cn/xh/web/formbean/CartItem.java --------------------------------------------------------------------------------