Design and implementation of questionnaire survey system based on Java+SpringBoot+Vue with front-end and back-end separation

Blogger Introduction: ?300,000+ fans across the entire network, csdn guest author, blog expert, CSDN Rising Star Program mentor, high-quality creator in the Java field, Blog Star, Nuggets / Huawei Cloud / Alibaba Cloud / InfoQ and other platforms are high-quality authors, focusing on the field of Java technology and practical graduation projects?

Contact for source code at the end of the article

Recommended subscription for wonderful columns Otherwise, you won’t find it next time

The most comprehensive collection of computer software graduation project topics for 2022-2024: 1,000 popular topic recommendations?

Java project quality practical cases “100 sets”

Java WeChat Mini Program Project Practical “100 Sets”

If you are interested, you can save it first. If you have questions about graduation topics, projects, thesis writing and other related questions, you can leave me a message for consultation. I hope to help more people

?

System introduction:

Traditional information management mostly relies on manual registration and management by managers. However, with the rapid development of information technology in recent years, many old-fashioned information management models have been updated and iterated. Questionnaire information has complicated management content. , the large number of management results in manual processing that cannot meet the needs of the majority of users, so a corresponding questionnaire system came into being.

This questionnaire survey system has two permissions: administrator and user. The administrator can manage the basic information content of users, manage news information and rental information of news information, and can communicate with users. Users can view the questionnaire. Information, you can view news information and view administrator reply messages and other operations.

The questionnaire survey system adopts the most popular B/S three-tier structure model in WEB application development. It uses a MySQL database that takes up little space but has complete functions for data storage operations. The system development technology uses JSP technology. This questionnaire survey system can solve many problems of traditional manual operations, such as long delays in data query and cumbersome data management steps. In general, the questionnaire survey system has stable performance, relatively complete functions, and is very cost-effective when put into operation.

When dividing the functional modules in the system, the questionnaire survey system uses a hierarchical diagram to represent it. The hierarchical diagram has a tree structure and can use rectangular boxes to depict data information. The data structure represented by the top layer is very complete. The data represented by the rectangular box below the top layer is the subset data. Of course, the rectangular box at the bottom is the data element that cannot be subdivided. Using a hierarchical box diagram to describe the system functions allows users to understand at a glance. You can understand the functions of the system and the sub-functions under the corresponding function sections. The questionnaire system is divided into two operating roles: administrator and user. Their functions will be described below.

Administrators can manage users’ basic information and manage other functions. The administrator function structure diagram is as follows:

When the program is handed over to the user for use, the operation flow chart of the program needs to be provided, so that the user can easily understand the specific working steps of the program. Nowadays, the operation process of the program has a general standard, that is, first submit the login data through the login page, After the program is verified correctly, the user can operate the corresponding function on the program function operation area page.

?

Program operation flow chart

Function screenshot:

5.1 Implementation of administrator function module

5.1.1 Questionnaire List

Figure 5.1 shows the questionnaire list page. The functions provided to administrators on this page include: viewing questionnaires, adding questionnaires, modifying questionnaires, deleting questionnaires, etc.

Figure 5.1 Questionnaire list page

5.1.2 News information management

The administrator can manage the basic information of registered users at the front desk, and can set the accounts of registered users to be frozen or in use. The administrator can also select the information of many expired registered users for batch deletion. The registered user management interface is shown in Figure 5.2.

Figure 5.2 News information management page

5.1.3 News information type management

The news information type management page displays all news information types. On this page, administrators can not only add new news information types, but also edit and update existing news information type information. Invalid news information type information can also be deleted. Admin can delete quickly. The picture below is the news information type management page. The news information type management interface is shown in Figure 5.3.

Figure 5.3 News information type management interface

Code implementation:

/**
 * Login related
 */
@RequestMapping("users")
@RestController
public class UserController{
    
    @Autowired
    private UserService userService;
    
    @Autowired
    private TokenService tokenService;

    /**
     * Log in
     */
    @IgnoreAuth
    @PostMapping(value = "/login")
    public R login(String username, String password, String role, HttpServletRequest request) {
        UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
        if(user != null){
            if(!user.getRole().equals(role)){
                return R.error("Permissions are abnormal");
            }
            if(user==null || !user.getPassword().equals(password)) {
                return R.error("Account or password is incorrect");
            }
            String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
            return R.ok().put("token", token);
        }else{
            return R.error("Account or password or permissions are incorrect");
        }

    }
    
    /**
     * register
     */
    @IgnoreAuth
    @PostMapping(value = "/register")
    public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
        if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
            return R.error("User already exists");
        }
        userService.insert(user);
        return R.ok();
    }

    /**
     * quit
     */
    @GetMapping(value = "logout")
    public R logout(HttpServletRequest request) {
        request.getSession().invalidate();
        return R.ok("Exit successfully");
    }
    
    /**
     * reset Password
     */
    @IgnoreAuth
    @RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
        UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
        if(user==null) {
            return R.error("Account does not exist");
        }
        user.setPassword("123456");
        userService.update(user,null);
        return R.ok("Password has been reset to: 123456");
    }
    
    /**
     * list
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,UserEntity user){
        EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
        PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
        return R.ok().put("data", page);
    }

    /**
     * information
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * Get the user's session user information
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
        Integer id = (Integer)request.getSession().getAttribute("userId");
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }

    /**
     * save
     */
    @PostMapping("/save")
    public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
        if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
            return R.error("User already exists");
        }
        userService.insert(user);
        return R.ok();
    }

    /**
     * Revise
     */
    @RequestMapping("/update")
    public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
        userService.updateById(user);//Update all
        return R.ok();
    }

    /**
     * delete
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
        userService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}

Paper reference:

Source code acquisition:

Everyone like, collect, follow, comment, viewget contact information

Recommended subscription for wonderful columns: In the column below

The most comprehensive collection of computer software graduation project topics for 2022-2024: 1,000 popular topic recommendations?

Java project quality practical cases “100 sets”

Java WeChat Mini Program Project Practice “100 Sets”

The knowledge points of the article match the official knowledge files, and you can further learn related knowledge. Java Skill TreeHomepageOverview 130149 people are learning the system