├── .DS_Store ├── .gitattributes ├── README.md ├── src ├── com │ └── shine │ │ └── game │ │ ├── bean │ │ ├── Admin.java │ │ ├── Book.java │ │ ├── Cart.java │ │ ├── CartItem.java │ │ ├── Catalog.java │ │ ├── Comment.java │ │ ├── Order.java │ │ ├── OrderItem.java │ │ ├── PageBean.java │ │ ├── UpLoadImg.java │ │ └── User.java │ │ ├── dao │ │ ├── AdminDao.java │ │ ├── BookDao.java │ │ ├── CatalogDao.java │ │ ├── CommentDao.java │ │ ├── OrderDao.java │ │ ├── OrderItemDao.java │ │ ├── UpLoadImgDao.java │ │ ├── UserDao.java │ │ └── impl │ │ │ ├── AdminDaoImpl.java │ │ │ ├── BookDaoImpl.java │ │ │ ├── CatalogDaoImpl.java │ │ │ ├── CommentDaoImpl.java │ │ │ ├── OrderDaoImpl.java │ │ │ ├── OrderItemDaoImpl.java │ │ │ ├── UpLoadImgDaoImpl.java │ │ │ └── UserDaoImpl.java │ │ ├── filter │ │ ├── FilterEnconding.java │ │ └── FilterLogin.java │ │ ├── listener │ │ └── ListenerCount.java │ │ ├── servlet │ │ ├── admin │ │ │ ├── AdminManageServlet.java │ │ │ ├── BookManageServlet.java │ │ │ ├── CatalogServlet.java │ │ │ ├── CommentManageServlet.java │ │ │ ├── LoginOutServlet.java │ │ │ ├── LoginServlet.java │ │ │ ├── OrderManageServlet.java │ │ │ └── UserManageServlet.java │ │ └── book │ │ │ ├── BookList.java │ │ │ ├── CartServlet.java │ │ │ ├── CodeServlet.java │ │ │ ├── CommentServlet.java │ │ │ ├── GetCatalog.java │ │ │ ├── OrderSubServlet.java │ │ │ ├── ShopIndex.java │ │ │ ├── UserServlet.java │ │ │ └── bookdetailed.java │ │ ├── test │ │ ├── Test.java │ │ └── Test2.java │ │ └── util │ │ ├── DateUtil.java │ │ ├── DbUtil.java │ │ ├── ImageCode.java │ │ ├── MathUtils.java │ │ ├── PropertiesUtil.java │ │ ├── RanUtil.java │ │ └── Test.java └── dbinfo.properties └── web ├── META-INF └── MANIFEST.MF ├── WEB-INF ├── lib │ ├── commons-beanutils-1.9.2.jar │ ├── commons-collections-3.2.1.jar │ ├── commons-fileupload-1.3.1.jar │ ├── commons-io-2.5.jar │ ├── commons-lang-2.4.jar │ ├── commons-logging-1.1.3.jar │ ├── ezmorph-1.0.6.jar │ ├── json-lib-2.3-jdk15.jar │ ├── jstl-1.2.jar │ └── mysql-connector-java-5.1.10-bin.jar └── web.xml ├── bs ├── css │ ├── bootstrap.css │ └── bootstrap.min.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery.min.js │ └── npm.js └── validform │ ├── Validform_v5.3.2_min.js │ ├── img │ ├── error.png │ ├── onLoad.gif │ └── right.png │ └── style.css ├── css ├── admin │ ├── adminManage │ │ └── userList.css │ ├── header.css │ └── left.css ├── book │ ├── booklist.css │ ├── head_footer.css │ ├── index.css │ └── user_reg_login.css └── login │ └── login.css ├── images ├── admin │ └── bk_header.jpg ├── book │ ├── banner1.jpg │ ├── banner2.jpg │ ├── banner3.jpg │ ├── banner4-oold.jpg │ ├── banner4.jpg │ ├── banner5.jpg │ ├── bookimg │ │ ├── 07e2d4e161ba4dc6829fbc6111247682.png │ │ ├── 082970b5166748f8a247de63dbaa49f0.png │ │ ├── 0d60d4d279b848fda9216c7acba3aa04.jpg │ │ ├── 17cdda3d2b7d4c15b406fc7e9ce3c06c.png │ │ ├── 25c13e8627a54d63b260b61440148ec8.png │ │ ├── 59afebc652544489b76a6fcd36394ef7.jpg │ │ ├── 645ffbe8a9a44ac7b5f46a2f5d56d729.png │ │ ├── 6a74d7fc5b1048e88637aa9a2cccc979.png │ │ ├── 6f3acf47d34f47918424c3447cdd6758.png │ │ ├── 79f34b81fbea4032bee2e7fe06fdb783.jpg │ │ ├── 7eac259a929d49bb827a2a8a06086ded.png │ │ ├── 837d9114183942c7ac1b5f6224d6c2e8.jpg │ │ ├── b77d4a0448b14dc4850058e16aca3c56.png │ │ ├── cc383864c2fe469e9496ea238a442a42.png │ │ ├── ccd90fd7d27646efb1e81e6451466cc6.png │ │ ├── d5394d4d13b34628a7170ca5b14f2bce.jpg │ │ ├── ee70dcea8135427183ccbd4ce64f95fe.jpg │ │ ├── f469505d78a04ffbb6c70915dc8800ae.png │ │ └── fcf76cbd056842f48f949e38ab59a073.jpg │ ├── corr.png │ ├── footer_bg.png │ ├── footer_bg_01.png │ ├── footer_bg_02.png │ ├── footer_bg_03.png │ ├── footer_bg_04.png │ ├── noneImg.jpg │ ├── testimg.jpg │ └── validate.gif ├── login │ ├── bg.jpg │ ├── pwd.png │ └── user.png └── logo.png ├── index.html ├── index.jsp ├── js ├── admin │ ├── adminManage │ │ ├── adminAdd.js │ │ └── adminEdit.js │ ├── bookManage │ │ └── bookAdd.js │ └── userManage │ │ ├── userAdd.js │ │ └── userEdit.js ├── book │ ├── addcart.js │ ├── getCatalog.js │ ├── index.js │ ├── landing.js │ └── user_reg_login.js └── jquery.min.js └── jsp ├── admin ├── adminManage │ ├── adminAdd.jsp │ ├── adminEdit.jsp │ └── adminList.jsp ├── bookManage │ ├── bookAdd.jsp │ ├── bookDetail.jsp │ ├── bookEdit.jsp │ ├── bookList.jsp │ ├── catalogAdd.jsp │ ├── catalogEdit.jsp │ └── catalogList.jsp ├── commentManage │ ├── commentEdit.jsp │ └── commentList.jsp ├── index.jsp ├── left.jsp ├── login.jsp ├── main.jsp ├── onlineUser.jsp ├── orderManage │ ├── orderDetail.jsp │ ├── orderOp.jsp │ └── orderlist.jsp └── userManage │ ├── userAdd.jsp │ ├── userDetail.jsp │ ├── userEdit.jsp │ └── userList.jsp └── book ├── bookdetails.jsp ├── booklist.jsp ├── cart.jsp ├── conorder.jsp ├── footer.jsp ├── header.jsp ├── index.jsp ├── myorderlist.jsp ├── myselllist.jsp ├── orderDetail.jsp ├── orderOp.jsp ├── ordersuccess.jsp ├── reg.jsp ├── sellBookAdd.jsp ├── sellBookEdit.jsp └── userinfo.jsp /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=java 2 | *.css linguist-language=java 3 | *.html linguist-language=java 4 | *.vue linguist-language=java -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 全目录 2 | 3 | [更多系统、论文,供君选择 ~~>](https://www.yuque.com/wisebit/blog) 4 | 5 | # 296.GameProductTradingManagementSystem 6 | 7 |

群: 983063232(入群获取sql文件)

8 |

QQ: 206157502(加好友获取sql文件)

9 | 10 |

296.游戏商品交易管理系统

11 | 12 | 13 | 14 |

15 | 16 | 17 | 18 | 19 |

20 | 21 | 演示地址: []() 22 | 23 | # 简介 24 | 25 | > 本代码来源于网络,仅供学习参考使用,请入群(983063232)后联系群主索要sql文件! 26 | > 27 | > 提供1.远程部署/2.修改代码/3.设计文档指导/4.框架代码讲解等服务 28 | > 29 | > 前端地址: http://localhost:8080/jsp/book/index.jsp 30 | > 31 | > 前端登录地址:http://localhost:8080/jsp/book/reg.jsp?type=login 32 | > 33 | > 用户名: user 密码: 123456 34 | > 35 | > 后端管理地址: http://localhost:8080/jsp/admin/login.jsp 36 | > 37 | > 管理员用户名: admin 密码: 123456 38 | > 39 | 40 | 41 | # 环境 42 | 43 | - IntelliJ IDEA 2021.3 44 | 45 | - Mysql 5.7.26 46 | 47 | - Tomcat 7.0.73 48 | 49 | - JDK 1.8 50 | 51 | 52 | 53 | 54 | 55 | ## 缩略图 56 | 57 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/3ce60f34-a45a-422d-be1e-79cc7e7ab0e3.png) 58 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/d83277fb-fe9a-4c35-b4fd-90b2e4d354f6.png) 59 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/045dce91-fd08-4ab0-a030-c1ec304b4afd.png) 60 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/fec80d17-1d5f-4f97-8aba-c10d9e1aad47.png) 61 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/a2b2c748-cd7b-4d3a-98b7-68166ce674b1.png) 62 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/a3c75ffb-2b00-4f12-bbef-d8fea5688fec.png) 63 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/91f68928-1e84-4f83-b150-7ee81bc13396.png) 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/com/shine/game/bean/Admin.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.bean; 2 | 3 | import java.util.Date; 4 | import java.util.Map; 5 | /** 6 | * 管理员用户类 7 | * @author 8 | * 9 | */ 10 | public class Admin { 11 | private Integer id; //用户编号 12 | private String userName; //用户名 13 | private String passWord; //用户密码 14 | private String name; //用户姓名 15 | private Date lastLoginTime; //最后登录时间 16 | 17 | public Admin() {} 18 | 19 | public Admin(String userName,String passWord) { 20 | this.userName=userName; 21 | this.passWord=passWord; 22 | } 23 | 24 | public Admin(Integer id, String passWord, String name) { 25 | super(); 26 | this.id = id; 27 | this.passWord = passWord; 28 | this.name = name; 29 | } 30 | 31 | 32 | public Admin(String userName, String passWord, String name) { 33 | super(); 34 | this.userName = userName; 35 | this.passWord = passWord; 36 | this.name = name; 37 | } 38 | 39 | public Admin(Map map) { 40 | this.id = (Integer) map.get("id"); 41 | this.userName=(String) map.get("userName"); 42 | this.passWord = (String) map.get("passWord"); 43 | this.name = (String) map.get("name"); 44 | this.lastLoginTime=(Date) map.get("lastLoginTime"); 45 | } 46 | 47 | 48 | public Integer getId() { 49 | return id; 50 | } 51 | 52 | public void setId(Integer id) { 53 | this.id = id; 54 | } 55 | 56 | public String getUserName() { 57 | return userName; 58 | } 59 | 60 | public void setUserName(String userName) { 61 | this.userName = userName; 62 | } 63 | 64 | public String getPassWord() { 65 | return passWord; 66 | } 67 | 68 | public void setPassWord(String passWord) { 69 | this.passWord = passWord; 70 | } 71 | 72 | public String getName() { 73 | return name; 74 | } 75 | 76 | public void setName(String name) { 77 | this.name = name; 78 | } 79 | 80 | 81 | public Date getLastLoginTime() { 82 | return lastLoginTime; 83 | } 84 | 85 | public void setLastLoginTime(Date lastLoginTime) { 86 | this.lastLoginTime = lastLoginTime; 87 | } 88 | 89 | @Override 90 | public String toString() { 91 | return "Admin{" + 92 | "id=" + id + 93 | ", userName='" + userName + '\'' + 94 | ", passWord='" + passWord + '\'' + 95 | ", name='" + name + '\'' + 96 | ", lastLoginTime=" + lastLoginTime + 97 | '}'; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/com/shine/game/bean/Book.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.bean; 2 | 3 | import java.util.Date; 4 | import java.util.Map; 5 | 6 | public class Book { 7 | 8 | private int bookId; // 饰品编号 9 | private String bookName; // 饰品名称 10 | private double price; // 价格 11 | private String description; // 描述信息 12 | private String author; // 饰品品质 13 | private String press; // 饰品类别 14 | private int catalogId; // 饰品分类id 15 | private int imgId; // 图片id 16 | private Date addTime;//上架时间 17 | private Catalog catalog = new Catalog(); // 饰品分类类属性 18 | private UpLoadImg upLoadImg = new UpLoadImg(); // 图片类属性 19 | private int sellUserId ;//出售者id 20 | private String sellUserName;//出售者姓名 21 | public Book() { 22 | } 23 | 24 | // 这里是从数据库获取时集合转对象 25 | public Book(Map map) { 26 | this.bookId = (int) map.get("bookId"); 27 | this.bookName = (String) map.get("bookName"); 28 | this.price = (double) map.get("price"); 29 | this.description = (String) map.get("description"); 30 | this.author = (String) map.get("author"); 31 | this.press = (String) map.get("press"); 32 | this.addTime=(Date) map.get("addTime"); 33 | this.sellUserId=(int) map.get("sellUserId"); 34 | this.sellUserName=(String) map.get("sellUserName"); 35 | this.catalog = new Catalog(map); 36 | this.upLoadImg = new UpLoadImg(map); 37 | } 38 | 39 | public int getBookId() { 40 | return bookId; 41 | } 42 | 43 | public void setBookId(int bookId) { 44 | this.bookId = bookId; 45 | } 46 | 47 | public String getBookName() { 48 | return bookName; 49 | } 50 | 51 | public void setBookName(String bookName) { 52 | this.bookName = bookName; 53 | } 54 | 55 | public double getPrice() { 56 | return price; 57 | } 58 | 59 | public void setPrice(double price) { 60 | this.price = price; 61 | } 62 | 63 | public String getDescription() { 64 | return description; 65 | } 66 | 67 | public void setDescription(String description) { 68 | this.description = description; 69 | } 70 | 71 | public String getAuthor() { 72 | return author; 73 | } 74 | 75 | public void setAuthor(String author) { 76 | this.author = author; 77 | } 78 | 79 | public String getPress() { 80 | return press; 81 | } 82 | 83 | public void setPress(String press) { 84 | this.press = press; 85 | } 86 | 87 | public int getCatalogId() { 88 | this.catalogId = this.catalog.getCatalogId(); 89 | return catalogId; 90 | } 91 | 92 | public void setCatalogId(int catalogId) { 93 | this.catalog.setCatalogId(catalogId); 94 | } 95 | 96 | public int getImgId() { 97 | this.imgId = this.upLoadImg.getImgId(); 98 | return imgId; 99 | } 100 | 101 | public void setImgId(int imgId) { 102 | this.upLoadImg.setImgId(imgId); 103 | ; 104 | } 105 | 106 | public Catalog getCatalog() { 107 | return catalog; 108 | } 109 | 110 | public void setCatalog(Catalog catalog) { 111 | this.catalog = catalog; 112 | } 113 | 114 | public UpLoadImg getUpLoadImg() { 115 | return upLoadImg; 116 | } 117 | 118 | public void setUpLoadImg(UpLoadImg upLoadImg) { 119 | this.upLoadImg = upLoadImg; 120 | } 121 | 122 | public Date getAddTime() { 123 | return addTime; 124 | } 125 | 126 | public void setAddTime(Date addTime) { 127 | this.addTime = addTime; 128 | } 129 | 130 | public int getSellUserId() { 131 | return sellUserId; 132 | } 133 | 134 | public void setSellUserId(int sellUserId) { 135 | this.sellUserId = sellUserId; 136 | } 137 | 138 | public String getSellUserName() { 139 | return sellUserName; 140 | } 141 | 142 | public void setSellUserName(String sellUserName) { 143 | this.sellUserName = sellUserName; 144 | } 145 | 146 | @Override 147 | public String toString() { 148 | return "Book{" + 149 | "bookId=" + bookId + 150 | ", bookName='" + bookName + '\'' + 151 | ", price=" + price + 152 | ", description='" + description + '\'' + 153 | ", author='" + author + '\'' + 154 | ", press='" + press + '\'' + 155 | ", catalogId=" + catalogId + 156 | ", imgId=" + imgId + 157 | ", addTime=" + addTime + 158 | ", catalog=" + catalog + 159 | ", upLoadImg=" + upLoadImg + 160 | ", sellUserId=" + sellUserId + 161 | ", sellUserName='" + sellUserName + '\'' + 162 | '}'; 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /src/com/shine/game/bean/Cart.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.bean; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import com.shine.game.util.MathUtils; 7 | 8 | /** 9 | * @version 10 | */ 11 | public class Cart { 12 | private Map map=new HashMap<>(); 13 | private double totPrice; 14 | private int totQuan; 15 | 16 | public Cart() { 17 | super(); 18 | } 19 | public Cart(Map map, double totPrice) { 20 | super(); 21 | this.map = map; 22 | this.totPrice = totPrice; 23 | } 24 | public Map getMap() { 25 | return map; 26 | } 27 | public void setMap(Map map) { 28 | this.map = map; 29 | } 30 | public double getTotPrice() { 31 | double sum=0; 32 | for(CartItem cartItem:map.values()) { 33 | double d=cartItem.getSubtotal(); 34 | sum+=d; 35 | } 36 | this.totPrice=MathUtils.getTwoDouble(sum); 37 | return totPrice; 38 | } 39 | public void setTotPrice(double totPrice) { 40 | this.totPrice = totPrice; 41 | } 42 | 43 | 44 | public int getTotQuan() { 45 | int sum=0; 46 | for(CartItem cartItem:map.values()) { 47 | sum+=cartItem.getQuantity(); 48 | } 49 | this.totQuan=sum; 50 | return totQuan; 51 | } 52 | 53 | //获取book ID 54 | public int getBookId(){ 55 | int bookId=0; 56 | for(CartItem cartItem:map.values()) { 57 | bookId=cartItem.getBook().getBookId(); 58 | } 59 | return bookId; 60 | } 61 | 62 | public void setTotQuan(int totQuan) { 63 | this.totQuan = totQuan; 64 | } 65 | public void addBook(Book book) { 66 | int bookId = book.getBookId(); 67 | if(map.containsKey(bookId)) { 68 | CartItem item = map.get(bookId); 69 | item.setQuantity(item.getQuantity()+1); 70 | }else { 71 | map.put(bookId, new CartItem(book,1)); 72 | } 73 | } 74 | 75 | @Override 76 | public String toString() { 77 | return "Cart [map=" + map + ", totPrice=" + totPrice + "]"; 78 | } 79 | 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/com/shine/game/bean/CartItem.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.bean; 2 | 3 | import com.shine.game.util.MathUtils; 4 | 5 | /** 6 | * @version 7 | */ 8 | public class CartItem { 9 | private Book book; 10 | private int quantity;//数量 11 | private double subtotal;//小计 12 | 13 | public CartItem() {} 14 | 15 | 16 | 17 | public CartItem(Book book, int quantity) { 18 | super(); 19 | this.setBook(book); 20 | this.setQuantity(quantity); 21 | } 22 | 23 | public Book getBook() { 24 | return book; 25 | } 26 | public void setBook(Book book) { 27 | this.book = book; 28 | } 29 | public int getQuantity() { 30 | return quantity; 31 | } 32 | public void setQuantity(int quantity) { 33 | this.quantity = quantity; 34 | this.subtotal = MathUtils.getTwoDouble(quantity*book.getPrice()); 35 | } 36 | public double getSubtotal() { 37 | return subtotal; 38 | } 39 | public void setSubtotal(double subtotal) { 40 | this.subtotal = subtotal; 41 | } 42 | 43 | 44 | 45 | @Override 46 | public String toString() { 47 | return "CartItem [book=" + book + ", quantity=" + quantity + ", subtotal=" + subtotal + "]"; 48 | } 49 | 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/com/shine/game/bean/Catalog.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.bean; 2 | 3 | import java.util.Map; 4 | 5 | public class Catalog { 6 | 7 | private int catalogId; //图片分类编号 8 | 9 | private String catalogName; //图片分类名称 10 | 11 | private long catalogSize; 12 | 13 | public Catalog() { 14 | } 15 | 16 | public Catalog(Map map) { 17 | this.catalogId= (int) map.get("catalogId"); 18 | this.catalogName= (String) map.get("catalogName"); 19 | } 20 | public int getCatalogId() { 21 | return catalogId; 22 | } 23 | 24 | public void setCatalogId(int catalogId) { 25 | this.catalogId = catalogId; 26 | } 27 | 28 | public String getCatalogName() { 29 | return catalogName; 30 | } 31 | 32 | public void setCatalogName(String catalogName) { 33 | this.catalogName = catalogName; 34 | } 35 | 36 | 37 | public long getCatalogSize() { 38 | return catalogSize; 39 | } 40 | 41 | public void setCatalogSize(long catalogSize) { 42 | this.catalogSize = catalogSize; 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return "Catalog [catalogId=" + catalogId + ", catalogName=" 48 | + catalogName + "]"; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/com/shine/game/bean/Comment.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.bean; 2 | 3 | import java.util.Date; 4 | import java.util.Map; 5 | 6 | /** 7 | * 评价 8 | */ 9 | public class Comment { 10 | 11 | private int id; // 编号 12 | private String comment; //内容 13 | private String send; //发货速度 14 | private String credible;//可信度 15 | private String start; //评级 16 | private Date time; //评价时间 17 | private int uid; //用户id 18 | private int gid; //商品id 19 | private User user = new User(); // 买家用户 20 | private Book book = new Book();//商品 21 | 22 | public Comment() { 23 | } 24 | 25 | public Comment(String comment, String send, String credible, String start, Date time, int uid, int gid) { 26 | this.comment = comment; 27 | this.send = send; 28 | this.credible = credible; 29 | this.start = start; 30 | this.time = time; 31 | this.uid = uid; 32 | this.gid = gid; 33 | } 34 | 35 | // 这里是从数据库获取时集合转对象 36 | public Comment(Map map) { 37 | this.id = (int) map.get("id"); 38 | this.comment = (String) map.get("comment"); 39 | this.send = (String) map.get("send"); 40 | this.credible = (String) map.get("credible"); 41 | this.start = (String) map.get("start"); 42 | this.time = (Date) map.get("time"); 43 | this.user = new User(map); 44 | this.book = new Book(map); 45 | } 46 | 47 | public Comment(int id, String comment, String send, String credible, String start) { 48 | this.comment = comment; 49 | this.send = send; 50 | this.credible = credible; 51 | this.start = start; 52 | this.id = id; 53 | } 54 | 55 | public int getId() { 56 | return id; 57 | } 58 | 59 | public void setId(int id) { 60 | this.id = id; 61 | } 62 | 63 | public String getComment() { 64 | return comment; 65 | } 66 | 67 | public void setComment(String comment) { 68 | this.comment = comment; 69 | } 70 | 71 | public String getSend() { 72 | return send; 73 | } 74 | 75 | public void setSend(String send) { 76 | this.send = send; 77 | } 78 | 79 | public String getCredible() { 80 | return credible; 81 | } 82 | 83 | public void setCredible(String credible) { 84 | this.credible = credible; 85 | } 86 | 87 | public String getStart() { 88 | return start; 89 | } 90 | 91 | public void setStart(String start) { 92 | this.start = start; 93 | } 94 | 95 | public Date getTime() { 96 | return time; 97 | } 98 | 99 | public void setTime(Date time) { 100 | this.time = time; 101 | } 102 | 103 | public int getUid() { 104 | return uid; 105 | } 106 | 107 | public void setUid(int uid) { 108 | this.uid = uid; 109 | } 110 | 111 | public int getGid() { 112 | return gid; 113 | } 114 | 115 | public void setGid(int gid) { 116 | this.gid = gid; 117 | } 118 | 119 | public User getUser() { 120 | return user; 121 | } 122 | 123 | public void setUser(User user) { 124 | this.user = user; 125 | } 126 | 127 | public Book getBook() { 128 | return book; 129 | } 130 | 131 | public void setBook(Book book) { 132 | this.book = book; 133 | } 134 | 135 | @Override 136 | public String toString() { 137 | return "Comment{" + 138 | "id=" + id + 139 | ", comment='" + comment + '\'' + 140 | ", send='" + send + '\'' + 141 | ", credible='" + credible + '\'' + 142 | ", start='" + start + '\'' + 143 | ", time=" + time + 144 | ", uid=" + uid + 145 | ", gid=" + gid + 146 | ", user=" + user + 147 | ", book=" + book + 148 | '}'; 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /src/com/shine/game/bean/Order.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.bean; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | public class Order { 8 | 9 | private int orderId; //订单编号 10 | private String orderNum; //订单号 11 | private int userId; //用户编号 12 | private String orderDate; //订单日期 13 | private double money; //订单金额 14 | private int orderStatus; //订单状态 15 | private int sellUserId; //出售者 16 | 17 | private List oItem=new ArrayList<>(); 18 | private User user=new User(); 19 | 20 | public Order() { 21 | } 22 | 23 | public Order(Map map) { 24 | this.setOrderId((int) map.get("orderId")); 25 | this.setOrderNum((String) map.get("orderNum")); 26 | this.setUserId((int) map.get("userId")); 27 | this.setOrderDate((String) map.get("orderDate")); 28 | this.setMoney((double) map.get("money")); 29 | this.setOrderStatus((int) map.get("orderStatus")); 30 | this.setSellUserId((int)map.get("sellUserId")); 31 | } 32 | 33 | public int getOrderId() { 34 | return orderId; 35 | } 36 | 37 | public void setOrderId(int orderId) { 38 | this.orderId = orderId; 39 | } 40 | 41 | 42 | public String getOrderNum() { 43 | return orderNum; 44 | } 45 | 46 | public void setOrderNum(String orderNum) { 47 | this.orderNum = orderNum; 48 | } 49 | 50 | public int getUserId() { 51 | return userId; 52 | } 53 | 54 | public void setUserId(int userId) { 55 | this.userId = userId; 56 | } 57 | 58 | public String getOrderDate() { 59 | return orderDate; 60 | } 61 | 62 | public void setOrderDate(String orderDate) { 63 | this.orderDate = orderDate; 64 | } 65 | 66 | public int getOrderStatus() { 67 | return orderStatus; 68 | } 69 | 70 | public void setOrderStatus(int orderStatus) { 71 | this.orderStatus = orderStatus; 72 | } 73 | 74 | 75 | 76 | public List getoItem() { 77 | return oItem; 78 | } 79 | 80 | public void setoItem(List oItem) { 81 | this.oItem = oItem; 82 | } 83 | 84 | public double getMoney() { 85 | return money; 86 | } 87 | 88 | public void setMoney(double money) { 89 | this.money = money; 90 | } 91 | 92 | public User getUser() { 93 | return user; 94 | } 95 | 96 | public void setUser(User user) { 97 | this.user = user; 98 | } 99 | 100 | 101 | public int getSellUserId() { 102 | return sellUserId; 103 | } 104 | 105 | public void setSellUserId(int sellUserId) { 106 | this.sellUserId = sellUserId; 107 | } 108 | 109 | 110 | @Override 111 | public String toString() { 112 | return "Order{" + 113 | "orderId=" + orderId + 114 | ", orderNum='" + orderNum + '\'' + 115 | ", userId=" + userId + 116 | ", orderDate='" + orderDate + '\'' + 117 | ", money=" + money + 118 | ", orderStatus=" + orderStatus + 119 | ", sellUserId=" + sellUserId + 120 | ", oItem=" + oItem + 121 | ", user=" + user + 122 | '}'; 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /src/com/shine/game/bean/OrderItem.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.bean; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * 订单项 7 | * 8 | * @author 9 | * @create 2020-09-23 1:53 10 | */ 11 | public class OrderItem { 12 | 13 | private int itemId; //订单项编号 14 | private int bookId; //饰品编号 15 | private int orderId; //订单编号 16 | private int quantity; //数量 17 | private int isComment; //是否评价 18 | 19 | private Book book; 20 | 21 | public OrderItem() { 22 | } 23 | 24 | 25 | public OrderItem(Map map) { 26 | this.setOrderId((int) map.get("orderId")); 27 | this.setBookId((int) map.get("bookId")); 28 | this.setItemId((int) map.get("itemId")); 29 | this.setQuantity((int) map.get("quantity")); 30 | this.setIsComment((int) map.get("isComment")); 31 | } 32 | 33 | 34 | public int getItemId() { 35 | return itemId; 36 | } 37 | 38 | 39 | public void setItemId(int itemId) { 40 | this.itemId = itemId; 41 | } 42 | 43 | 44 | public int getBookId() { 45 | return bookId; 46 | } 47 | 48 | public void setBookId(int bookId) { 49 | this.bookId = bookId; 50 | } 51 | 52 | public int getOrderId() { 53 | return orderId; 54 | } 55 | 56 | public void setOrderId(int orderId) { 57 | this.orderId = orderId; 58 | } 59 | 60 | public int getQuantity() { 61 | return quantity; 62 | } 63 | 64 | public void setQuantity(int quantity) { 65 | this.quantity = quantity; 66 | } 67 | 68 | 69 | public Book getBook() { 70 | return book; 71 | } 72 | 73 | 74 | public void setBook(Book book) { 75 | this.book = book; 76 | } 77 | 78 | public int getIsComment() { 79 | return isComment; 80 | } 81 | 82 | public void setIsComment(int isComment) { 83 | this.isComment = isComment; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/com/shine/game/bean/PageBean.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.bean; 2 | /** 3 | * @version 4 | */ 5 | public class PageBean { 6 | private int curPage;//当前页 7 | private int prePage;//上一页 8 | private int nextPage;//下一页 9 | private int maxSize;//每页最大数 10 | private int pageCount;//总页数 11 | private long readCount;//查询总记录数 12 | 13 | public PageBean() { 14 | super(); 15 | } 16 | 17 | public PageBean(int curPage, int maxSize,long readCount) { 18 | super(); 19 | this.curPage = curPage; 20 | this.maxSize = maxSize; 21 | this.readCount=readCount; 22 | updatePage(); 23 | } 24 | 25 | public int getCurPage() { 26 | return curPage; 27 | } 28 | 29 | public void setCurPage(int curPage) { 30 | this.curPage = curPage; 31 | } 32 | 33 | public int getPrePage() { 34 | return prePage; 35 | } 36 | 37 | public void setPrePage(int prePage) { 38 | this.prePage = prePage; 39 | } 40 | 41 | public int getNextPage() { 42 | return nextPage; 43 | } 44 | 45 | public void setNextPage(int nextPage) { 46 | this.nextPage = nextPage; 47 | } 48 | 49 | public int getMaxSize() { 50 | return maxSize; 51 | } 52 | 53 | public void setMaxSize(int maxSize) { 54 | this.maxSize = maxSize; 55 | } 56 | 57 | public int getPageCount() { 58 | return pageCount; 59 | } 60 | 61 | public void setPageCount(int pageCount) { 62 | this.pageCount = pageCount; 63 | } 64 | 65 | public long getReadCount() { 66 | return readCount; 67 | } 68 | 69 | public void setReadCount(long readCount) { 70 | this.readCount = readCount; 71 | } 72 | 73 | public void updatePage(){ 74 | 75 | //总页数 76 | this.pageCount = (int) (this.readCount/this.maxSize+(this.readCount%this.maxSize==0?0:1)); 77 | //上一页 78 | this.prePage=this.curPage>1?(this.curPage-1):1; 79 | //下一页 80 | this.nextPage=this.curPage>=this.pageCount?this.pageCount:(this.curPage+1); 81 | 82 | 83 | } 84 | 85 | @Override 86 | public String toString() { 87 | return "PageBean [curPage=" + curPage + ", prePage=" + prePage + ", nextPage=" + nextPage + ", maxSize=" 88 | + maxSize + ", pageCount=" + pageCount + ", readCount=" + readCount + "]"; 89 | } 90 | 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/com/shine/game/bean/UpLoadImg.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.bean; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * 7 | */ 8 | public class UpLoadImg { 9 | private int imgId; // 文件编号 10 | private String imgName; // 文件名称 11 | private String imgSrc; // 文件路径 12 | private String imgType; // 文件类型 13 | 14 | public UpLoadImg() { 15 | } 16 | 17 | public UpLoadImg(int imgId, String imgName, String imgSrc, String imgType) { 18 | super(); 19 | this.imgId = imgId; 20 | this.imgName = imgName; 21 | this.imgSrc = imgSrc; 22 | this.imgType = imgType; 23 | } 24 | 25 | public UpLoadImg(Map map) { 26 | this.imgId = (int) map.get("imgId"); 27 | this.imgName = (String) map.get("imgName"); 28 | this.imgSrc = (String) map.get("imgSrc"); 29 | this.imgType = (String) map.get("imgType"); 30 | 31 | } 32 | 33 | public int getImgId() { 34 | return imgId; 35 | } 36 | 37 | public void setImgId(int imgId) { 38 | this.imgId = imgId; 39 | } 40 | 41 | public String getImgName() { 42 | return imgName; 43 | } 44 | 45 | public void setImgName(String imgName) { 46 | this.imgName = imgName; 47 | } 48 | 49 | public String getImgSrc() { 50 | return imgSrc; 51 | } 52 | 53 | public void setImgSrc(String imgSrc) { 54 | this.imgSrc = imgSrc; 55 | } 56 | 57 | public String getImgType() { 58 | return imgType; 59 | } 60 | 61 | public void setImgType(String imgType) { 62 | this.imgType = imgType; 63 | } 64 | 65 | @Override 66 | public String toString() { 67 | return "UpLoadImg [imgId=" + imgId + ", imgName=" + imgName + ", imgSrc=" + imgSrc + ", imgType=" + imgType 68 | + "]"; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/com/shine/game/bean/User.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.bean; 2 | 3 | import java.util.Map; 4 | 5 | public class User { 6 | 7 | private int userId; //用户编号 8 | private String userName; //用户名 9 | private String userPassWord; //用户密码 10 | private String payPwd;//支付密码 11 | private String name; //用户姓名 12 | private String sex; //用户性别 13 | private int age; //用户年龄 14 | private String tell; //用户电话 15 | private String address; //用户地址 16 | private String enabled; //用户状态y启用n禁用 17 | private String grade ; //卖家信用等级 18 | public User() {} 19 | 20 | public String getPayPwd() { 21 | return payPwd; 22 | } 23 | 24 | public void setPayPwd(String payPwd) { 25 | this.payPwd = payPwd; 26 | } 27 | 28 | public User(String userName, String userPassWord) { 29 | super(); 30 | this.userName = userName; 31 | this.userPassWord = userPassWord; 32 | } 33 | 34 | 35 | 36 | public User(String userName, String userPassWord, String name, String sex, int age, String tell, String address) { 37 | super(); 38 | this.userName = userName; 39 | this.userPassWord = userPassWord; 40 | this.name = name; 41 | this.sex = sex; 42 | this.age = age; 43 | this.tell = tell; 44 | this.address = address; 45 | 46 | } 47 | 48 | 49 | public User(int userId, String userPassWord, String name, String sex, int age, String tell, String address, 50 | String enabled) { 51 | super(); 52 | this.userId = userId; 53 | this.userPassWord = userPassWord; 54 | this.name = name; 55 | this.sex = sex; 56 | this.age = age; 57 | this.tell = tell; 58 | this.address = address; 59 | this.enabled = enabled; 60 | } 61 | 62 | 63 | 64 | public User(Map map) { 65 | userId=(int) map.get("userId"); 66 | userName=(String) map.get("userName"); 67 | userPassWord=(String) map.get("userPassWord"); 68 | name=(String) map.get("name"); 69 | sex=(String) map.get("sex"); 70 | age=(int) map.get("age"); 71 | payPwd=(String)map.get("paypwd"); 72 | tell=(String) map.get("tell"); 73 | address=(String) map.get("address"); 74 | enabled=(String) map.get("enabled"); 75 | grade=(String)map.get("grade"); 76 | } 77 | 78 | public int getUserId() { 79 | return userId; 80 | } 81 | 82 | public void setUserId(int userId) { 83 | this.userId = userId; 84 | } 85 | 86 | public String getUserName() { 87 | return userName; 88 | } 89 | 90 | public void setUserName(String userName) { 91 | this.userName = userName; 92 | } 93 | 94 | public String getUserPassWord() { 95 | return userPassWord; 96 | } 97 | 98 | public void setUserPassWord(String userPassWord) { 99 | this.userPassWord = userPassWord; 100 | } 101 | 102 | public String getSex() { 103 | return sex; 104 | } 105 | 106 | public void setSex(String sex) { 107 | this.sex = sex; 108 | } 109 | 110 | public int getAge() { 111 | return age; 112 | } 113 | 114 | public void setAge(int age) { 115 | this.age = age; 116 | } 117 | 118 | public String getTell() { 119 | return tell; 120 | } 121 | 122 | public void setTell(String tell) { 123 | this.tell = tell; 124 | } 125 | 126 | public String getAddress() { 127 | return address; 128 | } 129 | 130 | public void setAddress(String address) { 131 | this.address = address; 132 | } 133 | 134 | 135 | public String getName() { 136 | return name; 137 | } 138 | 139 | public void setName(String name) { 140 | this.name = name; 141 | } 142 | 143 | 144 | public String getEnabled() { 145 | return enabled; 146 | } 147 | 148 | public void setEnabled(String enabled) { 149 | this.enabled = enabled; 150 | } 151 | 152 | public String getGrade() { 153 | return grade; 154 | } 155 | 156 | public void setGrade(String grade) { 157 | this.grade = grade; 158 | } 159 | 160 | 161 | @Override 162 | public String toString() { 163 | return "User{" + 164 | "userId=" + userId + 165 | ", userName='" + userName + '\'' + 166 | ", userPassWord='" + userPassWord + '\'' + 167 | ", payPwd='" + payPwd + '\'' + 168 | ", name='" + name + '\'' + 169 | ", sex='" + sex + '\'' + 170 | ", age=" + age + 171 | ", tell='" + tell + '\'' + 172 | ", address='" + address + '\'' + 173 | ", enabled='" + enabled + '\'' + 174 | ", grade='" + grade + '\'' + 175 | '}'; 176 | } 177 | 178 | 179 | 180 | } 181 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/AdminDao.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.shine.game.bean.Admin; 6 | import com.shine.game.bean.PageBean; 7 | 8 | public interface AdminDao { 9 | 10 | //用户登录 11 | boolean userLogin(Admin admin); 12 | //获取总记录数 13 | long bookReadCount(); 14 | //获取用户列表(分页显示) 15 | List userList(PageBean pageBean); 16 | //增加用户 17 | boolean userAdd(Admin admin); 18 | //更新用户 19 | boolean userUpdate(Admin admin); 20 | //根据id获取一个用户的信息 21 | Admin findUser(Integer id); 22 | //查找用户名是否存在 23 | boolean findUser(String username); 24 | //根据id删除一个用户 25 | boolean delUser(int id); 26 | //根据一组id字符串批量删除用户 27 | boolean batDelUser(String ids); 28 | } 29 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/BookDao.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.shine.game.bean.Book; 6 | import com.shine.game.bean.PageBean; 7 | 8 | public interface BookDao { 9 | // 获取饰品总数 10 | long bookReadCount(); 11 | 12 | 13 | 14 | //获取饰品搜索总数 15 | long bookReadCountLikeName(String name); 16 | 17 | // 获取饰品分页列表(视图) 18 | List bookList(PageBean pageBean); 19 | 20 | // 按分类获取饰品数量 21 | long bookReadCount(int catalogId); 22 | 23 | // 按分类获取饰品分页列表(视图) 24 | List bookList(PageBean pageBean, int catalogId); 25 | List bookListLikeName(PageBean pageBean,String name) ; 26 | // 增加饰品 27 | boolean bookAdd(Book book); 28 | 29 | // 根据饰品id查找饰品信息(视图) 30 | Book findBookById(int bookId); 31 | 32 | // 根据饰品名称查找饰品是否存在 33 | boolean findBookByBookName(String bookName); 34 | 35 | // 更新饰品信息 36 | boolean bookUpdate(Book book); 37 | 38 | // 根据id删除饰品 39 | boolean bookDelById(int bookId); 40 | 41 | // 根据id串查询图片id串 42 | String findimgIdByIds(String ids); 43 | 44 | // 批量删除饰品 45 | boolean bookBatDelById(String ids); 46 | 47 | // 随机获取指定数量书 48 | List bookList(int num); 49 | 50 | // 获取指定数量新添加的饰品 51 | List newBooks(int num); 52 | 53 | long bookReadCountByUserId(int userId); 54 | 55 | // 获取饰品分页列表(视图) 56 | List bookListByUserId(PageBean pb ,int userId); 57 | } 58 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/CatalogDao.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.shine.game.bean.Catalog; 6 | import com.shine.game.bean.PageBean; 7 | 8 | /** 9 | * 饰品分类dao层 10 | * @author 11 | * 12 | */ 13 | public interface CatalogDao { 14 | //获取饰品分类信息 15 | List getCatalog(); 16 | //获取饰品分类信息(分页) 17 | List catalogList(PageBean pb); 18 | //统计总数 19 | long catalogReadCount(); 20 | //分类删除 21 | boolean catalogDel(int catalogId); 22 | //分类批量删除 23 | boolean catalogBatDelById(String ids); 24 | //查找分类名称 25 | boolean findCatalogByCatalogName(String catalogName); 26 | //按照分类id查询 27 | Catalog findCatalogByCatalogId(int catalogId); 28 | //增加分类 29 | boolean catalogAdd(String catalogName); 30 | 31 | boolean catalogUpdate(Catalog catalog); 32 | } 33 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/CommentDao.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao; 2 | 3 | import com.shine.game.bean.Comment; 4 | import com.shine.game.bean.PageBean; 5 | import com.shine.game.bean.User; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @version 11 | */ 12 | public interface CommentDao { 13 | 14 | // 获取评论总数 15 | long commentReadCount(); 16 | 17 | //获取评论列表 18 | List commentList(PageBean pageBean); 19 | 20 | //查找当前用户是否对此商品评价过 21 | boolean findCommentByUid(Integer gid,Integer uid); 22 | 23 | //根据id获取一个评论的信息 24 | Comment findComment(Integer id); 25 | 26 | //根据id删除一个评论 27 | boolean delComment(int id); 28 | 29 | //根据一组id字符串批量删除评论 30 | boolean batDelComment(String ids); 31 | //添加评论 32 | boolean commentAdd(Comment comment); 33 | 34 | //更新评论 35 | boolean updateComment(Comment comment); 36 | // 按商品id获取最新前10条评论 37 | List CommentList( int id); 38 | } 39 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/OrderDao.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.shine.game.bean.Order; 6 | import com.shine.game.bean.PageBean; 7 | 8 | /** 9 | * @version 10 | */ 11 | public interface OrderDao { 12 | 13 | //增加一个订单记录 14 | boolean orderAdd(Order order); 15 | //查找订单编号通过订单号 16 | int findOrderIdByOrderNum(String orderNum); 17 | //统计总订单数 18 | long orderReadCount(); 19 | //统计总订单数(by userId) 20 | long orderReadCount(int userId); 21 | //统计总订单数(by orderStatus) 22 | long orderReadCountByStatus(int status); 23 | //统计总订单数(by orderStatus) 24 | long orderReadCountByStatusUserId(int status,int userid); 25 | //获得订单列表(分页),条件用户id 26 | List orderList(PageBean pageBean); 27 | //获得订单列表(分页),条件用户id 28 | List orderList(PageBean pageBean,int userId); 29 | //获得订单列表(分页),条件orderStatus 30 | List orderListByStatus(PageBean pb, int status); 31 | 32 | //获得订单列表(分页),条件orderStatus 33 | List orderListByStatusUserId(PageBean pb, int status,int userid); 34 | //查找订单编号通过订单号 35 | Order findOrderByOrderId(int orderId); 36 | 37 | //更改订单状态 38 | boolean orderStatus(int orderId,int status); 39 | 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/OrderItemDao.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.shine.game.bean.OrderItem; 6 | 7 | /** 8 | * @version 9 | */ 10 | public interface OrderItemDao { 11 | //增加一个订单项记录 12 | boolean orderAdd(OrderItem orderItem); 13 | //通过订单编号查找订单项 14 | List findItemByOrderId(int orderId); 15 | 16 | /** 17 | * 18 | * @param itemId 订单明细id 19 | * @param state 是否评价(0:未评价,1:已评价) 20 | * @return 21 | */ 22 | boolean updateIsComment(int itemId,int state) ; 23 | } 24 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/UpLoadImgDao.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.shine.game.bean.UpLoadImg; 6 | 7 | /** 8 | * 饰品图片上传dao层 9 | * @author 10 | * 11 | */ 12 | public interface UpLoadImgDao { 13 | 14 | //图片增加 15 | boolean imgAdd(UpLoadImg upLoadImg); 16 | //根据饰品图片名称获取id(名称用的uuid唯一识别码) 17 | Integer findIdByImgName(String imgName); 18 | //更新图片信息 19 | boolean imgUpdate(UpLoadImg upImg); 20 | //通过id删除图片 21 | boolean imgDelById(int imgId); 22 | //通过imgIds查询图片信息 23 | List findImgByIds(String imgIds); 24 | //批量删除 25 | boolean imgBatDelById(String imgIds); 26 | } 27 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.shine.game.bean.PageBean; 6 | import com.shine.game.bean.User; 7 | 8 | /** 9 | * @version 10 | */ 11 | public interface UserDao { 12 | 13 | //获取总记录数 14 | long readCount(); 15 | //获取用户列表(分页显示) 16 | List userList(PageBean pageBean); 17 | //查找用户名是否存在 18 | boolean findUser(String userName); 19 | //查找用户名是否存在 20 | boolean findUserAndId(String userName,Integer id); 21 | //根据id获取一个用户的信息 22 | User findUser(Integer id); 23 | //增加用户 24 | boolean userAdd(User user); 25 | //更新用户 26 | boolean userUpdate(User user); 27 | //更新用户的信用 28 | boolean userUpdateGrade(User user); 29 | //根据id删除一个用户 30 | boolean delUser(int id); 31 | //根据一组id字符串批量删除用户 32 | boolean batDelUser(String ids); 33 | //登陆 34 | User userLogin(User user); 35 | } 36 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/impl/AdminDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao.impl; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import com.shine.game.bean.Admin; 8 | import com.shine.game.bean.PageBean; 9 | import com.shine.game.dao.AdminDao; 10 | import com.shine.game.util.DateUtil; 11 | import com.shine.game.util.DbUtil; 12 | 13 | public class AdminDaoImpl implements AdminDao { 14 | /** 15 | * @param user 传递要登录的用户信息 16 | * @return 返回一个boolean值,true登录成功,false失败 17 | */ 18 | @Override 19 | public boolean userLogin(Admin admin) { 20 | boolean flag=false; 21 | String sql="select * from admin where userName=? and passWord=?"; 22 | String sql2="update admin set lastLoginTime=? where id=?"; 23 | System.out.println(admin); 24 | List> list=DbUtil.executeQuery(sql, admin.getUserName(),admin.getPassWord()); 25 | 26 | System.out.println(list.size()); 27 | 28 | if(list.size()>0){ 29 | flag=true; 30 | //这里需要name值传入对象中 31 | admin.setName((String)list.get(0).get("name")); 32 | //通过登录成功用户的id更新最后登录时间 33 | DbUtil.excuteUpdate(sql2, DateUtil.getTimestamp(),list.get(0).get("id")); 34 | } 35 | return flag; 36 | } 37 | /** 38 | * @param pageBean 传递分页对象 39 | * @return 返回一个list集合,这里是通过limit分页查询的结果 40 | */ 41 | @Override 42 | public List userList(PageBean pageBean) { 43 | List lu=new ArrayList<>(); 44 | List> list=new ArrayList>(); 45 | 46 | String sql="select * from admin limit ?,?"; 47 | 48 | list=DbUtil.executeQuery(sql,(pageBean.getCurPage()-1)*pageBean.getMaxSize(),pageBean.getMaxSize()); 49 | 50 | if(list.size()>0) { 51 | for(Map map:list) { 52 | Admin u=new Admin(map); 53 | lu.add(u); 54 | } 55 | } 56 | 57 | return lu; 58 | } 59 | /** 60 | * @param user 要增加的用户对象 61 | * @return 返回一个boolean true用户增加成功 false用户增加失败 62 | */ 63 | @Override 64 | public boolean userAdd(Admin user) { 65 | String sql="insert into admin(userName,password,name) values(?,?,?)"; 66 | 67 | int i= DbUtil.excuteUpdate(sql, user.getUserName(),user.getPassWord(),user.getName()); 68 | 69 | return i>0?true:false; 70 | 71 | } 72 | /** 73 | * @param id 根据id查找一个用户信息 74 | * @return 返回一个list用户信息集合 75 | */ 76 | //查找指定id用户信息 77 | @Override 78 | public Admin findUser(Integer id) { 79 | String sql="select * from admin where id=?"; 80 | Admin admin=null; 81 | List> list=DbUtil.executeQuery(sql, id); 82 | if(list.size()>0) { 83 | admin=new Admin(list.get(0)); 84 | 85 | } 86 | return admin; 87 | } 88 | //查找用户名是否存在true存在 89 | @Override 90 | public boolean findUser(String userName) { 91 | String sql="select * from admin where userName=?"; 92 | List> list=DbUtil.executeQuery(sql, userName); 93 | return list.size()>0?true:false; 94 | } 95 | 96 | 97 | /** 98 | * 99 | * @param admin 更新用户,根据传过来的id 100 | * @return boolean 101 | */ 102 | @Override 103 | public boolean userUpdate(Admin admin) { 104 | String sql="update admin set password=? , name=? where id =?"; 105 | int i=DbUtil.excuteUpdate(sql, admin.getPassWord(),admin.getName(),admin.getId()); 106 | 107 | return i>0?true:false; 108 | } 109 | /** 110 | * @param id 要删除的用户id 111 | * @return 返回boolean true删除用户成功,false删除用户失败 112 | */ 113 | @Override 114 | public boolean delUser(int id) { 115 | String sql="delete from admin where id=?"; 116 | int i=DbUtil.excuteUpdate(sql, id); 117 | return i>0?true:false; 118 | } 119 | /** 120 | * @param ids 要批量删除id组的字符串 121 | */ 122 | @Override 123 | public boolean batDelUser(String ids) { 124 | String sql="delete from admin where id in ("+ids+")"; 125 | int i=DbUtil.excuteUpdate(sql); 126 | return i>0?true:false; 127 | } 128 | 129 | @Override 130 | public long bookReadCount() { 131 | long count=0; 132 | String sql="select count(*) as count from admin"; 133 | List> lm=DbUtil.executeQuery(sql); 134 | if(lm.size()>0){ 135 | count=(long) lm.get(0).get("count"); 136 | } 137 | return count; 138 | } 139 | 140 | } 141 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/impl/CatalogDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao.impl; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import com.shine.game.bean.Book; 8 | import com.shine.game.bean.Catalog; 9 | import com.shine.game.bean.PageBean; 10 | import com.shine.game.dao.CatalogDao; 11 | import com.shine.game.util.DbUtil; 12 | 13 | public class CatalogDaoImpl implements CatalogDao { 14 | 15 | /** 16 | * 获取饰品分类信息 17 | */ 18 | @Override 19 | public List catalogList(PageBean pb) { 20 | List list = new ArrayList(); 21 | String sql = "select * from catalog limit ?,?"; 22 | // 查询的分页结果集 23 | List> lm = DbUtil.executeQuery(sql, (pb.getCurPage() - 1) * pb.getMaxSize(), 24 | pb.getMaxSize()); 25 | if (lm.size() > 0) { 26 | for (Map map : lm) { 27 | Catalog catalog = new Catalog(map); 28 | list.add(catalog); 29 | } 30 | } 31 | return list; 32 | } 33 | 34 | @Override 35 | public long catalogReadCount() { 36 | long count = 0; 37 | String sql = "select count(*) as count from catalog"; 38 | List> lm = DbUtil.executeQuery(sql); 39 | if (lm.size() > 0) { 40 | count = (long) lm.get(0).get("count"); 41 | } 42 | return count; 43 | } 44 | 45 | @Override 46 | public List getCatalog() { 47 | List list = new ArrayList(); 48 | String sql = "select * from catalog"; 49 | 50 | List> lmso = DbUtil.executeQuery(sql); 51 | if (lmso.size() > 0) { 52 | for (Map map : lmso) { 53 | Catalog catalog = new Catalog(map); 54 | list.add(catalog); 55 | } 56 | } 57 | return list; 58 | } 59 | 60 | @Override 61 | public boolean catalogDel(int catalogId) { 62 | String sql = "delete from catalog where catalogId=?"; 63 | int i = DbUtil.excuteUpdate(sql, catalogId); 64 | return i > 0 ? true : false; 65 | } 66 | 67 | @Override 68 | public boolean catalogBatDelById(String ids) { 69 | String sql = "delete from catalog where catalogId in(" + ids + ")"; 70 | int i = DbUtil.excuteUpdate(sql); 71 | return i > 0 ? true : false; 72 | } 73 | 74 | @Override 75 | public boolean findCatalogByCatalogName(String catalogName) { 76 | String sql = "select * from catalog where catalogName=?"; 77 | List> list = DbUtil.executeQuery(sql, catalogName); 78 | return list.size() > 0 ? true : false; 79 | } 80 | 81 | @Override 82 | public Catalog findCatalogByCatalogId(int catalogId) { 83 | String sql = "select * from catalog where catalogId=?"; 84 | Catalog book = null; 85 | List> list = DbUtil.executeQuery(sql, catalogId); 86 | if (list.size() > 0) { 87 | book = new Catalog(list.get(0)); 88 | } 89 | return book; 90 | } 91 | 92 | @Override 93 | public boolean catalogAdd(String catalogName) { 94 | String sql = "insert into catalog(catalogName) values(?)"; 95 | int i = DbUtil.excuteUpdate(sql, catalogName); 96 | return i > 0 ? true : false; 97 | } 98 | 99 | /** 100 | * 更新分类信息 101 | */ 102 | @Override 103 | public boolean catalogUpdate(Catalog catalog) { 104 | String sql = "update catalog set catalogName=? where catalogId=?"; 105 | int i = DbUtil.excuteUpdate(sql, catalog.getCatalogName(), catalog.getCatalogId()); 106 | return i > 0 ? true : false; 107 | } 108 | 109 | 110 | } 111 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/impl/CommentDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao.impl; 2 | 3 | import com.shine.game.bean.Comment; 4 | import com.shine.game.bean.PageBean; 5 | import com.shine.game.dao.CommentDao; 6 | import com.shine.game.util.DbUtil; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | public class CommentDaoImpl implements CommentDao { 12 | 13 | @Override 14 | public long commentReadCount() { 15 | String sql = "select count(*) as count from comment"; 16 | List> lm = DbUtil.executeQuery(sql); 17 | return lm.size() > 0 ? (long) lm.get(0).get("count") : 0; 18 | } 19 | 20 | @Override 21 | public List commentList(PageBean pageBean) { 22 | List list = new ArrayList<>(); 23 | String sql = "SELECT * from comment c left join book s on c.gid =s.bookId left join user u on c.uid=u.userId ORDER BY c.time DESC limit ?,?"; 24 | // 查询的分页结果集 25 | List> lm = DbUtil.executeQuery(sql, (pageBean.getCurPage() - 1) * pageBean.getMaxSize(), 26 | pageBean.getMaxSize()); 27 | // 把查询的book结果由List>转换为List 28 | if (lm.size() > 0) { 29 | for (Map map : lm) { 30 | Comment book = new Comment(map); 31 | list.add(book); 32 | } 33 | } 34 | return list; 35 | } 36 | 37 | /** 38 | * 39 | * @param gid 商品id 40 | * @param uid 用户id 41 | * @return 42 | */ 43 | @Override 44 | public boolean findCommentByUid(Integer gid, Integer uid) { 45 | String sql = "SELECT * from comment where gid=? and uid=?"; 46 | System.out.println("执行sql"); 47 | System.out.println(sql); 48 | List> i = DbUtil.executeQuery(sql, gid,uid); 49 | return i.size() > 0 ? true : false; 50 | } 51 | 52 | @Override 53 | public Comment findComment(Integer id) { 54 | String sql = "SELECT * from comment c left join book s on c.gid =s.bookId left join user u on c.uid=u.userId where 1=1 and id=?"; 55 | Comment book = null; 56 | List> list = DbUtil.executeQuery(sql, id); 57 | if (list.size() > 0) { 58 | book = new Comment(list.get(0)); 59 | } 60 | return book; 61 | } 62 | 63 | @Override 64 | public boolean delComment(int id) { 65 | String sql = "delete from comment where id=?"; 66 | int i = DbUtil.excuteUpdate(sql, id); 67 | return i > 0 ? true : false; 68 | } 69 | 70 | @Override 71 | public boolean batDelComment(String ids) { 72 | String sql = "delete from comment where id in(" + ids + ")"; 73 | int i = DbUtil.excuteUpdate(sql); 74 | return i > 0 ? true : false; 75 | } 76 | 77 | /** 78 | *按商品id获取最新前10条评论 79 | */ 80 | @Override 81 | public List CommentList( int id) { 82 | List list = new ArrayList<>(); 83 | String sql = "SELECT * from comment c left join book s on c.gid =s.bookId left join user u on c.uid=u.userId where 1=1 and c.gid=? ORDER BY c.time DESC limit 0,10 "; 84 | // 查询的分页结果集 85 | List> lm = DbUtil.executeQuery(sql, id); 86 | // 把查询的Comment结果由List>转换为List 87 | if (lm.size() > 0) { 88 | for (Map map : lm) { 89 | Comment book = new Comment(map); 90 | list.add(book); 91 | } 92 | } 93 | return list; 94 | } 95 | 96 | /** 97 | * @param 98 | * @return 返回一个boolean 99 | */ 100 | @Override 101 | public boolean commentAdd(Comment comment) { 102 | String sql="INSERT INTO comment (comment, send, credible, start, time, uid, gid) VALUES (?,?,?,?,?,?,?)"; 103 | int i= DbUtil.excuteUpdate(sql, comment.getComment(),comment.getSend(),comment.getCredible(),comment.getStart(),comment.getTime(),comment.getUid(),comment.getGid()); 104 | return i>0?true:false; 105 | } 106 | 107 | @Override 108 | public boolean updateComment(Comment comment) { 109 | String sql="update comment set comment=?,send=?,credible=?,start=? where id =?"; 110 | int i=DbUtil.excuteUpdate(sql,comment.getComment(),comment.getSend(),comment.getCredible(),comment.getStart(),comment.getId()); 111 | return i>0?true:false; 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/impl/OrderDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao.impl; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import com.shine.game.bean.Order; 8 | import com.shine.game.bean.PageBean; 9 | import com.shine.game.dao.OrderDao; 10 | import com.shine.game.util.DbUtil; 11 | 12 | /** 13 | * @version 14 | */ 15 | public class OrderDaoImpl implements OrderDao { 16 | /** 17 | * 向order插入一条订单记录 18 | */ 19 | @Override 20 | public boolean orderAdd(Order order) { 21 | String sql="insert into orders(orderNum,userId,orderDate,orderStatus,money,sellUserId) values(?,?,?,?,?,?)"; 22 | int i= DbUtil.excuteUpdate(sql,order.getOrderNum(),order.getUserId(),order.getOrderDate(),order.getOrderStatus(),order.getMoney(),order.getSellUserId()); 23 | return i>0?true:false; 24 | } 25 | /** 26 | * by订单号查询订单编号 27 | */ 28 | @Override 29 | public int findOrderIdByOrderNum(String orderNum) { 30 | int orderId=0; 31 | String sql="select orderId from orders where orderNum=?"; 32 | List> query = DbUtil.executeQuery(sql, orderNum); 33 | if(query.size()>0) { 34 | orderId=(int) query.get(0).get("orderId"); 35 | } 36 | 37 | return orderId; 38 | } 39 | @Override 40 | public long orderReadCount(int userId) { 41 | String sql = "select count(*) as count from orders where userId=?"; 42 | List> lm = DbUtil.executeQuery(sql,userId); 43 | return lm.size() > 0 ? (long) lm.get(0).get("count") : 0; 44 | } 45 | @Override 46 | public List orderList(PageBean pageBean,int userId) { 47 | List lo=new ArrayList<>(); 48 | List> list=new ArrayList>(); 49 | String sql="select * from orders where userId=? limit ?,?"; 50 | list=DbUtil.executeQuery(sql,userId,(pageBean.getCurPage()-1)*pageBean.getMaxSize(),pageBean.getMaxSize()); 51 | 52 | System.out.println(list.size()); 53 | if(list.size()>0) { 54 | for(Map map:list) { 55 | Order order=new Order(map); 56 | lo.add(order); 57 | } 58 | } 59 | 60 | return lo; 61 | } 62 | 63 | @Override 64 | public long orderReadCount() { 65 | String sql = "select count(*) as count from orders"; 66 | List> lm = DbUtil.executeQuery(sql); 67 | return lm.size() > 0 ? (long) lm.get(0).get("count") : 0; 68 | } 69 | 70 | @Override 71 | public List orderList(PageBean pageBean) { 72 | List lo=new ArrayList<>(); 73 | List> list=new ArrayList>(); 74 | 75 | String sql="select * from orders limit ?,?"; 76 | 77 | list=DbUtil.executeQuery(sql,(pageBean.getCurPage()-1)*pageBean.getMaxSize(),pageBean.getMaxSize()); 78 | 79 | if(list.size()>0) { 80 | for(Map map:list) { 81 | Order order=new Order(map); 82 | lo.add(order); 83 | } 84 | } 85 | 86 | return lo; 87 | } 88 | 89 | @Override 90 | public Order findOrderByOrderId(int orderId) { 91 | Order order=null; 92 | String sql="select * from orders where orderId=?"; 93 | List> query = DbUtil.executeQuery(sql, orderId); 94 | if(query.size()>0) { 95 | order=new Order(query.get(0)); 96 | } 97 | 98 | return order; 99 | } 100 | 101 | @Override 102 | public long orderReadCountByStatus(int status) { 103 | String sql = "select count(*) as count from orders where orderStatus=?"; 104 | List> lm = DbUtil.executeQuery(sql,status); 105 | return lm.size() > 0 ? (long) lm.get(0).get("count") : 0; 106 | } 107 | 108 | @Override 109 | public long orderReadCountByStatusUserId(int status ,int userid) { 110 | String sql = "select count(*) as count from orders where orderStatus=? and sellUserId=?"; 111 | List> lm = DbUtil.executeQuery(sql,status,userid); 112 | return lm.size() > 0 ? (long) lm.get(0).get("count") : 0; 113 | 114 | } 115 | 116 | @Override 117 | public List orderListByStatus(PageBean pageBean, int status) { 118 | List lo=new ArrayList<>(); 119 | List> list=new ArrayList>(); 120 | 121 | String sql="select * from orders where orderStatus=? limit ?,?"; 122 | 123 | list=DbUtil.executeQuery(sql,status,(pageBean.getCurPage()-1)*pageBean.getMaxSize(),pageBean.getMaxSize()); 124 | 125 | if(list.size()>0) { 126 | for(Map map:list) { 127 | Order order=new Order(map); 128 | lo.add(order); 129 | } 130 | } 131 | return lo; 132 | } 133 | 134 | @Override 135 | public List orderListByStatusUserId(PageBean pb, int status, int userid) { 136 | List lo=new ArrayList<>(); 137 | List> list=new ArrayList>(); 138 | 139 | String sql="select * from orders where orderStatus=? and sellUserId=? limit ?,?"; 140 | 141 | list=DbUtil.executeQuery(sql,status,userid ,(pb.getCurPage()-1)*pb.getMaxSize(),pb.getMaxSize()); 142 | 143 | if(list.size()>0) { 144 | for(Map map:list) { 145 | Order order=new Order(map); 146 | lo.add(order); 147 | } 148 | } 149 | return lo; 150 | } 151 | @Override 152 | public boolean orderStatus(int orderId,int status) { 153 | String sql="update orders set orderStatus=? where orderId=?"; 154 | int i = DbUtil.excuteUpdate(sql, status,orderId); 155 | return i>0?true:false; 156 | } 157 | 158 | } 159 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/impl/OrderItemDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao.impl; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import com.shine.game.bean.OrderItem; 8 | import com.shine.game.dao.OrderItemDao; 9 | import com.shine.game.util.DbUtil; 10 | 11 | /** 12 | * @version 13 | */ 14 | public class OrderItemDaoImpl implements OrderItemDao { 15 | 16 | @Override 17 | public boolean orderAdd(OrderItem orderItem) { 18 | String sql="insert into orderItem(bookId,orderId,quantity) values(?,?,?)"; 19 | 20 | int i= DbUtil.excuteUpdate(sql,orderItem.getBookId(),orderItem.getOrderId(),orderItem.getQuantity()); 21 | 22 | return i>0?true:false; 23 | } 24 | 25 | @Override 26 | public List findItemByOrderId(int orderId) { 27 | List lo=new ArrayList<>(); 28 | String sql="select * from orderItem where orderId=?"; 29 | List> query = DbUtil.executeQuery(sql, orderId); 30 | if(query.size()>0) { 31 | for(Map map:query) { 32 | OrderItem oItem=new OrderItem(map); 33 | lo.add(oItem); 34 | } 35 | 36 | } 37 | return lo; 38 | } 39 | 40 | /** 41 | * 42 | * @param itemId 订单明细id 43 | * @param state 是否评价(0:未评价,1:已评价) 44 | * @return 45 | */ 46 | @Override 47 | public boolean updateIsComment(int itemId,int state) { 48 | String sql="update orderitem set IsComment=? where itemId =?"; 49 | int i=DbUtil.excuteUpdate(sql,state,itemId); 50 | return i>0?true:false; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/impl/UpLoadImgDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao.impl; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import com.shine.game.bean.UpLoadImg; 8 | import com.shine.game.dao.UpLoadImgDao; 9 | import com.shine.game.util.DbUtil; 10 | 11 | public class UpLoadImgDaoImpl implements UpLoadImgDao { 12 | /** 13 | * 增加饰品图片 14 | */ 15 | @Override 16 | public boolean imgAdd(UpLoadImg upLoadImg) { 17 | String sql="insert into uploadimg(imgName,imgSrc,imgType) values(?,?,?)"; 18 | int i=DbUtil.excuteUpdate(sql, upLoadImg.getImgName(),upLoadImg.getImgSrc(),upLoadImg.getImgType()); 19 | return i>0?true:false; 20 | } 21 | /** 22 | * 获取饰品图片id 23 | */ 24 | 25 | @Override 26 | public Integer findIdByImgName(String imgName) { 27 | Integer id=0; 28 | String sql = "select imgId from uploadimg where imgName=?"; 29 | List> list = DbUtil.executeQuery(sql, imgName); 30 | if(list.size()>0){ 31 | id=(Integer) list.get(0).get("imgId"); 32 | } 33 | return id; 34 | 35 | } 36 | /** 37 | * 更新图片信息 38 | */ 39 | @Override 40 | public boolean imgUpdate(UpLoadImg upImg) { 41 | String sql = "update uploadimg set imgName=? , imgSrc=? , imgType=? where imgId=?"; 42 | int i = DbUtil.excuteUpdate(sql, upImg.getImgName(),upImg.getImgSrc(),upImg.getImgType(),upImg.getImgId()); 43 | return i>0?true:false; 44 | } 45 | /** 46 | * 通过id删除图片 47 | */ 48 | @Override 49 | public boolean imgDelById(int imgId) { 50 | String sql="delete from uploadimg where imgId=?"; 51 | int i = DbUtil.excuteUpdate(sql, imgId); 52 | return i>0?true:false; 53 | } 54 | //根据ids查询图片 55 | @Override 56 | public List findImgByIds(String imgIds) { 57 | List luli=new ArrayList<>(); 58 | 59 | String sql="select * from uploadimg where imgId in("+imgIds+")"; 60 | List> list = DbUtil.executeQuery(sql); 61 | if(list.size()>0) { 62 | for(Map map:list) { 63 | UpLoadImg uli=new UpLoadImg(map); 64 | luli.add(uli); 65 | } 66 | } 67 | return luli; 68 | } 69 | //批量删除 70 | @Override 71 | public boolean imgBatDelById(String imgIds) { 72 | String sql="delete from uploadimg where imgId in("+imgIds+")"; 73 | int i=DbUtil.excuteUpdate(sql); 74 | return i>0?true:false; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/com/shine/game/dao/impl/UserDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.dao.impl; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | import com.shine.game.bean.PageBean; 7 | import com.shine.game.bean.User; 8 | import com.shine.game.dao.UserDao; 9 | import com.shine.game.util.DbUtil; 10 | 11 | /** 12 | * @version 13 | */ 14 | public class UserDaoImpl implements UserDao { 15 | 16 | @Override 17 | public long readCount() { 18 | long count=0; 19 | String sql="select count(*) as count from user"; 20 | List> lm=DbUtil.executeQuery(sql); 21 | if(lm.size()>0){ 22 | count=(long) lm.get(0).get("count"); 23 | } 24 | return count; 25 | } 26 | 27 | @Override 28 | public List userList(PageBean pageBean) { 29 | List lu=new ArrayList<>(); 30 | List> list=new ArrayList>(); 31 | String sql="select * from user limit ?,?"; 32 | list=DbUtil.executeQuery(sql,(pageBean.getCurPage()-1)*pageBean.getMaxSize(),pageBean.getMaxSize()); 33 | if(list.size()>0) { 34 | for(Map map:list) { 35 | User u=new User(map); 36 | lu.add(u); 37 | } 38 | } 39 | 40 | return lu; 41 | } 42 | 43 | @Override 44 | public boolean findUser(String userName) { 45 | String sql="select * from user where userName=?"; 46 | List> list=DbUtil.executeQuery(sql, userName); 47 | return list.size()>0?true:false; 48 | } 49 | 50 | @Override 51 | public boolean findUserAndId(String userName,Integer id) { 52 | String sql="select * from user where userName=? and userId!=?"; 53 | 54 | List> list=DbUtil.executeQuery(sql, userName,id); 55 | 56 | return list.size()>0?true:false; 57 | } 58 | 59 | /** 60 | * @param user 要增加的用户对象 61 | * @return 返回一个boolean true用户增加成功 false用户增加失败 62 | */ 63 | @Override 64 | public boolean userAdd(User user) { 65 | String sql="insert into user(userName,userPassWord,name,sex,age,tell,address,enabled,paypwd) values(?,?,?,?,?,?,?,?,?)"; 66 | int i= DbUtil.excuteUpdate(sql, user.getUserName(),user.getUserPassWord(),user.getName(),user.getSex(),user.getAge() 67 | ,user.getTell(),user.getAddress(),user.getEnabled(),user.getPayPwd()); 68 | return i>0?true:false; 69 | 70 | } 71 | /** 72 | * @param id 根据id查找一个用户信息 73 | * @return 返回一个list用户信息集合 74 | */ 75 | //查找指定id用户信息 76 | @Override 77 | public User findUser(Integer id) { 78 | String sql="select * from user where userId=?"; 79 | User u=null; 80 | List> list=DbUtil.executeQuery(sql, id); 81 | if(list.size()>0) { 82 | u=new User(list.get(0)); 83 | } 84 | return u; 85 | } 86 | /** 87 | * 88 | * @param user 更新用户,根据传过来的id 89 | * @return boolean 90 | */ 91 | @Override 92 | public boolean userUpdate(User user) { 93 | String sql="update user set userPassWord=?,name=?,sex=?,age=?,tell=?,address=?,enabled=?,paypwd=? where userId =?"; 94 | int i=DbUtil.excuteUpdate(sql,user.getUserPassWord(),user.getName(),user.getSex(),user.getAge() 95 | ,user.getTell(),user.getAddress(),user.getEnabled(),user.getPayPwd(),user.getUserId()); 96 | return i>0?true:false; 97 | } 98 | 99 | @Override 100 | public boolean userUpdateGrade(User user) { 101 | String sql="update user set grade=? where userId =?"; 102 | int i=DbUtil.excuteUpdate(sql,user.getGrade(),user.getUserId()); 103 | return i>0?true:false; 104 | } 105 | 106 | /** 107 | * @param id 要删除的用户id 108 | * @return 返回boolean true删除用户成功,false删除用户失败 109 | */ 110 | @Override 111 | public boolean delUser(int id) { 112 | String sql="delete from user where userId=?"; 113 | int i=DbUtil.excuteUpdate(sql, id); 114 | return i>0?true:false; 115 | } 116 | /** 117 | * @param ids 要批量删除id组的字符串 118 | */ 119 | @Override 120 | public boolean batDelUser(String ids) { 121 | String sql="delete from user where userId in ("+ids+")"; 122 | int i=DbUtil.excuteUpdate(sql); 123 | return i>0?true:false; 124 | } 125 | 126 | @Override 127 | public User userLogin(User user) { 128 | User user1=null; 129 | String sql="select * from user where userName=? and userPassWord=?"; 130 | List> list = DbUtil.executeQuery(sql, user.getUserName(),user.getUserPassWord()); 131 | if(list.size()>0) { 132 | Map map = list.get(0); 133 | user1=new User(map); 134 | 135 | } 136 | return user1; 137 | } 138 | 139 | } 140 | -------------------------------------------------------------------------------- /src/com/shine/game/filter/FilterEnconding.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.filter; 2 | 3 | import java.io.IOException; 4 | import javax.servlet.Filter; 5 | import javax.servlet.FilterChain; 6 | import javax.servlet.FilterConfig; 7 | import javax.servlet.ServletException; 8 | import javax.servlet.ServletRequest; 9 | import javax.servlet.ServletResponse; 10 | import javax.servlet.annotation.WebFilter; 11 | import javax.servlet.annotation.WebInitParam; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | 15 | /** 16 | * Servlet Filter implementation class FilterEnconding 17 | */ 18 | @WebFilter(filterName="FilterEnconding", 19 | urlPatterns="/*", 20 | initParams= {@WebInitParam(name="enconding",value="utf-8")}) 21 | public class FilterEnconding implements Filter { 22 | private String enconding; 23 | 24 | 25 | /** 26 | * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain) 27 | */ 28 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { 29 | 30 | HttpServletRequest httpRequest=(HttpServletRequest) request; 31 | HttpServletResponse httpResponse=(HttpServletResponse) response; 32 | 33 | httpRequest.setCharacterEncoding(this.enconding); 34 | httpResponse.setCharacterEncoding(this.enconding); 35 | 36 | //System.out.println(DateUtil.show()+">>设置enconding"+this.enconding); 37 | 38 | chain.doFilter(request, response); 39 | } 40 | 41 | /** 42 | * @see Filter#init(FilterConfig) 43 | */ 44 | public void init(FilterConfig fConfig) throws ServletException { 45 | this.enconding=fConfig.getInitParameter("enconding"); 46 | } 47 | 48 | @Override 49 | public void destroy() { 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/com/shine/game/filter/FilterLogin.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.filter; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import javax.servlet.Filter; 6 | import javax.servlet.FilterChain; 7 | import javax.servlet.FilterConfig; 8 | import javax.servlet.ServletException; 9 | import javax.servlet.ServletRequest; 10 | import javax.servlet.ServletResponse; 11 | import javax.servlet.annotation.WebFilter; 12 | import javax.servlet.annotation.WebInitParam; 13 | import javax.servlet.http.HttpServletRequest; 14 | import javax.servlet.http.HttpServletResponse; 15 | 16 | /** 17 | * Servlet Filter implementation class FilterLogin 18 | */ 19 | @WebFilter(filterName="FilterLogin",urlPatterns="/jsp/admin/*", 20 | initParams={@WebInitParam(name="allowPath",value="login.jsp;LoginServlet;images;css")}) 21 | public class FilterLogin implements Filter { 22 | private String allowPath; 23 | /** 24 | * @see Filter#destroy() 25 | */ 26 | public void destroy() { 27 | // TODO Auto-generated method stub 28 | } 29 | 30 | /** 31 | * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain) 32 | */ 33 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { 34 | HttpServletRequest httpRequest=(HttpServletRequest) request; 35 | HttpServletResponse httpResponse=(HttpServletResponse) response; 36 | String urlPath=httpRequest.getServletPath(); 37 | if(httpRequest.getSession().getAttribute("adminUser")!=null){ 38 | chain.doFilter(request, response); 39 | return; 40 | } 41 | 42 | String[] urls=this.allowPath.split(";"); 43 | for(String url:urls){ 44 | if(urlPath.indexOf(url)>0){ 45 | chain.doFilter(request, response); 46 | return; 47 | } 48 | } 49 | String noPath=httpRequest.getScheme()+"://"+httpRequest.getServerName()+":"+httpRequest.getServerPort()+httpRequest.getContextPath()+"/jsp/admin/login.jsp"; 50 | //httpResponse.sendRedirect("login.jsp"); 51 | //'http://localhost:8080/bookshop/login.jsp' 52 | PrintWriter pw=httpResponse.getWriter(); 53 | //解决iframe框架未登录顶层窗口跳转地址问题 54 | pw.println(""); 55 | // pw.write(""); 56 | // pw.flush(); 57 | 58 | } 59 | 60 | /** 61 | * @see Filter#init(FilterConfig) 62 | */ 63 | public void init(FilterConfig fConfig) throws ServletException { 64 | this.allowPath=fConfig.getInitParameter("allowPath"); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/com/shine/game/listener/ListenerCount.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.listener; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import javax.servlet.ServletContext; 7 | import javax.servlet.ServletContextEvent; 8 | import javax.servlet.ServletContextListener; 9 | import javax.servlet.annotation.WebListener; 10 | import javax.servlet.http.HttpSessionAttributeListener; 11 | import javax.servlet.http.HttpSessionBindingEvent; 12 | import javax.servlet.http.HttpSessionEvent; 13 | import javax.servlet.http.HttpSessionListener; 14 | 15 | import com.shine.game.bean.Admin; 16 | import com.shine.game.util.DateUtil; 17 | 18 | /** 19 | * Application Lifecycle Listener implementation class ListenerCount 20 | * 21 | */ 22 | @WebListener 23 | public class ListenerCount implements ServletContextListener, HttpSessionListener, HttpSessionAttributeListener { 24 | ServletContext application; 25 | 26 | /** 27 | * @see HttpSessionListener#sessionCreated(HttpSessionEvent) 28 | */ 29 | public void sessionCreated(HttpSessionEvent se) { 30 | //记录系统访问的人数; 31 | Integer vCount=(Integer) this.application.getAttribute("vCount"); 32 | vCount++; 33 | this.application.setAttribute("vCount", vCount); 34 | } 35 | 36 | /** 37 | * @see HttpSessionListener#sessionDestroyed(HttpSessionEvent) 38 | */ 39 | public void sessionDestroyed(HttpSessionEvent se) { 40 | // TODO Auto-generated method stub 41 | } 42 | 43 | /** 44 | * @see ServletContextListener#contextDestroyed(ServletContextEvent) 45 | */ 46 | public void contextDestroyed(ServletContextEvent sce) { 47 | 48 | } 49 | 50 | /** 51 | * @see HttpSessionAttributeListener#attributeAdded(HttpSessionBindingEvent) 52 | */ 53 | public void attributeAdded(HttpSessionBindingEvent se) { 54 | List olUser=(List) this.application.getAttribute("olUser"); 55 | String name=se.getName(); 56 | if("userInfo".equals(name)){ 57 | Admin user=(Admin) se.getValue(); 58 | olUser.add(user.getUserName()); 59 | this.application.setAttribute("olUser", olUser); 60 | System.out.println(DateUtil.show()+">>> 用户:"+user.getUserName()+"登录"); 61 | } 62 | 63 | } 64 | 65 | /** 66 | * @see HttpSessionAttributeListener#attributeRemoved(HttpSessionBindingEvent) 67 | */ 68 | public void attributeRemoved(HttpSessionBindingEvent se) { 69 | List olUser=(List) this.application.getAttribute("olUser"); 70 | String name=se.getName(); 71 | if("userInfo".equals(name)){ 72 | Admin user=(Admin) se.getValue(); 73 | if(olUser.contains(user.getUserName())){ 74 | olUser.remove(user.getUserName()); 75 | this.application.setAttribute("olUser", olUser); 76 | } 77 | System.out.println(DateUtil.show()+">>> 用户:"+user.getUserName()+"退出登录"); 78 | } 79 | 80 | } 81 | 82 | /** 83 | * @see HttpSessionAttributeListener#attributeReplaced(HttpSessionBindingEvent) 84 | */ 85 | public void attributeReplaced(HttpSessionBindingEvent se) { 86 | // TODO Auto-generated method stub 87 | } 88 | 89 | /** 90 | * @see ServletContextListener#contextInitialized(ServletContextEvent) 91 | */ 92 | public void contextInitialized(ServletContextEvent sce) { 93 | this.application=sce.getServletContext(); 94 | this.application.setAttribute("vCount", 0); 95 | this.application.setAttribute("olUser", new ArrayList()); 96 | 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /src/com/shine/game/servlet/admin/LoginOutServlet.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.servlet.admin; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | /** 12 | * 注销登录 13 | */ 14 | @WebServlet("/LoginOutServlet") 15 | public class LoginOutServlet extends HttpServlet { 16 | private static final long serialVersionUID = 1L; 17 | /** 18 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 19 | */ 20 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 21 | request.getSession().removeAttribute("admin_user"); 22 | response.sendRedirect("jsp/admin/login.jsp");//这里跳转不能用jsp/login/login.jsp,过滤器会不拦截 23 | } 24 | 25 | /** 26 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 27 | */ 28 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 29 | // TODO Auto-generated method stub 30 | doGet(request, response); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/com/shine/game/servlet/admin/LoginServlet.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.servlet.admin; 2 | 3 | import java.io.IOException; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import javax.servlet.ServletException; 8 | import javax.servlet.annotation.WebServlet; 9 | import javax.servlet.http.HttpServlet; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | 13 | import com.shine.game.bean.Admin; 14 | import com.shine.game.dao.AdminDao; 15 | import com.shine.game.dao.impl.AdminDaoImpl; 16 | 17 | /** 18 | * Servlet implementation class LoginServlet 19 | */ 20 | @WebServlet("/jsp/admin/LoginServlet") 21 | public class LoginServlet extends HttpServlet { 22 | private static final long serialVersionUID = 1L; 23 | 24 | /** 25 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 26 | */ 27 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 28 | String mainPath = "index.jsp"; 29 | String loginPath = "login.jsp"; 30 | 31 | String userName = request.getParameter("userName"); 32 | String passWord = request.getParameter("passWord"); 33 | Admin admin = new Admin(userName, passWord); 34 | AdminDao ud = new AdminDaoImpl(); 35 | 36 | List list = new ArrayList(); 37 | if (userName == null) { 38 | list.add("用户名不能为空"); 39 | } 40 | if (passWord == null) { 41 | list.add("密码不能为空"); 42 | } 43 | if (list.size() == 0) { 44 | if (ud.userLogin(admin)) { 45 | request.getSession().setAttribute("adminUser", admin); 46 | response.sendRedirect(mainPath); 47 | return; 48 | } else { 49 | list.add("用户名或密码错误!请重新输入"); 50 | } 51 | } 52 | request.setAttribute("infoList", list); 53 | request.getRequestDispatcher(loginPath).forward(request, response); 54 | 55 | 56 | } 57 | 58 | /** 59 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 60 | */ 61 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 62 | doGet(request, response); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/com/shine/game/servlet/admin/OrderManageServlet.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.servlet.admin; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import com.shine.game.bean.Order; 12 | import com.shine.game.bean.OrderItem; 13 | import com.shine.game.bean.PageBean; 14 | import com.shine.game.dao.BookDao; 15 | import com.shine.game.dao.OrderDao; 16 | import com.shine.game.dao.OrderItemDao; 17 | import com.shine.game.dao.UserDao; 18 | import com.shine.game.dao.impl.BookDaoImpl; 19 | import com.shine.game.dao.impl.OrderDaoImpl; 20 | import com.shine.game.dao.impl.OrderItemDaoImpl; 21 | import com.shine.game.dao.impl.UserDaoImpl; 22 | 23 | /** 24 | * Servlet implementation class OrderManageServlet 25 | */ 26 | @WebServlet("/jsp/admin/OrderManageServlet") 27 | public class OrderManageServlet extends HttpServlet { 28 | private static final long serialVersionUID = 1L; 29 | private static final String ORDERLIST_PATH = "orderManage/orderlist.jsp"; 30 | private static final String ORDERDETAIL_PATH = "orderManage/orderDetail.jsp"; 31 | private static final String ORDEROP_PATH = "orderManage/orderOp.jsp"; 32 | 33 | /** 34 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 35 | */ 36 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 37 | doPost(request, response); 38 | } 39 | 40 | /** 41 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 42 | */ 43 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 44 | String action = request.getParameter("action"); 45 | switch (action) { 46 | case "list": 47 | orderList(request, response); 48 | break; 49 | case "detail": 50 | orderDetail(request, response); 51 | break; 52 | case "processing": 53 | orderProcessing(request, response); 54 | break; 55 | case "ship": 56 | orderShip(request, response); 57 | break; 58 | } 59 | 60 | } 61 | 62 | private void orderShip(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 63 | String orderId = request.getParameter("id"); 64 | OrderDao orderDao = new OrderDaoImpl(); 65 | 66 | if (orderDao.orderStatus(Integer.parseInt(orderId), 2)) { 67 | request.setAttribute("orderMessage", "一个订单操作成功"); 68 | } else { 69 | request.setAttribute("orderMessage", "一个订单操作失败"); 70 | } 71 | orderProcessing(request, response); 72 | } 73 | 74 | private void orderProcessing(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 75 | int curPage = 1; 76 | String page = request.getParameter("page"); 77 | if (page != null) { 78 | curPage = Integer.parseInt(page); 79 | } 80 | int maxSize = Integer.parseInt(request.getServletContext().getInitParameter("maxPageSize")); 81 | OrderDao orderDao = new OrderDaoImpl(); 82 | PageBean pb = new PageBean(curPage, maxSize, orderDao.orderReadCountByStatus(1)); 83 | 84 | request.setAttribute("pageBean", pb); 85 | request.setAttribute("orderList", orderDao.orderListByStatus(pb, 1)); 86 | request.getRequestDispatcher(ORDEROP_PATH).forward(request, response); 87 | 88 | } 89 | 90 | private void orderDetail(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 91 | int orderId = Integer.parseInt(request.getParameter("id")); 92 | OrderDao orderDao = new OrderDaoImpl(); 93 | OrderItemDao oItemDao = new OrderItemDaoImpl(); 94 | UserDao userDao = new UserDaoImpl(); 95 | BookDao bookDao = new BookDaoImpl(); 96 | 97 | Order order = orderDao.findOrderByOrderId(orderId); 98 | order.setUser(userDao.findUser(order.getUserId())); 99 | order.setoItem(oItemDao.findItemByOrderId(order.getOrderId())); 100 | for (OrderItem oItem : order.getoItem()) { 101 | //通过饰品id获取饰品对象 102 | oItem.setBook(bookDao.findBookById(oItem.getBookId())); 103 | } 104 | request.setAttribute("order", order); 105 | request.getRequestDispatcher(ORDERDETAIL_PATH).forward(request, response); 106 | 107 | } 108 | 109 | private void orderList(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 110 | int curPage = 1; 111 | String page = request.getParameter("page"); 112 | if (page != null) { 113 | curPage = Integer.parseInt(page); 114 | } 115 | int maxSize = Integer.parseInt(request.getServletContext().getInitParameter("maxPageSize")); 116 | OrderDao orderDao = new OrderDaoImpl(); 117 | PageBean pb = new PageBean(curPage, maxSize, orderDao.orderReadCount()); 118 | request.setAttribute("pageBean", pb); 119 | request.setAttribute("orderList", orderDao.orderList(pb)); 120 | request.getRequestDispatcher(ORDERLIST_PATH).forward(request, response); 121 | 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /src/com/shine/game/servlet/book/CartServlet.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.servlet.book; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import com.shine.game.bean.Book; 12 | import com.shine.game.bean.Cart; 13 | import com.shine.game.bean.CartItem; 14 | import com.shine.game.dao.BookDao; 15 | import com.shine.game.dao.impl.BookDaoImpl; 16 | 17 | import net.sf.json.JSONObject; 18 | 19 | /** 20 | * Servlet implementation class CartServlet 21 | */ 22 | @WebServlet("/CartServlet") 23 | public class CartServlet extends HttpServlet { 24 | private static final long serialVersionUID = 1L; 25 | 26 | /** 27 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 28 | */ 29 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 30 | doPost(request, response); 31 | } 32 | 33 | /** 34 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 35 | */ 36 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 37 | String action = request.getParameter("action"); 38 | switch (action) { 39 | case "add": 40 | addTOCart(request, response); 41 | break; 42 | case "changeIn": 43 | changeIn(request, response);//更改购物车商品数量 44 | break; 45 | case "delItem": 46 | delItem(request, response); 47 | break; 48 | case "delAll": 49 | delAll(request, response); 50 | break; 51 | } 52 | } 53 | 54 | 55 | private void delAll(HttpServletRequest request, HttpServletResponse response) throws IOException { 56 | request.getSession().removeAttribute("shopCart"); 57 | response.sendRedirect("jsp/book/cart.jsp"); 58 | } 59 | 60 | //购物项删除 61 | private void delItem(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 62 | int bookId = Integer.parseInt(request.getParameter("id")); 63 | Cart shopCart = (Cart) request.getSession().getAttribute("shopCart"); 64 | if (shopCart.getMap().containsKey(bookId)) { 65 | shopCart.getMap().remove(bookId); 66 | } 67 | response.sendRedirect("jsp/book/cart.jsp"); 68 | } 69 | 70 | //更改购物项数量 71 | private void changeIn(HttpServletRequest request, HttpServletResponse response) throws IOException { 72 | 73 | int bookId = Integer.parseInt(request.getParameter("bookId")); 74 | int quantity = Integer.parseInt(request.getParameter("quantity")); 75 | Cart shopCart = (Cart) request.getSession().getAttribute("shopCart"); 76 | CartItem item = shopCart.getMap().get(bookId); 77 | item.setQuantity(quantity); 78 | JSONObject json = new JSONObject(); 79 | json.put("subtotal", item.getSubtotal()); 80 | json.put("totPrice", shopCart.getTotPrice()); 81 | json.put("totQuan", shopCart.getTotQuan()); 82 | json.put("quantity", item.getQuantity()); 83 | response.getWriter().print(json.toString()); 84 | 85 | 86 | } 87 | 88 | private void addTOCart(HttpServletRequest request, HttpServletResponse response) throws IOException { 89 | String bookId = request.getParameter("bookId"); 90 | BookDao bd = new BookDaoImpl(); 91 | Book book = bd.findBookById(Integer.parseInt(bookId)); 92 | 93 | Cart shopCart = (Cart) request.getSession().getAttribute("shopCart"); 94 | 95 | if (shopCart == null) { 96 | shopCart = new Cart(); 97 | request.getSession().setAttribute("shopCart", shopCart); 98 | } 99 | shopCart.addBook(book); 100 | response.getWriter().print(shopCart.getTotQuan());//返回现在购物车实时数量 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /src/com/shine/game/servlet/book/CodeServlet.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.servlet.book; 2 | 3 | import java.io.IOException; 4 | import javax.servlet.ServletException; 5 | import javax.servlet.ServletOutputStream; 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import com.shine.game.util.ImageCode; 12 | import net.sf.json.JSONObject; 13 | 14 | /** 15 | * 验证码 Servlet 16 | */ 17 | @WebServlet("/CodeServlet") 18 | public class CodeServlet extends HttpServlet { 19 | private static final long serialVersionUID = 1L; 20 | 21 | /** 22 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 23 | */ 24 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 25 | String action = request.getParameter("action"); 26 | if ("code".equals(action)) { 27 | getCode(request, response); 28 | } 29 | if ("ckCode".equals(action)) { 30 | ckCode(request, response); 31 | } 32 | } 33 | 34 | private void ckCode(HttpServletRequest request, HttpServletResponse response) throws IOException { 35 | String code = request.getParameter("param"); 36 | String ck_code = (String) request.getSession().getAttribute("checkCode"); 37 | JSONObject json = new JSONObject(); 38 | if (ck_code.equals(code)) { 39 | json.put("info", "验证码正确"); 40 | json.put("status", "y"); 41 | } else { 42 | json.put("info", "验证码输入不正确"); 43 | json.put("status", "n"); 44 | } 45 | response.getWriter().write(json.toString()); 46 | } 47 | 48 | private void getCode(HttpServletRequest request, HttpServletResponse response) throws IOException { 49 | // 设置浏览器不要缓存此图片 50 | response.setHeader("Pragma", "no-cache"); 51 | response.setHeader("Cache-Control", "no-cache"); 52 | response.setDateHeader("Expires", 0); 53 | ServletOutputStream outputStream = response.getOutputStream(); 54 | String rands = ImageCode.getImageCode(70, 30, outputStream); 55 | //将生成的随机四个字符保存在session范围checkCode属性 56 | request.getSession().setAttribute("checkCode", rands); 57 | outputStream.close(); 58 | } 59 | 60 | /** 61 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 62 | */ 63 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 64 | // TODO Auto-generated method stub 65 | doGet(request, response); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/com/shine/game/servlet/book/GetCatalog.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.servlet.book; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.annotation.WebServlet; 8 | import javax.servlet.http.HttpServlet; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | import com.shine.game.bean.Catalog; 13 | import com.shine.game.dao.BookDao; 14 | import com.shine.game.dao.CatalogDao; 15 | import com.shine.game.dao.impl.BookDaoImpl; 16 | import com.shine.game.dao.impl.CatalogDaoImpl; 17 | 18 | import net.sf.json.JSONObject; 19 | 20 | /** 21 | * Servlet implementation class GetCatalog 22 | */ 23 | @WebServlet("/GetCatalog") 24 | public class GetCatalog extends HttpServlet { 25 | private static final long serialVersionUID = 1L; 26 | 27 | /** 28 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 29 | */ 30 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 31 | response.setContentType("text/json"); 32 | JSONObject json = new JSONObject(); 33 | CatalogDao cd = new CatalogDaoImpl(); 34 | BookDao bd = new BookDaoImpl(); 35 | List catalog = cd.getCatalog(); 36 | //这里返回查询每个分类的数量 37 | for (int i = 0; i < catalog.size(); i++) { 38 | Catalog c = catalog.get(i); 39 | long size = bd.bookReadCount(c.getCatalogId()); 40 | c.setCatalogSize(size); 41 | } 42 | json.put("catalog", catalog); 43 | response.getWriter().append(json.toString()); 44 | } 45 | 46 | /** 47 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 48 | */ 49 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 50 | // TODO Auto-generated method stub 51 | doGet(request, response); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/com/shine/game/servlet/book/ShopIndex.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.servlet.book; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.util.List; 6 | 7 | import javax.servlet.ServletException; 8 | import javax.servlet.annotation.WebServlet; 9 | import javax.servlet.http.HttpServlet; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | 13 | import com.shine.game.bean.Book; 14 | import com.shine.game.dao.BookDao; 15 | import com.shine.game.dao.impl.BookDaoImpl; 16 | 17 | import net.sf.json.JSONObject; 18 | 19 | /** 20 | * 系统加载首页 21 | */ 22 | @WebServlet("/ShopIndex") 23 | public class ShopIndex extends HttpServlet { 24 | private static final long serialVersionUID = 1L; 25 | 26 | 27 | /** 28 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 29 | */ 30 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 31 | doPost(request, response); 32 | } 33 | 34 | /** 35 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 36 | */ 37 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 38 | response.setContentType("text/json"); 39 | JSONObject json = new JSONObject(); 40 | BookDao bd = new BookDaoImpl(); 41 | List recBooks = bd.bookList(4); 42 | json.put("recBooks", recBooks); 43 | List newBooks = bd.newBooks(4); 44 | json.put("newBooks", newBooks); 45 | PrintWriter pw = response.getWriter(); 46 | pw.print(json); 47 | pw.flush(); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/com/shine/game/servlet/book/bookdetailed.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.servlet.book; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.annotation.WebServlet; 8 | import javax.servlet.http.HttpServlet; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | import javax.servlet.http.HttpSession; 12 | 13 | import com.shine.game.bean.Comment; 14 | import com.shine.game.bean.User; 15 | import com.shine.game.dao.BookDao; 16 | import com.shine.game.dao.impl.BookDaoImpl; 17 | import com.shine.game.dao.impl.CommentDaoImpl; 18 | 19 | /** 20 | * Servlet implementation class bookdetailed 21 | */ 22 | @WebServlet("/bookdetail") 23 | public class bookdetailed extends HttpServlet { 24 | private static final long serialVersionUID = 1L; 25 | private static final String DETAIL_PATH="jsp/book/bookdetails.jsp"; 26 | 27 | /** 28 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse 29 | * response) 30 | */ 31 | protected void doGet(HttpServletRequest request, HttpServletResponse response) 32 | throws ServletException, IOException { 33 | doPost(request, response); 34 | } 35 | 36 | /** 37 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse 38 | * response) 39 | */ 40 | protected void doPost(HttpServletRequest request, HttpServletResponse response) 41 | throws ServletException, IOException { 42 | int bookId = Integer.parseInt(request.getParameter("bookId")); 43 | //获得及生成一些需要的对象和数据 44 | HttpSession session = request.getSession(); 45 | User user = (User) session.getAttribute("landing"); 46 | BookDao bd = new BookDaoImpl(); 47 | CommentDaoImpl commentDao=new CommentDaoImpl(); 48 | if(user!=null){ 49 | System.out.println("用户id"+user.getUserId()+"---id:"+bookId); 50 | //查询改用户是否评价过 51 | boolean commentByUid = commentDao.findCommentByUid(bookId, user.getUserId()); 52 | //查询该用户是否购买过当前商品 53 | 54 | System.out.println("改用户是否评价过:"+commentByUid); 55 | request.setAttribute("isComment",commentByUid); 56 | }else{ 57 | request.setAttribute("isComment",null); 58 | } 59 | //是否登录 60 | request.setAttribute("islogin",user!=null?true:false); 61 | //查询该商品最新前10的评价 62 | List comments = commentDao.CommentList(bookId); 63 | System.out.println("是否有评论"); 64 | System.out.println(comments.toString()); 65 | request.setAttribute("bookInfo", bd.findBookById(bookId)); 66 | request.setAttribute("comments", comments); 67 | request.getRequestDispatcher(DETAIL_PATH).forward(request, response); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/com/shine/game/test/Test.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.test; 2 | 3 | import com.shine.game.util.DateUtil; 4 | 5 | /** 6 | * @version 7 | */ 8 | public class Test { 9 | 10 | public static void main(String[] args) { 11 | System.out.println(DateUtil.show()); 12 | 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/com/shine/game/test/Test2.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.test; 2 | /** 3 | * @version 4 | */ 5 | public class Test2 { 6 | 7 | public static void main(String[] args) { 8 | // TODO 自动生成的方法存根 9 | System.out.println((int)(Math.random()*6)); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/com/shine/game/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.util; 2 | 3 | import java.sql.Timestamp; 4 | import java.text.ParseException; 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | 8 | public class DateUtil { 9 | 10 | //按格式输出当前时间方法 11 | public static String show() { 12 | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); 13 | 14 | } 15 | public static Date getDate(String str) { 16 | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); 17 | Date date=null; 18 | try { 19 | date = sdf.parse(str); 20 | } catch (ParseException e) { 21 | e.printStackTrace(); 22 | } 23 | return date; 24 | } 25 | public static Timestamp getTimestamp() { 26 | return Timestamp.valueOf(show()); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/com/shine/game/util/DbUtil.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.util; 2 | 3 | import java.sql.DriverManager; 4 | import java.sql.PreparedStatement; 5 | import java.sql.ResultSet; 6 | import java.sql.ResultSetMetaData; 7 | import java.sql.SQLException; 8 | import java.util.ArrayList; 9 | import java.util.HashMap; 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | import com.mysql.jdbc.Connection; 14 | /** 15 | * 16 | * @author thh 17 | * 数据库工具类 18 | */ 19 | public class DbUtil { 20 | public static String BASE_NAME="dbinfo"; 21 | private static String DB_DRIVER=PropertiesUtil.getValue("DB_DRIVER"); 22 | private static String DB_URL=PropertiesUtil.getValue("DB_URL"); 23 | private static String DB_USERNAME=PropertiesUtil.getValue("DB_USERNAME"); 24 | private static String DB_PASSWORD=PropertiesUtil.getValue("DB_PASSWORD"); 25 | 26 | static{ 27 | try { 28 | Class.forName(DB_DRIVER); 29 | } catch (Exception e) { 30 | System.out.println("*****驱动加载失败*****"); 31 | } 32 | } 33 | 34 | /** 35 | * 36 | * @param sql sql语句(增删改) 37 | * @param obj Object...obj为可变长度参数,可有可无 38 | * @return 返回受影响的行数 (int) 39 | */ 40 | public static int excuteUpdate(String sql,Object...obj) { 41 | int row=0; 42 | Connection con=DbUtil.getConnection(); 43 | PreparedStatement pst=null; 44 | try { 45 | pst=con.prepareStatement(sql); 46 | if(obj!=null&&obj.length>0) { 47 | for(int i=0;i>) 66 | */ 67 | //查询用的方法 68 | public static List> executeQuery(String sql,Object...obj){ 69 | List> list=new ArrayList>(); 70 | Connection con=DbUtil.getConnection(); 71 | PreparedStatement pst=null; 72 | ResultSet rs=null; 73 | try { 74 | pst=con.prepareStatement(sql); 75 | System.out.println(sql); 76 | if(obj!=null&&obj.length>0) { 77 | for(int i=0;i mso=new HashMap(); 89 | for(int i=1;i<=colCount;i++) { 90 | //rsmd.getColumnName(i);获取每列的列名 91 | mso.put(rsmd.getColumnName(i), rs.getObject(i)); 92 | } 93 | list.add(mso); 94 | } 95 | } 96 | } catch (Exception e) { 97 | e.getStackTrace(); 98 | }finally { 99 | dbClose(con, pst, rs); 100 | } 101 | return list; 102 | } 103 | 104 | /** 105 | * 106 | * @return 返回一个Connection连接对象 107 | */ 108 | private static Connection getConnection() { 109 | Connection conn=null; 110 | try { 111 | conn=(Connection) DriverManager.getConnection(DB_URL,DB_USERNAME, DB_PASSWORD); 112 | 113 | } catch (SQLException e) { 114 | System.out.println(DateUtil.show()+">>数据库连接失败!"+e.getMessage()); 115 | } 116 | return conn; 117 | 118 | } 119 | /** 120 | * 121 | * @param conn 要关闭Connection对象 122 | * @param pstm 要关闭PreparedStatement对象 123 | */ 124 | private static void dbClose(Connection conn,PreparedStatement pstm) { 125 | try { 126 | if(conn!=null) { 127 | conn.close(); 128 | } 129 | if(pstm!=null) { 130 | pstm.close(); 131 | } 132 | 133 | } catch (Exception e) { 134 | e.getStackTrace(); 135 | } 136 | } 137 | /** 138 | * 139 | * @param conn 要关闭Connection对象 140 | * @param pstm 要关闭PreparedStatement对象 141 | * @param rs 要关闭ResultSet对象 142 | */ 143 | private static void dbClose(Connection conn,PreparedStatement pstm,ResultSet rs) { 144 | try { 145 | if(conn!=null) { 146 | conn.close(); 147 | } 148 | if(pstm!=null) { 149 | pstm.close(); 150 | } 151 | if(rs!=null) { 152 | rs.close(); 153 | } 154 | } catch (Exception e) { 155 | e.getStackTrace(); 156 | } 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /src/com/shine/game/util/ImageCode.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.util; 2 | 3 | import java.awt.Color; 4 | import java.awt.Font; 5 | import java.awt.Graphics; 6 | import java.awt.image.BufferedImage; 7 | import java.io.FileNotFoundException; 8 | import java.io.IOException; 9 | import java.io.OutputStream; 10 | import java.util.Random; 11 | 12 | import javax.imageio.ImageIO; 13 | 14 | /** 15 | * @version 16 | */ 17 | public class ImageCode { 18 | 19 | private static int fontHeight = 24; 20 | 21 | private static String ver_codes = "0123456789qwertyuiopasdfghjklzxcvbnm"; 22 | 23 | 24 | public static String getImageCode(int w,int h,OutputStream os) { 25 | 26 | StringBuffer randCode=new StringBuffer(); 27 | BufferedImage buffImg=new BufferedImage(w, h,BufferedImage.TYPE_INT_RGB ); 28 | getImages(w, h, 4, randCode, buffImg); 29 | try { 30 | ImageIO.write(buffImg,"jpeg", os); 31 | } catch (IOException e) { 32 | 33 | e.printStackTrace(); 34 | } 35 | 36 | return randCode.toString(); 37 | 38 | } 39 | 40 | 41 | 42 | 43 | 44 | public static void getImages(int w,int h,int codeCount,StringBuffer randCode,BufferedImage buffImg) { 45 | 46 | // Graphics2D gd = buffImg.createGraphics(); 47 | // Graphics2D gd = (Graphics2D) buffImg.getGraphics(); 48 | Graphics gd = buffImg.getGraphics(); 49 | // 创建一个随机数生成器类 50 | Random random = new Random(); 51 | // 将图像填充为 52 | //gd.setColor(Color.WHITE); 53 | gd.setColor(new Color(204, 204, 204)); 54 | gd.fillRect(0, 0, w, h); 55 | 56 | // 随机产生40条干扰线,使图象中的认证码不易被其它程序探测到。 57 | gd.setColor(getRandColor(50, 200)); 58 | for (int i = 0; i < 30; i++) { 59 | int x = random.nextInt(w); 60 | int y = random.nextInt(h); 61 | int xl = random.nextInt(12); 62 | int yl = random.nextInt(12); 63 | gd.drawLine(x, y, x + xl, y + yl); 64 | } 65 | 66 | 67 | 68 | 69 | // 创建字体,字体的大小应该根据图片的高度来定。 70 | Font font = new Font("Fixedsys", Font.BOLD, fontHeight); 71 | // 设置字体。 72 | gd.setFont(font); 73 | 74 | //绘制验证码字符 75 | char[] charArray = ver_codes.toCharArray(); 76 | int red = 0, green = 0, blue = 0; 77 | for (int i = 0; i < codeCount; i++) { 78 | // 产生随机的颜色分量来构造颜色值,这样输出的每位数字的颜色值都将不同。 79 | red = random.nextInt(200); 80 | green = random.nextInt(200); 81 | blue = random.nextInt(200); 82 | 83 | // 用随机产生的颜色将验证码绘制到图像中。 84 | gd.setColor(new Color(red, green, blue)); 85 | 86 | String code =String.valueOf(charArray[random.nextInt(charArray.length)]); 87 | //获取每一位字符绘制到图像中 88 | 89 | gd.drawString(code, (int)(i * w/codeCount),fontHeight-(int)(Math.random()*(h-fontHeight))+ (int)(Math.random()*(h-fontHeight))); 90 | 91 | randCode.append(code); 92 | } 93 | 94 | gd.dispose(); 95 | 96 | } 97 | private static Color getRandColor(int fc, int bc) { 98 | Random random=new Random(); 99 | if (fc > 255) 100 | fc = 255; 101 | if (bc > 255) 102 | bc = 255; 103 | int r = fc + random.nextInt(bc - fc); 104 | int g = fc + random.nextInt(bc - fc); 105 | int b = fc + random.nextInt(bc - fc); 106 | return new Color(r, g, b); 107 | } 108 | 109 | public static void main(String[] args) throws FileNotFoundException { 110 | // OutputStream os=new FileOutputStream("d://123.jpg"); 111 | // System.out.println(getImageCode(120, 40, os)); 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /src/com/shine/game/util/MathUtils.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.util; 2 | 3 | import java.text.DecimalFormat; 4 | 5 | /** 6 | * @version 7 | */ 8 | public class MathUtils { 9 | 10 | public static Double getTwoDouble(Double d) { 11 | String str = new DecimalFormat("#.00").format(d); 12 | return Double.parseDouble(str); 13 | } 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/com/shine/game/util/PropertiesUtil.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.util; 2 | 3 | import java.util.ResourceBundle; 4 | 5 | /** 6 | * 读取dbInfo.properties的参数类 7 | * @author 8 | * 9 | */ 10 | public class PropertiesUtil { 11 | 12 | private static ResourceBundle bundle; 13 | 14 | 15 | 16 | public static String getValue(String key){ 17 | try { 18 | bundle=ResourceBundle.getBundle(DbUtil.BASE_NAME);//这里通过类常量(db文件名)获取资源 19 | } catch (Exception e) { 20 | e.getStackTrace(); 21 | } 22 | 23 | return bundle.getString(key); 24 | } 25 | 26 | 27 | 28 | // public static void main(String[] args) { 29 | // String Driver=PropertiesUtil.getValue("DB_DRIVER"); 30 | // System.out.println(Driver); 31 | // } 32 | 33 | // public static String getValue(String name){ 34 | // Properties p=new Properties(); 35 | // try { 36 | // //查找dbInfo.properties文件。并返回输入流 37 | // InputStream is=PropertiesUtil.class.getResourceAsStream("/dbinfo.properties"); 38 | // p.load(is); 39 | // } catch (IOException e) { 40 | // System.out.println(DateUtil.show()+">>数据库配置文件加载失败!"+e.getMessage()); 41 | // } 42 | // 43 | // return p.getProperty(name); 44 | // } 45 | } 46 | -------------------------------------------------------------------------------- /src/com/shine/game/util/RanUtil.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.util; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | import java.util.UUID; 6 | 7 | public class RanUtil { 8 | 9 | public static String getOrderNum(){ 10 | String date=new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()); 11 | //随机生成uuid唯一识别码,获取hashcode码 12 | int code=UUID.randomUUID().hashCode(); 13 | if(code<0){ 14 | code=-code; 15 | } 16 | String strCode=String.format("%08d",code); 17 | return date+strCode; 18 | 19 | } 20 | 21 | public static String getUUID(){ 22 | 23 | return UUID.randomUUID().toString().replaceAll("-", ""); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/com/shine/game/util/Test.java: -------------------------------------------------------------------------------- 1 | package com.shine.game.util; 2 | 3 | import java.net.MalformedURLException; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | /** 8 | * @version 9 | */ 10 | public class Test { 11 | 12 | public static void main(String[] args) throws MalformedURLException { 13 | // System.out.println(DbUtil.executeQuery("select * from view2")); 14 | //// String uuid=UUID.randomUUID().toString().replaceAll("-", ""); 15 | // 16 | //// System.out.println(RanUtil.getUUID().length()); 17 | // 18 | // File f=new File("images/book/"+RanUtil.getUUID()+".jpg"); 19 | // 20 | // 21 | // System.out.println(f.toURL()); 22 | 23 | // String sql = "insert into book(bookName,catalogId,price,imgId,desc) values(?,?,?,?,?)"; 24 | // System.out.println(DbUtil.excuteUpdate(sql, "sdafs",2,98.9,12,"dsafsda")); 25 | // 26 | String imgIds=""; 27 | String ids="1,6"; 28 | String sql="select imgId from book where bookId in("+ids+")"; 29 | 30 | List> list = DbUtil.executeQuery(sql); 31 | if(list.size()>0) { 32 | for(int i=0;i 2 | 3 | shinebookshop 4 | 5 | index.html 6 | index.jsp 7 | 8 | 9 | maxPageSize 10 | 8 11 | 12 | 13 | ver 14 | v1.01 15 | 16 | 17 | admin 18 | /jsp/admin/index.jsp 19 | 20 | 21 | admin 22 | /admin 23 | 24 | -------------------------------------------------------------------------------- /web/bs/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/bs/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /web/bs/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/bs/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /web/bs/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/bs/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /web/bs/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/bs/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /web/bs/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /web/bs/validform/img/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/bs/validform/img/error.png -------------------------------------------------------------------------------- /web/bs/validform/img/onLoad.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/bs/validform/img/onLoad.gif -------------------------------------------------------------------------------- /web/bs/validform/img/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/bs/validform/img/right.png -------------------------------------------------------------------------------- /web/bs/validform/style.css: -------------------------------------------------------------------------------- 1 | 2 | /*==========以下部分是Validform必须的===========*/ 3 | .Validform_checktip{ 4 | line-height:20px; 5 | height:20px; 6 | overflow:hidden; 7 | color:#999; 8 | font-size:12px; 9 | } 10 | .Validform_right{ 11 | color:#71b83d; 12 | padding-left:20px; 13 | background:url(img/right.png) no-repeat left center; 14 | } 15 | .Validform_wrong{ 16 | color:red; 17 | padding-left:20px; 18 | white-space:nowrap; 19 | background:url(img/error.png) no-repeat left center; 20 | } 21 | .Validform_loading{ 22 | padding-left:20px; 23 | background:url(img/onLoad.gif) no-repeat left center; 24 | } 25 | .Validform_error{ 26 | background-color:#ffe7e7; 27 | } 28 | #Validform_msg{color:#7d8289; font: 12px/1.5 tahoma, arial, \5b8b\4f53, sans-serif; width:280px; -webkit-box-shadow:2px 2px 3px #aaa; -moz-box-shadow:2px 2px 3px #aaa; background:#fff; position:absolute; top:0px; right:50px; z-index:99999; display:none;filter: progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=135, Color='#999999');} 29 | #Validform_msg .iframe{position:absolute; left:0px; top:-1px; z-index:-1;} 30 | #Validform_msg .Validform_title{line-height:25px; height:25px; text-align:left; font-weight:bold; padding:0 8px; color:#fff; position:relative; background-color:#000;} 31 | #Validform_msg a.Validform_close:link,#Validform_msg a.Validform_close:visited{line-height:22px; position:absolute; right:8px; top:0px; color:#fff; text-decoration:none;} 32 | #Validform_msg a.Validform_close:hover{color:#cc0;} 33 | #Validform_msg .Validform_info{padding:8px;border:1px solid #000; border-top:none; text-align:left;} -------------------------------------------------------------------------------- /web/css/admin/adminManage/userList.css: -------------------------------------------------------------------------------- 1 | body{ 2 | margin:0; 3 | padding:0; 4 | background:#eee; 5 | } 6 | .content{ 7 | padding:20px 40px 0 40px; 8 | } 9 | .page-div{ 10 | display: inline-block; 11 | width:110px; 12 | } 13 | .homePage,.prePage,.page-go,.nextPage,.lastPage{ 14 | border-radius:15px; 15 | color:#337ab7; 16 | } 17 | .pager{ 18 | padding:0 20px; 19 | } 20 | 21 | .funbtn{ 22 | margin:10px 0; 23 | } 24 | .funbtn a{ 25 | margin-right:10px; 26 | } 27 | #page-input{ 28 | display:inline-block; 29 | width:60px; 30 | border-radius: 10px; 31 | } -------------------------------------------------------------------------------- /web/css/admin/header.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin:0; 3 | padding:0; 4 | } 5 | 6 | a { 7 | text-decoration:none; 8 | } 9 | 10 | body { 11 | font-family:"Microsoft YaHei"; 12 | } 13 | 14 | .header { 15 | background:#144d63; 16 | color:#fff; 17 | height:60px; 18 | padding:0 20px; 19 | } 20 | 21 | .header .title { 22 | background:url(../../images/logo.png) no-repeat left center; 23 | background-size:50px; 24 | color:#fff; 25 | display:inline-block; 26 | font-size:24px; 27 | height:60px; 28 | line-height:60px; 29 | padding-left:60px; 30 | text-decoration:none; 31 | width:330px; 32 | } 33 | 34 | 35 | .header .adminName { 36 | display:inline-block; 37 | position: absolute; 38 | top:26px; 39 | right:50px; 40 | } 41 | 42 | 43 | .left,.right{ 44 | position:absolute; 45 | top:60px; 46 | overflow: hidden; 47 | } 48 | .left{ 49 | left:0; 50 | bottom:0; 51 | z-index: 1; 52 | } 53 | .right{ 54 | bottom:0; 55 | left:210px; 56 | right:0; 57 | z-index: 2; 58 | } 59 | .dropdown-menu{ 60 | margin:0; 61 | } 62 | -------------------------------------------------------------------------------- /web/css/admin/left.css: -------------------------------------------------------------------------------- 1 | *{ 2 | padding: 0; 3 | margin:0; 4 | } 5 | a{ 6 | text-decoration: none; 7 | } 8 | body{ 9 | font-family: "Microsoft YaHei"; 10 | background:#144d63; 11 | } 12 | .left{ 13 | position: absolute; 14 | left: 0; 15 | top: 30px; 16 | width: 200px; 17 | background:#eee; 18 | display: block; 19 | margin:0 5px; 20 | border-radius: 0 15px 0 0; 21 | } 22 | 23 | .nowTime{ 24 | font-size:16px; 25 | height:30px; 26 | background:#eee; 27 | line-height: 30px; 28 | text-align: center; 29 | color:#d30c2f; 30 | } 31 | 32 | .left ul .list{ 33 | list-style: none; 34 | text-align: center; 35 | border-top:6px #144d63 solid; 36 | 37 | } 38 | .left ul .list a{ 39 | display: block; 40 | width: 100%; 41 | height: 40px; 42 | line-height: 40px; 43 | color: #000; 44 | font-size: 18px; 45 | border-bottom: 1px #144d63 solid; 46 | } 47 | .left .list h3{ 48 | line-height: 40px; 49 | height: 40px; 50 | color:#fff; 51 | font-size: 22px; 52 | background:#144d63; 53 | } 54 | 55 | .left .list h3:hover{ 56 | cursor: pointer; 57 | color:#bc0a6b; 58 | } 59 | .left ul .list a:hover{ 60 | color: #bc0a6b; 61 | background: #ccc; 62 | } -------------------------------------------------------------------------------- /web/css/book/booklist.css: -------------------------------------------------------------------------------- 1 | .wrapper .main h3{ 2 | border-bottom: 1px #ccc solid; 3 | padding:15px; 4 | margin:10px 0; 5 | } 6 | 7 | .wrapper .main .main-left ul li a{ 8 | padding:2px 5px; 9 | display: block; 10 | height:26px; 11 | line-height: 26px; 12 | } 13 | .wrapper .main .main-left ul li a:hover{ 14 | background:rgba(215, 0, 109,0.03); 15 | } 16 | .wrapper .main .pro .pro-list li{ 17 | padding:0 10px 10px 10px; 18 | overflow: hidden; 19 | } 20 | .wrapper .main .pro .pro-list li .list{ 21 | border:1px #eee solid; 22 | padding:5px; 23 | } 24 | .wrapper .main .pro .pro-list li .list:hover{ 25 | background:rgba(215, 0, 109,0.05); 26 | } 27 | .wrapper .main .pro .pro-list li .list a{ 28 | position: relative; 29 | display:block; 30 | overflow: hidden; 31 | } 32 | 33 | .wrapper .main .pro .pro-list li .list .proinfo{ 34 | padding:5px; 35 | 36 | } 37 | .wrapper .main .pro .pro-list li .list .proinfo h2 a{ 38 | display:inline-block; 39 | width:100%; 40 | word-break:keep-all; 41 | white-space:nowrap; 42 | overflow:hidden; 43 | 44 | } 45 | .wrapper .main .pro .pro-list li .list .proinfo p{ 46 | padding:5px; 47 | margin:0; 48 | height:30px; 49 | line-height: 30px; 50 | } 51 | 52 | .wrapper .main .pro .pro-list li .list .proinfo p i{ 53 | color:red; 54 | font-size: 24px; 55 | 56 | } 57 | .wrapper .main .pro .pro-list li .list .proinfo p a{ 58 | display: inline-block; 59 | float:right; 60 | margin-top:5px; 61 | 62 | } 63 | /* 分页样式 */ 64 | .wrapper .pager{ 65 | border-top:1px #eee solid; 66 | padding-top:15px; 67 | } 68 | .wrapper .pager .page-div{ 69 | display: inline-block; 70 | width:110px; 71 | } 72 | .wrapper .homePage,.wrapper .prePage,.wrapper .page-go,.wrapper .nextPage,.lastPage{ 73 | border-radius:15px; 74 | color:#d7006d; 75 | } 76 | 77 | 78 | .wrapper #page-input{ 79 | display:inline-block; 80 | width:60px; 81 | border-radius: 10px; 82 | } 83 | .wrapper .bookImg{ 84 | width:50px; 85 | } 86 | .wrapper .funbtn{ 87 | margin:10px 0; 88 | } 89 | .wrapper .funbtn a{ 90 | margin-right:10px; 91 | } -------------------------------------------------------------------------------- /web/css/book/head_footer.css: -------------------------------------------------------------------------------- 1 | body,a,ul,li{ 2 | margin:0; 3 | padding:0; 4 | color:#555; 5 | font-size: 14px; 6 | } 7 | ul{ 8 | list-style: none; 9 | } 10 | a{ 11 | text-decoration: none; 12 | } 13 | a:hover{ 14 | color:#d7006d; 15 | text-decoration:none; 16 | transition:all 0.2s; 17 | } 18 | 19 | /* head start */ 20 | .head{ 21 | border-bottom: 4px #d7006d solid; 22 | } 23 | .head .top{ 24 | background:#eee; 25 | highet:30px; 26 | line-height: 30px; 27 | } 28 | .head .top .top-right{ 29 | display:inline; 30 | float: right; 31 | } 32 | 33 | .head .mid .logo{ 34 | height:100px; 35 | font-size:38px; 36 | } 37 | .head .mid .logo img{ 38 | height:100px; 39 | } 40 | 41 | .head .mid .search{ 42 | margin-top:35px; 43 | } 44 | 45 | .head .shopcart a{ 46 | display: block; 47 | width:135px; 48 | height:30px; 49 | background:#eee; 50 | font-size: 18px; 51 | padding:5px 15px; 52 | margin-top:35px; 53 | } 54 | .head .shopcart .badge{ 55 | padding:3px 6px; 56 | position:absolute; 57 | top:22px; 58 | left:39px; 59 | z-index: 10; 60 | font-size:14px; 61 | background-color:red; 62 | } 63 | .head .navbar{ 64 | margin:10px 0 0 0; 65 | min-height: 43px; 66 | 67 | } 68 | .head .navbar .nav li{ 69 | border-bottom: 0; 70 | } 71 | .head .navbar .nav a{ 72 | padding:10px 25px; 73 | font-size: 22px; 74 | border-bottom: 2px #fff solid; 75 | 76 | } 77 | .head .navbar .nav li a:hover,.head .navbar .active{ 78 | border-bottom:2px rgb(215, 0, 109) solid; 79 | background:rgba(215, 0, 109,0.1); 80 | } 81 | 82 | 83 | /* footer */ 84 | .footer{ 85 | border-top: 2px solid #d7006d; 86 | margin-top: 30px; 87 | background-color:#fff; 88 | clear: both; 89 | } 90 | .footer_pic_new{ 91 | background-color: #fafafa; 92 | border-bottom:1px solid #ebebeb; 93 | width:100%; 94 | } 95 | .footer_pic_new_inner{ 96 | padding:10px 40px; 97 | } 98 | .public_footer_new{ 99 | text-align:center; 100 | padding:25px 20px 15px; 101 | } 102 | .public_footer_new .footer_sort .f_title{ 103 | font-size: 18px; 104 | font-weight: bold; 105 | line-height: 28px; 106 | } 107 | .public_footer_new .footer_sort li a{ 108 | line-height: 24px; 109 | } 110 | .footer_copyright{ 111 | border-top:1px solid #ebebeb; 112 | padding:30px 0; 113 | } 114 | -------------------------------------------------------------------------------- /web/css/book/index.css: -------------------------------------------------------------------------------- 1 | .wrapper .main h3{ 2 | border-bottom: 1px #ccc solid; 3 | padding:15px; 4 | margin:10px 0; 5 | } 6 | 7 | .wrapper .main .main-left ul li a{ 8 | padding:2px 5px; 9 | display: block; 10 | height:26px; 11 | line-height: 26px; 12 | } 13 | .wrapper .main .main-left ul li a:hover{ 14 | background:rgba(215, 0, 109,0.03); 15 | } 16 | .wrapper .main .pro .pro-list li{ 17 | padding:0 10px 10px 10px; 18 | overflow: hidden; 19 | } 20 | .wrapper .main .pro .pro-list li .list{ 21 | border:1px #eee solid; 22 | padding:5px; 23 | } 24 | .wrapper .main .pro .pro-list li .list:hover{ 25 | background:rgba(215, 0, 109,0.05); 26 | } 27 | .wrapper .main .pro .pro-list li .list a{ 28 | position: relative; 29 | display:block; 30 | overflow: hidden; 31 | } 32 | 33 | .wrapper .main .pro .pro-list li .list .proinfo{ 34 | padding:5px; 35 | 36 | } 37 | .wrapper .main .pro .pro-list li .list .proinfo h2 a{ 38 | display:inline-block; 39 | width:100%; 40 | word-break:keep-all; 41 | white-space:nowrap; 42 | overflow:hidden; 43 | 44 | } 45 | .wrapper .main .pro .pro-list li .list .proinfo p{ 46 | padding:5px; 47 | margin:0; 48 | height:30px; 49 | line-height: 30px; 50 | } 51 | 52 | .wrapper .main .pro .pro-list li .list .proinfo p i{ 53 | color:red; 54 | font-size: 24px; 55 | 56 | } 57 | .wrapper .main .pro .pro-list li .list .proinfo p a{ 58 | display: inline-block; 59 | float:right; 60 | margin-top:5px; 61 | 62 | } 63 | /* 分页样式 */ 64 | .wrapper .pager{ 65 | border-top:1px #eee solid; 66 | padding-top:15px; 67 | } 68 | .wrapper .pager .page-div{ 69 | display: inline-block; 70 | width:110px; 71 | } 72 | .wrapper .homePage,.wrapper .prePage,.wrapper .page-go,.wrapper .nextPage,.lastPage{ 73 | border-radius:15px; 74 | color:#d7006d; 75 | } 76 | 77 | 78 | .wrapper #page-input{ 79 | display:inline-block; 80 | width:60px; 81 | border-radius: 10px; 82 | } 83 | .wrapper .bookImg{ 84 | width:50px; 85 | } 86 | .wrapper .funbtn{ 87 | margin:10px 0; 88 | } 89 | .wrapper .funbtn a{ 90 | margin-right:10px; 91 | } -------------------------------------------------------------------------------- /web/css/book/user_reg_login.css: -------------------------------------------------------------------------------- 1 | .wrapper .title{ 2 | text-align:center; 3 | } 4 | .wrapper{ 5 | margin-top:50px; 6 | } 7 | .wrapper .main{ 8 | width:650px; 9 | } 10 | .wrapper .main ul li a{ 11 | width:200px; 12 | } 13 | .wrapper .main .nav-tabs .active a{ 14 | color:#d7006d; 15 | 16 | } 17 | .wrapper .tab-content{ 18 | padding:30px 20px; 19 | border:1px #ccc solid; 20 | border-top:0; 21 | } 22 | .wrapper .Validform_checktip{ 23 | font-size: 12px; 24 | color:#777; 25 | font-style: italic; 26 | } -------------------------------------------------------------------------------- /web/css/login/login.css: -------------------------------------------------------------------------------- 1 | body, p, div, ul, li, h1, h2, h3, h4, h5, h6 { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | body { 7 | background: url("../../images/login/bg.jpg"); 8 | } 9 | 10 | #login { 11 | width: 400px; 12 | height: 250px; 13 | background: rgba(255, 255, 255, 0.3); 14 | margin: 200px auto 0; 15 | position: relative; 16 | border-radius: 10px; 17 | } 18 | 19 | #title { 20 | text-align: center; 21 | position: absolute; 22 | left: 40px; 23 | right: 0; 24 | top: 70px; 25 | font-size: 36px; 26 | color: #fff; 27 | } 28 | 29 | #login form p { 30 | text-align: center; 31 | } 32 | 33 | #userName { 34 | background: url(../../images/login/user.png) rgba(255, 255, 255, 0.7) 35 | no-repeat; 36 | width: 200px; 37 | height: 30px; 38 | border: solid #ccc 1px; 39 | border-radius: 3px; 40 | padding-left: 32px; 41 | margin-top: 50px; 42 | margin-bottom: 30px; 43 | } 44 | 45 | #passWord { 46 | background: url(../../images/login/pwd.png) rgba(255, 255, 255, 0.7) no-repeat; 47 | width: 200px; 48 | height: 30px; 49 | border: solid #ccc 1px; 50 | border-radius: 3px; 51 | padding-left: 32px; 52 | margin-bottom: 30px; 53 | } 54 | 55 | #submit { 56 | width: 232px; 57 | height: 30px; 58 | background: rgba(255, 255, 255, 0.7); 59 | border: solid #ccc 1px; 60 | border-radius: 3px; 61 | } 62 | 63 | #submit:hover { 64 | cursor: pointer; 65 | background: rgba(75, 81, 123, 0.42); 66 | } -------------------------------------------------------------------------------- /web/images/admin/bk_header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/admin/bk_header.jpg -------------------------------------------------------------------------------- /web/images/book/banner1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/banner1.jpg -------------------------------------------------------------------------------- /web/images/book/banner2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/banner2.jpg -------------------------------------------------------------------------------- /web/images/book/banner3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/banner3.jpg -------------------------------------------------------------------------------- /web/images/book/banner4-oold.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/banner4-oold.jpg -------------------------------------------------------------------------------- /web/images/book/banner4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/banner4.jpg -------------------------------------------------------------------------------- /web/images/book/banner5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/banner5.jpg -------------------------------------------------------------------------------- /web/images/book/bookimg/07e2d4e161ba4dc6829fbc6111247682.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/07e2d4e161ba4dc6829fbc6111247682.png -------------------------------------------------------------------------------- /web/images/book/bookimg/082970b5166748f8a247de63dbaa49f0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/082970b5166748f8a247de63dbaa49f0.png -------------------------------------------------------------------------------- /web/images/book/bookimg/0d60d4d279b848fda9216c7acba3aa04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/0d60d4d279b848fda9216c7acba3aa04.jpg -------------------------------------------------------------------------------- /web/images/book/bookimg/17cdda3d2b7d4c15b406fc7e9ce3c06c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/17cdda3d2b7d4c15b406fc7e9ce3c06c.png -------------------------------------------------------------------------------- /web/images/book/bookimg/25c13e8627a54d63b260b61440148ec8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/25c13e8627a54d63b260b61440148ec8.png -------------------------------------------------------------------------------- /web/images/book/bookimg/59afebc652544489b76a6fcd36394ef7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/59afebc652544489b76a6fcd36394ef7.jpg -------------------------------------------------------------------------------- /web/images/book/bookimg/645ffbe8a9a44ac7b5f46a2f5d56d729.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/645ffbe8a9a44ac7b5f46a2f5d56d729.png -------------------------------------------------------------------------------- /web/images/book/bookimg/6a74d7fc5b1048e88637aa9a2cccc979.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/6a74d7fc5b1048e88637aa9a2cccc979.png -------------------------------------------------------------------------------- /web/images/book/bookimg/6f3acf47d34f47918424c3447cdd6758.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/6f3acf47d34f47918424c3447cdd6758.png -------------------------------------------------------------------------------- /web/images/book/bookimg/79f34b81fbea4032bee2e7fe06fdb783.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/79f34b81fbea4032bee2e7fe06fdb783.jpg -------------------------------------------------------------------------------- /web/images/book/bookimg/7eac259a929d49bb827a2a8a06086ded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/7eac259a929d49bb827a2a8a06086ded.png -------------------------------------------------------------------------------- /web/images/book/bookimg/837d9114183942c7ac1b5f6224d6c2e8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/837d9114183942c7ac1b5f6224d6c2e8.jpg -------------------------------------------------------------------------------- /web/images/book/bookimg/b77d4a0448b14dc4850058e16aca3c56.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/b77d4a0448b14dc4850058e16aca3c56.png -------------------------------------------------------------------------------- /web/images/book/bookimg/cc383864c2fe469e9496ea238a442a42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/cc383864c2fe469e9496ea238a442a42.png -------------------------------------------------------------------------------- /web/images/book/bookimg/ccd90fd7d27646efb1e81e6451466cc6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/ccd90fd7d27646efb1e81e6451466cc6.png -------------------------------------------------------------------------------- /web/images/book/bookimg/d5394d4d13b34628a7170ca5b14f2bce.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/d5394d4d13b34628a7170ca5b14f2bce.jpg -------------------------------------------------------------------------------- /web/images/book/bookimg/ee70dcea8135427183ccbd4ce64f95fe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/ee70dcea8135427183ccbd4ce64f95fe.jpg -------------------------------------------------------------------------------- /web/images/book/bookimg/f469505d78a04ffbb6c70915dc8800ae.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/f469505d78a04ffbb6c70915dc8800ae.png -------------------------------------------------------------------------------- /web/images/book/bookimg/fcf76cbd056842f48f949e38ab59a073.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/bookimg/fcf76cbd056842f48f949e38ab59a073.jpg -------------------------------------------------------------------------------- /web/images/book/corr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/corr.png -------------------------------------------------------------------------------- /web/images/book/footer_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/footer_bg.png -------------------------------------------------------------------------------- /web/images/book/footer_bg_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/footer_bg_01.png -------------------------------------------------------------------------------- /web/images/book/footer_bg_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/footer_bg_02.png -------------------------------------------------------------------------------- /web/images/book/footer_bg_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/footer_bg_03.png -------------------------------------------------------------------------------- /web/images/book/footer_bg_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/footer_bg_04.png -------------------------------------------------------------------------------- /web/images/book/noneImg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/noneImg.jpg -------------------------------------------------------------------------------- /web/images/book/testimg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/testimg.jpg -------------------------------------------------------------------------------- /web/images/book/validate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/book/validate.gif -------------------------------------------------------------------------------- /web/images/login/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/login/bg.jpg -------------------------------------------------------------------------------- /web/images/login/pwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/login/pwd.png -------------------------------------------------------------------------------- /web/images/login/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/login/user.png -------------------------------------------------------------------------------- /web/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GameProductTradingManagementSystem/77a19f60ab9088a6e1b0d7745142de19d82a6186/web/images/logo.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 入口 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /web/index.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: Administrator 4 | Date: 2020/6/4 5 | Time: 20:11 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | $Title$ 12 | 13 | 14 | $END$ 15 | 16 | 17 | -------------------------------------------------------------------------------- /web/js/admin/adminManage/adminAdd.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var form=$("#myForm").Validform({ 3 | tiptype:2,//validform初始化 4 | }); 5 | 6 | form.addRule([ 7 | { 8 | ele:"#userName", 9 | datatype:"/^[a-zA-Z]{1}[a-zA-Z0-9]{3,7}$/", 10 | ajaxurl:"jsp/admin/AdminManageServlet?action=find", 11 | nullmsg:"请输入用户名!", 12 | errormsg:"用户名以字母开头,4-8个字符,请重新输入!" 13 | }, 14 | { 15 | ele:"#passWord", 16 | datatype:"s4-8", 17 | nullmsg:"请输入密码", 18 | errormsg:"密码为4~8位字符,请重新输入!" 19 | }, 20 | { 21 | ele:"#c_passWord", 22 | datatype:"*", 23 | recheck:"passWord", 24 | mullmsg:"请输入确认密码!", 25 | errormsg:"两次输入的密码不一致,请重新输入!" 26 | }, 27 | { 28 | ele:"#name", 29 | datatype:"s2-8", 30 | mullmsg:"请输入姓名!", 31 | errormsg:"姓名为2~8位字符,请重新输入!" 32 | } 33 | ]); 34 | 35 | }); 36 | 37 | 38 | 39 | ////ajax实时判断用户存在否 40 | //var oldErr; 41 | //var xmlHttp; 42 | //var flag=true;//标记 43 | //function ck_username(){ 44 | // xmlHttp=getXmlHttp(); 45 | // 46 | // //用户名验证4-8位大小写字母和数字 47 | // 48 | // if($("#userName").val()==null){ 49 | // return; 50 | // } 51 | // 52 | // var url="UserServlet?action=find&userName="+$("#userName").val(); 53 | // xmlHttp.open("GET",url,true); 54 | // xmlHttp.onreadystatechange=function(){ 55 | // if(xmlHttp.readyState==4 && xmlHttp.status==200){ 56 | // var json=JSON.parse(xmlHttp.responseText); 57 | // var info=json['info']; 58 | // if(info==0){ 59 | // oldErr=$(".ckerr").eq(0).html("*用户名已存在!请重新输入!").css("color","red"); 60 | // flag=true; 61 | // }else{ 62 | // if(oldErr!=null){ 63 | // oldErr.html("√ 正确").css("color","green"); 64 | // flag=false; 65 | // } 66 | // } 67 | // } 68 | // } 69 | // xmlHttp.send(null); 70 | // } 71 | // 72 | // 73 | // 74 | //function getXmlHttp(){ 75 | // var xHttp; 76 | // if(window.XMLHttpRequest){ 77 | // xHttp=new XMLHttpRequest(); 78 | // } 79 | // if(window.ActiveXObject){ 80 | // xHttp=new ActiveXObject("Microsoft.XMLHttp"); 81 | // } 82 | // return xHttp; 83 | //} 84 | // 85 | // 86 | // 87 | // 88 | //function checkAdd(){ 89 | // //拦截用户存在还提交 90 | // if(flag){ 91 | // $("#userName").focus(); 92 | // return false; 93 | // } 94 | // if(oldErr!=null){ 95 | // oldErr.html("√ 正确").css("color","green"); 96 | // } 97 | // 98 | // //用户名验证4-8位大小写字母和数字 99 | // var reg=/^[a-zA-Z]{1}[a-zA-Z0-9]{3,7}$/; 100 | // if(!reg.test($("#userName").val())){ 101 | // $("#userName").focus(); 102 | // oldErr=$(".ckerr").eq(0).html("*用户名以字母开头的4~8位字母数字组成,请重新输入!").css("color","red"); 103 | // return false; 104 | // } 105 | // 106 | // //密码验证4-8位单字符 107 | // reg=/^(\w){4,8}$/; 108 | // if(!reg.test($("#passWord").val())){ 109 | // $("#passWord").focus(); 110 | // oldErr=$(".ckerr").eq(1).html("*密码为4~8位字符,请重新输入!").css("color","red"); 111 | // return false; 112 | // } 113 | // if($("#passWord_ck").val()!=$("#passWord").val()){ 114 | // $("#passWord_ck").focus(); 115 | // oldErr=$(".ckerr").eq(2).html("*两次密码不一致,请重新输入!").css("color","red"); 116 | // return false; 117 | // } 118 | // //姓名验证2-8位 119 | // namelen=$("#name").val().length; 120 | // if(namelen<2 && namelen>8){ 121 | // $("#name").focus(); 122 | // oldErr=$(".ckerr").eq(3).html("*姓名为2~8位,请重新输入!").css("color","red"); 123 | // return false; 124 | // } 125 | // 126 | // return true; 127 | //} 128 | // -------------------------------------------------------------------------------- /web/js/admin/adminManage/adminEdit.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var form=$("#myForm").Validform({ 3 | tiptype:2,//validform初始化 4 | }); 5 | form.addRule([ 6 | { 7 | ele:"#passWord", 8 | datatype:"s4-8", 9 | nullmsg:"请输入密码", 10 | errormsg:"密码为4~8位字符,请重新输入!" 11 | }, 12 | { 13 | ele:"#c_passWord", 14 | datatype:"*", 15 | recheck:"passWord", 16 | mullmsg:"请输入确认密码!", 17 | errormsg:"两次输入的密码不一致,请重新输入!" 18 | }, 19 | { 20 | ele:"#name", 21 | datatype:"s2-8", 22 | mullmsg:"请输入姓名!", 23 | errormsg:"姓名为2~8位字符,请重新输入!" 24 | } 25 | ]); 26 | 27 | }); 28 | 29 | -------------------------------------------------------------------------------- /web/js/admin/bookManage/bookAdd.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var form=$("#bookAddForm").Validform({ 3 | tiptype:2,//validform初始化 4 | }); 5 | 6 | form.addRule([ 7 | { 8 | ele:"#bookName", 9 | datatype:"*2-32", 10 | //ajaxurl:"jsp/admin/BookManageServlet?action=find", 11 | nullmsg:"请输入饰品名称!", 12 | errormsg:"饰品名称至少2个字符,最多32个字符!" 13 | }, 14 | { 15 | ele:"#catalog", 16 | datatype:"*", 17 | nullmsg:"请选择饰品分类!", 18 | errormsg:"请选择饰品分类!" 19 | }, 20 | { 21 | ele:"#price", 22 | datatype:"/^[0-9]{1,}([.][0-9]{1,2})?$/", 23 | mullmsg:"价格不能为空!", 24 | errormsg:"价格只能为数字" 25 | }, 26 | { 27 | ele:"#author", 28 | datatype:"*2-30", 29 | nullmsg:"请输入品质名称!", 30 | errormsg:"品质名称至少2个字符,最多30个字符!" 31 | }, 32 | { 33 | ele:"#press", 34 | datatype:"*2-30", 35 | nullmsg:"请输入类别!", 36 | errormsg:"类别至少2个字符,最多30个字符!" 37 | }, 38 | { 39 | ele:"#bookImg", 40 | datatype:"*", 41 | nullmsg:"请上传饰品图片!", 42 | errormsg:"请上传饰品图片!" 43 | } 44 | 45 | ]); 46 | 47 | }); 48 | 49 | 50 | 51 | ////ajax实时判断用户存在否 52 | //var oldErr; 53 | //var xmlHttp; 54 | //var flag=true;//标记 55 | //function ck_username(){ 56 | // xmlHttp=getXmlHttp(); 57 | // 58 | // //用户名验证4-8位大小写字母和数字 59 | // 60 | // if($("#userName").val()==null){ 61 | // return; 62 | // } 63 | // 64 | // var url="UserServlet?action=find&userName="+$("#userName").val(); 65 | // xmlHttp.open("GET",url,true); 66 | // xmlHttp.onreadystatechange=function(){ 67 | // if(xmlHttp.readyState==4 && xmlHttp.status==200){ 68 | // var json=JSON.parse(xmlHttp.responseText); 69 | // var info=json['info']; 70 | // if(info==0){ 71 | // oldErr=$(".ckerr").eq(0).html("*用户名已存在!请重新输入!").css("color","red"); 72 | // flag=true; 73 | // }else{ 74 | // if(oldErr!=null){ 75 | // oldErr.html("√ 正确").css("color","green"); 76 | // flag=false; 77 | // } 78 | // } 79 | // } 80 | // } 81 | // xmlHttp.send(null); 82 | // } 83 | // 84 | // 85 | // 86 | //function getXmlHttp(){ 87 | // var xHttp; 88 | // if(window.XMLHttpRequest){ 89 | // xHttp=new XMLHttpRequest(); 90 | // } 91 | // if(window.ActiveXObject){ 92 | // xHttp=new ActiveXObject("Microsoft.XMLHttp"); 93 | // } 94 | // return xHttp; 95 | //} 96 | // 97 | // 98 | -------------------------------------------------------------------------------- /web/js/admin/userManage/userAdd.js: -------------------------------------------------------------------------------- 1 | //注册表单验证 2 | $(function(){ 3 | var form=$("#myForm").Validform({ 4 | tiptype:2,//validform初始化 5 | }); 6 | 7 | form.addRule([ 8 | { 9 | ele:"#userName", 10 | datatype:"*2-15", 11 | ajaxurl:"jsp/admin/UserManageServlet?action=find", 12 | nullmsg:"*请输入用户名!", 13 | errormsg:"*用户名为2-15个字符,请重新输入!" 14 | }, 15 | { 16 | ele:"#passWord", 17 | datatype:"*4-8", 18 | nullmsg:"*请输入密码!", 19 | errormsg:"*密码为4-8位字符,请重新输入" 20 | }, 21 | { 22 | ele:"#c_passWord", 23 | datatype:"*", 24 | recheck:"passWord", 25 | mullmsg:"*请输入确认密码!", 26 | errormsg:"*两次输入的密码不一致,请重新输入!" 27 | }, 28 | { 29 | ele:"#name", 30 | datatype:"*2-15", 31 | nullmsg:"请输入姓名!", 32 | errormsg:"姓名为2-15个字符,请重新输入!" 33 | }, 34 | { 35 | ele:"#sex", 36 | datatype:"*", 37 | nullmsg:"请选择性别!", 38 | errormsg:"请选择性别!" 39 | }, 40 | { 41 | ele:"#age", 42 | datatype:"n1-2", 43 | nullmsg:"请输入年龄", 44 | errormsg:"年龄为1-2位数字,请重新输入!" 45 | }, 46 | { 47 | ele:"#tell", 48 | datatype:"/^13[0-9]{9}$|17[0-9]{9}$|14[0-9]{9}&|15[0-9]{9}$|18[0-9]{9}$/", 49 | nullmsg:"请输入电话号码", 50 | errormsg:"电话号码输入不正确,请重新输入!" 51 | }, 52 | { 53 | ele:"#address", 54 | datatype:"*1-100", 55 | nullmsg:"请输入地址!", 56 | errormsg:"请输入地址长度过长(100)!" 57 | } 58 | 59 | ]); 60 | 61 | }); -------------------------------------------------------------------------------- /web/js/admin/userManage/userEdit.js: -------------------------------------------------------------------------------- 1 | //注册表单验证 2 | $(function(){ 3 | var form=$("#myForm").Validform({ 4 | tiptype:2,//validform初始化 5 | }); 6 | 7 | form.addRule([ 8 | 9 | { 10 | ele:"#passWord", 11 | datatype:"*4-8", 12 | nullmsg:"*请输入密码!", 13 | errormsg:"*密码为4-8位字符,请重新输入" 14 | }, 15 | { 16 | ele:"#c_passWord", 17 | datatype:"*", 18 | recheck:"passWord", 19 | mullmsg:"*请输入确认密码!", 20 | errormsg:"*两次输入的密码不一致,请重新输入!" 21 | }, 22 | { 23 | ele:"#name", 24 | datatype:"*2-15", 25 | nullmsg:"请输入姓名!", 26 | errormsg:"姓名为2-15个字符,请重新输入!" 27 | }, 28 | { 29 | ele:"#sex", 30 | datatype:"*", 31 | nullmsg:"请选择性别!", 32 | errormsg:"请选择性别!" 33 | }, 34 | { 35 | ele:"#age", 36 | datatype:"n1-2", 37 | nullmsg:"请输入年龄", 38 | errormsg:"年龄为1-2位数字,请重新输入!" 39 | }, 40 | { 41 | ele:"#tell", 42 | datatype:"/^13[0-9]{9}$|17[0-9]{9}$|14[0-9]{9}&|15[0-9]{9}$|18[0-9]{9}$/", 43 | nullmsg:"请输入电话号码", 44 | errormsg:"电话号码输入不正确,请重新输入!" 45 | }, 46 | { 47 | ele:"#address", 48 | datatype:"*1-100", 49 | nullmsg:"请输入地址!", 50 | errormsg:"请输入地址长度过长(100)!" 51 | } 52 | 53 | ]); 54 | 55 | }); -------------------------------------------------------------------------------- /web/js/book/addcart.js: -------------------------------------------------------------------------------- 1 | function addToCart(bookId){ 2 | $.ajax({ 3 | url:"CartServlet?action=add", 4 | dataType:"json", 5 | async:true, 6 | data:{"bookId":bookId}, 7 | type:"POST", 8 | success:function(data){ 9 | $("#cart .num").html(data); 10 | } 11 | 12 | }) 13 | } 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /web/js/book/getCatalog.js: -------------------------------------------------------------------------------- 1 | $.ajax({ 2 | url:"GetCatalog", 3 | dataType:"json", 4 | async:true, 5 | data:{}, 6 | type:"POST", 7 | success:function(data){ 8 | //分类信息 9 | if(data.catalog!=null){ 10 | $.each(data.catalog,function(i,n){ 11 | $("#catalog-list").append("
  • "+n.catalogName+"("+n.catalogSize+")
  • "); 12 | }) 13 | } 14 | 15 | } 16 | 17 | }) 18 | 19 | 20 | -------------------------------------------------------------------------------- /web/js/book/index.js: -------------------------------------------------------------------------------- 1 | $.ajax({ 2 | url:"ShopIndex", 3 | dataType:"json", 4 | async:true, 5 | data:{}, 6 | type:"POST", 7 | success:function(data){ 8 | datalist(data); 9 | } 10 | 11 | }) 12 | 13 | function datalist(data){ 14 | 15 | 16 | //推荐书籍 17 | if(data.recBooks!=null){ 18 | $.each(data.recBooks,function(i,n){ 19 | var tag="
  • " + 20 | ""+ 21 | "

    "+n.bookName+"

    "+ 22 | "

    ¥"+n.price+"加入购物车

  • "; 24 | 25 | $("#recBooks ul").append(tag); 26 | }) 27 | } 28 | 29 | //新增加的书 30 | if(data.newBooks!=null){ 31 | $.each(data.newBooks,function(i,n){ 32 | var tag="
  • " + 33 | ""+ 34 | "

    "+n.bookName+"

    "+ 35 | "

    ¥"+n.price+"加入购物车

  • "; 37 | 38 | $("#newBooks ul").append(tag); 39 | 40 | }) 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /web/js/book/landing.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | $(".adminName").mouseover(function(){ 3 | $(".dropdown-menu").css("display","inline-block"); 4 | }) 5 | $(".adminName").mouseout(function(){ 6 | $(".dropdown-menu").css("display","none"); 7 | }) 8 | }) -------------------------------------------------------------------------------- /web/js/book/user_reg_login.js: -------------------------------------------------------------------------------- 1 | //注册表单验证 2 | $(function(){ 3 | var form=$("#regForm").Validform({ 4 | tiptype:2,//validform初始化 5 | }); 6 | 7 | form.addRule([ 8 | { 9 | ele:"#userName", 10 | datatype:"*2-15", 11 | ajaxurl:"", 12 | nullmsg:"*请输入用户名!", 13 | errormsg:"*用户名为2-15个字符,请重新输入!" 14 | }, 15 | { 16 | ele:"#passWord", 17 | datatype:"*4-8", 18 | nullmsg:"*请输入密码!", 19 | errormsg:"*密码为4-8位字符,请重新输入" 20 | }, 21 | { 22 | ele:"#c_passWord", 23 | datatype:"*", 24 | recheck:"passWord", 25 | mullmsg:"*请输入确认密码!", 26 | errormsg:"*两次输入的密码不一致,请重新输入!" 27 | }, 28 | { 29 | ele:"#name", 30 | datatype:"*2-15", 31 | nullmsg:"请输入姓名!", 32 | errormsg:"姓名为2-15个字符,请重新输入!" 33 | }, 34 | { 35 | ele:"#sex", 36 | datatype:"*", 37 | nullmsg:"请选择性别!", 38 | errormsg:"请选择性别!" 39 | }, 40 | { 41 | ele:"#age", 42 | datatype:"n1-2", 43 | nullmsg:"请输入年龄", 44 | errormsg:"年龄为1-2位数字,请重新输入!" 45 | }, 46 | { 47 | ele:"#tell", 48 | datatype:"/^13[0-9]{9}$|17[0-9]{9}$|14[0-9]{9}&|15[0-9]{9}$|18[0-9]{9}$/", 49 | nullmsg:"请输入电话号码", 50 | errormsg:"电话号码输入不正确,请重新输入!" 51 | }, 52 | { 53 | ele:"#address", 54 | datatype:"*", 55 | nullmsg:"请输入地址!", 56 | errormsg:"请输入地址!" 57 | } 58 | 59 | ]); 60 | 61 | }); 62 | 63 | //登录验证 64 | $(function(){ 65 | 66 | var form=$("#loginForm").Validform({ 67 | tiptype:3 68 | }); 69 | 70 | form.addRule([ 71 | { 72 | ele:"#l_userName", 73 | datatype:"*", 74 | nullmsg:"*请输入用户名!", 75 | errormsg:"*用户名输入不正确,请重新输入!" 76 | }, 77 | { 78 | ele:"#l_passWord", 79 | datatype:"*", 80 | nullmsg:"*请输入密码!", 81 | errormsg:"*密码输入不正确,请重新输入" 82 | }, 83 | { 84 | ele:"#ck_code", 85 | datatype:"*", 86 | ajaxurl:"CodeServlet?action=ckCode", 87 | nullmsg:"*请输入验证码!", 88 | errormsg:"*验证码输入不正确" 89 | } 90 | 91 | ]); 92 | 93 | }); 94 | -------------------------------------------------------------------------------- /web/jsp/admin/adminManage/adminAdd.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 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 7 | %> 8 | 9 | 10 | 11 | 12 | 13 | 用户增加 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 28 | 29 | 30 |

    ${adminMessage}

    31 |
    32 |
    33 | 34 |

    用户增加

    35 |
    36 |
    37 | 38 |
    39 | 40 |
    41 |
    42 | 用户名以字母开头,4-8个字符 43 |
    44 |
    45 |
    46 | 47 |
    48 | 49 |
    50 |
    51 | 密码为4~8位字符 52 |
    53 |
    54 |
    55 | 56 |
    57 | 58 |
    59 |
    60 | 61 |
    62 |
    63 |
    64 | 65 |
    66 | 67 |
    68 |
    69 | 姓名为2~8位字符 70 |
    71 |
    72 | 73 |
    74 | 77 | 80 | 81 |
    82 |
    83 |
    84 | 85 | -------------------------------------------------------------------------------- /web/jsp/admin/adminManage/adminEdit.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 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 7 | %> 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |

    ${adminMessage}

    22 |
    23 |
    24 |

    用户修改

    25 |
    26 | 27 |
    28 | 29 |
    30 | ${adminInfo.userName} 31 |
    32 |
    33 |
    34 | 35 |
    36 | 37 |
    38 |
    39 | 密码为4~8位字符 40 |
    41 |
    42 |
    43 | 44 |
    45 | 46 |
    47 |
    48 | 49 |
    50 |
    51 |
    52 | 53 |
    54 | 55 |
    56 |
    57 | 姓名为2~8位字符 58 |
    59 |
    60 |
    61 | 64 | 67 |
    68 |
    69 |
    70 | 71 | -------------------------------------------------------------------------------- /web/jsp/admin/bookManage/bookAdd.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 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 7 | %> 8 | 9 | 10 | 11 | 12 | 13 | 饰品增加 14 | 15 | 16 | 17 | 18 | 19 | 26 | 27 | 28 |
    29 | 30 |

    ${bookMessage}

    31 |
    32 |

    饰品增加

    33 |
    34 |
    35 | 36 |
    37 | 38 |
    39 |
    40 |
    41 |
    42 | 43 |
    44 | 52 |
    53 |
    54 |
    55 |
    56 | 57 |
    58 | 59 |
    60 |
    61 |
    62 |
    63 | 64 |
    65 | 66 |
    67 |
    68 |
    69 |
    70 | 71 |
    72 | 73 |
    74 |
    75 |
    76 |
    77 | 78 |
    79 | 80 |
    81 |
    82 |
    83 | 84 |
    85 | 86 |
    87 | 88 |
    89 |
    *选填
    90 |
    91 |
    92 | 95 | 98 | 99 |
    100 | 101 |
    102 | 103 |
    104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /web/jsp/admin/bookManage/bookDetail.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 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> 5 | 6 | <% 7 | String path = request.getContextPath(); 8 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 9 | %> 10 | 11 | 12 | 13 | 14 | 15 | 饰品详情页 16 | 17 | 30 | 31 | 32 |

    饰品详情

    33 |
    34 |
    35 |
    饰品id
    36 |
    ${bookInfo.bookId}
    37 |
    38 |
    39 |
    饰品名称
    40 |
    ${bookInfo.bookName}
    41 |
    42 |
    43 |
    饰品分类
    44 |
    ${bookInfo.catalog.catalogName}
    45 |
    46 |
    47 |
    饰品品质
    48 |
    ${bookInfo.author}
    49 |
    50 |
    51 |
    类别
    52 |
    ${bookInfo.press}
    53 |
    54 |
    55 |
    饰品价格
    56 |
    ¥${bookInfo.price}
    57 |
    58 |
    59 |
    上架日期
    60 |
    61 | 62 |
    63 |
    64 |
    65 |
    饰品简介
    66 |
    ${bookInfo.description}
    67 |
    68 |
    69 | 70 |
    71 | 72 |
    73 | 74 | 75 | -------------------------------------------------------------------------------- /web/jsp/admin/bookManage/catalogAdd.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 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 7 | %> 8 | 9 | 10 | 11 | 12 | 13 | 增加分类 14 | 15 | 16 | 17 | 18 | 28 | 45 | 46 | 47 |
    48 | 49 |

    ${catalogMessage}

    50 |
    51 |

    增加饰品分类

    52 |
    53 |
    54 | 55 |
    56 | 57 |
    58 |
    59 |
    60 |
    61 | 64 | 67 | 68 |
    69 | 70 |
    71 | 72 |
    73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /web/jsp/admin/bookManage/catalogEdit.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 | String path = request.getContextPath(); 6 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; 7 | %> 8 | 9 | 10 | 11 | 12 | 13 | 增加分类 14 | 15 | 16 | 17 | 18 | 29 | 45 | 46 | 47 |
    48 | 49 |

    ${catalogMessage}

    50 |
    51 |

    增加饰品分类

    52 |
    53 | 54 | 55 |
    56 | 57 |
    58 | 60 |
    61 |
    62 |
    63 |
    64 | 67 | 70 | 71 |
    72 | 73 |
    74 | 75 |
    76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /web/jsp/admin/commentManage/commentEdit.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 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 7 | %> 8 | 9 | 10 | 11 | 12 | 用户修改 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |

    ${userMessage}

    23 |
    24 |
    25 |

    用户修改

    26 |
    27 | 28 | 42 | 43 | 55 | 65 | 71 | 72 |
    73 | 76 | 79 |
    80 |
    81 |
    82 | 83 | 84 | -------------------------------------------------------------------------------- /web/jsp/admin/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <% 4 | String path = request.getContextPath(); 5 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 6 | %> 7 | 8 | 9 | 10 | 11 | 12 | 主页 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 |
    24 | CSGO游戏交易后台管理系统 25 |
    26 | 29 | 32 |
    33 | 34 |
    35 |
    36 | 37 |
    38 |
    39 | 40 |
    41 | 42 | 43 | 51 | 52 | -------------------------------------------------------------------------------- /web/jsp/admin/left.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <% 4 | String path = request.getContextPath(); 5 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 6 | %> 7 | 8 | 9 | 10 | 11 | 12 | 在此处插入标题 13 | 14 | 15 | 16 | 17 |
    18 |
    19 | 45 |
    46 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /web/jsp/admin/login.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.List"%> 2 | <%@ page language="java" contentType="text/html; charset=UTF-8" 3 | pageEncoding="UTF-8"%> 4 | <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 5 | <% 6 | String path = request.getContextPath(); 7 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 8 | + path + "/"; 9 | %> 10 | 11 | 12 | 13 | 14 | 15 | 网上书店登录 16 | 17 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | 43 | 44 | 45 |

    46 | CSGO游戏交易后台管理系统 <%=application.getInitParameter("ver")%> 47 |

    48 |
    49 |
    51 |

    52 | 53 |

    54 |

    55 | 57 |

    58 |

    59 | 60 |

    61 |
    62 |
    63 | 64 | 65 | -------------------------------------------------------------------------------- /web/jsp/admin/main.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <% 4 | String path = request.getContextPath(); 5 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 6 | %> 7 | 8 | 9 | 10 | 11 | 12 | main 13 | 31 | 32 | 33 |

    欢迎-${adminUser.name}-登陆CSGO游戏交易后台管理系统

    34 | 35 | 36 | -------------------------------------------------------------------------------- /web/jsp/admin/onlineUser.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.Set"%> 2 | <%@page import="java.util.Map"%> 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 | String path = request.getContextPath(); 8 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 9 | %> 10 | 11 | 12 | 13 | 14 | 15 | 在线用户管理界面† 16 | 24 | 25 | 26 |

    在线用户列表

    27 |
    28 | 29 | 30 | ${i}, 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /web/jsp/admin/orderManage/orderDetail.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 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 7 | %> 8 | 9 | 10 | 11 | 12 | 13 | 饰品详情页 14 | 15 | 28 | 29 | 30 |

    订单详情

    31 |
    32 |
    33 |
    订单号
    34 |
    ${order.orderNum}
    35 |
    36 |
    37 |
    客户id
    38 |
    ${order.userId}
    39 |
    40 |
    41 |
    客户姓名
    42 |
    ${order.user.name}
    43 |
    44 |
    45 |
    寄送地址
    46 |
    ${order.user.address}
    47 |
    48 |
    49 |
    联系方式
    50 |
    ${order.user.tell}
    51 |
    52 |
    53 |
    订单状态
    54 |
    55 | 已提交 56 | 已发货 57 | 已完成 58 |
    59 |
    60 |
    61 |
    订单商品信息
    62 |
    63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 |
     单价数量金额
    74 |
    75 |

    ${i.book.bookName}

    76 |

    ${i.book.author}

    77 |

    ${i.book.press}

    78 |
    79 |
    ${i.book.price}${i.quantity}¥${order.money } 
    93 | 94 |
    95 |
    96 | 97 | 98 | 99 |
    100 | 101 | 102 | -------------------------------------------------------------------------------- /web/jsp/admin/orderManage/orderOp.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 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 7 | pageContext.setAttribute("basePath", basePath); 8 | %> 9 | 10 | 11 | 12 | 13 | 14 | 订单列表界面 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | 25 |

    ${orderMessage}

    26 |
    27 |

    待处理订单列表

    28 |
    29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 54 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |
    订单编号订单号用户id订单日期金额订单状态操作
    ${i.orderId}${i.orderNum}${i.userId}${i.orderDate}${i.money} 50 | 已提交 51 | 已发货 52 | 已完成 53 | 55 | 详情 56 | 发货 57 |

    当前无更多订单信息

    68 | 69 |
      70 |
    • 71 |
    • 72 |
    • 总共 ${pageBean.pageCount} 页 | 当前 ${pageBean.curPage} 页
    • 73 |
    • 74 | 跳转到 75 |
      76 | 77 | 78 | 79 | 80 |
      81 |
    • 82 |
    • 83 |
    • 84 |
    85 |
    86 | 138 | 139 | -------------------------------------------------------------------------------- /web/jsp/admin/orderManage/orderlist.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 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 7 | pageContext.setAttribute("basePath", basePath); 8 | %> 9 | 10 | 11 | 12 | 13 | 14 | 订单列表界面 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | 25 |

    ${orderMessage}

    26 |
    27 |

    全部订单列表

    28 |
    29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 54 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 |
    订单编号订单号用户id订单日期金额订单状态操作
    ${i.orderId}${i.orderNum}${i.userId}${i.orderDate}${i.money} 50 | 已提交 51 | 已发货 52 | 已完成 53 | 55 | 详情 56 |

    当前无更多订单信息

    67 | 68 |
      69 |
    • 70 |
    • 71 |
    • 总共 ${pageBean.pageCount} 页 | 当前 ${pageBean.curPage} 页
    • 72 |
    • 73 | 跳转到 74 |
      75 | 76 | 77 | 78 | 79 |
      80 |
    • 81 |
    • 82 |
    • 83 |
    84 |
    85 | 137 | 138 | -------------------------------------------------------------------------------- /web/jsp/admin/userManage/userAdd.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 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 7 | %> 8 | 9 | 10 | 11 | 12 | 13 | 用户增加 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 28 | 29 | 30 |

    ${userMessage}

    31 |
    32 |
    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 |
    62 |
    63 |
    64 | 65 |
    66 | 67 |
    68 |
    69 | *必填 70 |
    71 |
    72 |
    73 | 74 |
    75 | 78 | 81 |
    82 | 83 |
    84 |
    85 | 86 |
    87 | 88 |
    89 |
    90 | *必填 91 |
    92 |
    93 |
    94 | 95 |
    96 | 97 |
    98 |
    99 | *必填 100 |
    101 |
    102 |
    103 | 104 |
    105 | 106 |
    107 |
    108 | *必填 109 |
    110 |
    111 |
    112 | 115 | 118 |
    119 |
    120 |
    121 | 122 | -------------------------------------------------------------------------------- /web/jsp/admin/userManage/userDetail.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 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 7 | %> 8 | 9 | 10 | 11 | 12 | 13 | 饰品详情页 14 | 15 | 28 | 29 | 30 |

    用户详情

    31 |
    32 |
    33 |
    用户编号
    34 |
    ${userInfo.userId}
    35 |
    36 |
    37 |
    用户名
    38 |
    ${userInfo.userName}
    39 |
    40 |
    41 |
    用户密码
    42 |
    ${userInfo.userPassWord}
    43 |
    44 |
    45 |
    姓名
    46 |
    ${userInfo.name}
    47 |
    48 |
    49 |
    性别
    50 |
    ${userInfo.sex}
    51 |
    52 |
    53 |
    年龄
    54 |
    ¥${userInfo.age}
    55 |
    56 |
    57 |
    电话
    58 |
    ${userInfo.tell}
    59 |
    60 |
    61 |
    地址
    62 |
    ${userInfo.address}
    63 |
    64 |
    65 |
    启用状态
    66 |
    67 | 68 | 69 | 启用 70 | 71 | 72 | 禁用 73 | 74 | 75 |
    76 |
    77 | 78 | 79 |
    80 | 81 | 82 | -------------------------------------------------------------------------------- /web/jsp/book/footer.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 34 | -------------------------------------------------------------------------------- /web/jsp/book/header.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 |
    4 |
    5 |
    6 |
    | 7 | 服务中心 8 | 网站地图 9 |
    10 | 11 |
    12 | 13 | 14 |
    15 | HI~ 16 | [登录] 17 | [免费注册] 18 |
    19 |
    20 | 21 | 33 | 34 |
    35 |
    36 |
    37 |
    38 |
    39 |
    40 | 44 | 55 | 72 |
    73 | 79 |
    80 |
    81 | -------------------------------------------------------------------------------- /web/jsp/book/index.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.List"%> 2 | <%@page import="java.util.ArrayList"%> 3 | <%@ page language="java" contentType="text/html; charset=UTF-8" 4 | pageEncoding="UTF-8"%> 5 | <% 6 | String path = request.getContextPath(); 7 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 8 | pageContext.setAttribute("basePath", basePath); 9 | %> 10 | <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 11 | 12 | 13 | 14 | 15 | 16 | CSGO游戏交易 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 40 | 41 | 42 |
    43 | <%@include file="header.jsp" %> 44 |
    45 | 46 | 84 | 85 |
    86 |
    87 |
    88 |

    饰品分类

    89 | 90 | 94 |
    95 |
    96 |
    97 |

    推荐饰品

    98 |
    99 |
      100 | 116 | 117 |
    118 |
    119 | 120 |
    121 |
    122 |

    新品上架

    123 |
    124 |
      125 | 126 |
    127 |
    128 |
    129 |
    130 | 131 |
    132 |
    133 |
    134 | 135 | <%@include file="footer.jsp" %> 136 |
    137 | 138 | 152 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /web/jsp/book/ordersuccess.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.List"%> 2 | <%@page import="java.util.ArrayList"%> 3 | <%@ page language="java" contentType="text/html; charset=UTF-8" 4 | pageEncoding="UTF-8"%> 5 | <% 6 | String path = request.getContextPath(); 7 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 8 | + path + "/"; 9 | pageContext.setAttribute("basePath", basePath); 10 | %> 11 | <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 12 | 13 | 14 | 15 | 16 | 17 | 订单提交成功 18 | 19 | 20 | 21 | 22 | 23 | 45 | 46 | 47 | 48 |
    49 | <%@include file="header.jsp" %> 50 |
    51 |
    52 |
    53 |
    54 |
    55 | 56 |
    57 |
    58 |

    订单${orderNum}已成功生成,我们会尽快送达!

    59 |

    订单金额:¥${money}

    60 |

    支付方式:货到付款

    61 |
    62 |
    63 | 67 |
    68 |
    69 |
    70 | 71 | <%@include file="footer.jsp" %> 72 |
    73 | 74 | 75 | 78 | 79 | --------------------------------------------------------------------------------