Design and implementation of java graduation project based on spingboot+vue questionnaire system

Collect and follow to avoid getting lost, end of source code article

Article directory

  • Preface
  • 1. Project introduction
  • 2. Development environment
  • 3. Function introduction
    • 1 Administrator use case
    • 2User use cases
  • 4. Core code
  • 5. Effect drawing
  • 6. Article Table of Contents

Foreword

With the rapid development of science and technology, all walks of life are striving to integrate with modern advanced technology and improve their own advantages through scientific and technological means; of course, the questionnaire system cannot be excluded. As network technology continues to mature, it has driven The questionnaire system has completely changed the traditional management method in the past. It not only makes service management easier, but also improves the flexibility of management. Questionnaire survey system, the main modules include administrator; system homepage, personal center, user management, statistical analysis management, online message, questionnaire management, questionnaire question management, system management, questionnaire question management, user; homepage, questionnaire survey, announcement column, online message, personal center, front-end system homepage; homepage, questionnaire, bulletin board, online message, personal center and other functions. Administrators in the system are mainly responsible for storing and managing various types of information safely and effectively. They can also manage, update and maintain the system, and have corresponding operating rights for questionnaires. This personalized platform pays special attention to interaction coordination and management, which stimulates the creativity and initiative of managers, which is very beneficial to the questionnaire survey system.
The database used in this system is Mysql, which is developed using the SpringBoot framework. The running environment uses the Tomcat server. ECLIPSE is the development platform of this system. During the design process, the system code was fully guaranteed to have good readability, practicality, easy scalability, versatility, easy later maintenance, easy operation, and simple page.

1. Project introduction

With the popularity and development of the Internet, more and more people are beginning to communicate through the Internet and instant messaging tools. Online questionnaires emerged as the times require. They are cost-effective, more efficient, more accurate and easier to analyze than traditional paper questionnaires. Using a questionnaire survey system not only saves time and economic costs, but also allows you to easily obtain large amounts of respondent data.
The questionnaire system is a method of collecting, organizing and analyzing data, mainly used to understand people’s thoughts, opinions, attitudes and behaviors. In sociology, psychology, marketing and other fields, questionnaires are widely used and have become an important means of evaluating research and analyzing social phenomena. Below we explore the background of questionnaire systems and their significance.

2. Development environment

Development language: Java
Framework: springboot
JDK version: JDK1.8
Server: tomcat7
Database: mysql
Database tool: Navicat11
Development software: eclipse/myeclipse/idea
Maven package: Maven
—————-

3. Function introduction

The functions that administrators can use mainly include: system homepage, personal center, user management, statistical analysis management, online messages, questionnaire management, questionnaire question management, system management, questionnaire question management, etc.
Users can implement homepage, questionnaire, bulletin board, online message, personal center, etc.

1 Administrator use case

After logging in, the administrator can perform system homepage, personal center, user management, statistical analysis management, online messages, questionnaire management, questionnaire management, system management, and questionnaire management. The administrator’s use case is shown in Figure 3-1.

Figure 3-1 Administrator use case diagram

2User use cases

After registering and logging in, the user can access the home page, questionnaire, bulletin board, online message, and personal center. The user use case is shown in Figure 3-2.

Figure 3-2 User use case diagram

4. Core code

Part of the code:

package com.example.controller;

import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.example.common.Result;
import com.example.common.ResultCode;
import com.example.entity.Caiwu;
import com.example.exception.CustomException;
import com.example.service.CaiwuService;
import com.example.utils.MapWrapperUtils;
import com.example.utils.jwt.JwtUtil;
import com.example.vo.CaiwuVo;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(value = "/caiwu")
public class CaiwuController {<!-- -->

    @Resource
    private CaiwuService caiwuService;

    @PostMapping
    public Result<Caiwu> add(@RequestBody CaiwuVo caiwu) {<!-- -->
        caiwuService.add(caiwu);
           return Result.success(caiwu);
    }
\t
\t

    @PostMapping("/deleteList")
    public Result<Caiwu> deleteList(@RequestBody CaiwuVo caiwu) {<!-- -->
        caiwuService.deleteList(caiwu.getList());
        return Result.success();
    }

    @DeleteMapping("/{id}")
    public Result delete(@PathVariable Long id) {<!-- -->
        caiwuService.delete(id);
        return Result.success();
    }

    @PutMapping
    public Result update(@RequestBody CaiwuVo caiwu) {<!-- -->
        caiwuService.update(caiwu);
        return Result.success();
    }

    @GetMapping("/{id}")
    public Result<Caiwu> detail(@PathVariable Integer id) {<!-- -->
        Caiwu caiwu = caiwuService.findById(id);
        return Result.success(caiwu);
    }

    @GetMapping
    public Result<List<Caiwu>> all() {<!-- -->
        return Result.success(caiwuService.list());
    }

    @PostMapping("/page")
    public Result<CaiwuVo> page(@RequestBody CaiwuVo caiwuVo) {<!-- -->
        return Result.success(caiwuService.findPage(caiwuVo));
    }
@PostMapping("/login")
    public Result login(@RequestBody Caiwu caiwu, HttpServletRequest request) {<!-- -->
        if (StrUtil.isBlank(caiwu.getZhanghao()) || StrUtil.isBlank(caiwu.getMima())) {<!-- -->
            throw new CustomException(ResultCode.PARAM_LOST_ERROR);
        }
        Caiwu login = caiwuService.login(caiwu);
// if(!login.getStatus()){<!-- -->
// return Result.error("1001","Status restriction, unable to log in to the system");
// }
        if(login != null) {<!-- -->
            HashMap hashMap = new HashMap();
            hashMap.put("user", login);
            Map<String, Object> map = MapWrapperUtils.builder(MapWrapperUtils.KEY_USER_ID,caiwu.getId());
            String token = JwtUtil.creatToken(map);
            hashMap.put("token", token);
            return Result.success(hashMap);
        }else {<!-- -->
            return Result.error();
        }
    }
    @PutMapping("/updatePassword")
    public Result updatePassword(@RequestBody Caiwu info, HttpServletRequest request) {<!-- -->
        Caiwu caiwu = caiwuService.findById(info.getId());
        String oldPassword = SecureUtil.md5(info.getMima());
        if (!oldPassword.equals(caiwu.getMima())) {<!-- -->
            return Result.error(ResultCode.PARAM_PASSWORD_ERROR.code, ResultCode.PARAM_PASSWORD_ERROR.msg);
        }
        info.setMima(SecureUtil.md5(info.getNewPassword()));
        Caiwu caiwu1 = new Caiwu();
        BeanUtils.copyProperties(info, caiwu1);
        caiwuService.update(caiwu1);
        return Result.success();
    }
}

5. Renderings

Please add a picture description
Please add a picture description
Please add a picture description
Please add an image description
Please add an image description
Please add an image description
Please add an image description

6. Article directory

Table of contents
Chapter 1 Introduction 1
1.1 Background and significance 1
1.2 Overview of research at home and abroad 2
1.3 Contents of the study 2
Chapter 2 Research on Key Technologies 3
2.1 Related technologies 3
2.2 Java technology 3
2.3 ECLIPSE development environment 4
2.4 Introduction to Tomcat 4
2.5 Spring Boot Framework 5
Chapter 3 System Analysis 5
3.1 System design goals 6
3.2 System feasibility analysis 6
3.3 System function analysis and description 7
3.4 System UML use case analysis 8
3.4.1 Administrator use case 9
3.4.2 User use cases 9
3.5 System process analysis 10
3.5.1 Add information process 11
3.5.2 Operation process 12
3.5.3 Deletion of information process 13
Chapter 4 System Design 14
4.1 System Architecture 15
4.2 Database design principles 16
4.3 Data sheet 17
Chapter 5 System Implementation 18
5.1 User function module 18
5.2 Administrator function module 19
5.3 User function module 19
5.4 Front page function module 19
Chapter 6 System Test 20
6.1 Test definition and purpose 21
6.2 Performance Test 22
6.3 Test module 23
6.4 Test results 24
Summary 25
Acknowledgments 27