大家好!我是职场程序猿,感谢您阅读本文,欢迎一键三连哦。
💞当前专栏:Java毕业设计
精彩专栏推荐👇🏻👇🏻👇🏻
开发运行环境
- 框架:ssm
- JDK版本:JDK1.8
- 服务器:tomcat7
- 数据库:mysql 5.7
- 数据库工具:Navicat12
- 开发软件:eclipse/myeclipse/idea
- Maven包:Maven3.3.9
- 浏览器:谷歌浏览器
源码下载地址:
https://download.csdn.net/download/m0_46388260/89082748
论文目录
【如需全文请按文末获取联系】
一、项目简介
使用精品酒销售管理系统的用户分管理员和用户两个角色的权限子模块。
管理员所能使用的功能主要有:主页、个人中心、用户管理、商品分类管理、商品信息管理、系统管理、订单管理等。
用户可以实现主页、个人中心、我的收藏管理、订单管理等。
前台首页可以实现商品信息、新闻资讯、我的、跳转到后台、购物车等。
二、系统设计
2.1软件功能模块设计
此系统功能较为全面如下图系统功能结构如图4-4所示。
2.2数据库设计
商品信息实体E-R图,如图4.6所示。
用户信息E-R图,如图4.7所示。
三、系统项目部分截图
3.1管理员功能模块
管理员通过用户名和密码填写完成后进行登录,如图5-6所示。管理员登录成功后进入到系统操作界面,可以对主页、个人中心、用户管理、商品分类管理、商品信息管理、系统管理、订单管理等功能模块进行相对应操作。
个人中心:通过列表可以获取原密码、新密码、确认密码等内容,可以进行修改或删除操作,如图5-7所示。
用户管理:通过列表可以获取用户账号、用户姓名、密码、性别、联系电话、电子邮箱、余额等信息,进行修改或删除操作,如图5-9所示。
已支付订单列表:管理员通过列表可以获取订单id、用户id、商品id、商品名称、商品图片、购买数量、价格/积分、折扣价格、总价格/总积分、折扣总价格、支付类型、
状态、地址等信息,进行修改或删除操作,如图5-15所示。
3.2前台首页功能模块
精品酒销售管理系统,在精品酒销售管理系统可以查看商品信息、新闻资讯、我的、跳转到后台、购物车等内容,如图5-17所示。
个人中心,在个人中心页面可以查看用户账号、用户姓名、密码、性别、联系电话、电子邮箱等如图5-20所示。
确认下单,在确认下单页面可以查看选择收货地址、清单列表等信息进行支付如图5-22所示。
四、部分核心代码
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.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.CartEntity;
import com.entity.view.CartView;
import com.service.CartService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 购物车表
* 后端接口
* @author
* @email
* @date 2021-01-08 22:38:59
*/
@RestController
@RequestMapping("/cart")
public class CartController {
@Autowired
private CartService cartService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,CartEntity cart, HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
cart.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper<CartEntity> ew = new EntityWrapper<CartEntity>();
PageUtils page = cartService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, cart), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,CartEntity cart, HttpServletRequest request){
EntityWrapper<CartEntity> ew = new EntityWrapper<CartEntity>();
PageUtils page = cartService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, cart), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( CartEntity cart){
EntityWrapper<CartEntity> ew = new EntityWrapper<CartEntity>();
ew.allEq(MPUtil.allEQMapPre( cart, "cart"));
return R.ok().put("data", cartService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(CartEntity cart){
EntityWrapper< CartEntity> ew = new EntityWrapper< CartEntity>();
ew.allEq(MPUtil.allEQMapPre( cart, "cart"));
CartView cartView = cartService.selectView(ew);
return R.ok("查询购物车表成功").put("data", cartView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
CartEntity cart = cartService.selectById(id);
return R.ok().put("data", cart);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id){
CartEntity cart = cartService.selectById(id);
return R.ok().put("data", cart);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody CartEntity cart, HttpServletRequest request){
cart.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(cart);
cart.setUserid((Long)request.getSession().getAttribute("userId"));
cartService.insert(cart);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody CartEntity cart, HttpServletRequest request){
cart.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(cart);
cartService.insert(cart);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody CartEntity cart, HttpServletRequest request){
//ValidatorUtils.validateEntity(cart);
cartService.updateById(cart);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
cartService.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<CartEntity> wrapper = new EntityWrapper<CartEntity>();
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 = cartService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
获取源码或论文
如需对应的论文或源码,以及其他定制需求,也可以下方微信联系我。