目录
文档含项目技术介绍、E-R图、数据字典、项目功能介绍与截图等
数据库表有注释,可以导出数据字典及更新数据库时间,欢迎交流学习
1绪 论
1.1 课题背景
21世纪以来,随着科学技术的飞速发展,人们对信息的要求越来越高,于是传统的信息技术越来越难以满足人们的要求。“涛宝”大学生二手物品交易商城通过计算机技术进行信息管理,完善平台与用户之间的关系,有助于提高工作效率,实现信息化管理[1]。此次设计的系统不仅利于管理员总体负责整体系统的运行维护,统筹协调,同时也方便用户随时查询求购物品、闲置物品、公告信息等,“涛宝”大学生二手物品交易商城的开发很好地解决了这一问题,同时也为用户提供方便的信息获取渠道。
1.2 选题的目的与意义
本文研究的目标是通过对各种功能单元进行最优的整合,从而达到对各种管理的具体要求,从而最大限度地提高本行业的自动化和信息化水平,从而使得“涛宝”大学生二手物品交易商城更清楚、更透明。操作简单,管理方便,可以实现自动检测,减少了“涛宝”大学生二手物品交易商城的错误。“涛宝”大学生二手物品交易商城最大的特色在于信息的处理,因为它涉及到大量的信息,而且涉及到的各种类型和复杂的管理,使得整个过程更加的繁琐。它们之间的联系很复杂,而且数据的检索和分析方式也很复杂。在以往的传统“涛宝”大学生二手物品交易管理中,以上各项工作都是非常繁杂和繁琐的。由于在进行数据的加工时,往往会发生信息的反复传输和丢失,所以必须引进电脑进行信息的管理,以达到改善工作者管理工作的效果。
该软件满足了时代的变化,满足了用户的需求,充分发挥了网络的交互和实时性,提供了方便、快捷、舒适的服务,使用户能够及时掌握最新的信息,使用户能够及时掌握最新的数据,并能有效地提升用户的服务水平。本制度的优势在于:
(1)该系统将闲置物品及时地提供给使用者。使用者可以在任何时候登陆该网站查询相关资讯,所有资讯均真实可信,并严肃处理各项事务,确保使用者权益得到切实保障。
(2)该系统网页的界面结构简洁,便于使用者使用。
(3)系统更新方便,成本低廉,能够与用户进行双向的信息交换,能够适应市场的发展,并能吸引到越来越多的用户[2]。
1.3 初步设计方法与实施方案
软件体系结构方案:由于本系统需要在不同设备上都能运行,而且电脑配置要求也要越低越好,为了实现这一要求,经过考虑B/S架构成为最佳之选。使用B/S架构的系统可以几乎在任何电脑上运行,只要浏览器可以正常工作就可以正常运行该系统,而且后期维护及二次修改较为容易,符合要求。
操作系统方案:Windows10操作系统,该系统是目前微软公司推出的最新系统,目前大多数市面上的电脑都使用该系统,并且该系统功能完善,兼容性好。开发工具:选用 Eclipse,Java开发语言springboot框架,MySQL数据库。
1.4 本文研究内容
该系统以 B/S架构为基础,通过 Mysql技术,实现了对数据的查询与存储,保证了工作的正常、高效,提高了工作效率。主要的工作包括:
(1)本系统界面简洁明了,便于使用者进行操作。Eclipse提供了可视化的程序设计,大多数的功能都可以由控制程序来实现,并且用户可以很容易地进行各种操作。
(2)本系统分为二部分,能够满足管理人员与使用者的不同需要。该系统的使用者有:管理员及用户[3]。
一、整体目录(示范):
该项目含有源码、文档、PPT、图文修改教程、配套开发软件、软件安装教程、项目发布教程、相关文档模板等学习内容。
二、运行截图
三、代码部分(示范):
package com.controller;
import java.math.BigDecimal;
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.transaction.annotation.Transactional;
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.OrdersEntity;
import com.service.OrdersService;
import com.entity.XianzhiwupinEntity;
import com.entity.view.XianzhiwupinView;
import com.service.XianzhiwupinService;
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;
import com.service.StoreupService;
import com.entity.StoreupEntity;
/**
* 闲置物品
* 后端接口
* @author
* @email
* @date 2023-02-19 10:05:23
*/
@RestController
@RequestMapping("/xianzhiwupin")
public class XianzhiwupinController {
@Autowired
private XianzhiwupinService xianzhiwupinService;
@Autowired
private StoreupService storeupService;
@Autowired
private OrdersService ordersService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,XianzhiwupinEntity xianzhiwupin,
@RequestParam(required = false) Double pricestart,
@RequestParam(required = false) Double priceend,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
xianzhiwupin.setYonghuzhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<XianzhiwupinEntity> ew = new EntityWrapper<XianzhiwupinEntity>();
if(pricestart!=null) ew.ge("price", pricestart);
if(priceend!=null) ew.le("price", priceend);
PageUtils page = xianzhiwupinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xianzhiwupin), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,XianzhiwupinEntity xianzhiwupin,
@RequestParam(required = false) Double pricestart,
@RequestParam(required = false) Double priceend,
HttpServletRequest request){
EntityWrapper<XianzhiwupinEntity> ew = new EntityWrapper<XianzhiwupinEntity>();
if(pricestart!=null) ew.ge("price", pricestart);
if(priceend!=null) ew.le("price", priceend);
PageUtils page = xianzhiwupinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xianzhiwupin), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( XianzhiwupinEntity xianzhiwupin){
EntityWrapper<XianzhiwupinEntity> ew = new EntityWrapper<XianzhiwupinEntity>();
ew.allEq(MPUtil.allEQMapPre( xianzhiwupin, "xianzhiwupin"));
return R.ok().put("data", xianzhiwupinService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(XianzhiwupinEntity xianzhiwupin){
EntityWrapper< XianzhiwupinEntity> ew = new EntityWrapper< XianzhiwupinEntity>();
ew.allEq(MPUtil.allEQMapPre( xianzhiwupin, "xianzhiwupin"));
XianzhiwupinView xianzhiwupinView = xianzhiwupinService.selectView(ew);
return R.ok("查询闲置物品成功").put("data", xianzhiwupinView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
XianzhiwupinEntity xianzhiwupin = xianzhiwupinService.selectById(id);
xianzhiwupin.setClicknum(xianzhiwupin.getClicknum()+1);
xianzhiwupin.setClicktime(new Date());
xianzhiwupinService.updateById(xianzhiwupin);
return R.ok().put("data", xianzhiwupin);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
XianzhiwupinEntity xianzhiwupin = xianzhiwupinService.selectById(id);
xianzhiwupin.setClicknum(xianzhiwupin.getClicknum()+1);
xianzhiwupin.setClicktime(new Date());
xianzhiwupinService.updateById(xianzhiwupin);
return R.ok().put("data", xianzhiwupin);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody XianzhiwupinEntity xianzhiwupin, HttpServletRequest request){
xianzhiwupin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xianzhiwupin);
xianzhiwupinService.insert(xianzhiwupin);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody XianzhiwupinEntity xianzhiwupin, HttpServletRequest request){
xianzhiwupin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xianzhiwupin);
xianzhiwupinService.insert(xianzhiwupin);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody XianzhiwupinEntity xianzhiwupin, HttpServletRequest request){
//ValidatorUtils.validateEntity(xianzhiwupin);
xianzhiwupinService.updateById(xianzhiwupin);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
xianzhiwupinService.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<XianzhiwupinEntity> wrapper = new EntityWrapper<XianzhiwupinEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
wrapper.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));
}
int count = xianzhiwupinService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,XianzhiwupinEntity xianzhiwupin, HttpServletRequest request,String pre){
EntityWrapper<XianzhiwupinEntity> ew = new EntityWrapper<XianzhiwupinEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicknum");
params.put("order", "desc");
PageUtils page = xianzhiwupinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xianzhiwupin), params), params));
return R.ok().put("data", page);
}
/**
* 协同算法(按用户购买推荐)
*/
@RequestMapping("/autoSort2")
public R autoSort2(@RequestParam Map<String, Object> params,XianzhiwupinEntity xianzhiwupin, HttpServletRequest request){
String userId = request.getSession().getAttribute("userId").toString();
String goodtypeColumn = "wupinfenlei";
List<OrdersEntity> orders = ordersService.selectList(new EntityWrapper<OrdersEntity>().eq("userid", userId).eq("tablename", "xianzhiwupin").orderBy("addtime", false));
List<String> goodtypes = new ArrayList<String>();
Integer limit = params.get("limit")==null?10:Integer.parseInt(params.get("limit").toString());
List<XianzhiwupinEntity> xianzhiwupinList = new ArrayList<XianzhiwupinEntity>();
//去重
List<OrdersEntity> ordersDist = new ArrayList<OrdersEntity>();
for(OrdersEntity o1 : orders) {
boolean addFlag = true;
for(OrdersEntity o2 : ordersDist) {
if(o1.getGoodid()==o2.getGoodid() || o1.getGoodtype().equals(o2.getGoodtype())) {
addFlag = false;
break;
}
}
if(addFlag) ordersDist.add(o1);
}
if(ordersDist!=null && ordersDist.size()>0) {
for(OrdersEntity o : ordersDist) {
xianzhiwupinList.addAll(xianzhiwupinService.selectList(new EntityWrapper<XianzhiwupinEntity>().eq(goodtypeColumn, o.getGoodtype())));
}
}
EntityWrapper<XianzhiwupinEntity> ew = new EntityWrapper<XianzhiwupinEntity>();
params.put("sort", "id");
params.put("order", "desc");
PageUtils page = xianzhiwupinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xianzhiwupin), params), params));
List<XianzhiwupinEntity> pageList = (List<XianzhiwupinEntity>)page.getList();
if(xianzhiwupinList.size()<limit) {
int toAddNum = (limit-xianzhiwupinList.size())<=pageList.size()?(limit-xianzhiwupinList.size()):pageList.size();
for(XianzhiwupinEntity o1 : pageList) {
boolean addFlag = true;
for(XianzhiwupinEntity o2 : xianzhiwupinList) {
if(o1.getId().intValue()==o2.getId().intValue()) {
addFlag = false;
break;
}
}
if(addFlag) {
xianzhiwupinList.add(o1);
if(--toAddNum==0) break;
}
}
} else if(xianzhiwupinList.size()>limit) {
xianzhiwupinList = xianzhiwupinList.subList(0, limit);
}
page.setList(xianzhiwupinList);
return R.ok().put("data", page);
}
}
四、数据库表(示范):
数据库表有注释,可以导出数据字典及更新数据库时间,欢迎交流学习
五、主要技术介绍:
系统使用Java作为编程语言,后端使用Spring Boot框架技术,前端使用Vue、JavaScript、CSS、数据库使用MySQL。技术路线如下:
1. 后端技术选择:
使用Spring Boot作为基础框架,简化开发流程,提高开发效率。
使用Spring MVC作为Web框架,处理HTTP请求和响应。
使用Spring Data JPA进行数据库操作,简化数据库访问和管理。
使用Spring Security进行权限管理和用户认证。
2. 前端技术选择:
使用VUE、CSS和JavaScript进行页面开发。
使用Vue.js等前端框架进行页面交互和数据展示。
使用AJAX进行与后端的数据交互。
3. 数据库设计:
使用MySQL进行数据库存储数据。
软件开发环境及开发工具:
操作系统:Windows 11、Windows 10、Windows 8、Windows 7
开发语言:Java
使用框架:ssm
开发工具:IDEA(2020版)/MyEclipse(2017)/Eclipse、Vs Code
数据库:MySQL 5.6以上
数据库管理工具:Navicat
JDK版本:Java 1.8
Maven:apache-maven 3.6.1-bin
Tomcat:apache-tomcat-7.0.88
六、项目调试学习(点击查看)
七、更多精品
可视化大屏项目
基于django的财经新闻文本挖掘分析与可视化应用
基于Python的沧州地区空气质量数据分析及可视化
django基于大数据的房价数据分析
基丁Python的个性化电影推荐系统的设计与实现
django基于Python的热门旅游景点数据分析系统的设计与实现
django基于协同过滤的图书推荐系统的设计与实现
django基于Spark的国漫推荐系统的设计与实现
django基于大数据的学习资源推送系统的设计与实现
django基于协同过滤算法的小说推荐系统
python基于爬虫的个性化书籍推荐系统
python基于Flask的电影论坛
django基于python的影片数据爬取与数据分析
django基丁Python可视化的学习系统的设计与实现
django基于协同过滤算法的招聘信息推荐系统
时尚渐变色UI
二手车评估、到店预约功能(细节满满)
管理员、商家、用户三角色商城系统,实现用户与商家的咨询沟通
用户与商家的沟通
个人中心实现用户全部功能