在现实生活中,不论是学生还是工作人员,都需要对你的文具进行书写完成相应的学业以及工作。传统的文具购买方式都是到文具店购买。是到文具店购买对应的文具也有一定的弊端,一方面是文具店,因为成本的原因商品并没有那么全面。方面就是文具店在经营的时候,因为房租等因素销售的价格要相对高一些。为了能够让需要文具的人买到更加物美价廉的文具,本系统采用java语言开发,后端采用springboot框架,前端采用vue技术,数据库采用mysql进行数据存储开发了本项目。
前台模块
(1)注册登录:用于会员注册的登录,登录时可以选择保存密码。
(2)商品浏览:对所有商品进行浏览以便选购。
(3)商品搜索:根据关键名词可以对所有的商品进行搜索。
(4)推荐商品:最受欢迎的商品展示给用户
(5)个人订单管理:对购买商品后的订单进行管理删除等处理。
(6)购物车:用户可以进行添加购物车,删除购物车等操作。
后台模块
(1)商品管理:包括商品的添加、修改删除、标记。管理商品分类且对商品数量进行统计。
(2)订单管理:管理员对订单的操作,发货后对订单做出发货标记。并且可以对订单统计生成销售报表。
(3)商品分类管理,对商品进行分类,方便用户根据分类查找所需的商品。
(4)会员管理:搜索查看会员信息。
开发语言:Java
数据库 :MySQL
系统架构:B/S
后端框架:SpringBoot
前端框架: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);
}
}