项目介绍
现如今是一个快节奏的生活,无论各个行业都是快速的发展,再也不是以前自给自足的社会,快节奏的生活带来了无数的变化。人们生活生活方式的变化,例如购物的方式,出行的方式等,
尤其突出的是在购物方式上的变化,人们现在喜欢高效便捷,再也不是以前那个啰里啰嗦的导购式消费,在种种消费模式的变化下,如何购买到放心的阿迪达斯是很多人关心的问题。所以一个综合功能强的体育用品销售系统是大众的所需,设计这个网站是以让人们拥有一个更好的购物体验为根基点,以快速流程简单为辅助,创造一种更好的购物方式。
本系统从实际情况出发,并考虑用户的实际问题,采用当前比较流程的Java语言来进行程序的设计,在数据库存储方面主要是使用MySQL来进行存储,前端使用vue技术,后端在框架选择上我们使用的是当前最流行的SSM框架来进行设计。
体育用品销售系统分为前台和后台两部分,其中前台部分主要是给用户使用的包括注册登录,查看公告信息,查看体育用品信息,将体育用品加入到购物车,结算管理,订单管理,评价管理,个人信息管理等功能;后台部分主要包括分类信息管理,体育用品信息管理,新闻公告管理,用户信息管理,订单信息管理,评价信息管理,留言信息管理等功能,通过这些功能可以让用户更加方便的找到所需的体育用品并进行购买,让管理员可以方便快捷的对订单信息进行管理。
开发环境
开发语言:Java
数据库 :MySQL
系统架构:B/S
后端框架:SSM
前端框架:Vue
开发工具:IDEA或者Eclipse,JDK1.8,Maven
支持定做:Java/PHP/Python/Android/小程序/Vue/爬虫/C#/Asp.net
系统截图
部分代码
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.ShangpinfenleiEntity;
import com.entity.view.ShangpinfenleiView;
import com.service.ShangpinfenleiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 体育用品分类
* 后端接口
*/
@RestController
@RequestMapping("/shangpinfenlei")
public class ShangpinfenleiController {
@Autowired
private ShangpinfenleiService shangpinfenleiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ShangpinfenleiEntity shangpinfenlei,
HttpServletRequest request){
EntityWrapper<ShangpinfenleiEntity> ew = new EntityWrapper<ShangpinfenleiEntity>();
PageUtils page = shangpinfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shangpinfenlei), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ShangpinfenleiEntity shangpinfenlei, HttpServletRequest request){
EntityWrapper<ShangpinfenleiEntity> ew = new EntityWrapper<ShangpinfenleiEntity>();
PageUtils page = shangpinfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shangpinfenlei), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ShangpinfenleiEntity shangpinfenlei){
EntityWrapper<ShangpinfenleiEntity> ew = new EntityWrapper<ShangpinfenleiEntity>();
ew.allEq(MPUtil.allEQMapPre( shangpinfenlei, "shangpinfenlei"));
return R.ok().put("data", shangpinfenleiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ShangpinfenleiEntity shangpinfenlei){
EntityWrapper< ShangpinfenleiEntity> ew = new EntityWrapper< ShangpinfenleiEntity>();
ew.allEq(MPUtil.allEQMapPre( shangpinfenlei, "shangpinfenlei"));
ShangpinfenleiView shangpinfenleiView = shangpinfenleiService.selectView(ew);
return R.ok("查询汉服分类成功").put("data", shangpinfenleiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ShangpinfenleiEntity shangpinfenlei = shangpinfenleiService.selectById(id);
return R.ok().put("data", shangpinfenlei);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ShangpinfenleiEntity shangpinfenlei = shangpinfenleiService.selectById(id);
return R.ok().put("data", shangpinfenlei);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ShangpinfenleiEntity shangpinfenlei, HttpServletRequest request){
shangpinfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(shangpinfenlei);
shangpinfenleiService.insert(shangpinfenlei);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ShangpinfenleiEntity shangpinfenlei, HttpServletRequest request){
shangpinfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(shangpinfenlei);
shangpinfenleiService.insert(shangpinfenlei);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ShangpinfenleiEntity shangpinfenlei, HttpServletRequest request){
//ValidatorUtils.validateEntity(shangpinfenlei);
shangpinfenleiService.updateById(shangpinfenlei);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
shangpinfenleiService.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<ShangpinfenleiEntity> wrapper = new EntityWrapper<ShangpinfenleiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = shangpinfenleiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}