基于javaweb+springboot的在线购书系统网上书店图书商城(前台、后台)(java+Springboot+ssm+mysql+maven)

基于javaweb+springboot的在线购书系统网上书店图书商城(前台、后台)(java+Springboot+ssm+mysql+maven)

一、项目简述
功能:一个基于JavaWeb的网上书店的设计与实现,归纳 出了几个模块,首先是登录注册模块,图书查找模块,购物车模块,订单模块,个人中心模块,用户管理模块,图 书管理模块等。 该项目是javaJeb技术的实战操作,采用了MVC设计模 式,包括基本的entity, jscript, servlet,以及ajax异步请 求,查询分页,持久化层方法的封装等等,对javaweb技 术的巩固很有帮助,为J2EE的学习打下基础,适用于课程 设计,毕业设计。

二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)

项目技术: JSP +Springboot+ SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + maven等等

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

适用

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

			return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
	}
	@PostMapping("/delete")
	public ResultVO categoryDelete(String categoryCode)
	{
		int categories = categoryService.deleteByByCategoryCode(categoryCode);
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加验证
	@PostMapping("/insert")
	public ResultVO categoryInsert(@Valid Category record)
	{
		
		int categories = categoryService.insert(record);
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加验证
	@PostMapping("/update")
	public  ResultVO categoryUpdate(@Valid Category record)
	{
		int categories = categoryService.updateByCategoryCode(record);
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加分页
	@GetMapping("/searchall")
	public  ResultVO categorySearchAll(Integer page,Integer limit)
	{
		List<Category> categories = categoryService.selectAll(page==null?0:page,limit==null?10:limit);
		if(categories.size()!=0)
			return new ResultVO(ResultCode.SUCCESS,categories);
		else
			return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
	}	
}
订单管理模块:
/**
 * @Description: 订单管理模块
 */
@RestController
@RequestMapping("/order")
public class OrderController {
     @Autowired
     private OrderService orderService;
     * 多条件搜索订单 ---- by guozongchao
     * @param order
     * @param page
     * @param limit
     * @return
     */
    @GetMapping("/search")
    public ResultVO searchOrders(Order order, Integer page, Integer limit) {
        if (order.getConsigneeName().isEmpty()) {
            order.setConsigneeName(null);
        }
		int categories = categoryService.insert(record);
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加验证
	@PostMapping("/update")
	public  ResultVO categoryUpdate(@Valid Category record)
	{
		int categories = categoryService.updateByCategoryCode(record);
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加分页
	@GetMapping("/searchall")
	public  ResultVO categorySearchAll(Integer page,Integer limit)
	{
		List<Category> categories = categoryService.selectAll(page==null?0:page,limit==null?10:limit);
		if(categories.size()!=0)
			return new ResultVO(ResultCode.SUCCESS,categories);
    @GetMapping("/search")
    public ResultVO searchOrders(Order order, Integer page, Integer limit) {
        if (order.getConsigneeName().isEmpty()) {
            order.setConsigneeName(null);
        }
        List<Order> orders = orderService.searchOrders(order, page, limit);
        PageInfo pageInfo = new PageInfo(orders);
        return new ResultVO(ResultCode.SUCCESS, (int) pageInfo.getTotal(), orders);
    }
}
	//添加验证
	@PostMapping("/update")
	public  ResultVO categoryUpdate(@Valid Category record)
	{
		int categories = categoryService.updateByCategoryCode(record);
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加分页
	@GetMapping("/searchall")
	public  ResultVO categorySearchAll(Integer page,Integer limit)
	{
		List<Category> categories = categoryService.selectAll(page==null?0:page,limit==null?10:limit);
		if(categories.size()!=0)
			return new ResultVO(ResultCode.SUCCESS,categories);
		else
			return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
	}	
}
    @PostMapping("/delete")
    public ResultVO bookDelete(Integer bookId) {
        int books = bookService.bookDeleteSearchById(bookId);
        return new ResultVO(ResultCode.SUCCESS, null);
    }
    //添加验证注解
    @PostMapping("/insert")
    public ResultVO bookInsert(@Valid Book record) {
        int books = bookService.bookInsert(record);
        return new ResultVO(ResultCode.SUCCESS, null);
    }
    @GetMapping("/searchcode")
  public ResultVO bookSerchByCategoryCode(String catrgoryCode,Integer page,Integer limit) {
      List<Book> books = bookService.bookSearchByCode(catrgoryCode,page,limit);
        PageInfo pageInfo = new PageInfo(books);
     if(books.size()!=0)
     {
      return new ResultVO(ResultCode.SUCCESS,(int)pageInfo.getTotal(), books);
     }
     else
    }
   /* @GetMapping("/list/user_order/{userId}")
    public ResultVO getOrderByUserId(@PathVariable("userId") Integer userId) {
    	List<Order> orders = orderService.selectByUserId(userId);
    	if(orders.size()!=0)
    	{
    		return new ResultVO(ResultCode.SUCCESS,orders);
    	}
        else
        	return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
    }*/
    @GetMapping("/list/{orderId}")
        public ResultVO getOrderByOrderId(@PathVariable("orderId") Integer orderId) {
    	Order orders = orderService.selectByOrderId(orderId);
    	if(orders!=null)
        return new ResultVO(ResultCode.SUCCESS,orders);
    	else
    	return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
    }
    /**
     * 多条件搜索订单 ---- by guozongchao
     * @param order
     * @param page
     * @param limit
     * @param book
     * @param page
     * @param limit
     * @return
     */
    @GetMapping("/search")
    public ResultVO searchBooks(Book book,Integer page, Integer limit) {
        if(book.getBookName().isEmpty()){
            book.setBookName(null);
        }
        if(book.getIsbn().isEmpty()){
            book.setIsbn(null);
        }
        List<Book> books = bookService.searchBooks(book, page, limit);
        PageInfo pageInfo = new PageInfo(books);
        return new ResultVO(ResultCode.SUCCESS, (int) pageInfo.getTotal(), books);
    }
	{
		int categories = categoryService.deleteByByCategoryCode(categoryCode);
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加验证
	@PostMapping("/insert")
	public ResultVO categoryInsert(@Valid Category record)
	{
		
		int categories = categoryService.insert(record);
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加验证
	@PostMapping("/update")
	public  ResultVO categoryUpdate(@Valid Category record)
	{
		int categories = categoryService.updateByCategoryCode(record);
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加分页
     */
    @GetMapping("/search")
    public ResultVO searchOrders(Order order, Integer page, Integer limit) {
        if (order.getConsigneeName().isEmpty()) {
            order.setConsigneeName(null);
        }
        List<Order> orders = orderService.searchOrders(order, page, limit);
        PageInfo pageInfo = new PageInfo(orders);
        return new ResultVO(ResultCode.SUCCESS, (int) pageInfo.getTotal(), orders);
    }
}
后台页面的路由跳转:
/**
 * @Description: 后台页面的路由跳转
 */
@Controller
@RequestMapping("/admin")
public class AdminRouterController {
    //跳转用户管理页面
    //跳转书籍管理页面
    @GetMapping({"/","/book_manage"})
    public String toBookManage(){
        return "admin/books";
    }
    //跳转分类管理页面
    @GetMapping("/category_manage")
    public String toCategoryManage(){
        return "admin/category";
    }
    //跳转订单管理页面
    @GetMapping("/order_manage")
    public String toOrderManage(){
        return "admin/order";
     * @param page    页码
     * @param limit   每页的条数
     * @return
     */
    @GetMapping("/list")
    public ResultVO getOrderList(@RequestParam(required = false) Integer page,@RequestParam(required = false) Integer limit) {
        List<Order> orders = orderHandleService.getAllOrdersByPage(page, limit);
        PageInfo pageInfo = new PageInfo(orders);
        return new ResultVO(ResultCode.SUCCESS,(int)pageInfo.getTotal(),orders);
    }
    /**
    }*/
    @GetMapping("/list/{orderId}")
        public ResultVO getOrderByOrderId(@PathVariable("orderId") Integer orderId) {
    	Order orders = orderService.selectByOrderId(orderId);
    	if(orders!=null)
        return new ResultVO(ResultCode.SUCCESS,orders);
    	else
    	return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
    }
    /**
     * 多条件搜索订单 ---- by guozongchao
     * @param order
     * @param page
     * @param limit
     * @return
     */
	}
	//添加验证
	@PostMapping("/update")
	public  ResultVO categoryUpdate(@Valid Category record)
	{
		int categories = categoryService.updateByCategoryCode(record);
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加分页
	@GetMapping("/searchall")
	public  ResultVO categorySearchAll(Integer page,Integer limit)
	{
		List<Category> categories = categoryService.selectAll(page==null?0:page,limit==null?10:limit);
		if(categories.size()!=0)
			return new ResultVO(ResultCode.SUCCESS,categories);
		else
			return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
	}	
}
订单管理模块:
/**
    @GetMapping("/searchid")
    public ResultVO bookSearchByBookId(Integer bookId) {
        // Book books=bookMapper.selectByBookId(bookIde);
        Book books = bookService.bookSearchById(bookId);
        if (books != null)
            return new ResultVO(ResultCode.SUCCESS,books);
        else
            return new ResultVO(ResultCode.RECORD_NOT_FOUND, null);
    }
    @PostMapping("/delete")
    public ResultVO bookDelete(Integer bookId) {
    //跳转添加书籍页面
    @GetMapping("/add_book")
    public String AddBook(){
        return "admin/add_book";
    }
    //跳转后台登录页面
    @GetMapping("/login")
    public String toAdminLogin(){
        return "admin/login";
    }
}
书籍管理模块控制器:
/**
 * @Description: 书籍管理模块控制器
 */
@RestController
@RequestMapping("/book")
public class BookController {
    @Autowired
    private BookService bookService;
 * @Description: 后台页面的路由跳转
 */
@Controller
@RequestMapping("/admin")
public class AdminRouterController {
    //跳转用户管理页面
    @GetMapping("/user_manage")
    public String toUserManage(){
        return "admin/user";
    }
    //跳转书籍管理页面
    @GetMapping({"/","/book_manage"})
    public String toBookManage(){
        return "admin/books";
    }
    //跳转分类管理页面
	@Autowired
	private CategoryService categoryService;
	@Resource
	private CategoryMapper categoryMapper;
	@GetMapping("/searchcode")
	public ResultVO categorySearchByCode(String categoryCode)
	{
		
		Category categories = categoryService.selectByByCategoryCode(categoryCode);
		if(categories!=null)
		return new ResultVO(ResultCode.SUCCESS,categories);
		else
			return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
	}
	@PostMapping("/delete")
	public ResultVO categoryDelete(String categoryCode)
	{
		int categories = categoryService.deleteByByCategoryCode(categoryCode);
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加验证
	@PostMapping("/insert")
	public ResultVO categoryInsert(@Valid Category record)
	{
		Category categories = categoryService.selectByByCategoryCode(categoryCode);
		if(categories!=null)
		return new ResultVO(ResultCode.SUCCESS,categories);
		else
			return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
	}
	@PostMapping("/delete")
	public ResultVO categoryDelete(String categoryCode)
	{
		int categories = categoryService.deleteByByCategoryCode(categoryCode);
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加验证
	@PostMapping("/insert")
	public ResultVO categoryInsert(@Valid Category record)
	{
		
		int categories = categoryService.insert(record);
	//添加分页
	@GetMapping("/searchall")
	public  ResultVO categorySearchAll(Integer page,Integer limit)
	{
		List<Category> categories = categoryService.selectAll(page==null?0:page,limit==null?10:limit);
		if(categories.size()!=0)
			return new ResultVO(ResultCode.SUCCESS,categories);
		else
			return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
	}	
		return new ResultVO(ResultCode.SUCCESS,null);
	}
	//添加分页
	@GetMapping("/searchall")
	public  ResultVO categorySearchAll(Integer page,Integer limit)
	{
		List<Category> categories = categoryService.selectAll(page==null?0:page,limit==null?10:limit);
		if(categories.size()!=0)
			return new ResultVO(ResultCode.SUCCESS,categories);
		else
	private CategoryMapper categoryMapper;
	@GetMapping("/searchcode")
	public ResultVO categorySearchByCode(String categoryCode)
	{
		
		Category categories = categoryService.selectByByCategoryCode(categoryCode);
		if(categories!=null)
		return new ResultVO(ResultCode.SUCCESS,categories);
		else
			return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
	}
	@PostMapping("/delete")
	public ResultVO categoryDelete(String categoryCode)
        	return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
    }*/
    @GetMapping("/list/{orderId}")
        public ResultVO getOrderByOrderId(@PathVariable("orderId") Integer orderId) {
    	Order orders = orderService.selectByOrderId(orderId);
    	if(orders!=null)
        return new ResultVO(ResultCode.SUCCESS,orders);
    	else
    	return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
    }
    /**
     * 多条件搜索订单 ---- by guozongchao
     * @param order
     * @param page
     * @param limit
     * @return
     */
        List<Book> books = bookService.searchBooks(book, page, limit);
        PageInfo pageInfo = new PageInfo(books);
        return new ResultVO(ResultCode.SUCCESS, (int) pageInfo.getTotal(), books);
    }
}
分类管理模块控制器:
/**
 * @Description: 分类管理模块控制器
 */
@RestController
@RequestMapping("category")
public class CategoryController {
	@Autowired
	private CategoryService categoryService;
	@Resource
     }
     else
    	 return new ResultVO(ResultCode.RECORD_NOT_FOUND, null);
  }
    //添加验证注解
    @PostMapping("/update")
    public ResultVO bookUpdate(@Valid Book record) {
        int books = bookService.bookUpdate(record);
        return new ResultVO(ResultCode.SUCCESS, null);
    }
    /**
    	Order orders = orderService.selectByOrderId(orderId);
    	if(orders!=null)
        return new ResultVO(ResultCode.SUCCESS,orders);
    	else
    	return new ResultVO(ResultCode.RECORD_NOT_FOUND,null);
    }
    /**
     * 多条件搜索订单 ---- by guozongchao
     * @param order
     * @param page
     * @param limit
     * @return
     */
    @GetMapping("/search")
    public ResultVO searchOrders(Order order, Integer page, Integer limit) {
        if (order.getConsigneeName().isEmpty()) {
            order.setConsigneeName(null);
        }
        List<Order> orders = orderService.searchOrders(order, page, limit);
        PageInfo pageInfo = new PageInfo(orders);
        return new ResultVO(ResultCode.SUCCESS, (int) pageInfo.getTotal(), orders);
    }
     @Autowired
     private OrderService orderService;
    @Autowired
    private OrderHandleService orderHandleService;
    /**
     * 分页获取订单列表,如果都为空,则获取所有
     * @param page    页码
     * @param limit   每页的条数
     * @return
     */
    @GetMapping("/list")
    public ResultVO getOrderList(@RequestParam(required = false) Integer page,@RequestParam(required = false) Integer limit) {
        List<Order> orders = orderHandleService.getAllOrdersByPage(page, limit);
        PageInfo pageInfo = new PageInfo(orders);
        return new ResultVO(ResultCode.SUCCESS,(int)pageInfo.getTotal(),orders);
    }
    /**
     * 用户提交订单处理
     * @param order
     * @param session
     * @return
     */
    @PostMapping("/submit")
    public ResultVO orderSubmit(@RequestBody @Valid Order order, HttpSession session) {

适用

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值