基于Springboot+Vue开发前后端端分离农产品进销存系统

简介: 农产品进销存系统是针对商店、商场、超市的进销存业务处理的计算机化而设计,为进销存业务的处理人员提供计算机化的服务,改变以往的手工操作,提高工作效率,进而增强竞争力。本系统提供的服务主要有商品的进货、销售、库存管理以及相应的报表、查询功能等。系统使用前后端分离模式开发实现,后台使用springboot+mybatis开发,前端使用vue+nodejs实现,通过接口远程调用。

项目编号:BS-XX-145

一,项目简介

农产品进销存系统是针对商店、商场、超市的进销存业务处理的计算机化而设计,为进销存业务的处理人员提供计算机化的服务,改变以往的手工操作,提高工作效率,进而增强竞争力。本系统提供的服务主要有商品的进货、销售、库存管理以及相应的报表、查询功能等。系统使用前后端分离模式开发实现,后台使用springboot+mybatis开发,前端使用vue+nodejs实现,通过接口远程调用。系统前端主要实现产品的展销功能,后台主要实现相关的数据管理功能,具体的功能实现如下:

    1. 系统用户管理
    2. 商品管理
    3. 客户管理
    4. 供应商管理
    5. 进货管理
    6. 销售管理
    7. 统计报表
    8. 前台轮播广告图管理

    二,环境介绍

    语言环境:Java:  jdk1.8

    数据库:Mysql: mysql5.7

    应用服务器:Tomcat:  tomcat8.5.31

    开发工具:IDEA或eclipse

    后台开发技术:Springboot+mybatis

    前台开发技术:nodejs+vue

    三,系统展示

    前端页面及功能展示

    image.gif编辑

    产品购买:

    image.gif编辑

    后台用户登陆

    image.gif编辑

    用户管理

    image.gif编辑

    商品管理

    image.gif编辑

    客户管理

    image.gif编辑

    供应商管理

    image.gif编辑

    商品进货

    image.gif编辑

    退货查询

    image.gif编辑

    商品销售

    image.gif编辑

    商品退货查询

    image.gif编辑

    统计报表

    image.gif编辑

    轮播图管理

    image.gif编辑

    四,核心代码展示

    package com.example.demo.controller;
    import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
    import com.example.demo.dto.QueryDTO;
    import com.example.demo.entity.Customer;
    import com.example.demo.entity.Good;
    import com.example.demo.result.DataGridViewResult;
    import com.example.demo.result.Result;
    import com.example.demo.service.CustomerService;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.web.bind.annotation.PostMapping;
    import org.springframework.web.bind.annotation.RequestBody;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RestController;
    import java.util.List;
    /**
     * Description: 客户
     * date: 2022/9/30 23:46
     * @author: znz
     * @since JDK 1.8
     */
    @RestController
    public class CustomerController {
        @Autowired
        private CustomerService customerService;
        /**
         * 分页查询
         * @param queryDTO
         * @return
         */
        @PostMapping("api/cust/list")
        public Result customerList(@RequestBody QueryDTO queryDTO){
            return new Result(200,"",customerService.selectCustomerPage(queryDTO));
        }
        /**
         * 添加
         * @param customer
         * @return
         */
        @PostMapping("api/cust/add")
        public Result addCustomer(@RequestBody Customer customer){
            return new Result(200,"",customerService.addCustomer(customer));
        }
        /**
         * 更新/修改
         * @param customer
         * @return
         */
        @PostMapping("api/cust/update")
        public Result updateCustomer(@RequestBody Customer customer){
            System.out.println(customer);
            return new Result(200,"",customerService.updateCustomer(customer));
        }
        /**
         * 删除
         * @param custid
         * @return
         */
        @PostMapping("api/cust/delete")
        public Result deleteCustomer(Integer custid){
            return new Result(200,"",customerService.deleteCustomer(custid));
        }
        /**
         * 批量删除
         * @param custids
         * @return
         */
        @PostMapping("api/cust/delete/batch")
        public Result batchDeleteCustomer(@RequestBody List<Integer> custids){
            customerService.batchDelete(custids);
            return new Result(200,"","");
        }
        /**
         * 加载下拉框
         *
         * @return
         */
        @RequestMapping("api/cust/AllCust")
        public DataGridViewResult loadAllCust() {
            QueryWrapper<Customer> queryWrapper = new QueryWrapper<>();
            List<Customer> list = customerService.list(queryWrapper);
            return new DataGridViewResult(list);
        }
        /**
         * 根据客户id加载客户名称
         * @param
         * @return
         */
        @PostMapping("api/cust/loadCustById")
        public DataGridViewResult loadCustById(Integer custid) {
            QueryWrapper<Customer> goodsQueryWrapper = new QueryWrapper<>();
            goodsQueryWrapper.eq(custid != 0, "custid", custid);
            Customer customer = customerService.getById(custid);
            return new DataGridViewResult(customer);
        }
    }

    image.gif

    package com.example.demo.controller;
    import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
    import com.baomidou.mybatisplus.core.metadata.IPage;
    import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
    import com.example.demo.dto.QueryDTO;
    import com.example.demo.entity.Good;
    import com.example.demo.entity.Provider;
    import com.example.demo.mapper.GoodMapper;
    import com.example.demo.result.DataGridViewResult;
    import com.example.demo.result.Result;
    import com.example.demo.service.GoodService;
    import com.example.demo.service.ProviderService;
    import org.apache.commons.lang3.RandomStringUtils;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.util.StringUtils;
    import org.springframework.web.bind.annotation.*;
    import javax.servlet.http.HttpServletRequest;
    import java.util.List;
    /**
     * Description:
     * date: 2022/9/18 23:56
     * @author: znz
     * @since JDK 1.8
     */
    @RestController
    public class GoodController {
        @Autowired
        private GoodService service;
        @Autowired
        private GoodMapper goodMapper;
        /**
         * 分页查询
         * @param queryDTO
         * @return
         */
        @PostMapping("api/good/list")
        public Result goodList(@RequestBody QueryDTO queryDTO){
            return new Result(200,"",service.selectGoodPage(queryDTO));
        }
        @PostMapping("api/good/listpro")
        public Result goodProList(String keyword){
            return new Result(200,"",goodMapper.selectname(keyword));
        }
        /**
         * 前台显示
         * @return
         */
        @PostMapping("api/good/lists")
        public Result goodLists(){
            return new Result(200,"",service.list());
        }
        /**
         * 前台查询商品名称
         * @return
         */
        @PostMapping("api/good/selectlists")
        public Result goodSelectLists(String keyword){
            return new Result(200,"",goodMapper.selectgood(keyword));
        }
        /**
         * 添加
         * @param good
         * @return
         */
        @PostMapping("api/good/add")
        public Result addGood(@RequestBody Good good){
            // 随机的商品编号
            String bering = RandomStringUtils.randomAlphanumeric(8);
            good.setCommbering(bering);
            good.setInventory(0);
            return new Result(200,"",service.addGood(good));
        }
        /**
         * 更新/修改
         * @param good
         * @return
         */
        @PostMapping("api/good/update")
        public Result updateGoods(@RequestBody Good good){
            return new Result(200,"",service.updateGood(good));
        }
        /**
         * 删除
         * @param commid
         * @return
         */
        @PostMapping("api/good/delete")
        public Result deleteGood(Integer commid){
            return new Result(200,"",service.deleteGood(commid));
        }
        /**
         * 批量删除
         * @param commids
         * @return
         */
        @PostMapping("api/good/delete/batch")
        public Result batchDeleteGood(@RequestBody List<Integer> commids){
            service.batchDelete(commids);
            return new Result(200,"","");
        }
        /**
         * 根据商品id加载商品信息
         * @param
         * @return
         */
        @PostMapping("api/good/loadGoodById")
        public DataGridViewResult loadGoodsById(Integer commid) {
            QueryWrapper<Good> goodsQueryWrapper = new QueryWrapper<>();
            goodsQueryWrapper.eq(commid != 0, "commid", commid);
            Good good = service.getById(commid);
            System.out.println(good);
            return new DataGridViewResult(good);
        }
        /**
         * 根据供应商id加载商品信息
         * @param
         * @return
         */
        @PostMapping("api/good/loadProById")
        public DataGridViewResult loadProById(Integer providerid) {
            QueryWrapper<Good> goodsQueryWrapper = new QueryWrapper<>();
            goodsQueryWrapper.eq(providerid != 0, "providerid", providerid);
            Good good = service.getById(providerid);
            System.out.println(good);
            return new DataGridViewResult(good);
        }
        /**
         * 加载下拉框
         *
         * @return
         */
        @RequestMapping("api/good/AllGood")
        public DataGridViewResult loadAllGoods() {
            QueryWrapper<Good> queryWrapper = new QueryWrapper<>();
            List<Good> list = service.list(queryWrapper);
            return new DataGridViewResult(list);
        }
    }

    image.gif

    package com.example.demo.controller;
    import com.example.demo.result.SysResult;
    import org.apache.tomcat.util.http.fileupload.FileUtils;
    import org.springframework.http.MediaType;
    import org.springframework.util.ResourceUtils;
    import org.springframework.web.bind.annotation.PostMapping;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestParam;
    import org.springframework.web.bind.annotation.RestController;
    import org.springframework.web.multipart.MultipartFile;
    import javax.servlet.http.HttpServletRequest;
    import java.io.File;
    import java.io.IOException;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    @RestController
    public class ImageudController {
            /**
             * 文件上传
             * @param picture
             * @param request
             * @return
             */
            @RequestMapping("/api/good/upload")
            public SysResult upload(@RequestParam("picture") MultipartFile picture, HttpServletRequest request) {
                // 获取文件在服务器的储存位置
                // String path = request.getSession().getServletContext().getRealPath("/upload");
                // 将文件存储到vue的static文件方便修改整理
                String path = "E:/vue/demo-vue/static/upload";
                File filePath = new File(path);
                System.out.println("文件的保存路径:" + path);
                if (!filePath.exists() && !filePath.isDirectory()) {
                    System.out.println("目录不存在,创建目录:" + filePath);
                    filePath.mkdir();
                }
                //获取原始文件名称(包含格式)
                String originalFileName = picture.getOriginalFilename();
                System.out.println("原始文件名称:" + originalFileName);
                //获取文件类型,以最后一个`.`为标识
                String type = originalFileName.substring(originalFileName.lastIndexOf(".") + 1);
                System.out.println("文件类型:" + type);
                //获取文件名称(不包含格式)
                String name = originalFileName.substring(0, originalFileName.lastIndexOf("."));
                //设置文件新名称: 当前时间+文件名称(不包含格式)
                Date d = new Date();
                SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
                String date = sdf.format(d);
                String fileName = date + name + "." + type;
                System.out.println("新文件名称:" + fileName);
                //在指定路径下创建一个文件
                File targetFile = new File(path, fileName);
                //将文件保存到指定位置
                try {
                    picture.transferTo(targetFile);
                    System.out.println("上传成功");
                    //将文件在指定存储路径返回
                    return new SysResult(true,"/upload/" + fileName);
                } catch (IOException e) {
                    System.out.println("上传失败");
                    e.printStackTrace();
                    return new SysResult(false, "上传失败");
                }
            }
        /**
         * 文件上传
         * @param image
         * @param request
         * @return
         */
        @RequestMapping("/api/sildeshow/upload")
        public SysResult uploads(@RequestParam("image") MultipartFile image, HttpServletRequest request) {
            // 获取文件在服务器的储存位置
            // String path = request.getSession().getServletContext().getRealPath("/upload");
            // 将文件存储到vue的static文件方便修改整理
            String path = "E:/vue/demo-vue/static/upload";
            File filePath = new File(path);
            System.out.println("文件的保存路径:" + path);
            if (!filePath.exists() && !filePath.isDirectory()) {
                System.out.println("目录不存在,创建目录:" + filePath);
                filePath.mkdir();
            }
            //获取原始文件名称(包含格式)
            String originalFileName = image.getOriginalFilename();
            System.out.println("原始文件名称:" + originalFileName);
            //获取文件类型,以最后一个`.`为标识
            String type = originalFileName.substring(originalFileName.lastIndexOf(".") + 1);
            System.out.println("文件类型:" + type);
            //获取文件名称(不包含格式)
            String name = originalFileName.substring(0, originalFileName.lastIndexOf("."));
            //设置文件新名称: 当前时间+文件名称(不包含格式)
            Date d = new Date();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
            String date = sdf.format(d);
            String fileName = date + name + "." + type;
            System.out.println("新文件名称:" + fileName);
            //在指定路径下创建一个文件
            File targetFile = new File(path, fileName);
            //将文件保存到指定位置
            try {
                image.transferTo(targetFile);
                System.out.println("上传成功");
                //将文件在指定存储路径返回
                return new SysResult(true,"/upload/" + fileName);
            } catch (IOException e) {
                System.out.println("上传失败");
                e.printStackTrace();
                return new SysResult(false, "上传失败");
            }
        }
        }

    image.gif

    package com.example.demo.controller;
    import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
    import com.example.demo.dto.QueryDTO;
    import com.example.demo.entity.Good;
    import com.example.demo.entity.Provider;
    import com.example.demo.entity.User;
    import com.example.demo.result.DataGridViewResult;
    import com.example.demo.result.Result;
    import com.example.demo.service.ProviderService;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.web.bind.annotation.PostMapping;
    import org.springframework.web.bind.annotation.RequestBody;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RestController;
    import java.util.List;
    /**
     * @Author znz
     * @Date 2022/10/3 0:06
     * @Version 1.0
     */
    @RestController
    public class ProviderController {
        @Autowired
        private ProviderService service;
        /**
         * 分页查询
         * @param queryDTO
         * @return
         */
        @PostMapping("api/provider/list")
        public Result providerList(@RequestBody QueryDTO queryDTO){
            return new Result(200,"",service.selectProviderPage(queryDTO));
        }
        /**
         * 添加
         * @param provider
         * @return
         */
        @PostMapping("api/provider/add")
        public Result addProvider(@RequestBody Provider provider){
            return new Result(200,"",service.addProvider(provider));
        }
        /**
         * 更新/修改
         * @param provider
         * @return
         */
        @PostMapping("api/provider/update")
        public Result updateProvider(@RequestBody Provider provider){
            return new Result(200,"",service.updateProvider(provider));
        }
        /**
         * 删除
         * @param providerid
         * @return
         */
        @PostMapping("api/provider/delete")
        public Result deleteProvider(Integer providerid){
            return new Result(200,"",service.deleteProvider(providerid));
        }
        /**
         * 批量删除
         * @param providerids
         * @return
         */
        @PostMapping("api/provider/delete/batch")
        public Result batchDeleteProvider(@RequestBody List<Integer> providerids){
            service.batchDelete(providerids);
            return new Result(200,"","");
        }
        /**
         * 根据供应商id加载供应商信息
         * @param
         * @return
         */
        @PostMapping("api/provider/loadProviderById")
        public DataGridViewResult loadProviderById(Integer providerid) {
            QueryWrapper<Provider> goodsQueryWrapper = new QueryWrapper<>();
            goodsQueryWrapper.eq(providerid != 0, "providerid", providerid);
            Provider provider = service.getById(providerid);
            System.out.println(provider);
            return new DataGridViewResult(provider);
        }
        /**
         * 根据供应商id加载供应商信息
         * @param
         * @return
         */
        @PostMapping("api/provider/loadProviderByIds")
        public DataGridViewResult loadProviderByIds(Integer providerid) {
            QueryWrapper<Provider> goodsQueryWrapper = new QueryWrapper<>();
            goodsQueryWrapper.eq(providerid != 0, "providerid", providerid);
            Provider provider = service.getById(providerid);
            System.out.println(provider);
            return new DataGridViewResult(provider);
        }
        /**
         * 加载下拉框
         *
         * @return
         */
        @RequestMapping("api/provider/AllProvider")
        public DataGridViewResult loadAllProvider() {
            QueryWrapper<Provider> queryWrapper = new QueryWrapper<>();
            List<Provider> list = service.list(queryWrapper);
            return new DataGridViewResult(list);
        }
    }

    image.gif

    五,项目总结

    本项目功能齐全,基于前后端开发模式,前端和后台分别独立运行,并且提供了进销存商品展销的前端页面来供浏览,比较适合做毕业设计使用。

    相关文章
    |
    21天前
    |
    前端开发 安全 Java
    基于springboot+vue开发的会议预约管理系统
    一个完整的会议预约管理系统,包含前端用户界面、管理后台和后端API服务。 ### 后端 - **框架**: Spring Boot 2.7.18 - **数据库**: MySQL 5.6+ - **ORM**: MyBatis Plus 3.5.3.1 - **安全**: Spring Security + JWT - **Java版本**: Java 11 ### 前端 - **框架**: Vue 3.3.4 - **UI组件**: Element Plus 2.3.8 - **构建工具**: Vite 4.4.5 - **状态管理**: Pinia 2.1.6 - **HTTP客户端
    128 4
    基于springboot+vue开发的会议预约管理系统
    |
    5月前
    |
    JavaScript 前端开发 Java
    制造业ERP源码,工厂ERP管理系统,前端框架:Vue,后端框架:SpringBoot
    这是一套基于SpringBoot+Vue技术栈开发的ERP企业管理系统,采用Java语言与vscode工具。系统涵盖采购/销售、出入库、生产、品质管理等功能,整合客户与供应商数据,支持在线协同和业务全流程管控。同时提供主数据管理、权限控制、工作流审批、报表自定义及打印、在线报表开发和自定义表单功能,助力企业实现高效自动化管理,并通过UniAPP实现移动端支持,满足多场景应用需求。
    465 1
    |
    6月前
    |
    前端开发 Java 关系型数据库
    基于Java+Springboot+Vue开发的鲜花商城管理系统源码+运行
    基于Java+Springboot+Vue开发的鲜花商城管理系统(前后端分离),这是一项为大学生课程设计作业而开发的项目。该系统旨在帮助大学生学习并掌握Java编程技能,同时锻炼他们的项目设计与开发能力。通过学习基于Java的鲜花商城管理系统项目,大学生可以在实践中学习和提升自己的能力,为以后的职业发展打下坚实基础。技术学习共同进步
    431 7
    |
    2月前
    |
    前端开发 JavaScript Java
    基于springboot+vue开发的校园食堂评价系统【源码+sql+可运行】【50809】
    本系统基于SpringBoot与Vue3开发,实现校园食堂评价功能。前台支持用户注册登录、食堂浏览、菜品查看及评价发布;后台提供食堂、菜品与评价管理模块,支持权限控制与数据维护。技术栈涵盖SpringBoot、MyBatisPlus、Vue3、ElementUI等,适配响应式布局,提供完整源码与数据库脚本,可直接运行部署。
    101 0
    基于springboot+vue开发的校园食堂评价系统【源码+sql+可运行】【50809】
    |
    7月前
    |
    JSON 自然语言处理 前端开发
    【01】对APP进行语言包功能开发-APP自动识别地区ip后分配对应的语言功能复杂吗?-成熟app项目语言包功能定制开发-前端以uniapp-基于vue.js后端以laravel基于php为例项目实战-优雅草卓伊凡
    【01】对APP进行语言包功能开发-APP自动识别地区ip后分配对应的语言功能复杂吗?-成熟app项目语言包功能定制开发-前端以uniapp-基于vue.js后端以laravel基于php为例项目实战-优雅草卓伊凡
    314 72
    【01】对APP进行语言包功能开发-APP自动识别地区ip后分配对应的语言功能复杂吗?-成熟app项目语言包功能定制开发-前端以uniapp-基于vue.js后端以laravel基于php为例项目实战-优雅草卓伊凡
    |
    5月前
    |
    供应链 JavaScript BI
    ERP系统源码,基于SpringBoot+Vue+ElementUI+UniAPP开发
    这是一款专为小微企业打造的 SaaS ERP 管理系统,基于 SpringBoot+Vue+ElementUI+UniAPP 技术栈开发,帮助企业轻松上云。系统覆盖进销存、采购、销售、生产、财务、品质、OA 办公及 CRM 等核心功能,业务流程清晰且操作简便。支持二次开发与商用,提供自定义界面、审批流配置及灵活报表设计,助力企业高效管理与数字化转型。
    482 2
    ERP系统源码,基于SpringBoot+Vue+ElementUI+UniAPP开发
    |
    6月前
    |
    JavaScript 前端开发 Java
    Spring Boot 与 Vue.js 前后端分离中的数据交互机制
    本文深入探讨了Spring Boot与Vue.js在前后端分离架构下的数据交互机制。通过对比传统`model.addAttribute()`方法与RESTful API的设计,分析了两者在耦合性、灵活性及可扩展性方面的差异。Spring Boot以RESTful API提供数据服务,Vue.js借助Axios消费API并动态渲染页面,实现了职责分明的解耦架构。该模式显著提升了系统的灵活性和维护性,适用于复杂应用场景如论坛、商城系统等,为现代Web开发提供了重要参考。
    500 0
    |
    9月前
    |
    JavaScript Java 测试技术
    基于SpringBoot+Vue实现的留守儿童爱心网站设计与实现(计算机毕设项目实战+源码+文档)
    博主是一位全网粉丝超过100万的CSDN特邀作者、博客专家,专注于Java、Python、PHP等技术领域。提供SpringBoot、Vue、HTML、Uniapp、PHP、Python、NodeJS、爬虫、数据可视化等技术服务,涵盖免费选题、功能设计、开题报告、论文辅导、答辩PPT等。系统采用SpringBoot后端框架和Vue前端框架,确保高效开发与良好用户体验。所有代码由博主亲自开发,并提供全程录音录屏讲解服务,保障学习效果。欢迎点赞、收藏、关注、评论,获取更多精品案例源码。
    |
    9月前
    |
    JavaScript Java 测试技术
    基于SpringBoot+Vue实现的家政服务管理平台设计与实现(计算机毕设项目实战+源码+文档)
    面向大学生毕业选题、开题、任务书、程序设计开发、论文辅导提供一站式服务。主要服务:程序设计开发、代码修改、成品部署、支持定制、论文辅导,助力毕设!
    |
    9月前
    |
    JavaScript 搜索推荐 Java
    基于SpringBoot+Vue实现的家乡特色推荐系统设计与实现(源码+文档+部署)
    面向大学生毕业选题、开题、任务书、程序设计开发、论文辅导提供一站式服务。主要服务:程序设计开发、代码修改、成品部署、支持定制、论文辅导,助力毕设!