├── 数据库脚本 └── book-manager-system.sql ├── 必备软件包.jpeg ├── image10.png ├── images ├── image1.png ├── image2.png ├── image3.png ├── image4.png ├── image5.png ├── image6.png ├── image7.png ├── image8.png └── image9.png ├── src ├── main │ ├── java │ │ └── com │ │ │ └── xunmaw │ │ │ └── book │ │ │ ├── pojo │ │ │ ├── OrderStatus.java │ │ │ ├── Department.java │ │ │ ├── Wish.java │ │ │ ├── Manager.java │ │ │ ├── Major.java │ │ │ ├── Book.java │ │ │ ├── User.java │ │ │ ├── Order_Cancel.java │ │ │ ├── Order.java │ │ │ ├── UserExcelData.java │ │ │ └── OrderExcelData.java │ │ │ ├── dao │ │ │ ├── ManagerMapper.java │ │ │ ├── WishMapper.java │ │ │ ├── DepartmentMapper.java │ │ │ ├── MajorMapper.java │ │ │ ├── BookMapper.java │ │ │ ├── OrderMapper.java │ │ │ ├── UserMapper.java │ │ │ └── Order_CancelMapper.java │ │ │ ├── BookApplication.java │ │ │ ├── config │ │ │ ├── LoginHandlerInterceptor.java │ │ │ └── MyMvcConfig.java │ │ │ └── controller │ │ │ ├── WishController.java │ │ │ ├── ManagerController.java │ │ │ ├── DepartmentController.java │ │ │ ├── MajorController.java │ │ │ ├── BookController.java │ │ │ ├── Order_CancelController.java │ │ │ ├── UserController.java │ │ │ └── OrderController.java │ └── resources │ │ ├── static │ │ ├── img │ │ │ ├── back.jpg │ │ │ ├── bookback.jpg │ │ │ └── bootstrap-solid.svg │ │ └── css │ │ │ ├── signin.css │ │ │ ├── dashboard.css │ │ │ └── style.css │ │ ├── dao │ │ ├── ManagerMapper.xml │ │ ├── DepartmentMapper.xml │ │ ├── WishMapper.xml │ │ ├── MajorMapper.xml │ │ ├── BookMapper.xml │ │ ├── UserMapper.xml │ │ ├── OrderMapper.xml │ │ └── Order_CancelMapper.xml │ │ ├── application.yml │ │ └── templates │ │ ├── error │ │ └── 404.html │ │ ├── department │ │ ├── add.html │ │ ├── update.html │ │ ├── queryList.html │ │ └── list.html │ │ ├── major │ │ ├── add.html │ │ ├── update.html │ │ ├── queryList.html │ │ └── list.html │ │ ├── wish │ │ ├── list.html │ │ └── detail.html │ │ ├── index.html │ │ ├── order │ │ ├── querylist.html │ │ ├── detail.html │ │ └── list.html │ │ ├── user │ │ ├── detail.html │ │ └── list.html │ │ ├── dashboard.html │ │ ├── book │ │ ├── detail.html │ │ └── list.html │ │ ├── order2 │ │ ├── detail.html │ │ └── list.html │ │ └── commons │ │ └── commons.html └── test │ └── java │ └── Test.java ├── .gitignore ├── README.en.md ├── README.md └── pom.xml /数据库脚本/book-manager-system.sql: -------------------------------------------------------------------------------- 1 | 获取源码/数据库脚本 联系微信:xunmaw001 2 | 关注公众号:工具优选 -------------------------------------------------------------------------------- /必备软件包.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/必备软件包.jpeg -------------------------------------------------------------------------------- /image10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/image10.png -------------------------------------------------------------------------------- /images/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/images/image1.png -------------------------------------------------------------------------------- /images/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/images/image2.png -------------------------------------------------------------------------------- /images/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/images/image3.png -------------------------------------------------------------------------------- /images/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/images/image4.png -------------------------------------------------------------------------------- /images/image5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/images/image5.png -------------------------------------------------------------------------------- /images/image6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/images/image6.png -------------------------------------------------------------------------------- /images/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/images/image7.png -------------------------------------------------------------------------------- /images/image8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/images/image8.png -------------------------------------------------------------------------------- /images/image9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/images/image9.png -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/pojo/OrderStatus.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.pojo; 2 | 3 | public enum OrderStatus { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/static/img/back.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/src/main/resources/static/img/back.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | /**/apollo/ 4 | /**/target/ 5 | *.log 6 | *.gz 7 | *.tmp 8 | 9 | # misc 10 | .DS_Store 11 | *.pem 12 | -------------------------------------------------------------------------------- /src/main/resources/static/img/bookback.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xunmaw/book-manager-system/HEAD/src/main/resources/static/img/bookback.jpg -------------------------------------------------------------------------------- /src/main/resources/dao/ManagerMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/pojo/Department.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | /** 8 | * Created by IntelliJ IDEA. 9 | * 10 | * @Author : xunmaw 11 | * @create 2022/7/16 14:34 12 | */ 13 | @Data 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | public class Department { 17 | 18 | private int id; 19 | private String name; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/dao/ManagerMapper.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.dao; 2 | 3 | import com.xunmaw.book.pojo.Manager; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * Created by IntelliJ IDEA. 9 | * 10 | * @Author : xunmaw 11 | * @create 2022/7/16 13:50 12 | */ 13 | @Repository 14 | @Mapper 15 | public interface ManagerMapper { 16 | 17 | Manager getManagerByUsername(String username); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/BookApplication.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * springboot启动类 8 | * 9 | * @author xunmaw 2023/6/22 20:42 10 | */ 11 | @SpringBootApplication 12 | public class BookApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(BookApplication.class, args); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/dao/WishMapper.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.dao; 2 | 3 | import com.xunmaw.book.pojo.Wish; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by IntelliJ IDEA. 11 | * 12 | * @Author : xunmaw 13 | * @create 2022/7/17 15:04 14 | */ 15 | @Repository 16 | @Mapper 17 | public interface WishMapper { 18 | 19 | List getWishList(); 20 | 21 | Wish getWishById(int id); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/pojo/Wish.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | /** 8 | * Created by IntelliJ IDEA. 9 | * 10 | * @Author : xunmaw 11 | * @create 2022/7/17 14:50 12 | */ 13 | @Data 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | public class Wish { 17 | 18 | private int id; 19 | 20 | private int user_id; 21 | private String nickName; 22 | private String tel; 23 | 24 | private String title; 25 | private String desc; 26 | 27 | private int state; 28 | private String sName; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/pojo/Manager.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | /** 8 | * Created by IntelliJ IDEA. 9 | * 10 | * @Author : xunmaw 11 | * @create 2022/7/16 13:45 12 | */ 13 | @Data 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | public class Manager { 17 | 18 | private int id; 19 | private String username; 20 | private String password; 21 | 22 | public Manager(String username, String password) { 23 | this.username = username; 24 | this.password = password; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/pojo/Major.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | /** 8 | * Created by IntelliJ IDEA. 9 | * 10 | * @Author : xunmaw 11 | * @create 2022/7/16 14:32 12 | */ 13 | @Data 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | public class Major { 17 | 18 | private int id; 19 | private String name; 20 | 21 | private int departId; 22 | private String departName; 23 | 24 | public Major(String name, int departId) { 25 | this.name = name; 26 | this.departId = departId; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/dao/DepartmentMapper.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.dao; 2 | 3 | import com.xunmaw.book.pojo.Department; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by IntelliJ IDEA. 11 | * 12 | * @Author : xunmaw 13 | * @create 2022/7/17 9:48 14 | */ 15 | @Repository 16 | @Mapper 17 | public interface DepartmentMapper { 18 | 19 | List getDepartList(); 20 | 21 | Department getDepartById(int id); 22 | 23 | void addDepart(String name); 24 | 25 | void delDepart(int id); 26 | 27 | void updateDepart(Department department); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/dao/MajorMapper.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.dao; 2 | 3 | import com.xunmaw.book.pojo.Major; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by IntelliJ IDEA. 12 | * 13 | * @Author : xunmaw 14 | * @create 2022/7/17 13:30 15 | */ 16 | @Repository 17 | @Mapper 18 | public interface MajorMapper { 19 | 20 | List getMajorList(); 21 | 22 | Major getMajorById(@Param("id") Integer id); 23 | 24 | void addMajor(Major major); 25 | 26 | void delMajor(int id); 27 | 28 | void updMajor(Major major); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | username: root 4 | password: root 5 | url: jdbc:mysql://localhost:3000/book-manager-system?useUnicode=true&characterEncoding=utf-8 6 | driver-class-name: com.mysql.cj.jdbc.Driver 7 | 8 | mvc: 9 | date-format: yyyy-MM-dd 10 | 11 | pagehelper: 12 | helperDialect: mysql 13 | reasonable: true 14 | supportMethodsArguments: true 15 | params: count=countSql 16 | 17 | 18 | mybatis: 19 | type-aliases-package: com.xunmaw.book.pojo 20 | mapper-locations: 21 | - classpath:dao/*.xml 22 | configuration: 23 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 24 | 25 | server: 26 | port: 8080 27 | servlet: 28 | context-path: /book 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/dao/BookMapper.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.dao; 2 | 3 | import com.xunmaw.book.pojo.Book; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by IntelliJ IDEA. 12 | * 13 | * @Author : xunmaw 14 | * @create 2022/7/16 13:50 15 | */ 16 | @Repository 17 | @Mapper 18 | public interface BookMapper { 19 | 20 | List getBooks(); 21 | 22 | Book getBookById(int id); 23 | 24 | List selectAccuracyBook(@Param("bookname") String bookName, @Param("state") Integer state); 25 | 26 | List likeSelectBook(@Param("bookname") String bookName, @Param("state") Integer state); 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/pojo/Book.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.util.Date; 8 | 9 | /** 10 | * Created by IntelliJ IDEA. 11 | * 12 | * @Author : xunmaw 13 | * @create 2022/7/16 15:17 14 | */ 15 | @Data 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | public class Book { 19 | 20 | private int id; 21 | private String name; 22 | private String publisher; 23 | private String code; 24 | private String author; 25 | private double price; 26 | private int newDeg; 27 | 28 | private int uId; 29 | private String uname; 30 | 31 | private int state; 32 | private String sname; 33 | 34 | private Date publishTime; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/pojo/User.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.util.Date; 8 | 9 | /** 10 | * Created by IntelliJ IDEA. 11 | * 12 | * @Author : xunmaw 13 | * @create 2022/7/16 22:06 14 | */ 15 | @Data 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | public class User { 19 | 20 | private int id; 21 | private String nickname; 22 | private String password; 23 | private String tel; 24 | private Date registerTime; 25 | 26 | private int departId; 27 | private String departName; 28 | 29 | private int majorId; 30 | private String majorName; 31 | 32 | private int grade; 33 | private String address; 34 | private String name; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/Test.java: -------------------------------------------------------------------------------- 1 | import com.alibaba.excel.EasyExcel; 2 | import com.alibaba.excel.write.builder.ExcelWriterBuilder; 3 | import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder; 4 | import com.xunmaw.book.pojo.UserExcelData; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class Test { 10 | public static void main(String[] args) { 11 | //工作簿对象 12 | ExcelWriterBuilder writerBuilder = EasyExcel.write("测试.xlsx", UserExcelData.class); 13 | 14 | ExcelWriterSheetBuilder sheet = writerBuilder.sheet(); 15 | 16 | List list = new ArrayList<>(); 17 | 18 | list.add(new UserExcelData(1, "cc", "熙杰", "数科院", "计科", 1)); 19 | 20 | list.add(new UserExcelData(2, "cc", "熙杰", "数科院", "计科", 2)); 21 | 22 | sheet.doWrite(list); 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/config/LoginHandlerInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.config; 2 | 3 | import org.springframework.web.servlet.HandlerInterceptor; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | public class LoginHandlerInterceptor implements HandlerInterceptor { 9 | 10 | @Override 11 | public boolean preHandle(HttpServletRequest req, HttpServletResponse resp, Object handler) throws Exception { 12 | 13 | Object loginUser = req.getSession().getAttribute("loginUser"); 14 | 15 | if (loginUser == null) { 16 | req.setAttribute("msg", "没有权限,请先登录"); 17 | req.getRequestDispatcher("/index.html").forward(req, resp); 18 | return false; 19 | } else { 20 | return true; 21 | } 22 | 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/pojo/Order_Cancel.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | /** 8 | * Created by IntelliJ IDEA. 9 | * 10 | * @Author : xunmaw 11 | * @create 2022/7/17 21:48 12 | */ 13 | @Data 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | 17 | public class Order_Cancel { 18 | 19 | private int id; 20 | 21 | private int book_id; 22 | private String name; 23 | private String publisher; 24 | private String code; 25 | private String author; 26 | private double price; 27 | private int newDeg; 28 | 29 | 30 | private int order_id; 31 | private int id_buy; 32 | private String nickname; 33 | private String tel; 34 | private String address; 35 | 36 | private String reason; 37 | private int state; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/dao/OrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.dao; 2 | 3 | import com.xunmaw.book.pojo.Order; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by IntelliJ IDEA. 12 | * 13 | * @Author : xunmaw 14 | * @create 2022/7/16 23:16 15 | */ 16 | @Repository 17 | @Mapper 18 | public interface OrderMapper { 19 | 20 | List getOrders(); 21 | 22 | Order getOrderById(int id); 23 | 24 | List selectAccuracyOrder(@Param("oid") Integer oid, @Param("username") String username, @Param("status") Integer status); 25 | 26 | List selectLikeOrder(@Param("oid") Integer oid, @Param("username") String username, @Param("status") Integer status); 27 | 28 | String selectState(@Param("id") Integer id); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.dao; 2 | 3 | import com.xunmaw.book.pojo.User; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by IntelliJ IDEA. 12 | * 13 | * @Author : xunmaw 14 | * @create 2022/7/16 13:50 15 | */ 16 | @Repository 17 | @Mapper 18 | public interface UserMapper { 19 | 20 | List getUsers(); 21 | 22 | User getUserById(int id); 23 | 24 | List selectAccuracyUser(@Param("username") String username, @Param("name") String name, @Param("dept_id") Integer dept_id, @Param("major_id") Integer major_id); 25 | 26 | List likeSelectUser(@Param("username") String username, @Param("name") String name, @Param("dept_id") Integer dept_id, @Param("major_id") Integer major_id); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/resources/dao/DepartmentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 12 | 13 | 16 | 17 | 18 | insert into department (name) values (#{name}) 19 | 20 | 21 | 22 | delete from department where id = #{id} 23 | 24 | 25 | 26 | update department set name = #{name} where id = #{id} 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/dao/Order_CancelMapper.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.dao; 2 | 3 | import com.xunmaw.book.pojo.Order_Cancel; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by IntelliJ IDEA. 12 | * 13 | * @Author : xunmaw 14 | * @create 2022/7/17 21:56 15 | */ 16 | @Repository 17 | @Mapper 18 | public interface Order_CancelMapper { 19 | 20 | List getOrder_CancelList(); 21 | 22 | Order_Cancel getOrder_CancelById(int id); 23 | 24 | List selectAccuracyOrder2(@Param("bookname") String bookname, @Param("username") String username, @Param("state") Integer state); 25 | 26 | List likeSelectOrder2(@Param("bookname") String bookname, @Param("username") String username, @Param("state") Integer state); 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/resources/dao/WishMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 15 | 16 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/pojo/Order.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.pojo; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.util.Date; 8 | 9 | /** 10 | * Created by IntelliJ IDEA. 11 | * 12 | * @Author : xunmaw 13 | * @create 2022/7/16 22:07 14 | */ 15 | @Data 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | public class Order { 19 | 20 | 21 | private int id; 22 | 23 | private int id_buy; //购买人id 24 | private String nickname; 25 | private String tel; 26 | private String address; 27 | 28 | private int book_id; //购买书id 29 | private String name; 30 | private String publisher; 31 | private String code; 32 | private String author; 33 | private double price; 34 | private int newDeg; 35 | 36 | private int uId; //本书所有人id 37 | private String uName; 38 | private String uTel; 39 | private String uAddress; 40 | 41 | private Date time; 42 | private int state; 43 | private String sname; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /README.en.md: -------------------------------------------------------------------------------- 1 | # 基于SpringBoot校园二手书管理系统 2 | 3 | #### Description 4 | 基于springboot实现的校园二手书管理系统,功能主要包含八大模块:登录、首页、二手图书管理、订单管理、撤销订单管理、院系管理、专业管理、用户管理;代码规范,运行简单, 5 | 6 | #### Software Architecture 7 | Software architecture description 8 | 9 | #### Installation 10 | 11 | 1. xxxx 12 | 2. xxxx 13 | 3. xxxx 14 | 15 | #### Instructions 16 | 17 | 1. xxxx 18 | 2. xxxx 19 | 3. xxxx 20 | 21 | #### Contribution 22 | 23 | 1. Fork the repository 24 | 2. Create Feat_xxx branch 25 | 3. Commit your code 26 | 4. Create Pull Request 27 | 28 | 29 | #### Gitee Feature 30 | 31 | 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 32 | 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 33 | 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 34 | 4. The most valuable open source project [GVP](https://gitee.com/gvp) 35 | 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 36 | 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) 37 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/pojo/UserExcelData.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.pojo; 2 | 3 | import com.alibaba.excel.annotation.ExcelProperty; 4 | import com.alibaba.excel.annotation.write.style.ColumnWidth; 5 | import com.alibaba.excel.annotation.write.style.ContentStyle; 6 | import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | import lombok.ToString; 11 | 12 | @Data 13 | @ToString 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) //水平居中 17 | public class UserExcelData { 18 | @ExcelProperty("编号") 19 | private Integer id; 20 | 21 | @ExcelProperty("用户名") 22 | private String username; 23 | 24 | @ExcelProperty("姓名") 25 | private String name; 26 | 27 | @ExcelProperty("院系") 28 | @ColumnWidth(20) 29 | private String depart; 30 | 31 | @ExcelProperty("专业") 32 | @ColumnWidth(20) 33 | private String major; 34 | 35 | @ExcelProperty("年级") 36 | @ColumnWidth(10) 37 | private Integer grade; 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/controller/WishController.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.controller; 2 | 3 | import com.xunmaw.book.dao.WishMapper; 4 | import com.xunmaw.book.pojo.Wish; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | import java.util.List; 12 | 13 | 14 | @Controller 15 | public class WishController { 16 | 17 | @Autowired 18 | private WishMapper wishMapper; 19 | 20 | @RequestMapping("/wishes") 21 | public String wishList(Model model) { 22 | 23 | List wishes = wishMapper.getWishList(); 24 | model.addAttribute("wishes", wishes); 25 | return "/wish/list"; 26 | 27 | } 28 | 29 | @RequestMapping("/wish/detail/{id}") 30 | public String wishDetail(@PathVariable("id") int id, Model model) { 31 | 32 | Wish wish = wishMapper.getWishById(id); 33 | 34 | model.addAttribute("wish", wish); 35 | 36 | return "wish/detail"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/config/MyMvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.config; 2 | 3 | /** 4 | * Created by IntelliJ IDEA. 5 | * 6 | * @Author : xunmaw 7 | * @create 2022/6/22 20:38 8 | */ 9 | 10 | import org.springframework.context.annotation.Configuration; 11 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 12 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 13 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 14 | 15 | @Configuration 16 | public class MyMvcConfig implements WebMvcConfigurer { 17 | 18 | @Override 19 | public void addViewControllers(ViewControllerRegistry registry) { 20 | registry.addViewController("/").setViewName("index"); 21 | registry.addViewController("/index.html").setViewName("index"); 22 | registry.addViewController("/main.html").setViewName("dashboard"); 23 | } 24 | 25 | // 注册拦截器 26 | @Override 27 | public void addInterceptors(InterceptorRegistry registry) { 28 | registry.addInterceptor(new LoginHandlerInterceptor()).addPathPatterns("/**").excludePathPatterns("/index.html", "/", "/login", "/code", "/css/*", "/js/*", "/img/*"); 29 | } 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/main/resources/static/img/bootstrap-solid.svg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/resources/dao/MajorMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 13 | 14 | 21 | 22 | 23 | insert into major (name,departId) values (#{name},#{departId}) 24 | 25 | 26 | 27 | delete from major where id = #{id} 28 | 29 | 30 | 31 | update major set name = #{name},departId = #{departId} where id = #{id} 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 基于SpringBoot校园二手书管理系统 2 | 3 | #### 介绍 4 | 基于springboot实现的校园二手书管理系统,功能主要包含八大模块:登录、首页、二手图书管理、订单管理、撤销订单管理、院系管理、专业管理、用户管理;代码规范,运行简单,适合二次开发做商业用途 5 | 6 | #### 软件架构 7 | 前端:html | thymeleaf 8 | 后端:springboot | mybatis 9 | 环境:mysql | jdk1.8 | maven 10 | 11 | #### 联系/演示地址 12 | [点击获取联系/演示地址](https://www.xunmaw.com/ "点击获取更多") 13 | 14 | 15 | #### 功能介绍 16 | ##### 【代码结构与数据库截图】 17 | ![输入图片说明](images/image1.png) 18 | ![输入图片说明](images/image2.png) 19 | 20 | ##### 【功能详述】 21 | 1. 登录页 22 | ![输入图片说明](images/image3.png) 23 | 24 | 2. 首页 25 | ![输入图片说明](images/image4.png) 26 | 27 | 3. 二手图书管理 28 | ![输入图片说明](images/image5.png) 29 | 30 | 4. 订单管理 31 | ![输入图片说明](images/image6.png) 32 | 33 | 5. 撤销订单管理 34 | ![输入图片说明](images/image7.png) 35 | 36 | 6. 院系管理 37 | ![输入图片说明](image10.png) 38 | 39 | 7. 专业管理 40 | ![输入图片说明](images/image8.png) 41 | 42 | 8. 用户管理 43 | ![输入图片说明](images/image9.png) 44 | 45 | 46 | #### 项目预览 47 | 地址:[商品详情 ](https://www.xunmaw.com/shop/detail/1673354083907424258) 48 | 点击商品详情中的演示地址,看查看系统录制的视频 49 | 50 | #### 使用说明 51 | 1. 创建数据库,执行数据库脚本 52 | 2. 修改jdbc数据库连接参数 53 | 3. 下载安装maven依赖jar 54 | 4. 启动SpringBoot启动类 55 | 56 | 后端管理: 57 | 请求地址: http://localhost:8080/book 58 | 用户名:admin 59 | 密码:123456 60 | 61 | #### 联系作者 62 | 这是作者的微信二维码,如需本项目源代码,可扫码联系联系作者 63 | 64 | 获取源码 联系微信:xunmaw001 65 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/pojo/OrderExcelData.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.pojo; 2 | 3 | import com.alibaba.excel.annotation.ExcelProperty; 4 | import com.alibaba.excel.annotation.format.DateTimeFormat; 5 | import com.alibaba.excel.annotation.write.style.ColumnWidth; 6 | import com.alibaba.excel.annotation.write.style.ContentStyle; 7 | import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; 8 | import lombok.AllArgsConstructor; 9 | import lombok.Data; 10 | import lombok.NoArgsConstructor; 11 | import lombok.ToString; 12 | 13 | import java.util.Date; 14 | 15 | /* 16 | 导出表格的数据格式 17 | */ 18 | @Data 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | @ToString 22 | @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) //水平居中 23 | public class OrderExcelData { 24 | 25 | @ExcelProperty("编号") 26 | private Integer id; 27 | @ExcelProperty("购买书名") 28 | @ColumnWidth(20) 29 | private String name; 30 | @ExcelProperty("价格") 31 | private Double price; 32 | @ExcelProperty("购买人用户名") 33 | private String nickName; 34 | @ExcelProperty("购买人电话") 35 | private String tel; 36 | @ExcelProperty("发货方用户名") 37 | private String uName; 38 | @ExcelProperty("发货方电话") 39 | private String uTel; 40 | @ExcelProperty("订单状态") 41 | private String state; 42 | @ExcelProperty("付款时间") 43 | @ColumnWidth(40) 44 | @DateTimeFormat("yyyy-mm-dd hh:MM:ss") 45 | private Date time; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/controller/ManagerController.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.controller; 2 | 3 | import com.xunmaw.book.pojo.Manager; 4 | import com.xunmaw.book.service.impl.ManagerServiceImpl; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | 11 | import javax.servlet.http.HttpSession; 12 | 13 | @Controller 14 | public class ManagerController { 15 | 16 | @Autowired 17 | private ManagerServiceImpl managerService; 18 | 19 | private Manager manager; 20 | 21 | @RequestMapping("/login") 22 | public String login(@RequestParam String username, @RequestParam String password, Model model, HttpSession session) { 23 | 24 | //通过用户名找到管理员 25 | manager = managerService.getManagerByUsername(username); 26 | 27 | //进行比对 28 | if (manager != null && manager.getPassword().equals(password)) { 29 | //验证通过,记录当前登录者的用户名,重定向到主页 30 | session.setAttribute("loginUser", username); 31 | return "redirect:/main.html"; 32 | } else { 33 | //登录失败,提示用户 34 | model.addAttribute("msg", "用户名或密码错误"); 35 | return "index"; 36 | } 37 | } 38 | 39 | @RequestMapping("/logout") 40 | public String logout(HttpSession session) { 41 | session.invalidate(); 42 | return "index"; 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/resources/templates/error/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Dashboard Template for Bootstrap 11 | 12 | 13 | 14 | 15 | 16 | 42 | 43 | 44 | 45 | 46 |
47 |
48 |

页面跳转发生错误ooo

49 |
50 |
51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/main/resources/static/css/signin.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | height: 100%; 4 | } 5 | 6 | body { 7 | display: -ms-flexbox; 8 | display: -webkit-box; 9 | display: flex; 10 | -ms-flex-align: center; 11 | -ms-flex-pack: center; 12 | -webkit-box-align: center; 13 | align-items: center; 14 | -webkit-box-pack: center; 15 | justify-content: center; 16 | padding-top: 40px; 17 | padding-bottom: 40px; 18 | background-image: url("../img/bookback.jpg"); 19 | background-size: cover; 20 | background-repeat: no-repeat; 21 | /*background-color: #f5f5f5;*/ 22 | } 23 | 24 | .form-signin { 25 | width: 100%; 26 | max-width: 350px; 27 | padding: 15px; 28 | margin: 0 auto; 29 | } 30 | 31 | .form-signin .checkbox { 32 | font-weight: 400; 33 | } 34 | /* 表单 */ 35 | .login-list{ 36 | margin: 50px auto 0; 37 | height: 440px; 38 | width: 650px; 39 | border: 1px solid #d2d6dc; 40 | border-radius: 10px; 41 | transition: .3s; 42 | -webkit-transition: .3s; 43 | -ms-transition: .3s; 44 | -moz-transition: .3s; 45 | box-shadow: 0 0 12px rgba(0,0,0,.6); 46 | background: white; 47 | } 48 | .login-list:hover{ 49 | box-shadow: 0 0 50px rgba(0,0,0,.4); 50 | } 51 | 52 | .form-signin .form-control { 53 | position: relative; 54 | box-sizing: border-box; 55 | height: auto; 56 | padding: 10px; 57 | font-size: 16px; 58 | } 59 | 60 | .form-signin .form-control:focus { 61 | z-index: 2; 62 | } 63 | 64 | .form-signin input[type="email"] { 65 | margin-bottom: -1px; 66 | border-bottom-right-radius: 0; 67 | border-bottom-left-radius: 0; 68 | } 69 | 70 | .form-signin input[type="password"] { 71 | margin-bottom: 10px; 72 | } 73 | -------------------------------------------------------------------------------- /src/main/resources/static/css/dashboard.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: .875rem; 3 | } 4 | 5 | .feather { 6 | width: 16px; 7 | height: 16px; 8 | vertical-align: text-bottom; 9 | } 10 | 11 | /* 12 | * Sidebar 13 | */ 14 | 15 | .sidebar { 16 | position: fixed; 17 | top: 0; 18 | bottom: 0; 19 | left: 0; 20 | z-index: 100; /* Behind the navbar */ 21 | padding: 0; 22 | box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1); 23 | } 24 | 25 | .sidebar-sticky { 26 | position: -webkit-sticky; 27 | position: sticky; 28 | top: 48px; /* Height of navbar */ 29 | height: calc(100vh - 48px); 30 | padding-top: .5rem; 31 | overflow-x: hidden; 32 | overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ 33 | } 34 | 35 | .sidebar .nav-link { 36 | font-weight: 500; 37 | color: #333; 38 | } 39 | 40 | .sidebar .nav-link .feather { 41 | margin-right: 4px; 42 | color: #999; 43 | } 44 | 45 | .sidebar .nav-link.active { 46 | color: #007bff; 47 | } 48 | 49 | .sidebar .nav-link:hover .feather, 50 | .sidebar .nav-link.active .feather { 51 | color: inherit; 52 | } 53 | 54 | .sidebar-heading { 55 | font-size: .75rem; 56 | text-transform: uppercase; 57 | } 58 | 59 | /* 60 | * Navbar 61 | */ 62 | 63 | .navbar-brand { 64 | padding-top: .75rem; 65 | padding-bottom: .75rem; 66 | font-size: 1rem; 67 | background-color: rgba(0, 0, 0, .25); 68 | box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25); 69 | } 70 | 71 | .navbar .form-control { 72 | padding: .75rem 1rem; 73 | border-width: 0; 74 | border-radius: 0; 75 | } 76 | 77 | .form-control-dark { 78 | color: #fff; 79 | background-color: rgba(255, 255, 255, .1); 80 | border-color: rgba(255, 255, 255, .1); 81 | } 82 | 83 | .form-control-dark:focus { 84 | border-color: transparent; 85 | box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); 86 | } 87 | 88 | /* 89 | * Utilities 90 | */ 91 | 92 | .border-top { 93 | border-top: 1px solid #e5e5e5; 94 | } 95 | 96 | .border-bottom { 97 | border-bottom: 1px solid #e5e5e5; 98 | } 99 | -------------------------------------------------------------------------------- /src/main/resources/dao/BookMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 17 | 18 | 27 | 28 | 45 | 46 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/controller/DepartmentController.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.controller; 2 | 3 | 4 | import com.xunmaw.book.pojo.Department; 5 | import com.xunmaw.book.service.impl.DepartmentServiceImpl; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestParam; 12 | 13 | import java.util.List; 14 | 15 | 16 | @Controller 17 | public class DepartmentController { 18 | 19 | @Autowired 20 | private DepartmentServiceImpl departmentService; 21 | 22 | @RequestMapping("/departs") 23 | public String departList(Model model) { 24 | 25 | List departments = departmentService.getDepartList(); 26 | model.addAttribute("departs", departments); 27 | 28 | return "department/list"; 29 | } 30 | 31 | @RequestMapping("/depart/toAdd") 32 | public String toAdd() { 33 | return "department/add"; 34 | } 35 | 36 | @RequestMapping("/depart/add") 37 | public String Add(@RequestParam String name) { 38 | departmentService.addDepart(name); 39 | return "redirect:/departs"; 40 | } 41 | 42 | @RequestMapping("/depart/delete/{id}") 43 | public String delDepart(@PathVariable("id") int id) { 44 | departmentService.delDepart(id); 45 | return "redirect:/departs"; 46 | } 47 | 48 | @RequestMapping("/depart/toupdate/{id}") 49 | public String toUpdateDepart(@PathVariable("id") int id, Model model) { 50 | Department department = departmentService.getDepartById(id); 51 | model.addAttribute("depart", department); 52 | return "department/update"; 53 | } 54 | 55 | @RequestMapping("/depart/update") 56 | public String updateDepart(Department department) { 57 | departmentService.updateDepart(department); 58 | return "redirect:/departs"; 59 | } 60 | 61 | @RequestMapping("/depart/query") 62 | public String queryDepart(@RequestParam(required = false) Integer id, Model model) { 63 | if (id == null){ 64 | List departList = departmentService.getDepartList(); 65 | model.addAttribute("departs", departList); 66 | return "department/list"; 67 | } 68 | Department department = departmentService.getDepartById(id); 69 | model.addAttribute("depart", department); 70 | 71 | return "department/queryList"; 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/controller/MajorController.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.controller; 2 | 3 | 4 | import com.xunmaw.book.pojo.Department; 5 | import com.xunmaw.book.pojo.Major; 6 | import com.xunmaw.book.service.impl.DepartmentServiceImpl; 7 | import com.xunmaw.book.service.impl.MajorServiceImpl; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | 15 | import java.util.List; 16 | 17 | /** 18 | * Created by IntelliJ IDEA. 19 | * 20 | * @Author : xunmaw 21 | * @create 2022/7/17 9:57 22 | */ 23 | @Controller 24 | public class MajorController { 25 | 26 | @Autowired 27 | private MajorServiceImpl majorService; 28 | @Autowired 29 | private DepartmentServiceImpl departmentService; 30 | List departments = null; 31 | 32 | 33 | @RequestMapping("/majors") 34 | public String majorList(Model model) { 35 | 36 | List majors = majorService.getMajorList(); 37 | model.addAttribute("majors", majors); 38 | 39 | return "major/list"; 40 | } 41 | 42 | @RequestMapping("/major/toAdd") 43 | public String toAdd(Model model) { 44 | departments = departmentService.getDepartList(); 45 | model.addAttribute("departments", departments); 46 | return "major/add"; 47 | } 48 | 49 | @RequestMapping("/major/add") 50 | public String Add(Major major) { 51 | majorService.addMajor(new Major(major.getName(), major.getDepartId())); 52 | return "redirect:/majors"; 53 | } 54 | 55 | @RequestMapping("/major/delete/{id}") 56 | public String delMajor(@PathVariable("id") int id) { 57 | majorService.delMajor(id); 58 | return "redirect:/majors"; 59 | } 60 | 61 | @RequestMapping("/major/toupdate/{id}") 62 | public String toUpdateMajor(@PathVariable("id") int id, Model model) { 63 | 64 | Major major = majorService.getMajorById(id); 65 | model.addAttribute("major", major); 66 | 67 | departments = departmentService.getDepartList(); 68 | model.addAttribute("departments", departments); 69 | return "major/update"; 70 | } 71 | 72 | @RequestMapping("/major/update") 73 | public String updateMajor(Major major) { 74 | majorService.updMajor(major); 75 | return "redirect:/majors"; 76 | } 77 | 78 | @RequestMapping("/major/query") 79 | public String queryMajor(@RequestParam(required = false) Integer id, Model model) { 80 | if (id == null){ 81 | List majorList = majorService.getMajorList(); 82 | model.addAttribute("majors", majorList); 83 | return "major/list"; 84 | } 85 | Major major = majorService.getMajorById(id); 86 | model.addAttribute("major", major); 87 | 88 | return "major/queryList"; 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /src/main/resources/dao/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 16 | 17 | 25 | 26 | 48 | 49 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/controller/BookController.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.controller; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import com.xunmaw.book.pojo.Book; 6 | import com.xunmaw.book.service.impl.BookServiceImpl; 7 | import com.xunmaw.book.service.impl.OrderServiceImpl; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.util.StringUtils; 12 | import org.springframework.web.bind.annotation.PathVariable; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RequestParam; 15 | 16 | import java.util.List; 17 | 18 | 19 | @Controller 20 | public class BookController { 21 | 22 | @Autowired 23 | private BookServiceImpl bookService; 24 | 25 | @Autowired 26 | private OrderServiceImpl orderService; 27 | 28 | @RequestMapping("/books") 29 | public String bookList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "12") Integer pageSize, Model model) { 30 | 31 | PageHelper.startPage(pageNum, pageSize); 32 | 33 | List books = bookService.getBooks(); 34 | model.addAttribute("books", books); 35 | 36 | PageInfo pageInfo = new PageInfo<>(books); 37 | model.addAttribute("pageInfo", pageInfo); 38 | 39 | return "book/list"; 40 | } 41 | 42 | @RequestMapping("/book/detail/{id}") 43 | public String bookDetail(@PathVariable("id") int id, Model model) { 44 | 45 | Book book = bookService.getBookById(id); 46 | 47 | model.addAttribute("book", book); 48 | 49 | return "book/detail"; 50 | } 51 | 52 | @RequestMapping("/book/query") 53 | public String bookquery(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, 54 | @RequestParam(defaultValue = "12") Integer pageSize, 55 | @RequestParam(value = "bookname", required = false) String bookname, 56 | @RequestParam(value = "state", required = false) Integer state, 57 | @RequestParam(value = "btnType", defaultValue = "1") Integer btnType, 58 | Model model) { 59 | if (!StringUtils.isEmpty(bookname)) { 60 | model.addAttribute("bookname", bookname); 61 | } 62 | if (state != null) { 63 | model.addAttribute("selectstatus", state); 64 | } 65 | model.addAttribute("btnType", btnType); 66 | PageHelper.startPage(pageNum, pageSize); 67 | List books = null; 68 | if (btnType == 1) { 69 | //精准查询 70 | books = bookService.accuracyFindBook(StringUtils.isEmpty(bookname) ? null : bookname, state == null || state == 0 ? null : state); 71 | } else { 72 | //模糊查询 73 | books = bookService.likeFindBook(StringUtils.isEmpty(bookname) ? null : bookname, state == null || state == 0 ? null : state); 74 | } 75 | model.addAttribute("books", books); 76 | PageInfo pageInfo = new PageInfo<>(books); 77 | model.addAttribute("pageInfo", pageInfo); 78 | return "book/list"; 79 | } 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/resources/dao/OrderMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 16 | 17 | 26 | 27 | 49 | 50 | 51 | 73 | 74 | 75 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/controller/Order_CancelController.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.controller; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import com.xunmaw.book.pojo.Order_Cancel; 6 | import com.xunmaw.book.service.impl.Order_CancelServiceImpl; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.util.StringUtils; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | 15 | import java.util.List; 16 | 17 | @Controller 18 | public class Order_CancelController { 19 | 20 | @Autowired 21 | private Order_CancelServiceImpl order_cancelService; 22 | 23 | @RequestMapping("/order2s") 24 | private String getOrder2List(Model model, @RequestParam(defaultValue = "1") Integer pageNum, 25 | @RequestParam(defaultValue = "12") Integer pageSize) { 26 | 27 | PageHelper.startPage(pageNum, pageSize); 28 | List orderCancels = order_cancelService.getOrder_CancelList(); 29 | model.addAttribute("order2s", orderCancels); 30 | PageInfo pageInfo = new PageInfo<>(orderCancels); 31 | model.addAttribute("pageInfo", pageInfo); 32 | return "order2/list"; 33 | 34 | } 35 | 36 | @RequestMapping("/order2/detail/{id}") 37 | public String bookDetail(@PathVariable("id") int id, Model model) { 38 | 39 | Order_Cancel order = order_cancelService.getOrder_CancelById(id); 40 | 41 | model.addAttribute("order", order); 42 | 43 | return "order2/detail"; 44 | } 45 | 46 | @RequestMapping("/order2/query") 47 | private String orderQuery2( 48 | @RequestParam(value = "username", required = false) String username, 49 | @RequestParam(value = "bookname", required = false) String bookname, 50 | @RequestParam(value = "state", required = false) Integer state, 51 | @RequestParam(value = "btnType", defaultValue = "1") Integer btnType, 52 | @RequestParam(defaultValue = "1") Integer pageNum, 53 | @RequestParam(defaultValue = "12") Integer pageSize, 54 | Model model) { 55 | 56 | 57 | List orderCancels = null; 58 | 59 | //给模板引擎添加搜索参数 60 | if (btnType != null) { 61 | model.addAttribute("btnType", btnType); 62 | } 63 | if (!StringUtils.isEmpty(username)) { 64 | model.addAttribute("username", username); 65 | } 66 | if (!StringUtils.isEmpty(bookname)) { 67 | model.addAttribute("bookname", bookname); 68 | } 69 | model.addAttribute("selectstatus", state); 70 | PageHelper.startPage(pageNum, pageSize); 71 | if (btnType == 1) { 72 | orderCancels = order_cancelService.accuracyGetOrder_Cancel(StringUtils.isEmpty(bookname) ? null : bookname, StringUtils.isEmpty(username) ? null : username, state == null || state == 0 ? null : state); 73 | } else { 74 | orderCancels = order_cancelService.likeGetOrder_Cancel(StringUtils.isEmpty(bookname) ? null : bookname, StringUtils.isEmpty(username) ? null : username, state == null || state == 0 ? null : state); 75 | } 76 | 77 | model.addAttribute("order2s", orderCancels); 78 | PageInfo pageInfo = new PageInfo<>(orderCancels); 79 | model.addAttribute("pageInfo", pageInfo); 80 | return "order2/list"; 81 | 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/main/resources/dao/Order_CancelMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 17 | 18 | 27 | 28 | 29 | 54 | 55 | 56 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/main/resources/templates/department/add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Dashboard Template for Bootstrap 12 | 13 | 14 | 15 | 16 | 17 | 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 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 81 | 82 | 83 | 84 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /src/main/resources/templates/department/update.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Dashboard Template for Bootstrap 12 | 13 | 14 | 15 | 16 | 17 | 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 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 83 | 84 | 85 | 86 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /src/main/resources/templates/major/add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Dashboard Template for Bootstrap 12 | 13 | 14 | 15 | 16 | 17 | 44 | 45 | 46 | 47 | 48 | 49 |
50 | 51 |
52 |
53 | 54 | 55 |
56 | 57 |
58 |
59 |
60 | 61 | 62 |
63 |
64 | 65 | 70 |
71 | 72 |
73 | 74 |
75 |
76 |
77 | 78 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 90 | 91 | 92 | 93 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /src/main/resources/templates/major/update.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Dashboard Template for Bootstrap 12 | 13 | 14 | 15 | 16 | 17 | 43 | 44 | 45 | 46 | 47 | 48 |
49 | 50 |
51 |
52 | 53 | 54 |
55 | 56 |
57 |
58 | 59 |
60 | 61 | 62 |
63 |
64 | 65 | 70 |
71 | 72 |
73 |
74 | 75 | 76 |
77 |
78 | 79 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 91 | 92 | 93 | 94 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /src/main/resources/templates/wish/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Dashboard Template for Bootstrap 11 | 12 | 13 | 14 | 15 | 16 | 17 | 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 | 76 | 77 | 78 | 79 | 80 | 83 | 84 | 85 | 86 |
编号用户名联系方式书名备注目前状态操作
81 | 详情 82 |
87 | 88 |
89 | 90 | 91 |
92 |
93 |
94 | 95 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 107 | 108 | 109 | 110 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 二手书系统-登录 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 43 | 44 | 45 | 46 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /src/main/resources/templates/department/queryList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Dashboard Template for Bootstrap 13 | 14 | 15 | 16 | 17 | 18 | 19 | 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 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 91 | 92 | 93 | 94 |
院系编号院系名操作
87 | 编辑 88 | 删除 90 |
95 | 96 | 97 |
98 | 99 | 100 |
101 |
102 |
103 | 104 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 116 | 117 | 118 | 119 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /src/main/resources/templates/major/queryList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Dashboard Template for Bootstrap 13 | 14 | 15 | 16 | 17 | 18 | 19 | 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 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 91 | 92 | 93 | 94 |
专业编号专业名所属学院操作
87 | 编辑 89 | 删除 90 |
95 | 96 | 97 |
98 | 99 | 100 |
101 |
102 |
103 | 104 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 116 | 117 | 118 | 119 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /src/main/resources/templates/department/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Dashboard Template for Bootstrap 13 | 14 | 15 | 16 | 17 | 18 | 19 | 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 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 90 | 91 | 92 | 93 |
院系编号院系名操作
86 | 编辑 87 | 删除 89 |
94 | 95 | 96 |
97 | 98 | 99 |
100 |
101 |
102 | 103 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 115 | 116 | 117 | 118 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /src/main/resources/templates/wish/detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Dashboard Template for Bootstrap 12 | 13 | 14 | 15 | 16 | 17 | 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 |
76 | 77 | 78 |
79 |
80 | 81 | 82 |
83 |
84 | 85 | 86 |
87 | 88 | 89 |

确认

90 |
91 |
92 | 93 | 94 |
95 |
96 | 97 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 109 | 110 | 111 | 112 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /src/main/resources/templates/major/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Dashboard Template for Bootstrap 13 | 14 | 15 | 16 | 17 | 18 | 19 | 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 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 92 | 93 | 94 | 95 |
专业编号专业名所属学院操作
88 | 编辑 90 | 删除 91 |
96 | 97 |
98 | 99 | 100 |
101 |
102 |
103 | 104 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 116 | 117 | 118 | 119 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | com.xunmaw 6 | book-manager-system 7 | 1.0.0 8 | book-manager-system 9 | 图书管理系统 10 | 11 | 12 | 1.8 13 | UTF-8 14 | UTF-8 15 | 2.3.7.RELEASE 16 | boot 17 | 18 | 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-thymeleaf 25 | 26 | 27 | com.alibaba 28 | easyexcel 29 | 3.0.5 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-test 34 | test 35 | 36 | 37 | org.junit.vintage 38 | junit-vintage-engine 39 | 40 | 41 | 42 | 43 | org.projectlombok 44 | lombok 45 | 46 | 47 | 48 | mysql 49 | mysql-connector-java 50 | 8.0.23 51 | 52 | 53 | commons-fileupload 54 | commons-fileupload 55 | 1.4 56 | 57 | 58 | org.springframework.boot 59 | spring-boot-starter-jdbc 60 | 61 | 62 | org.mybatis.spring.boot 63 | mybatis-spring-boot-starter 64 | 2.2.1 65 | 66 | 67 | org.springframework.boot 68 | spring-boot-starter-web 69 | 70 | 71 | com.github.pagehelper 72 | pagehelper-spring-boot-starter 73 | 1.4.2 74 | 75 | 76 | org.apache.commons 77 | commons-collections4 78 | 4.4 79 | 80 | 81 | org.springframework.boot 82 | spring-boot-devtools 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | org.springframework.boot 91 | spring-boot-dependencies 92 | ${spring-boot.version} 93 | pom 94 | import 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | org.springframework.boot 113 | spring-boot-maven-plugin 114 | 2.5.4 115 | 116 | com.xunmaw.book.BookApplication 117 | 118 | 119 | 120 | repackage 121 | 122 | repackage 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /src/main/resources/templates/order/querylist.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Dashboard Template for Bootstrap 12 | 13 | 14 | 15 | 16 | 17 | 43 | 44 | 45 | 46 | 47 | 48 |
49 | 50 |
51 |
52 | 53 | 54 |
55 | 56 |
57 | 58 |
59 |
60 | 61 | 编号:    62 | 姓名:   63 | 手机号:   64 | 身份证号:   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 | 93 | 98 | 99 | 100 | 101 |
编号姓名性别身份证号电话号码操作
94 | 编辑 95 | 删除 97 |
102 |
103 |
104 |
105 |
106 | 107 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 119 | 120 | 121 | 122 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /src/main/resources/templates/user/detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Dashboard Template for Bootstrap 12 | 13 | 14 | 15 | 16 | 17 | 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 | 74 |
75 |
76 | 77 | 78 |
79 |
80 | 81 | 82 |
83 |
84 | 85 | 86 |
87 |
88 | 89 | 90 |
91 |
92 | 93 | 94 |
95 | 96 |

确认

97 |
98 |
99 | 100 | 101 |
102 |
103 | 104 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 116 | 117 | 118 | 119 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css?family=Cardo:400i|Rubik:400,700&display=swap"); 2 | 3 | :root { 4 | --d: 700ms; 5 | --e: cubic-bezier(0.19, 1, 0.22, 1); 6 | --font-sans: "Rubik", sans-serif; 7 | --font-serif: "Cardo", serif; 8 | } 9 | 10 | 11 | html, body { 12 | height: 100%; 13 | } 14 | 15 | .page-content { 16 | display: grid; 17 | grid-gap: 1rem; 18 | padding: 1rem; 19 | max-width: 1024px; 20 | margin: 0 auto; 21 | font-family: var(--font-sans); 22 | } 23 | 24 | @media (min-width: 600px) { 25 | .page-content { 26 | grid-template-columns: repeat(2, 1fr); 27 | } 28 | } 29 | 30 | @media (min-width: 800px) { 31 | .page-content { 32 | grid-template-columns: repeat(4, 1fr); 33 | } 34 | } 35 | 36 | .card { 37 | position: relative; 38 | display: flex; 39 | align-items: flex-end; 40 | overflow: hidden; 41 | padding: 1rem; 42 | width: 100%; 43 | text-align: center; 44 | color: whitesmoke; 45 | background-color: whitesmoke; 46 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), 0 2px 2px rgba(0, 0, 0, 0.1), 0 4px 4px rgba(0, 0, 0, 0.1), 0 8px 8px rgba(0, 0, 0, 0.1), 0 16px 16px rgba(0, 0, 0, 0.1); 47 | } 48 | 49 | @media (min-width: 600px) { 50 | .card { 51 | height: 350px; 52 | } 53 | } 54 | 55 | .card:before { 56 | content: ""; 57 | position: absolute; 58 | top: 0; 59 | left: 0; 60 | width: 100%; 61 | height: 110%; 62 | background-size: cover; 63 | background-position: 0 0; 64 | transition: transform calc(var(--d) * 1.5) var(--e); 65 | pointer-events: none; 66 | } 67 | 68 | .card:after { 69 | content: ""; 70 | display: block; 71 | position: absolute; 72 | top: 0; 73 | left: 0; 74 | width: 100%; 75 | height: 200%; 76 | pointer-events: none; 77 | background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.009) 11.7%, rgba(0, 0, 0, 0.034) 22.1%, rgba(0, 0, 0, 0.072) 31.2%, rgba(0, 0, 0, 0.123) 39.4%, rgba(0, 0, 0, 0.182) 46.6%, rgba(0, 0, 0, 0.249) 53.1%, rgba(0, 0, 0, 0.32) 58.9%, rgba(0, 0, 0, 0.394) 64.3%, rgba(0, 0, 0, 0.468) 69.3%, rgba(0, 0, 0, 0.54) 74.1%, rgba(0, 0, 0, 0.607) 78.8%, rgba(0, 0, 0, 0.668) 83.6%, rgba(0, 0, 0, 0.721) 88.7%, rgba(0, 0, 0, 0.762) 94.1%, rgba(0, 0, 0, 0.79) 100%); 78 | transform: translateY(-50%); 79 | transition: transform calc(var(--d) * 2) var(--e); 80 | } 81 | 82 | .card:nth-child(1):before { 83 | background-image: url(https://images.unsplash.com/photo-1517021897933-0e0319cfbc28?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ); 84 | } 85 | 86 | .card:nth-child(2):before { 87 | background-image: url(https://images.unsplash.com/photo-1533903345306-15d1c30952de?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ); 88 | } 89 | 90 | .card:nth-child(3):before { 91 | background-image: url(https://images.unsplash.com/photo-1545243424-0ce743321e11?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ); 92 | } 93 | 94 | .card:nth-child(4):before { 95 | background-image: url(https://images.unsplash.com/photo-1531306728370-e2ebd9d7bb99?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ); 96 | } 97 | 98 | .content { 99 | position: relative; 100 | display: flex; 101 | flex-direction: column; 102 | align-items: center; 103 | width: 100%; 104 | padding: 1rem; 105 | transition: transform var(--d) var(--e); 106 | z-index: 1; 107 | } 108 | 109 | .content > * + * { 110 | margin-top: 1rem; 111 | } 112 | 113 | .title { 114 | font-size: 1.3rem; 115 | font-weight: bold; 116 | line-height: 1.2; 117 | } 118 | 119 | .copy { 120 | font-family: var(--font-serif); 121 | font-size: 1.125rem; 122 | font-style: italic; 123 | line-height: 1.35; 124 | } 125 | 126 | .btn { 127 | cursor: pointer; 128 | margin-top: 1.5rem; 129 | padding: 0.75rem 1.5rem; 130 | font-size: 0.65rem; 131 | font-weight: bold; 132 | letter-spacing: 0.025rem; 133 | text-transform: uppercase; 134 | color: white; 135 | background-color: black; 136 | border: none; 137 | } 138 | 139 | .btn:hover { 140 | background-color: #0d0d0d; 141 | } 142 | 143 | .btn:focus { 144 | outline: 1px dashed yellow; 145 | outline-offset: 3px; 146 | } 147 | 148 | @media (hover: hover) and (min-width: 600px) { 149 | .card:after { 150 | transform: translateY(0); 151 | } 152 | 153 | .content { 154 | transform: translateY(calc(100% - 4.5rem)); 155 | } 156 | 157 | .content > *:not(.title) { 158 | opacity: 0; 159 | transform: translateY(1rem); 160 | transition: transform var(--d) var(--e), opacity var(--d) var(--e); 161 | } 162 | 163 | .card:hover, 164 | .card:focus-within { 165 | align-items: center; 166 | } 167 | 168 | .card:hover:before, 169 | .card:focus-within:before { 170 | transform: translateY(-4%); 171 | } 172 | 173 | .card:hover:after, 174 | .card:focus-within:after { 175 | transform: translateY(-50%); 176 | } 177 | 178 | .card:hover .content, 179 | .card:focus-within .content { 180 | transform: translateY(0); 181 | } 182 | 183 | .card:hover .content > *:not(.title), 184 | .card:focus-within .content > *:not(.title) { 185 | opacity: 1; 186 | transform: translateY(0); 187 | transition-delay: calc(var(--d) / 8); 188 | } 189 | 190 | .card:focus-within:before, .card:focus-within:after, 191 | .card:focus-within .content, 192 | .card:focus-within .content > *:not(.title) { 193 | transition-duration: 0s; 194 | } 195 | } -------------------------------------------------------------------------------- /src/main/resources/templates/dashboard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Dashboard Template for Bootstrap 10 | 11 | 12 | 13 | 14 | 15 | 16 | 42 | 43 | 44 | 45 | 46 | 47 |
48 | 49 |
50 |
51 | 52 | 53 |
54 | 55 |
56 | 67 |
68 |

欢迎[[${session.loginUser}]]来到校园二手书管理系统

69 |
70 |
71 |
72 |
73 |

读书破万卷

74 |

书中有我们想要的知识,也有流传千古的思想

75 |
76 |
77 |
78 |
79 |

下笔如有神

80 |

腹有诗书气自华,人与书已浑然成为一体

81 |
82 |
83 |
84 |
85 |

读万卷书

86 |

书籍是人类进步的阶梯,在高处眺望思想的光辉

87 |
88 |
89 |
90 |
91 |

行万里路

92 |

我们能够摆脱的是什么,局限和狭隘,所以我们最终是要在相互的沟通、学习、交流当中看到自己的局限

93 |
94 |
95 |
96 | 97 | 98 | 99 | 100 |
101 |
102 |
103 | 104 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 116 | 117 | 118 | 119 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /src/main/resources/templates/book/detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Dashboard Template for Bootstrap 12 | 13 | 14 | 15 | 16 | 17 | 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 | 76 | 77 |
78 |
79 | 80 | 81 |
82 |
83 | 84 | 85 |
86 |
87 | 88 | 89 |
90 |
91 | 92 | 93 |
94 |
95 | 96 | 97 |
98 |
99 | 100 | 102 |
103 | 104 |

确认

105 |
106 |
107 | 108 | 109 |
110 |
111 | 112 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 124 | 125 | 126 | 127 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /src/main/resources/templates/order2/detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Dashboard Template for Bootstrap 12 | 13 | 14 | 15 | 16 | 17 | 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 | 76 | 77 |
78 |
79 | 80 | 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 | 113 |
114 | 115 |

确认

116 |
117 |
118 | 119 | 120 |
121 |
122 | 123 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 135 | 136 | 137 | 138 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /src/main/resources/templates/commons/commons.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 15 | 117 | 118 | -------------------------------------------------------------------------------- /src/main/resources/templates/order/detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Dashboard Template for Bootstrap 12 | 13 | 14 | 15 | 16 | 17 | 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 | 76 | 77 |
78 |
79 | 80 | 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 | 113 |
114 |
115 | 116 | 117 |
118 |
119 | 120 | 121 |
122 |
123 | 124 | 126 |
127 | 128 |

确认

129 |
130 |
131 | 132 | 133 |
134 |
135 | 136 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 148 | 149 | 150 | 151 | 180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.controller; 2 | 3 | import com.alibaba.excel.EasyExcel; 4 | import com.alibaba.excel.write.builder.ExcelWriterBuilder; 5 | import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder; 6 | import com.github.pagehelper.PageHelper; 7 | import com.github.pagehelper.PageInfo; 8 | import com.xunmaw.book.pojo.Department; 9 | import com.xunmaw.book.pojo.Major; 10 | import com.xunmaw.book.pojo.User; 11 | import com.xunmaw.book.pojo.UserExcelData; 12 | import com.xunmaw.book.service.impl.UserServiceImpl; 13 | import com.xunmaw.book.service.inte.DepartmentService; 14 | import com.xunmaw.book.service.inte.MajorService; 15 | import org.springframework.beans.factory.annotation.Autowired; 16 | import org.springframework.stereotype.Controller; 17 | import org.springframework.ui.Model; 18 | import org.springframework.util.StringUtils; 19 | import org.springframework.web.bind.annotation.*; 20 | 21 | import javax.servlet.ServletOutputStream; 22 | import javax.servlet.http.HttpServletResponse; 23 | import java.io.IOException; 24 | import java.net.URLEncoder; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | 29 | @Controller 30 | public class UserController { 31 | 32 | @Autowired 33 | private UserServiceImpl userService; 34 | @Autowired 35 | private MajorService majorService; 36 | @Autowired 37 | private DepartmentService departmentService; 38 | 39 | @RequestMapping("/users") 40 | public String userList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "12") Integer pageSize, Model model) { 41 | List majorList = majorService.getMajorList(); 42 | model.addAttribute("majorList", majorList); 43 | List departList = departmentService.getDepartList(); 44 | model.addAttribute("departList", departList); 45 | PageHelper.startPage(pageNum, pageSize); 46 | 47 | List users = userService.getUsers(); 48 | model.addAttribute("users", users); 49 | 50 | PageInfo pageInfo = new PageInfo<>(users); 51 | model.addAttribute("pageInfo", pageInfo); 52 | 53 | return "user/list"; 54 | } 55 | 56 | @RequestMapping("/user/detail/{id}") 57 | public String bookDetail(@PathVariable("id") int id, Model model) { 58 | 59 | User user = userService.getUserById(id); 60 | 61 | model.addAttribute("user", user); 62 | 63 | return "user/detail"; 64 | } 65 | 66 | @RequestMapping("/user/query") 67 | public String queryUser(@RequestParam(value = "username", required = false) String username, 68 | @RequestParam(value = "name", required = false) String name, 69 | @RequestParam(value = "depart_id", required = false) Integer depart_id, 70 | @RequestParam(value = "major_id", required = false) Integer major_id, 71 | @RequestParam(value = "btnType", required = false, defaultValue = "1") Integer btnType, 72 | @RequestParam(defaultValue = "1") Integer pageNum, 73 | @RequestParam(defaultValue = "12") Integer pageSize, 74 | Model model) { 75 | 76 | List majorList = majorService.getMajorList(); 77 | model.addAttribute("majorList", majorList); 78 | List departList = departmentService.getDepartList(); 79 | model.addAttribute("departList", departList); 80 | PageHelper.startPage(pageNum, pageSize); 81 | if (depart_id != null) { 82 | model.addAttribute("select_depid", depart_id); 83 | } 84 | if (major_id != null) { 85 | model.addAttribute("select_majorid", major_id); 86 | } 87 | if (username != null && !StringUtils.isEmpty(username)) { 88 | model.addAttribute("username", username); 89 | } 90 | if (name != null && !StringUtils.isEmpty(name)) { 91 | model.addAttribute("name", name); 92 | } 93 | if (btnType != null) { 94 | model.addAttribute("btnType", btnType); 95 | } 96 | List users = null; 97 | if (btnType == 1) { 98 | //精准查询 99 | users = userService.accuracyQueryUser(StringUtils.isEmpty(username) ? null : username, StringUtils.isEmpty(name) ? null : name, 100 | depart_id == null || depart_id == 0 ? null : depart_id, major_id == null || major_id == 0 ? null : major_id); 101 | 102 | } else if (btnType == 2) { 103 | //模糊查询(对用户名和姓名模糊查询) 104 | users = userService.likeQueryUser(StringUtils.isEmpty(username) ? null : username, StringUtils.isEmpty(name) ? null : name, 105 | depart_id == null || depart_id == 0 ? null : depart_id, major_id == null || major_id == 0 ? null : major_id); 106 | } 107 | System.out.println("users size : " + users.size()); 108 | for (User user : users) { 109 | System.out.println("user" + user); 110 | } 111 | model.addAttribute("users", users); 112 | PageInfo pageInfo = new PageInfo<>(users); 113 | model.addAttribute("pageInfo", pageInfo); 114 | return "user/list"; 115 | } 116 | 117 | /* 118 | 导出Execel 119 | */ 120 | @RequestMapping("/user/export") 121 | @ResponseBody 122 | public String exportExcel(@RequestParam(value = "username", required = false) String username, 123 | @RequestParam(value = "name", required = false) String name, 124 | @RequestParam(value = "depart_id", required = false) Integer depart_id, 125 | @RequestParam(value = "major_id", required = false) Integer major_id, 126 | @RequestParam(value = "btnType", defaultValue = "1") Integer btnType, 127 | @RequestParam(defaultValue = "1") Integer pageNum, 128 | @RequestParam(defaultValue = "12") Integer pageSize, 129 | HttpServletResponse response) throws IOException { 130 | List users = null; 131 | if (btnType == 1) { 132 | //精准查询 133 | users = userService.accuracyQueryUser(StringUtils.isEmpty(username) ? null : username, StringUtils.isEmpty(name) ? null : name, 134 | depart_id == null || depart_id == 0 ? null : depart_id, major_id == null || major_id == 0 ? null : major_id); 135 | 136 | } else if (btnType == 2) { 137 | //模糊查询(对用户名和姓名模糊查询) 138 | users = userService.likeQueryUser(StringUtils.isEmpty(username) ? null : username, StringUtils.isEmpty(name) ? null : name, 139 | depart_id == null || depart_id == 0 ? null : depart_id, major_id == null || major_id == 0 ? null : major_id); 140 | } 141 | System.out.println("users size : " + users.size()); 142 | List list = new ArrayList<>(); 143 | for (User user : users) { 144 | list.add(new UserExcelData(user.getId(), user.getNickname(), user.getName(), user.getDepartName(), user.getMajorName(), user.getGrade())); 145 | } 146 | 147 | //设置响应头信息 148 | response.setContentType("application/vnd.ms-excel"); 149 | response.setCharacterEncoding("utf-8"); 150 | String fileName = URLEncoder.encode("用户信息", "Utf-8"); 151 | response.setHeader("Content-Disposition", "attachment;filename*=UTF-8''" + fileName + ".xlsx"); 152 | //获得输出流 153 | ServletOutputStream outputStream = response.getOutputStream(); 154 | //工作簿对象 155 | ExcelWriterBuilder writerBuilder = EasyExcel.write(outputStream, UserExcelData.class); 156 | //工作表对象 157 | ExcelWriterSheetBuilder sheet = writerBuilder.sheet(); 158 | //导出Excel 159 | sheet.doWrite(list); 160 | outputStream.close(); 161 | return ""; 162 | 163 | } 164 | 165 | 166 | } 167 | -------------------------------------------------------------------------------- /src/main/java/com/xunmaw/book/controller/OrderController.java: -------------------------------------------------------------------------------- 1 | package com.xunmaw.book.controller; 2 | 3 | import com.alibaba.excel.EasyExcel; 4 | import com.alibaba.excel.write.builder.ExcelWriterBuilder; 5 | import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder; 6 | import com.github.pagehelper.PageHelper; 7 | import com.github.pagehelper.PageInfo; 8 | import com.xunmaw.book.pojo.Order; 9 | import com.xunmaw.book.pojo.OrderExcelData; 10 | import com.xunmaw.book.pojo.User; 11 | import com.xunmaw.book.service.impl.OrderServiceImpl; 12 | import com.xunmaw.book.service.impl.UserServiceImpl; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.stereotype.Controller; 15 | import org.springframework.ui.Model; 16 | import org.springframework.util.StringUtils; 17 | import org.springframework.web.bind.annotation.*; 18 | 19 | import javax.servlet.ServletOutputStream; 20 | import javax.servlet.http.HttpServletResponse; 21 | import java.io.IOException; 22 | import java.net.URLEncoder; 23 | import java.util.ArrayList; 24 | import java.util.List; 25 | 26 | @Controller 27 | public class OrderController { 28 | 29 | @Autowired 30 | private OrderServiceImpl orderService; 31 | @Autowired 32 | private UserServiceImpl userService; 33 | 34 | @RequestMapping("/orders") 35 | public String orderList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "12") Integer pageSize, Model model) { 36 | 37 | PageHelper.startPage(pageNum, pageSize); 38 | 39 | List orders = orderService.getOrders(); 40 | for (int i = 0; i < orders.size(); i++) { 41 | User user = userService.getUserById(orders.get(i).getUId()); 42 | orders.get(i).setUName(user.getNickname()); 43 | orders.get(i).setUTel(user.getTel()); 44 | orders.get(i).setUAddress(user.getAddress()); 45 | } 46 | 47 | model.addAttribute("orders", orders); 48 | 49 | PageInfo pageInfo = new PageInfo<>(orders); 50 | model.addAttribute("pageInfo", pageInfo); 51 | 52 | return "order/list"; 53 | } 54 | 55 | @RequestMapping("/order/detail/{id}") 56 | public String bookDetail(@PathVariable("id") int id, Model model) { 57 | 58 | Order order = orderService.getOrderById(id); 59 | 60 | User user = userService.getUserById(order.getUId()); 61 | order.setUTel(user.getTel()); 62 | order.setUName(user.getNickname()); 63 | order.setUAddress(user.getAddress()); 64 | 65 | model.addAttribute("order", order); 66 | 67 | return "order/detail"; 68 | } 69 | 70 | /* 71 | 查询订单(精准、模糊查询) 72 | */ 73 | @RequestMapping("/order/query") 74 | public String accuracyQueryOrder(@RequestParam(value = "oid", required = false) Integer oid, 75 | @RequestParam(value = "username", required = false) String userName, 76 | @RequestParam(value = "status", required = false) Integer status, 77 | @RequestParam(value = "btnType", defaultValue = "1") Integer btnType, 78 | @RequestParam(defaultValue = "1") Integer pageNum, 79 | @RequestParam(defaultValue = "12") Integer pageSize, 80 | Model model) { 81 | 82 | List orders = null; 83 | PageHelper.startPage(pageNum, pageSize); 84 | if (btnType != null) { 85 | model.addAttribute("btnType", btnType); 86 | } 87 | if (oid != null) { 88 | model.addAttribute("oid", oid); 89 | } 90 | if (!StringUtils.isEmpty(userName)) { 91 | model.addAttribute("username", userName); 92 | } 93 | if (status != null) { 94 | model.addAttribute("selectstatus", status); 95 | } 96 | 97 | if (btnType == 1) { 98 | //精准查询 99 | orders = orderService.accuracyQueryBooks(oid, StringUtils.isEmpty(userName) ? null : userName, status == 0 ? null : status); 100 | for (int i = 0; i < orders.size(); i++) { 101 | User user = userService.getUserById(orders.get(i).getUId()); 102 | orders.get(i).setUName(user.getNickname()); 103 | orders.get(i).setUTel(user.getTel()); 104 | orders.get(i).setUAddress(user.getAddress()); 105 | } 106 | } else if (btnType == 2) { 107 | //模糊查询 108 | orders = orderService.likeQueryBooks(oid, StringUtils.isEmpty(userName) ? null : userName, status == 0 ? null : status); 109 | for (int i = 0; i < orders.size(); i++) { 110 | User user = userService.getUserById(orders.get(i).getUId()); 111 | orders.get(i).setUName(user.getNickname()); 112 | orders.get(i).setUTel(user.getTel()); 113 | orders.get(i).setUAddress(user.getAddress()); 114 | } 115 | } 116 | if (orders != null) { 117 | for (Order order : orders) { 118 | System.out.println(order); 119 | } 120 | } 121 | model.addAttribute("orders", orders); 122 | PageInfo pageInfo = new PageInfo<>(orders); 123 | model.addAttribute("pageInfo", pageInfo); 124 | return "order/list"; 125 | } 126 | 127 | /* 128 | 导出查询到的订单信息 129 | */ 130 | @RequestMapping("/order/export") 131 | @ResponseBody 132 | public String excelExport(@RequestParam(value = "oid", required = false) Integer oid, 133 | @RequestParam(value = "username", required = false) String userName, 134 | @RequestParam(value = "status", required = false) Integer status, 135 | @RequestParam(value = "btnType", defaultValue = "1") Integer btnType, 136 | HttpServletResponse response) throws IOException { 137 | 138 | List orders = null; 139 | 140 | if (btnType == 1) { 141 | //精准查询 142 | orders = orderService.accuracyQueryBooks(oid, StringUtils.isEmpty(userName) ? null : userName, status == 0 ? null : status); 143 | for (int i = 0; i < orders.size(); i++) { 144 | User user = userService.getUserById(orders.get(i).getUId()); 145 | orders.get(i).setUName(user.getNickname()); 146 | orders.get(i).setUTel(user.getTel()); 147 | orders.get(i).setUAddress(user.getAddress()); 148 | } 149 | } else if (btnType == 2) { 150 | //模糊查询 151 | orders = orderService.likeQueryBooks(oid, StringUtils.isEmpty(userName) ? null : userName, status == 0 ? null : status); 152 | for (int i = 0; i < orders.size(); i++) { 153 | User user = userService.getUserById(orders.get(i).getUId()); 154 | orders.get(i).setUName(user.getNickname()); 155 | orders.get(i).setUTel(user.getTel()); 156 | orders.get(i).setUAddress(user.getAddress()); 157 | } 158 | } 159 | //设置响应头信息 160 | response.setContentType("application/vnd.ms-excel"); 161 | response.setCharacterEncoding("utf-8"); 162 | String fileName = URLEncoder.encode("订单信息", "Utf-8"); 163 | response.setHeader("Content-Disposition", "attachment;filename*=UTF-8''" + fileName + ".xlsx"); 164 | 165 | //获得输出流 166 | ServletOutputStream outputStream = response.getOutputStream(); 167 | 168 | //工作簿对象 169 | ExcelWriterBuilder writerBuilder = EasyExcel.write(outputStream, OrderExcelData.class); 170 | 171 | //工作表对象 172 | ExcelWriterSheetBuilder sheet = writerBuilder.sheet(); 173 | //准备数据 174 | List list = new ArrayList<>(); 175 | for (Order order : orders) { 176 | String stateName = orderService.findStateById(order.getState()); 177 | list.add(new OrderExcelData(order.getId(), order.getName(), order.getPrice(), order.getNickname(), order.getTel(), order.getUName(), order.getUTel(), stateName, order.getTime())); 178 | } 179 | 180 | //导出Excel 181 | sheet.doWrite(list); 182 | outputStream.close(); 183 | 184 | return ""; 185 | } 186 | 187 | 188 | } 189 | -------------------------------------------------------------------------------- /src/main/resources/templates/order2/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Dashboard Template for Bootstrap 13 | 14 | 15 | 16 | 17 | 18 | 19 | 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 | 退货状态:   75 | 76 | 77 | 78 | 79 |
80 |
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 | 114 | 115 | 116 | 117 |
编号购买书名出版社价格购买人用户名购买人电话退货原因退货状态操作
111 | 详情 113 |
118 | 119 |
    120 | 121 |
  • 122 | 首页 123 |
  • 124 | 125 |
  • 126 | 上一页 127 |
  • 128 | 129 |
  • 130 | 132 | 134 |
  • 135 | 136 |
  • 137 | 下一页 138 |
  • 139 | 140 |
  • 尾页
  • 142 |
143 | 144 |
145 | 146 | 147 |
148 |
149 |
150 | 151 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 163 | 164 | 165 | 166 | 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /src/main/resources/templates/book/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Dashboard Template for Bootstrap 13 | 14 | 15 | 16 | 17 | 18 | 19 | 45 | 46 | 47 | 48 | 49 | 50 |
51 | 52 |
53 |
54 | 55 | 56 |
57 | 58 |
59 | 60 |
61 |
62 | 63 | 64 | 65 | 书名:   66 | 67 | 图书状态:   79 | 80 | 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 | 113 | 116 | 117 | 118 | 119 |
编号书名出版社作者价格新旧程度图书状态发布时间操作
114 | 详情 115 |
120 | 121 |
    122 | 123 |
  • 124 | 首页 125 |
  • 126 | 127 |
  • 128 | 上一页 129 |
  • 130 | 131 |
  • 132 | 134 | 136 |
  • 137 | 138 |
  • 139 | 下一页 140 |
  • 141 | 142 |
  • 尾页
  • 144 |
145 |
146 |
147 |
148 |
149 | 150 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 162 | 163 | 164 | 165 | 210 | 211 | 212 | 213 | -------------------------------------------------------------------------------- /src/main/resources/templates/user/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Dashboard Template for Bootstrap 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 51 | 52 | 53 | 54 | 55 | 56 |
57 | 58 |
59 |
60 | 61 | 62 |
63 | 64 |
65 | 66 |
67 |
68 | 69 | 70 | 71 | 用户名:   72 | 73 | 姓名:    74 | 学院:   80 | 81 | 专业:   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 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 125 | 126 | 127 | 128 |
编号用户名姓名电话院系专业年级操作
123 | 详情 124 |
129 | 130 | 156 | 157 |
158 | 159 | 160 |
161 |
162 |
163 | 164 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 176 | 177 | 178 | 179 | 232 | 233 | 234 | 235 | -------------------------------------------------------------------------------- /src/main/resources/templates/order/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Dashboard Template for Bootstrap 10 | 11 | 12 | 13 | 14 | 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 | 订单状态:   77 | 78 | 79 | 80 | 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 | 113 | 114 | 115 | 119 | 120 | 121 | 122 |
编号购买书名价格购买人用户名购买人电话发货方用户名发货方电话订单状态付款时间操作
116 | 详情 118 |
123 | 124 | 150 | 151 |
152 |
153 |
154 |
155 | 156 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 168 | 169 | 170 | 171 | 228 | 229 | 230 | 231 | --------------------------------------------------------------------------------