项目介绍
农产品销售成为了很多农产品商家的一项重要的创收项目。传统的销售方式采用了摆摊销售和市场的农产品的批发,在销售农产品方面不是很方便,因此采用了网络的方式进行销售。也是电子商务发展今天的一种趋势,建立了网站,前台的销售和后台的管理。本系统采用java语言开发,编译工具选择idea,后端采用springboot框架,前端采用vue技术,数据库采用mysql进行数据存储。
用户要想实现购买操作必须进行登录系统,用户登录界面展示如图用户登录界面图所示;在用户信息添加界面,填写信息后,通过客户端验证后,提交数据到数据库。后台对用户信息进行保存操作,保存数据就,在数据库中可以查看到刚才录入的数据。用户注册在操作上属于数据的插入操作,用户注册前,需要验证该用户是否存在数据库,如果有这个用户,就不能继续注册
1、开发实现销售电商平台的整个系统程序;
2、管理员;首页、个人中心、分类管理、商品管理、用户管理、订单评价管理、管理员管理、系统管理、订单管理等。
3、用户:首页、个人中心、订单评价管理、我的收藏管理、订单管理。
4、前台首页:首页、公告资讯、个人中心、后台管理、购物车、客服等相应操作;
5、基础数据管理:实现系统基本信息的添加、修改及删除等操作,并且根据需求进行交流信息的查看及回复相应操作。
开发环境
开发语言: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.DingdanpingjiaEntity;
import com.entity.view.DingdanpingjiaView;
import com.service.DingdanpingjiaService;
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("/dingdanpingjia")
public class DingdanpingjiaController {
@Autowired
private DingdanpingjiaService dingdanpingjiaService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,DingdanpingjiaEntity dingdanpingjia,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
dingdanpingjia.setYonghuming((String)request.getSession().getAttribute("username"));
}
EntityWrapper<DingdanpingjiaEntity> ew = new EntityWrapper<DingdanpingjiaEntity>();
PageUtils page = dingdanpingjiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dingdanpingjia), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,DingdanpingjiaEntity dingdanpingjia, HttpServletRequest request){
EntityWrapper<DingdanpingjiaEntity> ew = new EntityWrapper<DingdanpingjiaEntity>();
PageUtils page = dingdanpingjiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dingdanpingjia), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( DingdanpingjiaEntity dingdanpingjia){
EntityWrapper<DingdanpingjiaEntity> ew = new EntityWrapper<DingdanpingjiaEntity>();
ew.allEq(MPUtil.allEQMapPre( dingdanpingjia, "dingdanpingjia"));
return R.ok().put("data", dingdanpingjiaService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(DingdanpingjiaEntity dingdanpingjia){
EntityWrapper< DingdanpingjiaEntity> ew = new EntityWrapper< DingdanpingjiaEntity>();
ew.allEq(MPUtil.allEQMapPre( dingdanpingjia, "dingdanpingjia"));
DingdanpingjiaView dingdanpingjiaView = dingdanpingjiaService.selectView(ew);
return R.ok("查询订单评价成功").put("data", dingdanpingjiaView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
DingdanpingjiaEntity dingdanpingjia = dingdanpingjiaService.selectById(id);
return R.ok().put("data", dingdanpingjia);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
DingdanpingjiaEntity dingdanpingjia = dingdanpingjiaService.selectById(id);
return R.ok().put("data", dingdanpingjia);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody DingdanpingjiaEntity dingdanpingjia, HttpServletRequest request){
dingdanpingjia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(dingdanpingjia);
dingdanpingjiaService.insert(dingdanpingjia);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody DingdanpingjiaEntity dingdanpingjia, HttpServletRequest request){
dingdanpingjia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(dingdanpingjia);
dingdanpingjiaService.insert(dingdanpingjia);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody DingdanpingjiaEntity dingdanpingjia, HttpServletRequest request){
//ValidatorUtils.validateEntity(dingdanpingjia);
dingdanpingjiaService.updateById(dingdanpingjia);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
dingdanpingjiaService.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<DingdanpingjiaEntity> wrapper = new EntityWrapper<DingdanpingjiaEntity>();
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("yonghuming", (String)request.getSession().getAttribute("username"));
}
int count = dingdanpingjiaService.selectCount(wrapper);
return R.ok().put("count", count);
}
}