收藏关注不迷路!!
🌟文末获取源码+数据库🌟
感兴趣的可以先收藏起来,还有大家在毕设选题(免费咨询指导选题),项目以及论文编写等相关问题都可以给我留言咨询,希望帮助更多的人
文章目录
- 摘要
- 一、开发技术介绍
- 二、功能介绍
- 三、代码展示
- 四、效果图
- 五 、源码获取
摘要
随着时代在一步一步在进步,旧物也成人们的烦恼,许多平台网站都在推广自已的产品像天猫、咸鱼、京东。所以开发出一套关于旧物置换网站成为必需。旧物置换网站主要是借助计算机,通过对用户进行管理。为减少管理员的工作,同时也方便广大用户对个人所需旧物置换的及时查询以及管理。
旧物置换网站的开发过程中,采用B / S架构,主要使用Java技术进行开发,结合最新流行的
springboot框架。中间件服务器是Tomcat服务器,使用Mysql数据库和Eclipse开发 环境。该旧物置换网站包括管理员、用户、卖家。其主要功能包括管理员:首页、个人中心、用户管理、卖家管理、旧物类型管理、旧物信息管理、置换交易管理、系统管理等,卖家后台:首页、个人中心、旧物类型管理、旧物信息管理、置换交易管理。前台首页;首页、旧物信息、网站公告、个人中心、后台管理等,用户后台:首页、个人中心、旧物信息管理、置换交易管理等功能。
本论文对旧物置换网站的发展背景进行详细的介绍,并且对系统开发技术进行介绍,然后对系统进行需求分析,对旧物置换网站业务信息、系统结构以及数据都进行详细说明。用户可根据关键字进行信息的查找自己心仪的信息等。
关键词:旧物置换网站,Mysql数据库,Java技术 springboot框架
一、开发技术介绍
- B/S 架构
- Java
- MySQL
- SpringBoot
二、功能介绍
该旧物置换网站功能结构图如图4-1所示
三、代码展示
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.MaijiaEntity;
import com.entity.view.MaijiaView;import com.service.MaijiaService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;/*** 卖家* 后端接口* @author * @email */
@RestController
@RequestMapping("/maijia")
public class MaijiaController {@Autowiredprivate MaijiaService maijiaService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@RequestMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {MaijiaEntity user = maijiaService.selectOne(new EntityWrapper<MaijiaEntity>().eq("maijiaming", username));if(user==null || !user.getMima().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(), username,"maijia", "卖家" );return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@RequestMapping("/register")public R register(@RequestBody MaijiaEntity maijia){//ValidatorUtils.validateEntity(maijia);MaijiaEntity user = maijiaService.selectOne(new EntityWrapper<MaijiaEntity>().eq("maijiaming", maijia.getMaijiaming()));if(user!=null) {return R.error("注册用户已存在");}Long uId = new Date().getTime();maijia.setId(uId);maijiaService.insert(maijia);return R.ok();}/*** 退出*/@RequestMapping("/logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");MaijiaEntity user = maijiaService.selectById(id);return R.ok().put("data", user);}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){MaijiaEntity user = maijiaService.selectOne(new EntityWrapper<MaijiaEntity>().eq("maijiaming", username));if(user==null) {return R.error("账号不存在");}user.setMima("123456");maijiaService.updateById(user);return R.ok("密码已重置为:123456");}/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,MaijiaEntity maijia, HttpServletRequest request){EntityWrapper<MaijiaEntity> ew = new EntityWrapper<MaijiaEntity>();PageUtils page = maijiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, maijia), params), params));return R.ok().put("data", page);}/*** 前端列表*/@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,MaijiaEntity maijia, HttpServletRequest request){EntityWrapper<MaijiaEntity> ew = new EntityWrapper<MaijiaEntity>();PageUtils page = maijiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, maijia), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( MaijiaEntity maijia){EntityWrapper<MaijiaEntity> ew = new EntityWrapper<MaijiaEntity>();ew.allEq(MPUtil.allEQMapPre( maijia, "maijia")); return R.ok().put("data", maijiaService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(MaijiaEntity maijia){EntityWrapper< MaijiaEntity> ew = new EntityWrapper< MaijiaEntity>();ew.allEq(MPUtil.allEQMapPre( maijia, "maijia")); MaijiaView maijiaView = maijiaService.selectView(ew);return R.ok("查询卖家成功").put("data", maijiaView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){MaijiaEntity maijia = maijiaService.selectById(id);return R.ok().put("data", maijia);}/*** 前端详情*/@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){MaijiaEntity maijia = maijiaService.selectById(id);return R.ok().put("data", maijia);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody MaijiaEntity maijia, HttpServletRequest request){maijia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(maijia);MaijiaEntity user = maijiaService.selectOne(new EntityWrapper<MaijiaEntity>().eq("maijiaming", maijia.getMaijiaming()));if(user!=null) {return R.error("用户已存在");}maijia.setId(new Date().getTime());maijiaService.insert(maijia);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody MaijiaEntity maijia, HttpServletRequest request){maijia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(maijia);MaijiaEntity user = maijiaService.selectOne(new EntityWrapper<MaijiaEntity>().eq("maijiaming", maijia.getMaijiaming()));if(user!=null) {return R.error("用户已存在");}maijia.setId(new Date().getTime());maijiaService.insert(maijia);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody MaijiaEntity maijia, HttpServletRequest request){//ValidatorUtils.validateEntity(maijia);maijiaService.updateById(maijia);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){maijiaService.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<MaijiaEntity> wrapper = new EntityWrapper<MaijiaEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}int count = maijiaService.selectCount(wrapper);return R.ok().put("count", count);}}
四、效果图
五 、源码获取
下方名片联系我即可!!
大家点赞、收藏、关注、评论啦 、查看👇🏻获取联系方式👇🏻