Java项目-基于springboot框架的网上图书商城项目实战(附源码+文档)
作者:计算机学长阿伟开发技术:SpringBoot、SSM、Vue、MySQL、ElementUI等,“文末源码”。
https://i-blog.csdnimg.cn/direct/5a814d045de04809929add9a48c71d98.png
开发运行环境
[*]开发语言:Java
[*]数据库:MySQL
[*]技术:SpringBoot、Vue、Mybaits Plus、ELementUI
[*]工具:IDEA/Ecilpse、Navicat、Maven
源码下载地点:
https://download.csdn.net/download/weixin_53180424/89909108
文档目次
【如需全文请按文末获取联系】
https://i-blog.csdnimg.cn/direct/20a216762356476a88d014f9c946764f.png
一、项目简介
网上图书商城是一个综合性的电商平台,致力于为读者提供丰富的图书资源、便捷的购书体验和全面的图书信息服务。平台涵盖了图书信息、图书资讯、个人中央、购物车、首页等多个功能模块,通过清晰的组织布局和高效的背景管理体系,为读者和卖家提供了一个互动、交流的网上图书生意业务空间。在背景管理体系中,管理员可以全面监控和管理平台的运营状态,包括卖家管理、用户管理、书信息管理、图书范例管理、订单管理以及体系管理等焦点功能。整个平台计划公道、功能强盛,满意了当代电子商务的多元化需求。
二、体系计划
2.1软件功能模块计划
https://i-blog.csdnimg.cn/direct/7a8da9bc1d184b45bf7712a63a9d7f85.png
2.2数据库计划
用户注册实体图如图4-1所示:
https://i-blog.csdnimg.cn/direct/18ac41bf532947b08328ede254ed973c.png
图书信息实体图如图4-2所示:
https://i-blog.csdnimg.cn/direct/651f0fd8c4024cc7a2ec1a82267f2a71.png
三、体系项目部分截图
3.1背景体系部分页面效果
3.1.1管理员功能模块
管理员登录网上图书商城,可以对首页、个人中央、用户管理、卖家管理、图书范例管理、图书信息管理、订单管理、体系管理等功能模块进行相应操纵,如图5-6所示。
https://i-blog.csdnimg.cn/direct/33c9d76455fd414b97e007c30e938e5e.png
用户管理,在用户管理页面可以对索引、用户名、姓名、性别、头像、邮箱、手机等信息进行详情,修改和删除等操纵,如图5-7所示。
https://i-blog.csdnimg.cn/direct/d8c499bbab494368ae89506058804aff.png
卖家管理,在卖家管理页面可以对索引、账号、卖家姓名、性别、头像、身份证、手机、邮箱、审核复兴、审核状态等内容进行详情,审核,修改和删除等操纵,如图5-8所示。
https://i-blog.csdnimg.cn/direct/68a9bda71a4840b2b7354c1eb86e2f6e.png
图书范例管理,在图书范例管理页面可以查察索引、图书范例等内容,并进行新增、修改和删除操纵,如图5-9所示。
https://i-blog.csdnimg.cn/direct/c55c3e7c93ae45aaa7e326027102ae57.png
图书信息管理,在图书信息管理页面可以查察索引、店铺名称、图书编号、图书名称、图书范例、图片、作者、出版社、账号、买家姓名、手机、价格、单限、库存等内容,并进行详情,修改,查察批评和删除操纵,如图5-10所示。
https://i-blog.csdnimg.cn/direct/52711f1f616448e1996f2d84845cf5a6.png
订单管理,在已支付订单页面可以对索引、订单编号、商品名称、商品图片、购买数量、价格/积分、折扣价格、总价格/总积分、折扣总价格、支付范例、状态、地点、电话、收货人、商户名称、下单时间等内容进行详情和删除等操纵,还可以对已退款订单,已完成订单,已发货订单,未支付订单,已取消订单进行相应的操纵;如图5-12所示。
https://i-blog.csdnimg.cn/direct/aaf561d7ffab4885808ed01230ba5fd8.png
3.1.2卖家功能模块
卖家登录进入网上图书商城,可以对首页、个人中央、图书信息管理、订单管理等功能进行相应操纵,如图5-13所示。
https://i-blog.csdnimg.cn/direct/9c4bd905ebde4bc49a63ae57fc0808a0.png
图书信息管理,在图书信息管理页面可以查察索引、店铺名称、图书编号、图书名称、图书范例、图片、作者、出版社、账号、买家姓名、手机、价格、单限、库存等内容,并进行详情,修改,查察批评和删除操纵,如图5-14所示。
https://i-blog.csdnimg.cn/direct/e2a1241964864c71afc68efff97d4cdf.png
订单管理,在已支付订单页面可以对索引、订单编号、商品名称、商品图片、购买数量、价格/积分、折扣价格、总价格/总积分、折扣总价格、支付范例、状态、地点、电话、收货人、商户名称、下单时间等信息进行详情、发货和删除操纵,还可以对已退款订单,已完成订单,已发货订单,未支付订单,已取消订单等进行相应的操纵;如图5-15所示。
https://i-blog.csdnimg.cn/direct/9fd1d47ac114487282d234514a43f421.png
3.2前台体系部分页面效果
网上图书商城,在体系首页可以查察首页、图书信息、图书资讯、个人中央、购物车等内容进行具体操纵,如图5-1所示。
https://i-blog.csdnimg.cn/direct/28197f6a9c954e148ac89f97aa010eda.png
用户注册,在用户注册页面通过填写用户账号、暗码、确认暗码、姓名、邮箱、手机号码等信息完成用户注册,如图5-2所示。
https://i-blog.csdnimg.cn/direct/a1cadc88677040b48af0e07ea49db92d.png
图书信息,在图书信息页面可以查察图书名称、价格、单次购买、库存、店铺名称、图书编号、图书范例、图片、作者、出版社、账号、买家账号、手机、图示介绍等具体内容,并进行添加到购物车,立刻购买,批评,等收藏操纵,如图5-3所示。
https://i-blog.csdnimg.cn/direct/e0101d469bdb49129b132ec6fce8648e.png
购物车,在购物车页面可以查察购买商品、价格、数量、总价等信息,还可以进行点击购买和删除操纵;如图5-4所示。
https://i-blog.csdnimg.cn/direct/40a72a31151947f09ebb2fc55bc9f5cb.png
个人中央,在个人中央页面通过填写用户名、暗码、姓名、性别、上传图片、邮箱、手机、余额等信息进行更新信息,根据需要对我的订单,我的地点,我的收藏进行具体操纵,如图5-5所示。
https://i-blog.csdnimg.cn/direct/43de9972675b4369bc0a97ea2606a6bd.png
四、部分焦点代码
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.AddressEntity;
import com.entity.view.AddressView;
import com.service.AddressService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
* 地址
* 后端接口
*/
@RestController
@RequestMapping("/address")
public class AddressController {
@Autowired
private AddressService addressService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,AddressEntity address,
HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
address.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,AddressEntity address,
HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
address.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( AddressEntity address){
EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
ew.allEq(MPUtil.allEQMapPre( address, "address"));
return R.ok().put("data", addressService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(AddressEntity address){
EntityWrapper< AddressEntity> ew = new EntityWrapper< AddressEntity>();
ew.allEq(MPUtil.allEQMapPre( address, "address"));
AddressView addressView =addressService.selectView(ew);
return R.ok("查询地址成功").put("data", addressView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
AddressEntity address = addressService.selectById(id);
return R.ok().put("data", address);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
AddressEntity address = addressService.selectById(id);
return R.ok().put("data", address);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody AddressEntity address, HttpServletRequest request){
address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(address);
address.setUserid((Long)request.getSession().getAttribute("userId"));
Long userId = (Long)request.getSession().getAttribute("userId");
if(address.getIsdefault().equals("是")) {
addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));
}
address.setUserid(userId);
addressService.insert(address);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody AddressEntity address, HttpServletRequest request){
address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(address);
address.setUserid((Long)request.getSession().getAttribute("userId"));
Long userId = (Long)request.getSession().getAttribute("userId");
if(address.getIsdefault().equals("是")) {
addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));
}
address.setUserid(userId);
addressService.insert(address);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody AddressEntity address, HttpServletRequest request){
//ValidatorUtils.validateEntity(address);
if(address.getIsdefault().equals("是")) {
addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", request.getSession().getAttribute("userId")));
}
addressService.updateById(address);//全部更新
return R.ok();
}
/**
* 获取默认地址
*/
@RequestMapping("/default")
public R defaultAddress(HttpServletRequest request){
Wrapper<AddressEntity> wrapper = new EntityWrapper<AddressEntity>().eq("isdefault", "是").eq("userid", request.getSession().getAttribute("userId"));
AddressEntity address = addressService.selectOne(wrapper);
return R.ok().put("data", address);
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
addressService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<AddressEntity> wrapper = new EntityWrapper<AddressEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));
}
int count = addressService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
获取源码或文档
如需对应的论文或文档,以及其他定制需求,也可以下方添加联系我。
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]