[Computer graduation project] 145 online questionnaire survey system

1. Screenshots of the system (if you need a demo video, you can chat privately)

Summary

Nowadays, all walks of life in society are using their own dedicated software to work. At this time of the development of the Internet, people have found that they cannot do without the Internet. The development of the Internet is inseparable from some new technologies, and new technologies are often created to solve existing problems. In view of the non-standardization of questionnaire information management, low fault tolerance rate, and time-consuming data processing by managers, the newly developed online questionnaire system can standardize the formality and legitimacy of the entire data processing process from the root.

The online questionnaire survey system can realize functions such as questionnaire management, user management, topic management, questionnaire management, and news information management. The system uses Mysql database, Java language, Spring Boot framework and other technologies for programming.

The online questionnaire survey system can improve the efficiency of solving questionnaire information management problems, optimize the questionnaire information processing process, and ensure the security of stored data. It is a very reliable and safe application.

Keywords: online questionnaire survey system; Mysql database; Java language


  directory

Chapter 1 Introduction

1.1 Subject background

1.2 Significance of the topic

1.3 Research content

Chapter 2 Development Environment and Technology

2.1 Java language

2.2 MYSQL database

2.3 IDEA development tools

2.4 Spring Boot framework

Chapter 3 System Analysis

3.1 Feasibility Analysis

3.1.1 Technical Feasibility

3.1.2 Economic feasibility

3.1.3 Operational Feasibility

3.2 System flow

3.2.1 Operation process

3.2.2 Login process

3.2.3 Delete information flow

3.2.4 Add information process

3.3 Performance requirements

3.4 Functional requirements

Chapter 4 System Design

4.1 Functional structure design

4.2 Database design

4.2.1 Database conceptual design

4.2.2 Database physical design

Chapter 5 System Implementation

5.1 Administrator function realization

5.1.1 Questionnaire management

5.1.2 Questionnaire management

5.1.3 Topic management

5.1.4 User Management

5.1.5 News and information management

5.2 User function realization

5.2.1 Questionnaire list

5.2.2 Questionnaire survey

5.2.3 News information

5.2.4 Questionnaire Records

Chapter 6 System Testing

6.1 Functional test

6.1.1 Login function test

6.1.2 Modify password function test

6.2 System test results

in conclusion

references

thanks

Chapter 1  Introduction _

1.1 Subject background 

The emergence of the Internet in the 21st century has changed people's lives for thousands of years, not only in the abundance of living materials, but also in the spiritual level. The sign of the progress of the times is to allow people to live a better life. Before the birth of the Internet, geographical location was often a gap in people's minds that could not cross domains. The speed of information dissemination was extremely slow, and the speed and requirements of information processing were still transmitted by people riding horses or carrier pigeons. It is very likely to be lost, and the level of information transmission determines the standard of people's lives. Nowadays, everyone is using the Internet to achieve their own goals, setting up computer management from the internal management, improving the level of internal information management, and obtaining relevant data from the external market with computers for processing. Nowadays, all walks of life have been heavily dependent on computers. .

This project researches and develops the online questionnaire survey system, which makes the system installed on the computer a little helper for managers, improves the processing speed of questionnaire survey information, standardizes the process of questionnaire survey information processing, and makes the output efficiency of managers higher.

1.2 Significance of the subject

Traditional data processing must be done on a sheet of paper, and then the statistics are collected on a sheet of paper after processing, and the processing is repeated continuously, and finally a result is given to the highest level as a reference. Before the Internet, this model was a kind of For common things, if the efficiency of information management cannot be improved, it is common sense for people to use talents. More people are more powerful. The birth of the computer is the discovery of the lack of a large number of people. For example, the training of high-end computing talents has been unable to keep up with the use, so people have developed a machine that helps people calculate, which is the predecessor of the computer. In the Internet age, people found that it is completely possible Let program suppliers provide solutions, and choose your own suitable solutions to improve your output ratio. As a result, various solutions relying on programs to process information have appeared on the market.

The online questionnaire survey system developed in this project is to provide a solution for questionnaire survey information processing. It can process information in a short time, and only needs the user to move the mouse and keyboard to obtain the information they need, and the information has Specialized storage devices, and data backup and migration can be set to be unattended. From the perspective of manpower, information processing and information security, the online questionnaire survey system is completely superior to traditional paper-based operations, so the online questionnaire survey system is So trustworthy.

1.3 Research content

This paper describes the design and implementation of the online questionnaire survey system in six chapters.

Chapter 1: The background of studying the online questionnaire survey system, and the significance of developing the online questionnaire survey system.

Chapter 2: Explains the environment and technology for developing an online questionnaire system.

Chapter 3: Analyze the feasibility, performance, process and function of the online questionnaire survey system.

Chapter 4: Design the functional structure of the online questionnaire survey system, design the database ER diagram and design the storage structure of the data table.

Chapter 5: Realize the functions of the online questionnaire survey system and display the functional interface.

Chapter 6: Explain the system test, and test some functions of the system.


Chapter 2 Development Environment and Technology 

This chapter describes the development environment that needs to be built to develop the online questionnaire survey system, as well as the programming techniques used in the development of the online questionnaire survey system.

2. 1 Java language  

The Java language is one of the evergreen trees that are still alive in the programming language industry today. The most primitive birth of the Java language is not only the creators who feel that the C language is very troublesome in programming. If you only focus on the processing of business logic, you will ignore various pointers and garbage collection operations, resulting in time to solve problems. It is often greater than the time for normal programming to process business logic, which is a waste of time. The creators of the Java language perfectly solved this problem by automating pointer processing and garbage disposal. Although this will lose some performance, with the continuous development of computer hardware, these performances can be ignored. And C language is a language for hardware development. Programming on qualified hardware can maximize the use of hardware performance. However, with changes in hardware or operating systems, if C language is still used, the entire program needs to be redesigned. For programming, only a language that changes with market changes is a language that conforms to the trend and the law of survival. The creator of the Java language developed the Java language specifically for the shortcomings of the C language. Let the Java language run no matter what kind of environment it is in, because there is a shell outside the running of the Java language, that is, a virtual machine. As long as the Java virtual machine can be installed on a computer, Java programs can be run.

2. 2  MYSQL database

The MySQL database is a type of relational database, and it is also a traditional row-based data model. Some data is first obtained row by row, and then displayed row by row, which is obviously different from the columnar database that has recently emerged from big data. The row database mainly deals with the most important data logic part, and it must be valid data, so that the data association in each place is indestructible. If the data security is relatively high, you must choose the MySQL database or the column database. The invention is only because of the high reading efficiency, and it is not much better than the traditional MySQL database in terms of data writing. Although the installation package of MySQL is only tens of megabytes or even hundreds of megabytes compared to oracle or SQL SERVER, it is a bit small, but its functions are not weak, and it strictly follows the SQL standard syntax. The data storage form of MySQL is from large to small. The database is the largest, and then the table. There are certain rules for storing data in each table. The data storage is in the form of a table, that is to say, there are horizontal and vertical. A row generally represents a piece of data. Each table has fields, and fields exist in the form of columns. This ensures that each field of a piece of data corresponds to data of the same data type. Tables can also be associated and divided into tables. If there are too many attributes related to a piece of data, then the effective correlation can be made into an association, and it can be set whether it is unique or not.

2.3 IDEA development tools

IDEA is a development software created by Java programmers and developers in the Czech Republic. At the beginning, it was mainly because they were not comfortable with Eclipse software, so they developed this software directly. The reason why it is not smooth is that there is no code promotion function. The reason is that Eclipse only uses code hints as a plug-in form. If some program developers are not clear about code hints, plug-ins may cause problems, and code hints are only used as plug-ins. So there is a lack of functionality. IDEA not only does a good job of code hints, but also makes it even more powerful in code refactoring. Program developers can choose a piece of code and then IDEA will decompose and refactor the code, effectively making the code more layered and reusable. It is more flexible, more concise and convenient to use, greatly reduces the workload of code, and improves the efficiency of code development. Of course, IDEA is so good for users, and there must be a purpose. The reason is that the more plug-ins are more friendly, it will cost a lot of money to use, so the use of IDEA mainly depends on your preferences.

2.4 Spring Boot framework

Spring Boot is a framework that does not require code generation, and does not need to configure any XML files, because Spring Boot comes with a lot of interfaces, just need to configure different interfaces to automatically apply and identify needs The dependency is very convenient in terms of configuration, and it feels like a framework is not used when using it. Spring Boot has many default configuration files, and the default configuration files can be modified, can be set to be automatically loaded, and exception handling can be divided into global exception handling and default exception handling. During the use of Spring Boot, it is like registering directly with what is used. The so-called registration is to make a special statement on the corresponding class and method.


Chapter 3  System Analysis

After confirming the subject of research, the author of this paper downloads documents from major digital libraries to read, and understands the general functions of the same type of websites, and then combines with the actual needs of users of this system to analyze, and concludes that this system should be studied specific functions and performance. Although the stage work of analyzing the system is mainly to determine the function, it affects the progress of the subsequent system development link, and it is also a relatively important link in the system development process.

3.1 Feasibility analysis 

The following part is to conduct feasibility analysis from three angles. The premise to ensure the success of development is feasibility analysis. Only by conducting analysis in advance and conforming to the program development process will the development process not be interrupted.

3.1.1 Technical Feasibility

At the level of technical implementation, several technical implementation methods have been analyzed, and there are corresponding successful cases. There are also many open source modules for reference. Therefore, from the perspective of technical feasibility analysis, there is no problem in implementing an online questionnaire survey system.

3.1.2 Economic feasibility

For developers who are students, there are few available economic resources. In order to develop an online questionnaire survey system, it is found through technical analysis that they can use their own computers for development, and the configuration of the school's computer room can also meet the requirements. The most important thing is that technical resources are generally open source and free to use, so it is concluded that it is economically feasible.

3.1.3 Operation Feasibility

The specific implementation of the online questionnaire survey system itself refers to the normal operation logic of human beings, and uses common operating habits as the main navigation implementation, which allows users to understand and operate more quickly, and it is feasible to implement a logical operation process. Concrete embodiment.

The above are analyzed from different angles to ensure the normal development of the online questionnaire survey system.

3.2 System flow

After the online questionnaire survey system is put into use, the internal operation logic of each function needs to be understood by the user through the flow chart.

3. 2.1 Operation process

When operating the online questionnaire survey system, users should operate according to the operation process provided by the system (Figure 3.1 is the operation flow chart of the system), which can reduce the errors in the user's operation and save the cost of entering the online questionnaire survey. system time.

Figure 3.1 System operation flow

3.2.2 Login process _ _

The online questionnaire survey system guides users to enter the designated functional operation area through the login function (Figure 3.2 is its login process), and also prevents users who are not from the system from enjoying the services provided by the system and viewing the information provided by the system, thereby ensuring Safe use of users of this system.

Figure 3.2 Login process

3. 2.3 Delete information process

After long-term use, the online questionnaire survey system will generate a lot of data information. In order to free up storage space to store more data, the data stored in the database of this system, some data without reference value need to be deleted (Figure 3.3 is the process of deleting information), in the process of deleting data, in order to avoid accidental deletion, use The user should decide whether to delete the data according to the prompt of the system.

Figure 3.3 Delete information flow

3. 2.4 Add information process

The online questionnaire survey system provides a visual functional operation area, which is very convenient for users to operate data. When users enter data into the system (Figure 3.4 is the process of adding information), the system will also judge the legality of the data. The data that meets the requirements can be registered in the designated table of the database.

Figure 3.4 Add information process

3.3 Performance requirements _

In the requirements analysis, the performance of the server required by the project should be analyzed, so as to conform to the normal analysis process. It is a very serious matter to only talk about functional requirements and not performance requirements, which may lead to a series of unpredictable problems in the use process, so performance requirements are also important items to be considered.

The following is to analyze the performance of the system from several aspects, and analyze the system performance from each angle.

(1) Capacity of system data: From the perspective of data analysis, each table and each database has reached a certain amount of data, whether it needs to be divided into tables or databases, if it exceeds the set limit of data, it may be As a result, the data is sluggish and the fault tolerance is increased.

(2) Requirements for data accuracy: It is necessary to consider the corresponding data accuracy issues in the data setting link in the demand analysis. It is necessary to find out whether the data is commonly used or not, and then set different values. Data accuracy problems will directly lead to design performance problems.

(3) Response time requirements: From the operation submitted by the user to the page reflection, there is a problem of data processing in the middle. If the amount of data is large, then consider the problem of indexing and sub-database. No matter how large the amount of data is, it is necessary to consider adding a columnar database. The problem, these must be judged according to the increase in the amount of data and the rigor of the logic in order to meet the user's requirements. After all, the response time is too long to operate and it is uncomfortable.

The performance requirements of the system can roughly understand the concepts related to the performance requirements from the beginning of the business requirements, and then realize them one by one from the system performance requirements, which can make the designed system valuable.

3.4 Functional requirements 

The online questionnaire survey system conducts functional analysis from the perspective of usage permissions, and uses use case diagrams to show the functions that each permission needs to operate.

Figure 3.5 is the administrator use case diagram. The functions of the administrator authority operation include the management of registered user information, the management of questionnaires, questions, questionnaires, news information and other information.

Figure 3.5 Administrator use case diagram

Figure 3.6 is a user use case diagram. The functions of user authority operations include participating in surveys, viewing news, and viewing survey records.

Figure 3.6 User use case diagram


Chapter 4 System Design 

The design of the system is all for the user's use. Although the user may only perform various operations on the browser during use, it does not mean that the system does not process the user's operations on the browser. Therefore, designing a The system needs to take all aspects into account.

4.1 Functional structure design

Figure 4.1 is the designed administrator function structure. The functions of the administrator authority operation include the management of registered user information, the management of questionnaires, topics, questionnaires, news information and other information.

Figure 4.1 Administrator function structure

Figure 4.2 is the designed user function structure. The functions of user authority operation include participating in surveys, viewing news, and viewing survey records.

Figure 4.2 User function structure

4.2 Database design

The data generated during the operation of the online questionnaire survey system needs to be stored according to the storage rules set in advance, and this storage rule is set in the design of the database. Usually, in order to better cooperate with the operation of the system and bring a good user experience to users, it is necessary to design a good database, because it can reduce the waiting time of users, and can also request the system in the shortest time. respond within time. Therefore, when designing the database, it takes a certain amount of time to analyze the system's requirements for data storage and the specific data stored, and then design specific storage rules to ensure that the database can respond to various data requests of the system in a timely manner and shorten data processing. time, and to a certain extent reduce data redundancy and save storage space.

4.2.1 Database concept design 

The entity-relationship diagram also has a name, the ER diagram, which is the abbreviation of the initials of the English words of the Entity Relationship Diagram. Its conceptual model is usually used to describe the real world. At the same time, it is also an effective means of visually expressing entities, relationships, and attributes in data. There are many tools that can be selected for drawing ER diagrams, but Office Visio is generally the preferred tool for drawing ER diagrams, because it is based on visual processing, and it is very simple to use it to create ER diagrams. Use basic ER diagram elements, such as ovals, rhombuses, rectangles, and solid line segments to express corresponding information. Ovals represent attributes, that is, characteristics of entities, rectangles represent entities, that is, a specific data table in the database, and diamonds represent entities. In the relationship between the two, the solid line segment is mainly to complete the connection of ellipse, rectangle, and rhombus. Based on this method, the complete drawing of the ER diagram of this system can be completed.

(1) Figure 4.4 is the attribute value owned by the title entity.

Figure 4.4 Topic Entity Attribute Map

(2) Figure 4.5 shows the attribute values ​​owned by the user entity.

Figure 4.5 User entity attribute graph

(3) Figure 4.6 shows the attribute values ​​owned by the questionnaire entity.

Figure 4.6 Questionnaire entity attribute diagram

  1. Figure 4.7 is the attribute value of the entity that is recorded in the questionnaire survey.

Figure 4.7 Entity attribute map of questionnaire survey records

  1. Figure 4.8 is the relationship existing in the entities introduced above.

Figure 4.8 ER diagram of relationship between entities

4. 2 .2 Database physical design

The main task of this section is to design the data storage structure based on the above content, that is, to design the data table that stores the data of the system in the database. When designing the data table, it is necessary to determine each field. Generally speaking, an entity and Corresponding to a data table, the attribute of the entity is used to represent the field name. The data type and value represented by different fields are different. Here, it needs to be set according to the actual data of the system, and it also needs to be determined in the specific table. Explain the primary key of the table and whether each field of the table can be kept empty. After designing the structure of a data table, it is also necessary to name it when saving it. Try to choose an English name to name and save it, so that it is convenient for the system to edit the data table in the future. When accessing data storage, while improving data storage efficiency, it is not easy to cause system errors. Next, the designed data table will be displayed.

Table 4.1 Questionnaire

field

note

type

null

id (primary key)

primary key

int(20)

no

exampaper_name

Questionnaire name

varchar(200)

no

exampaper_date

Duration (minutes)

int(11)

no

exampaper_jieshuyu

conclusion

varchar(255)

yes

exampaper_types

Questionnaire status

int(11)

no

create_time

creation time

timestamp

no

Table 4.2 Topic table

field

note

type

null

id (primary key)

primary key

int(20)

no

exampaper_id

Questionnaire id to which it belongs (foreign key)

int(20)

no

examquestion_name

Question title

varchar(200)

no

examquestion_options

options

longtext

yes

examquestion_types

Question type

int(20)

yes

examquestion_sequence

Sort the test questions, the higher the value, the higher the row

int(20)

yes

create_time

creation time

timestamp

no

Table 4.3 Questionnaire Survey Record Form

field

note

type

null

id (primary key)

primary key

int(20)

no

examrecord_uuid_number

Questionnaire ID

varchar(200)

yes

yonghu_id

Survey users

int(20)

no

exampaper_id

Questionnaire id to which it belongs (foreign key)

int(20)

no

insert_time

Questionnaire time

timestamp

no

create_time

creation time

timestamp

no

Table 4.4 Administrator table

field

note

type

null

id (primary key)

primary key

bigint(20)

no

username

username

varchar(100)

no

password

password

varchar(100)

no

role

Role

varchar(100)

yes

addtime

add time

timestamp

no

Table 4.5 News Information Table

field

note

type

null

id (primary key)

primary key

int(11)

no

news_name

News name

varchar(200)

yes

news_types

news type

int(11)

yes

news_photo

News information picture

varchar(200)

yes

insert_time

News information time

timestamp

yes

news_content

News details

text

yes

create_time

creation time

timestamp

yes

Table 4.6 Detailed table of answers

field

note

type

null

id (primary key)

primary key

int(20)

no

examredetails_uuid_number

Questionnaire ID

varchar(200)

yes

yonghu_id

user id

int(20)

no

examquestion_id

试题id(外键)

int(20)

examredetails_myanswer

用户选项

varchar(200)

create_time

创建时间

timestamp

表4.7 用户表

字段

注释

类型

id (主键)

主键

int(11)

username

账户

varchar(200)

password

密码

varchar(200)

yonghu_name

用户姓名

varchar(200)

sex_types

性别

int(11)

yonghu_id_number

身份证号

varchar(200)

yonghu_phone

手机号

varchar(200)

yonghu_photo

照片

varchar(200)

create_time

创建时间

timestamp

5 系统实现

编程人员在搭建的开发环境中,运用编程技术实现本系统设计的各个操作权限的功能。在本节中,就展示部分操作权限的功能与界面。

5.1 管理员功能实现

5.1.1 问卷管理

图5.1 即为编码实现的问卷管理界面,管理员在该界面中可以对已有问卷进行启用或禁用,可以新增问卷,编辑更改已有问卷的资料,包括问卷名称,结束语等信息,可以删除需要删除的问卷,可以根据问卷名称,问卷的状态来获取需要的问卷信息。

图5.1 问卷管理界面

核心代码:

    /**

    * 后端修改

    */

    @RequestMapping("/update")

    public R update(@RequestBody ExampaperEntity exampaper, HttpServletRequest request){

        logger.debug("update方法:,,Controller:{},,exampaper:{}",this.getClass().getName(),exampaper.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));

        if(StringUtil.isEmpty(role))

            return R.error(511,"权限为空");

        //根据字段查询是否有相同数据

        Wrapper<ExampaperEntity> queryWrapper = new EntityWrapper<ExampaperEntity>()

            .notIn("id",exampaper.getId())

            .andNew()

            .eq("exampaper_name", exampaper.getExampaperName())

            .eq("exampaper_date", exampaper.getExampaperDate())

            .eq("exampaper_types", exampaper.getExampaperTypes())

            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());

        ExampaperEntity exampaperEntity = exampaperService.selectOne(queryWrapper);

        if(exampaperEntity==null){

            //  String role = String.valueOf(request.getSession().getAttribute("role"));

            //  if("".equals(role)){

            //      exampaper.set

            //  }

            exampaperService.updateById(exampaper);//根据id更新

            return R.ok();

        }else {

            return R.error(511,"表中有相同数据");

        }

    }

    /**

    * 删除

    */

    @RequestMapping("/delete")

    public R delete(@RequestBody Integer[] ids){

        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());

        exampaperService.deleteBatchIds(Arrays.asList(ids));

        return R.ok();

    }

5.1.2 问卷调查管理

图5.2 即为编码实现的问卷调查管理界面,管理员在该界面中对用户提交的问卷调查信息进行查看,管理员可以直接查看每条问卷调查的调查详情信息,同时可以删除问卷调查信息。

图5.2 问卷调查管理界面

核心代码:

/**

     * 批量上传

     */

    @RequestMapping("/batchInsert")

    public R save( String fileName){

        logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);

        try {

            List<ExampaperEntity> exampaperList = new ArrayList<>();//上传的东西

            Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段

            Date date = new Date();

            int lastIndexOf = fileName.lastIndexOf(".");

            if(lastIndexOf == -1){

                return R.error(511,"该文件没有后缀");

            }else{

                String suffix = fileName.substring(lastIndexOf);

                if(!".xls".equals(suffix)){

                    return R.error(511,"只支持后缀为xls的excel文件");

                }else{

                    URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径

                    File file = new File(resource.getFile());

                    if(!file.exists()){

                        return R.error(511,"找不到上传文件,请联系管理员");

                    }else{

                        List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件

                        dataList.remove(0);//删除第一行,因为第一行是提示

                        for(List<String> data:dataList){

                            //循环

                            ExampaperEntity exampaperEntity = new ExampaperEntity();

//                            exampaperEntity.setExampaperName(data.get(0));                    //问卷名称 要改的

//                            exampaperEntity.setExampaperDate(Integer.valueOf(data.get(0)));   //时长(分钟) 要改的

//                            exampaperEntity.setExampaperTypes(Integer.valueOf(data.get(0)));   //问卷状态 要改的

//                            exampaperEntity.setCreateTime(date);//时间

                            exampaperList.add(exampaperEntity);

                            //把要查询是否重复的字段放入map中

                        }

                        //查询是否重复

                        exampaperService.insertBatch(exampaperList);

                        return R.ok();

                    }

                }

            }

        }catch (Exception e){

            return R.error(511,"批量插入数据异常,请联系管理员");

        }

    }

    /**

    * 前端列表

    */

    @IgnoreAuth

    @RequestMapping("/list")

    public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){

        logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

        // 没有指定排序字段就默认id倒序

        if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){

            params.put("orderBy","id");

        }

        PageUtils page = exampaperService.queryPage(params);

        //字典表数据转换

        List<ExampaperView> list =(List<ExampaperView>)page.getList();

        for(ExampaperView c:list)

            dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段

        return R.ok().put("data", page);

    }

    /**

    * 前端详情

    */

    @RequestMapping("/detail/{id}")

    public R detail(@PathVariable("id") Long id, HttpServletRequest request){

        logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);

        ExampaperEntity exampaper = exampaperService.selectById(id);

            if(exampaper !=null){

                //entity转view

                ExampaperView view = new ExampaperView();

                BeanUtils.copyProperties( exampaper , view );//把实体数据重构到view中

                //修改对应字典表字段

                dictionaryService.dictionaryConvert(view, request);

                return R.ok().put("data", view);

            }else {

                return R.error(511,"查不到数据");

            }

    }

5.1.3 题目管理

图5.3 即为编码实现的题目管理界面,管理员在该界面中可以导出题目,可以新增题目,可以对指定的题目信息进行修改,删除,同时可以查看用户对各个题目选项的统计信息,该统计信息是以饼图进行展示。

图5.3 题目管理界面

核心代码:

 /**

    * 后端详情

    */

    @RequestMapping("/info/{id}")

    public R info(@PathVariable("id") Long id, HttpServletRequest request){

        logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);

        ExamquestionEntity examquestion = examquestionService.selectById(id);

        if(examquestion !=null){

            //entity转view

            ExamquestionView view = new ExamquestionView();

            BeanUtils.copyProperties( examquestion , view );//把实体数据重构到view中

                //级联表

                ExampaperEntity exampaper = exampaperService.selectById(examquestion.getExampaperId());

                if(exampaper != null){

                    BeanUtils.copyProperties( exampaper , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段

                    view.setExampaperId(exampaper.getId());

                }

            //修改对应字典表字段

            dictionaryService.dictionaryConvert(view, request);

            return R.ok().put("data", view);

        }else {

            return R.error(511,"查不到数据");

        }

    }

    /**

    * 后端保存

    */

    @RequestMapping("/save")

    public R save(@RequestBody ExamquestionEntity examquestion, HttpServletRequest request){

        logger.debug("save方法:,,Controller:{},,examquestion:{}",this.getClass().getName(),examquestion.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));

        if(StringUtil.isEmpty(role))

            return R.error(511,"权限为空");

        Wrapper<ExamquestionEntity> queryWrapper = new EntityWrapper<ExamquestionEntity>()

            .eq("exampaper_id", examquestion.getExampaperId())

            .eq("examquestion_name", examquestion.getExamquestionName())

            .eq("examquestion_options", examquestion.getExamquestionOptions())

            .eq("examquestion_types", examquestion.getExamquestionTypes())

            .eq("examquestion_sequence", examquestion.getExamquestionSequence())

            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());

        ExamquestionEntity examquestionEntity = examquestionService.selectOne(queryWrapper);

        if(examquestionEntity==null){

            examquestion.setCreateTime(new Date());

            examquestionService.insert(examquestion);

            return R.ok();

        }else {

            return R.error(511,"表中有相同数据");

        }

    }

5.1.4 用户管理

图5.4 即为编码实现的用户管理界面,管理员在该界面中为用户重置密码,修改用户基本信息,新增用户,删除需要删除的用户信息。

图5.4 用户管理界面

核心代码:

 /**

    * 后端修改

    */

    @RequestMapping("/update")

    public R update(@RequestBody YonghuEntity yonghu, HttpServletRequest request){

        logger.debug("update方法:,,Controller:{},,yonghu:{}",this.getClass().getName(),yonghu.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));

        if(StringUtil.isEmpty(role))

            return R.error(511,"权限为空");

        //根据字段查询是否有相同数据

        Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()

            .notIn("id",yonghu.getId())

            .andNew()

            .eq("username", yonghu.getUsername())

            .or()

            .eq("yonghu_id_number", yonghu.getYonghuIdNumber())

            .or()

            .eq("yonghu_phone", yonghu.getYonghuPhone())

            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());

        YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);

        if("".equals(yonghu.getYonghuPhoto()) || "null".equals(yonghu.getYonghuPhoto())){

                yonghu.setYonghuPhoto(null);

        }

        if(yonghuEntity==null){

            //  String role = String.valueOf(request.getSession().getAttribute("role"));

            //  if("".equals(role)){

            //      yonghu.set

            //  }

            yonghuService.updateById(yonghu);//根据id更新

            return R.ok();

        }else {

            return R.error(511,"账户或者手机号或者身份证号已经被使用");

        }

    }

5.1.5 新闻资讯管理

图5.5 即为编码实现的新闻资讯管理界面,管理员在该界面中负责发布新闻资讯,更改新闻资讯的部分信息,删除需要删除的新闻资讯信息。

图5.5 新闻资讯管理界面

核心代码:

 /**

    * 后端列表

    */

    @RequestMapping("/page")

    public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){

        logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

        String role = String.valueOf(request.getSession().getAttribute("role"));

        if(StringUtil.isEmpty(role))

            return R.error(511,"权限为空");

        else if("用户".equals(role))

            params.put("yonghuId",request.getSession().getAttribute("userId"));

        if(params.get("orderBy")==null || params.get("orderBy")==""){

            params.put("orderBy","id");

        }

        PageUtils page = newsService.queryPage(params);

        //字典表数据转换

        List<NewsView> list =(List<NewsView>)page.getList();

        for(NewsView c:list){

            //修改对应字典表字段

            dictionaryService.dictionaryConvert(c, request);

        }

        return R.ok().put("data", page);

    }

5.2 用户功能实现

5.2.1 问卷列表

图5.6 即为编码实现的问卷列表界面,用户在该界面中选择问卷并参与问卷调查。

图5.6 问卷列表界面

核心代码:

/**

    * 前端列表

    */

    @IgnoreAuth

    @RequestMapping("/list")

    public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){

        logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

        // 没有指定排序字段就默认id倒序

        if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){

            params.put("orderBy","id");

        }

        PageUtils page = examrecordService.queryPage(params);

        //字典表数据转换

        List<ExamrecordView> list =(List<ExamrecordView>)page.getList();

        for(ExamrecordView c:list)

            dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段

        return R.ok().put("data", page);

    }

    /**

    * 前端详情

    */

    @RequestMapping("/detail/{id}")

    public R detail(@PathVariable("id") Long id, HttpServletRequest request){

        logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);

        ExamrecordEntity examrecord = examrecordService.selectById(id);

            if(examrecord !=null){

                //entity转view

                ExamrecordView view = new ExamrecordView();

                BeanUtils.copyProperties( examrecord , view );//把实体数据重构到view中

                //级联表

                    ExampaperEntity exampaper = exampaperService.selectById(examrecord.getExampaperId());

                if(exampaper != null){

                    BeanUtils.copyProperties( exampaper , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段

                    view.setExampaperId(exampaper.getId());

                }

                //级联表

                    YonghuEntity yonghu = yonghuService.selectById(examrecord.getYonghuId());

                if(yonghu != null){

                    BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段

                    view.setYonghuId(yonghu.getId());

                }

                //修改对应字典表字段

                dictionaryService.dictionaryConvert(view, request);

                return R.ok().put("data", view);

            }else {

                return R.error(511,"查不到数据");

            }

    }

5.2.2 问卷调查

图5.7 即为编码实现的问卷调查界面,用户在该界面中主要根据问卷调查题目信息进行选项答题,答题结束可以选择界面顶端的结束问卷调查按钮离开问卷调查界面。

图5.7 问卷调查界面

核心代码:

/**

    * 前端详情

    */

    @RequestMapping("/detail/{id}")

    public R detail(@PathVariable("id") Long id, HttpServletRequest request){

        logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);

        ExamredetailsEntity examredetails = examredetailsService.selectById(id);

            if(examredetails !=null){

                //entity转view

                ExamredetailsView view = new ExamredetailsView();

                BeanUtils.copyProperties( examredetails , view );//把实体数据重构到view中

                //级联表

                    ExamquestionEntity examquestion = examquestionService.selectById(examredetails.getExamquestionId());

                if(examquestion != null){

                    BeanUtils.copyProperties( examquestion , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段

                    view.setExamquestionId(examquestion.getId());

                }

                //级联表

                    YonghuEntity yonghu = yonghuService.selectById(examredetails.getYonghuId());

                if(yonghu != null){

                    BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段

                    view.setYonghuId(yonghu.getId());

                }

                //修改对应字典表字段

                dictionaryService.dictionaryConvert(view, request);

                return R.ok().put("data", view);

            }else {

                return R.error(511,"查不到数据");

            }

    }

5.2.3 新闻资讯

图5.8 即为编码实现的新闻资讯界面,用户在该界面中浏览新闻资讯,在界面右上角的搜索框中编辑新闻标题可以获取匹配的新闻资讯信息。

图5.8 新闻资讯界面

核心代码:

  /**

    * 前端详情

    */

    @RequestMapping("/detail/{id}")

    public R detail(@PathVariable("id") Long id, HttpServletRequest request){

        logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);

        NewsEntity news = newsService.selectById(id);

            if(news !=null){

                //entity转view

                NewsView view = new NewsView();

                BeanUtils.copyProperties( news , view );//把实体数据重构到view中

                //修改对应字典表字段

                dictionaryService.dictionaryConvert(view, request);

                return R.ok().put("data", view);

            }else {

                return R.error(511,"查不到数据");

            }

    }

5.2.4 问卷调查记录

图5.9 即为编码实现的问卷调查记录界面,用户在该界面中可以对参与问卷调查的记录信息进行查看。

图5.9 问卷调查记录界面

核心代码:

    @RequestMapping("/saveExamredetails")

    public R saveExamredetails(@RequestBody ExamredetailsEntity examredetails,Integer examrecordId, HttpServletRequest request){

        logger.debug("save方法:,,Controller:{},,examredetails:{}",this.getClass().getName(),examredetails.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));

        if(StringUtil.isEmpty(role)){

            return R.error(511,"权限为空");

        }else if(role.contains("用户id")){

            examredetails.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));

        }

        examredetails.setCreateTime(new Date());

        boolean insert = examredetailsService.insert(examredetails);

        if(!insert){

            return R.error();

        }

        return R.ok();

    }


6章 系统测试

当系统测试环节开始的时候,也就说明对于系统的编码已经弄得大致通顺了,剩下来需要对一些模块和功能进行测试,这个环节就叫系统测试。在程序开发过程中,系统测试是整个开发过程必不可少的一个环节。原因很简单,系统开发人员在面对各种需求需要对各个模块进行编码,开发人员编写过程中,对于程序的理解全部都在编码里面,一人计短,当一个人去做一些事情的时候,把自己的理解变成成果,很有可能会出现理解偏差,甚至是理解错误,这个在程序开发过程中很常见。程序开发人员在面对复杂的逻辑,没有想象中的多么清晰,开发过程就是面对着一堆代码,不断的变换数据类型,并且对各种操作用计算机编程语言进行实现,这些很容易实现程序开发人员的想法,但是如果是比较复杂的逻辑,很可能会出现各种问题,这是无法避免的。所以说,需要额外的人员进行系统测试编写,不要站在程序开发人员的角度去思考问题,要站在用户使用的角度去发现问题,这样开发与测试的分离,有助于系统开发的强壮,让程序表达的更完美一些。之所以把系统测试安排到程序开发过程中的原因在于,当测试发现问题,就可以直接反馈到程序开发人员手里,可以以最快的时间解决问题,这样能大大的提高开发效率。总的来说,在整个软件开发过程中,系统测试这个环节也必须要重视的,所以必须在系统测试环节做好应该做好的事情,让程序开发从开始到结束都有一个完美的流程。

6.1 功能测试

本节主要选择一些功能进行具体测试描述,在相应的功能里面,根据不同的合法与不合法条件输入看程序是否设定的有相关的判断,能否达到使用效果。以下会描述部分功能的测试过程和结果。

6.1.1 登录功能测试

登录是一个常规功能,虽然是常规功能,但是用处很大,可以拒绝非法用户访问,只有合法用户才可以访问对应的功能,这样能保证程序设定的功能符合安全性要求。

表6.1 管理员登录功能测试表

管理员账号

管理员密码

结果

uuu

uuu

成功登录系统

yyy

uuu

登录失败

uuu

yyy

登录失败

只有正确的账号密码才会进行跳转到对应的功能区,如果输入的账号密码不对的话,肯定会有相关提示,用来提示操作人员注意输入正确的账号密码,这样有助于提高用户体验。这里以使用者提交错误的账号为“yyy”,正确的密码为“uuu”为例进行测试,具体反馈结果看下面。

图6.1 登录失败提示

6.1.2 修改密码功能测试

任何用户角色都有安全性要求,那么对应的密码最好是经常更改,只有经常更改才会降低坏人的有机可乘几率,达到密码保护的最低要求,当然,如果用户登录人离开了,为了防止其他人乘机篡改密码,那么也会设定旧密码要求,只有输入正确的旧密码才可以进行密码的修改。下面就是测试过程。

表6.2 修改密码功能测试表

之前的旧密码

设置的新密码

结果

uuu

yyy

成功修改密码

hhh

yyy

修改密码失败

uuu

修改密码失败

不管是旧密码错误还是新密码不合规,都会提示相应的要求,下面就是关于旧密码输入错误的提示。

图6.2 错误的旧密码反馈提示

6.2 系统测试结果

对在线问卷调查系统进行了各种检测,包含功能检测和性能检测,甚至是系统的操作性方面也进行了检测,以及兼容性检测,通过各方面检测结果来判定系统是符合设计目标,达到开发预期。系统是可以实现所开发的功能,并且在扩展性或者是稳定性上面,也有很好的表现,能完全的满足用户需求。


结  论

由于本人学习的是计算机方面的专业,对于计算机软件方面的相关知识也进行过课堂上的学习以及课后的实际操作练习,因此,对于开发一款已经确定了课题的在线问卷调查系统,从功能需求,功能模块划分,数据库的选择,数据库的设计,编程语言的确定,系统界面的布局和设计等知识,我都有个大致的思路。所以,在参照软件设计思想以及设计流程的基础上,我运用已经具备的理论知识,加上后期从网络渠道获取的相关技术知识,我能够根据制定的系统开发时间安排完成各个阶段性的开发任务。并能够在系统完成开发后期,编写相应的系统文档。

在线问卷调查系统制作期间,我也遇到过一些难题,在最开始的时候,我并不知道该系统具体要设计几个功能模块,以及数据表需要设计几张表,还有对于开发技术的深度理论学习还不充分等,值得庆幸的是,我在面临这些困难时,我能够通过网络或者通过学院提供的图书馆寻求解决办法。比如在不知道具体功能的情况下,我从网上下载了很多的与在线问卷调查系统相关的程序,分析了它们的功能之后,我再结合即将开发的在线问卷调查系统进行综合分析,选取了适合在线问卷调查系统的功能部分,再结合实际情况以及使用者的需求确定本系统功能。对于数据表的设计,我先是在图书馆借阅了一本数据库方面的书籍进行查看,然后查看相似系统对于数据表的结构设计等知识,然后在本系统功能确定的情况下,结合本系统设计了配套的数据表,对于难度最大的开发技术部分,我花费了很多的时间研究网络上的相似系统的功能模块上的代码,一般都是对基础数据的增加,更新,查询或修改方面的代码,然后把本系统能够运用的代码部分在简单更改后进行使用,在完成了一个功能模块以及又一个功能模块之后,又经过了简单的测试工作,最终呈现出一个完整的能够解决用户实际问题的在线问卷调查系统。该系统唯一不足的就是代码方面还有很多重复的部分,不够精简,还有用户操作本系统,对于用户的误操作行为,本系统还不能及时反馈,这也是一大缺点。

在线问卷调查系统完成了,其相应的配套文档也需要进行编写,该文档主要描述在线问卷调查系统是如何进行分析,设计以及实现的,让其他阅读本文档的人增加对该系统的了解,编写文档过程中,由于自己平时对于办公软件的操作不是很频繁,根据学院要求的文档排版格式进行编辑也花了很多时间,在不断学习排版技巧以及对本系统配套文档的反复修改之后,最终在学院规定的时间内进行了文档定稿。

毕业项目各个工作进行到此,我也是收获颇丰,正因为自己努力学习知识,积极寻求解决办法,才让我能够提交一个完整的作品。制作毕业项目让我又得到了成长,不仅是专业知识的增加,也包括解决问题的能力得到了提高,很感谢学院给的制作毕业项目的机会。


参考文献

[1]蒲通,韩利凯. 基于JSP的在线调查系统的设计与实现[J]. 电子世界,2016,(08):104-105.

[2]刘慧梅. 基于Web的问卷调查系统的设计与实现[J]. 中小企业管理与科技(上旬刊),2014,(08):310-311.

[3]余涛.计算机软件开发中Java编程语言的应用研究[J].信息记录材料,2020,21(01):113-115.

[4]王子虎,胡丽珍.基于计算机软件安全开发的JAVA编程语言研究[J].数字技术与应用,2019,37(12):133-134.

[5]刘星淇.Java编程语言的特点与应用分析[J].通讯世界,2019,26(09):149-150.

[6]张云健.计算机软件Java编程特点及其技术应用[J].信息与电脑(理论版),2019(13):97-98.

[7]张振超,吴杰,陈序蓬.浅谈Java中Mysql数据库的连接与操作[J].信息记录材料,2020,21(02):144-145.

[8]范开勇,陈宇收.MySQL数据库性能优化研究[J].中国新通信,2019,21(01):57.

[9]丁佳.基于JSP+MySQL的用户登录系统SQL注入实例及防范[J].网络安全技术与应用,2020(09):49-51.

[10]王丹,孙晓宇,杨路斌,高胜严.基于SpringBoot的软件统计分析系统设计与实现[J].软件工程,2019,22(03):40-42.

[11]张峰.应用SpringBoot改变web应用开发模式[J].科技创新与应用,2017(23):193-194.

[12]谢志坚.计算机应用软件开发技术支撑思考[J].电子世界,2020(15):53-54.

[13]姬晓鹏.计算机软件开发技术与设计探究[J].电子测试,2020(16):133-134.

[14]Raffi Khatchadourian.Automated refactoring of legacy Java software to enumerated types[J].Automated Software Engineering,2017,24(4).

[15]Ben White.Marx and Chayanov at the margins:understanding agrarian change in Java[J].The Journal of Peasant Studies,2018,45(5-6).


  

也许是大学校园在管理上比较开放,学习知识时不像高中时期那样一整天都在学习,而是一天当中抽出部分时间安排学习,其余的时间就可以自由安排,可以去社会上参加实践,可以在学校的图书馆阅读书籍,丰富自己的知识,也可以加入学校的社团进行个人能力的锻炼等等,加上学院的学生都来自全国各地,大家的风俗习惯都有些不一样,这样同学之间也有更多的话题进行畅聊。基于这些原因,我觉得我的性格也逐渐变得开朗起来,正因为如此,我很快乐的度过了大学四年时光。然而,我们都要面临毕业,同学间,师生间也将面临分离,我们都会离开学校,进入社会这样的大环境学习并生活。虽然很不舍,但这也是人生成长中必经的阶段!

临走之际,对这几年的大学生活简单的进行了回想,发现自己学到的专业知识也增加了很多,在本专业上,自己也得到了一定的实操能力锻炼。这些成长都是我们的专业老师带来的,他们这几年辛苦教学,我们也从中获取了许多的专业知识,提高了个人的专业方面的能力,非常感谢他们。

还有一位老师也需要在此特别感谢,即论文指导老师。可以说最后这一年,跟指导老师接触比较多,指导老师在本专业上,非常全能,在我进行本课题的任务期间,导师给予我全面的指导,也能根据我的不足之处推荐合适的书籍让我查看,让我的能力得以提升,继而可以从容面对开发期间遇到的困难。

另外,我也要感谢我的寝室室友,还有我们班上的同学,从接到毕业项目任务之后,我们常常谈论各自课题进展的情况以及面临的问题,也经常互相鼓励对方要积极认真面对毕业项目,这种陪伴,让我在制作毕业项目期间并没有产生过多的焦虑,非常感谢他们。

最后时刻,我也要对我的大学校园表达谢意,我的大学校园是一个非常美丽的地方,而我这几年,在这么优美的环境下学习知识,我已经感到非常幸福。希望在今后能看到我的校园在众多师生共同努力下变得强大,校园的环境也将变得更加美丽。

Guess you like

Origin blog.csdn.net/licongzhuo/article/details/131355670