定制计算机毕业设计JAVA、PHP、爬虫、APP、小程序、C#、python、数据可视化、大数据、文案开题报告设计与实现

随着信息时代的来临,过去的传统管理方式缺点逐渐暴露,对过去的传统管理方式的缺点进行分析,采取计算机方式构建闲置物品共享平台。本文通过课题背景、课题目的及意义相关技术,提出了一种商品信息、商品举报、留言信息等于一体的系统构建方案。

本文通过采用B/S架构,MySQL数据库以及java语言、springboot框架,结合国内线上管理现状,开发了一个基于springboot的闲置物品共享平台。系统分为多个功能模块:用户信息、卖家信息、商品信息、商品举报等。通过系统测试,本系统实现了系统设计目标,相对于人工管理方式,本系统有效的减少了实体店的经济投入,并且大幅度提升了闲置物品共享管理的效率。

关键词:闲置物品共享平台;java语言;springboot框架;MySQL数据库

springboot vue闲置物品共享平台源码和论文答辩PPT929

演示视频:

springboot vue闲置物品共享平台源码和论文答辩PPT

Abstract

With the advent of the information age, the shortcomings of the traditional management methods in the past are gradually exposed. The shortcomings of the traditional management methods in the past are analyzed, and the computer mode is adopted to build the idle goods sharing platform. Based on the background, purpose and significance of the project, this paper proposes a system construction scheme that integrates commodity information, commodity reporting and message information.

By adopting B/S architecture, MySQL database, java language, spring boot framework, and combining the current situation of domestic online management, this paper has developed a spring boot based idle goods sharing platform. The system is divided into several functional modules: user information, seller information, commodity information, commodity reporting, etc. Through the system test, the system has achieved the system design goal. Compared with the manual management mode, the system has effectively reduced the economic investment of physical stores, and greatly improved the efficiency of idle goods sharing management.

Key words: idle goods sharing platform; Java language; Spring boot framework; MySQL database

package com.wuye.controller.admin;


import com.alibaba.fastjson.JSONObject;
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.wuye.config.AOP.Log;
import com.wuye.entity.Admin;
import com.wuye.entity.Videos;
import com.wuye.entity.Vote;
import com.wuye.entity.VoteOptions;
import com.wuye.entity.view.HouseInfo;
import com.wuye.service.AdminService;
import com.wuye.service.VoteOptionsService;
import com.wuye.service.VoteService;
import com.wuye.service.VoteUserService;
import com.wuye.util.DateUtils;
import com.wuye.util.ExcelUtil;
import com.wuye.util.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.bytebuddy.asm.Advice;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 投票信息主表 前端控制器
 * </p>
 *
 * @author hb
 * @since 2023-10-16
 */
@Api(description = "管理端-投票选举")
@RestController
@RequestMapping("v1/vote")
public class VoteController {

    @Autowired
    private VoteService voteService;
    @Autowired
    private VoteUserService voteUserService;
    @Autowired
    private VoteOptionsService voteOptionsService;
    @Autowired
    private AdminService adminService;

    @ApiOperation("投票信息分页查询")
    @Log(operation = "投票信息分页查询")
    @GetMapping("getListPage")
    public JSONObject getListPage(Integer propertyId, @RequestParam("page") Integer page, @RequestParam("size")Integer size,HttpServletRequest request){
        QueryWrapper<Vote> queryWrapper = new QueryWrapper<>();
        Admin admin=adminService.getAdminByToken(request.getHeader("token"));
        List<Integer> propertyIds = adminService.getPropertyIdsByAdminId(admin);
        if(propertyId!=null){
            queryWrapper.eq("property_id",propertyId);
        }else{
            if(propertyIds.size()==0){
                queryWrapper.eq("property_id",-1);
            }else{
                queryWrapper.in("property_id",propertyIds);
            }
        }
        try{
            Page<Vote> list  = new Page<>(page,size);
            queryWrapper.orderByDesc("create_time");
            IPage<Vote> iPage = voteService.page(list,queryWrapper);
            return ResultUtil.setData(iPage);
        }catch (Exception e){
            return ResultUtil.setJson(500,"获取失败:"+e.getMessage());
        }
    }



    @ApiOperation("新增投票")
    @Log(operation = "新增投票")
    @PostMapping("/add")
    public JSONObject add(HttpServletRequest request, @Valid @RequestBody Vote vote){

        try {

            List<VoteOptions> voteOptions  = vote.getVoteOptions();
            if(voteOptions.size()==0){
                return ResultUtil.setJson(500,"投票选项参数不能为空");
            }
            vote.setCreateTime(new Date());
            vote.setParticipantsNum(0);
               voteService.save(vote);
            for (VoteOptions options:voteOptions) {
                options.setVoteId(vote.getId());
                options.setCreatedTime(new Date());
                options.setVoteCount(0);
            }
            voteOptionsService.saveBatch(voteOptions);

        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.setJson(500,"error:"+e.getMessage());
        }

        return ResultUtil.setJson(200,"success");
    }

    @ApiOperation("修改,更新投票以及更新投票详情")
    @Log(operation = "修改,更新投票以及更新投票详情")
    @PostMapping("/update")
    public JSONObject updateByPrimaryKey( @Valid @RequestBody Vote vote){
        try {
            voteService.updateById(vote);
            List<VoteOptions> voteOptions  = vote.getVoteOptions();
            if(voteOptions!=null){
                if(vote.getVoteOptions().size()>0){
                    QueryWrapper<VoteOptions> queryWrapper = new QueryWrapper<>();
                    queryWrapper.eq("vote_id",vote.getId());
                    voteOptionsService.remove(queryWrapper);

                    for (VoteOptions options:voteOptions) {
                        options.setVoteId(vote.getId());
                        options.setCreatedTime(new Date());
                        options.setVoteCount(0);
                    }
                    voteOptionsService.saveBatch(voteOptions);

                }
            }


        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.setJson(500,"error:"+e.getMessage());
        }

        return ResultUtil.setJson(200,"success");
    }



    @ApiOperation("删除投票")
    @Log(operation = "删除投票")
    @PostMapping(value = "/del/{voteId}")
    public JSONObject delvote(@PathVariable("voteId") Integer voteId) {
        try {
            voteService.removeById(voteId);

            QueryWrapper<VoteOptions> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("vote_id",voteId);
            voteOptionsService.remove(queryWrapper);

        }catch (Exception e){
            return ResultUtil.setJson(500,"error:"+e.getMessage());
        }
        return ResultUtil.setJson(200,"success");
    }

    @ApiOperation("删除投票选项")
    @Log(operation = "删除投票选项")
    @PostMapping("/delOptions/{optionId}")
    public JSONObject delOptions(@PathVariable("optionId") Integer optionId) {
        try {
            voteOptionsService.removeById(optionId);
        }catch (Exception e){
            return ResultUtil.setJson(500,"error:"+e.getMessage());
        }
        return ResultUtil.setJson(200,"success");
    }



    @ApiOperation("根据投票ID查询投票以及详情")
    @Log(operation = "根据投票ID查询投票以及详情")
    @GetMapping("/queryVote/{id}")
    public JSONObject queryVote(@PathVariable("id") Integer id){

        try {
           Vote vote =  voteService.getById(id);
            QueryWrapper<VoteOptions> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("vote_id",id);
            List<VoteOptions> voteOptions  = voteOptionsService.list(queryWrapper);

            if(voteOptions.size()==0){
                return ResultUtil.setJson(500,"查询投票选项为空");
            }
            vote.setVoteOptions(voteOptions);
            return ResultUtil.setData(vote);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.setJson(500,"error:"+e.getMessage());
        }


    }

    @ApiOperation("结束投票")
    @Log(operation = "结束投票")
    @PostMapping("/endvote/{id}")
    public JSONObject endvote(@PathVariable("id") Integer id) {
        try {
            Vote vote =  voteService.getById(id);
            if(vote!=null){
                return ResultUtil.setJson(500,"投票信息为空,请检查参数id");
            }
            vote.setState(1);
            voteService.updateById(vote);

        }catch (Exception e){
            return ResultUtil.setJson(500,"error:"+e.getMessage());
        }
        return ResultUtil.setJson(200,"success");
    }




    @ApiOperation(value = "导出")
    @GetMapping(value = "/exportList/{id}")
    public void exportMemberList(@ApiIgnore HttpServletResponse response, @PathVariable("id") Integer id) {
        try {
            Vote vote =  voteService.getById(id);
            QueryWrapper<VoteOptions> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("vote_id",id);
            List<VoteOptions> voteOptions  = voteOptionsService.list(queryWrapper);

            //导出操作
            ExcelUtil.exportExcel(voteOptions,vote.getTitle()+"投票结果",vote.getTitle()+"投票结果", VoteOptions.class,vote.getTitle()+"投票结果"+ DateUtils.getCurrentTime() +".xlsx",response);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }




}

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐