基于SpringBoot vue的农产品商城平台

随着互联网技术的不断变革与发展,全世界人类的生产生活正在经历着翻天覆地的重大变革,如今互联网时代的全面到来便利了生活的方方面面。社会经济的发展和文明的进步为人们生活的改变提供了很大的动力。人们开始越来越多的网上购物,但市面上只售卖农产品产品的网站还是屈指可数的。从长远来看,企业对消费者的电子商务将最终在电子商务领域占据重要地位。但是由于各种因素的制约,目前以及比较长的一段时间内,这个层次的业务还只能占比较小的比重。它是以互联网为主要服务提供手段,实现公众消费和提供服务,并保证与其相关的付款方式的电子化。它是随着万维网(WWW)的出现而迅速发展的,可以将其看作是一种电子化的零售。目前,计算机普及率越来越高,计算机的市场正处于蓬勃发展的大好阶段。因此开发一个基于Spring Boot框架的农产品商城系统是很有必要的。

根据以上,在查阅了许多网站开发的相关资料的基础上,提出了基于Java技术,采用B/S构建结构,选用Spring Boot框架,Mybatis框架,运用VUE技术,UML技术和MySQL数据库来开发一个农产品商城网站,不同于市面上的京东、淘宝等购物网站,而是针对农产品产品购物的新型农产品购物商城,包含管理员、用户模块实现了商城的基本功能,使得农产品产品农产品的交易更加方便,有效,成本更低,将成为农产品产品农产品销售的崭新模式,具有一定的实际意义和推广价值。

关键词:农产品商城    Java    Spring Boot框架    MySQL

ABSTRACT

With the continuous transformation and development of Internet technology, the production and life of people all over the world are undergoing earth shaking changes. The comprehensive arrival of the Internet era has facilitated all aspects of life. The development of social economy and the progress of civilization have provided great impetus for the change of people's lives. People began to buy more and more online, but there are still few websites on the market that only sell computer products. In the long run, business to consumer e-commerce will eventually occupy an important position in the field of e-commerce. However, due to the constraints of various factors, the business at this level can only account for a relatively small proportion at present and for a relatively long period of time. It uses the Internet as the main service providing means to realize public consumption and service provision, and to ensure the electronic payment methods related to it. It has developed rapidly with the emergence of the world wide web (WWW), which can be regarded as an electronic retail. At present, the computer penetration rate is getting higher and higher, and the computer market is in a good stage of vigorous development. Therefore, it is necessary to develop a computer mall system based on spring boot framework.

According to the above, on the basis of consulting a lot of relevant materials on website development, the author proposes to develop a computer mall website based on Java technology, B / s construction structure, spring boot framework, mybatis framework, Vue technology, UML technology and MySQL database, which is different from shopping websites such as jd.com and Taobao. It is a new computer Mall for computer product shopping, including administrators The user module has realized the basic functions of the mall, making the transaction of computer products more convenient, effective and lower cost. It will become a brand-new mode of computer sales of computer products, with certain practical significance and promotion value.

【576】基于SpringBoot vue的农产品商城平台源码和论文含支付宝沙箱 

package com.java.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.print.DocFlavor.STRING;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.java.model.*;
import com.java.service.*;
import com.java.utils.CommonUtils;
import com.java.utils.JsonBody;
import com.java.utils.PageList;
import com.java.utils.ResponseUtil;
import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry;;

@RestController
@RequestMapping("/client")
public class ClientController {
	private ClientService clientService;

	public ClientService getClientService() {
		return clientService;
	}

	@Autowired
	public void setClientService(ClientService clientService) {
		this.clientService = clientService;
	}

	@Autowired
	private HttpServletRequest request;
	@Autowired
	private HttpServletResponse response;
	
	@CrossOrigin(origins = "*")
	@ResponseBody
	@RequestMapping("reg")
	public JsonBody reg(@RequestBody Client c) {
		if(clientService.Login(c.getLogin())!=null)
			return Util.SetMap("当前用户名已存在",false);
		if(clientService.Add(c)>0)
			return Util.SetMap("注册成功!",true);
		else
			return Util.SetMap("注册失败",false);
	}
	
	@CrossOrigin(origins = "*")
	@RequestMapping("/edit")
	@ResponseBody
	public JsonBody edit(@RequestBody Client c) {
		if(clientService.Edit(c)>0)
			return Util.SetMap("资料修改成功",true);
		else
			return Util.SetMap("资料修改失败",false);
	}
	
	@CrossOrigin(origins = "*")
	@RequestMapping("/pwd")
	@ResponseBody
	public JsonBody pwd(@RequestBody Client c) {
		int r=clientService.EditPass(c);
		if(r>0)
			return Util.SetMap("修改成功,请重新登陆",true);
		else
			return Util.SetMap("密码修改失败",false);
	}

	@CrossOrigin(origins = "*")
	@RequestMapping("/list")
	@ResponseBody
	public JsonBody  Get(Client c) {
		return Util.SetData(clientService.Get(c));
		
	}
	
	@CrossOrigin(origins = "*")
	@RequestMapping("/getbyid")
	@ResponseBody
	public JsonBody getbyid(int id) {
		return Util.SetData(clientService.GetByID(id), "");
	}
	
	
	@CrossOrigin(origins = "*")
	@RequestMapping("del")
	@ResponseBody
	public JsonBody Del(int id) {
			if(clientService.Del(id)>0)
				return Util.SetMap("删除成功!", true);
			else
				return Util.SetMap("删除失败", false);
	}
	
}

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.YonghutongzhiEntity;
import com.entity.view.YonghutongzhiView;

import com.service.YonghutongzhiService;
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 
 * @date 2021-04-06 18:09:59
 */
@RestController
@RequestMapping("/yonghutongzhi")
public class YonghutongzhiController {
    @Autowired
    private YonghutongzhiService yonghutongzhiService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,YonghutongzhiEntity yonghutongzhi, 
		HttpServletRequest request){

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("yonghu")) {
			yonghutongzhi.setZhanghao((String)request.getSession().getAttribute("username"));
		}
        EntityWrapper<YonghutongzhiEntity> ew = new EntityWrapper<YonghutongzhiEntity>();
		PageUtils page = yonghutongzhiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yonghutongzhi), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,YonghutongzhiEntity yonghutongzhi, HttpServletRequest request){
        EntityWrapper<YonghutongzhiEntity> ew = new EntityWrapper<YonghutongzhiEntity>();
		PageUtils page = yonghutongzhiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yonghutongzhi), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( YonghutongzhiEntity yonghutongzhi){
       	EntityWrapper<YonghutongzhiEntity> ew = new EntityWrapper<YonghutongzhiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( yonghutongzhi, "yonghutongzhi")); 
        return R.ok().put("data", yonghutongzhiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(YonghutongzhiEntity yonghutongzhi){
        EntityWrapper< YonghutongzhiEntity> ew = new EntityWrapper< YonghutongzhiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( yonghutongzhi, "yonghutongzhi")); 
		YonghutongzhiView yonghutongzhiView =  yonghutongzhiService.selectView(ew);
		return R.ok("查询用户通知成功").put("data", yonghutongzhiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        YonghutongzhiEntity yonghutongzhi = yonghutongzhiService.selectById(id);
        return R.ok().put("data", yonghutongzhi);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        YonghutongzhiEntity yonghutongzhi = yonghutongzhiService.selectById(id);
        return R.ok().put("data", yonghutongzhi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody YonghutongzhiEntity yonghutongzhi, HttpServletRequest request){
    	yonghutongzhi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(yonghutongzhi);

        yonghutongzhiService.insert(yonghutongzhi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody YonghutongzhiEntity yonghutongzhi, HttpServletRequest request){
    	yonghutongzhi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(yonghutongzhi);

        yonghutongzhiService.insert(yonghutongzhi);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody YonghutongzhiEntity yonghutongzhi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(yonghutongzhi);
        yonghutongzhiService.updateById(yonghutongzhi);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        yonghutongzhiService.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<YonghutongzhiEntity> wrapper = new EntityWrapper<YonghutongzhiEntity>();
		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("zhanghao", (String)request.getSession().getAttribute("username"));
		}

		int count = yonghutongzhiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}

  • 26
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序猿毕业分享网

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值