Graduation project based on Springboot enterprise website - with source code 211750

Design and Implementation of Springboot Enterprise Website

Summary

The 20th century has entered the highway of information development, and the digital revolution has brought new changes to all fields. With the popularization of computer office automation, e-commerce came into being, all thanks to the great contribution of the Internet, the world of the Internet contains infinite vitality, here there are only unexpected and impossible. The enterprise has professional website design application and maintenance personnel, makes full use of information resources on the Internet, develops core competitiveness, and maximizes market development.

The main functional modules of the corporate website studied in this paper include corporate information, corporate recruitment, message exchange, resume delivery, corporate culture, message classification modules, etc., adopting an object-oriented development model for software development and hardware erection, which can be very good To meet the needs of actual use, the work of corresponding software construction and program coding has been improved. SSM framework, JSP technology, and Ajax technology are used to code and develop the business system, and all the functions of the system are realized. This report first analyzes the background, function and significance of the research, laying the foundation for the rationality of the research work. Analyze the various needs and technical issues of the enterprise website, prove the necessity and technical feasibility of the system, then give a basic introduction to the technical software and design ideas that need to be used in the design system, and finally realize the deployment and implementation of the enterprise website. run.

Key words: corporate website; Springboot framework; database

Design and implementation of springboot enterprise website

Abstract

The 20th century has entered the information development highway, and the digital revolution has brought new changes to all fields. With the popularization of computer office automation, e-commerce came into being. Everything is due to the great contribution of the Internet. There is infinite vitality in the world of the Internet. There are only unexpected and impossible things here. The enterprise has professional website design, application and maintenance personnel, makes full use of the information resources on the Internet, develops core competitiveness and expands the market to the greatest extent.

The main functional modules of the enterprise website studied in this paper include enterprise information, enterprise recruitment, message exchange, resume delivery, enterprise culture, message classification module, etc. the object-oriented development mode is adopted for software development and hardware erection, which can well meet the needs of practical use, improve the corresponding software erection and program coding, and adopt SSM framework, JSP technology Ajax technology encodes and develops the business system, and realizes all the functions of the system. This report first analyzes the background, function and significance of the research, which lays a foundation for the rationality of the research work. This paper analyzes the requirements and technical problems of the enterprise website, proves the necessity and technical feasibility of the system, and then makes a basic introduction to the technical software and design ideas needed to design the system. Finally, it realizes the deployment and operation of the enterprise website.

Key words: Enterprise financial invoice management; Springboot framework; database

Table of contents

1. Introduction 5

(1) Research background and significance 5

(2) Research content 5

(3) Organizational structure of this article5

2. Introduction of development tools and related technologies 6

(1) J2EE technology 3

(2) MVVM pattern 3

(3) B/S structure 3

(4) Springboot framework 3

(5) Mysql database 4

(6) Working principle of B/S system 4

(7) JavaScript running mode 4

3. System Analysis 7

(1) Feasibility analysis7

1. Economic feasibility7

2. Technical feasibility7

3. Operational Feasibility7

(2) Functional requirements analysis 7

(3) Non-functional requirements analysis 11

4. System Design 12

(1) Functional module design 12

(2) Database design 14

1. Conceptual model design 14

2. Database table design 15

V. System Implementation 17

(1) Realization of user login18

(2) Realization of the main functions of the system18

6. System test 24

(1) System reliability test 24

(2) System functional test 24

(3) System qualification test 25

(4) Test results 25

7. Summary and Prospect 26

Reference 27

Thanks 27

  1. introduction

  1. research background and meaning

The Internet is currently the largest computer interconnection network in the world. It spreads all over the world and connects networks of various sizes around the world into a whole. As an advanced and easily accepted means of information retrieval on the Internet, the World Wide Web (WWW for short) develops very rapidly and has become the largest treasure house of information resources in the world. It is estimated that there are tens of millions of Web sites on the Internet at present, and their content scope spans various fields such as education, scientific research, cultural undertakings, finance, commerce, press and publication, entertainment, and sports. Its user base is very large, therefore, building a good website is very important for the development of an enterprise. From the perspective of the actual situation of the enterprise, with the increasingly close connection between domestic and international markets and the increasing intensity of market competition, the enterprise is facing huge market pressure. Foreign enterprises continue to gain comparative advantages through intellectual investment and technological innovation, which makes Chinese enterprises, which are relatively backward in technology and management, face very severe challenges. The Fifteenth National Congress of the Communist Party of China clearly required the transformation of the economic growth mode from extensive to intensive, which further increased the urgency for enterprises to improve their technological level. If you want to gain market advantage, you want to improve economic benefits through the road of connotative development. The status of website construction in Internet applications is obvious. It has become an important part of the information construction of governments, enterprises and institutions, and thus has attracted much attention. Improve the company's popularity and expand the company's scale.

  1. research content

The development and implementation of an enterprise website based on Springboot requires work content:

(1) First of all, determine the topic, determine the system to be built, and conduct a preliminary systematic confirmation of the background of the system and some problems currently facing it.

(2) After the system confirmation is completed, confirm the technology used for system development in combination with the needs of system development. The development of the enterprise website uses the Springboot framework, and the database is used to build and develop the system, and the technology used is confirmed for technical analysis. Whether the technology used The realization of the system can be completed.

(3) Determine the technology used by the system, confirm the user roles divided by the system online, and determine the functional modules to be designed according to the division of user roles. The design of the enterprise website is mainly divided into administrator and user roles, and the used The functional modules of the system are also different, but the content realized by the database of the system is interactive. Users can query information according to their own needs at any time. For system staff, they can process and operate online information according to their own assigned content. The detailed data information of all users will be processed and resolved in the first time according to the needs.

(4) Design the program and interface after the functional modules of the system are confirmed. The test method finds out the loopholes in the program, and solves the loopholes in the program online. If there is no problem in the test system, the system can be uploaded for formal operation.

  1. Organization of this article

Six chapters together constitute the research and design content of this paper, including:

Chapter One Introduction. At the beginning of this article, some textual descriptions of the research background and research significance of this topic are given.

Chapter Two: Introduction of related technologies. It mainly introduces the Springboot framework, Java embedded scripting language, B/S mode, etc.

Chapter Three: System Analysis. Including the overall system requirements description, analysis of system requirements from a functional point of view, and non-functional analysis of whether the system can be realized.

Chapter Four: System Design. The important part of this article provides the detailed design of the system architecture and the design description of some main functional modules.

Chapter Five: System Realization. The system is divided into the introduction of the development tools of the premise and the realization of the function code in the later stage.

Chapter Six: System Testing. After the system is completed, the functional test of each module is carried out according to the test cases of each module.

  1. Introduction to development tools and related technologies

  1. J2EE technology

People can master many foreign languages, but what a computer scientist is proficient in is mostly programming languages, which are not human natural languages, such as C language, Java, Perl and so on. Because the "middleware" developed by different companies is not standardized enough, Sun company launched J2EE and used this standard to solve the ills. It provides a good mechanism, allowing each layer to allow the corresponding server and components to run, making the system stable and usable, efficient in development, and easy to maintain.

  1. MVVM pattern

The Springboot (Spring+SpringMVC+MyBatis) framework set is composed of two open source frameworks, Spring and MyBatis (SpringMVC is part of Spring). Often used as a framework for web projects with simpler data sources.

1.1Spring

Spring is like a large factory for assembling beans in the entire project. In the configuration file, you can specify specific parameters to call the constructor of the entity class to instantiate the object. It can also be called the glue in the project.

The core idea of ​​Spring is IoC (Inversion of Control), that is, programmers are no longer required to explicitly `new` an object, but let the Spring framework do it for you.

1.2 SpringMVC

SpringMVC intercepts user requests in the project. Its core Servlet, DispatcherServlet, assumes the role of intermediary or front desk, and matches user requests with the Controller through HandlerMapping. The Controller is the specific operation performed by the corresponding request. SpringMVC is equivalent to struts in the SSH framework.

1.3 apartment

mybatis is an encapsulation of jdbc, which makes the underlying operation of the database transparent. The operations of mybatis revolve around a sqlSessionFactory instance. Mybatis is associated to the Mapper file of each entity class through the configuration file. The Mapper file configures the SQL statement mapping required by each class to the database. Every time you interact with the database, get a sqlSession through sqlSessionFactory, and then execute the sql command.

The page sends a request to the controller, the controller calls the business layer to process the logic, the logic layer sends the request to the persistence layer, the persistence layer interacts with the database, and returns the result to the business layer, the business layer sends the processing logic to the controller, and the controller then Call the view to display the data.

  1. B/S structure

B/S (Browser/Server) is a more convenient architecture than its predecessor architecture. It uses the Web server to complete the data transfer and exchange. You only need to download the browser as the client, then the work will achieve a "slimming" effect, and there is no need to consider the problem of non-stop installation of software.

  1. Spring boot framework

The Spring framework is an open source application framework on the Java platform that provides a container with inversion of control features. Although the Spring framework itself has no restrictions on the programming model, its frequent use in Java applications made it so popular that it was later used as a supplement or even a substitute for the EJB (EnterpriseJavaBeans) model. The Spring framework provides a series of solutions for development, such as using the core features of inversion of control, and implementing inversion of control through dependency injection to realize the containerization of the management object life cycle, using aspect-oriented programming for declarative transaction management, and integrating A variety of persistence technologies manage data access, provide a large number of excellent web frameworks to facilitate development, and so on. The Spring framework has the feature of inversion of control (IOC). IOC is designed to facilitate project maintenance and testing. It provides a method for unified configuration and management of Java objects through the Java reflection mechanism. The Spring framework uses the container to manage the life cycle of objects. The container can configure objects by scanning XML files or specific Java annotations on classes. Developers can obtain objects through dependency lookup or dependency injection. Aspect Oriented Programming(AOP) framework, the Spring AOP framework is based on the proxy mode, and can be configured at runtime; the AOP framework is mainly modularized for the cross concerns between modules. The AOP framework of the Spring framework only provides basic AOP features. Although it cannot be compared with the AspectJ framework, it can also meet the basic needs through integration with AspectJ. Functions such as transaction management and remote access under the Spring framework can be realized by using Spring AOP technology. Spring's transaction management framework brings an abstraction mechanism to the Java platform that enables local and global transactions, as well as nested transactions, to work with savepoints and in almost any environment on the Java platform. Spring integrates multiple transaction templates. The system can configure transactions through transaction templates, XML or Java annotations, and the transaction framework integrates functions such as messaging and caching. Spring's data access framework addresses common difficulties developers encounter when using databases in their applications. It not only provides support for all popular data access frameworks such as Java: JDBC, iBATS/MyBATIs, Hibernate, Java Data Objects (JDO), ApacheOJB and Apache Cayne, but also can be used with Spring's transaction management to provide data access Flexible abstraction. The Spring framework initially did not intend to build its own Web MVC framework . During the development process, its developers believed that the separation between the presentation layer and the request processing layer of the existing Struts Web framework and between the request processing layer and the model was not enough, so they created Spring MVC.

  1. Mysql database

Mysql has been updated many times, and the functional level has been very rich and perfect. From Mysql4 version to 5 version, a relatively large update has been made, and it has achieved good practical application results in actual commercial use. The latest version of Mysql supports the compression of information, and at the same time, it can also perform encryption to better meet the needs of information security. At the same time, after multiple updates of the system, the mirroring function of the database itself has also been greatly enhanced, the smoothness of operation and ease of use have been greatly improved, and the use and creation of drivers are also more efficient and faster. The biggest change is the optimization of the display of spatial information, which makes it easier to label and calculate coordinates on the application map. The powerful backup function also ensures that users will feel more at ease during the use process, and the supported Office features also support users' self-installation and use. The display form of information has also been greatly updated, and two very useful display areas have been added, one is the information area, which has classified tables and text, and the display of the interface is more refreshing and specific. The second is the information control of the instrument, which can display information in the instrument information area and compare multiple information at the same time, which brings great convenience to the actual use of users.

In the actual implementation process of the enterprise website designed in this article, the main reason for choosing the Mysql database is that there will be a large number of databases that are frequently operated during the application and development of the enterprise application system, and the data security requirements are also very high. Based on these factors, Mysql, which has a relatively high safety factor, is finally selected to store and operate the background data of the enterprise website.

(6) Working principle of B/S system

The B/S architecture adopts the working mode of browser request and server response.

Users can access information such as text, data, pictures, animation, video on demand and sound generated by the web server on the Internet through a browser;

And each web server can be connected with the database server in various ways, and a large amount of data is actually stored in the database server;

Download the program from the Web server to execute locally. If an instruction related to the database is encountered during the download process, the Web server will hand it over to the database server for interpretation and execution, and return it to the Web server, and the Web server will return it to the user. In this structure, many networks are connected together to form a huge network, that is, the global network. Each enterprise can build its own Internet on the basis of this structure.

In the B/S mode, the user requests access to many servers distributed on the network through the browser. The browser's request is processed by the server, and the processing result and corresponding information are returned to the browser. Other data Processing and requests are all completed by the Web Server. Through the frame structure and the browser embedded in the operating system, this structure has become the mainstream structure mode of today's software applications.

(7) JavaScript running mode

JavaScript is a high-level scripting language belonging to the network. It has been widely used in the development of Web applications. It is often used to add various dynamic functions to web pages and provide users with smoother and more beautiful browsing effects. Usually, JavaScript scripts realize their own functions by embedding them in HTML.

1.1 is an interpreted scripting language (code is not precompiled ).

1.2 is mainly used to add interactive behavior to HTML ( an application under the Standard Universal Markup Language ) page.

1.3 can be directly embedded in HTML pages, but written as a separate js file is conducive to the separation of structure and behavior .

1.4 Cross-platform feature, with the support of most browsers, it can run on multiple platforms (such as Windows , Linux , Mac , Android , iOS , etc.).

1.5 JavaScript scripting language, like other languages, has its own basic data types, expressions and arithmetic operators and the basic program framework of the program. JavaScript provides four basic data types and two special data types for processing data and text. Variables provide a place to store information, and expressions can complete more complex information processing.

  1. system analysis

  1. Feasibility Analysis

The feasibility analysis of this system will be carried out from the perspectives of economy, technology and operation.

  1. economic feasibility

The entire system has rigorous steps from design to development and testing. All work tasks are completed by myself without external technical support, which saves all service costs and labor costs. In terms of hardware, a second-hand mobile phone is used to save costs. The workstation is used as the project deployment server and database server, and the cost is less than 10,000 yuan. The actual network deployment is also completed by myself without other labor costs involved. The entire development process is based on the principle of low cost and low consumption.

  1. technical feasibility

The purpose of the technical feasibility analysis is to confirm whether the system can be implemented using existing technologies, and to evaluate the development efficiency and completion. Technical feasibility refers to whether the development of computer software and hardware can meet the requirements of development under the current technical conditions. Because the development of the system is based on the Java language, the software and hardware conditions required for the development of the system can be met on an ordinary computer. Because it takes up relatively little memory, there is theoretically no problem in developing and designing software with the Mysql database because it takes up too little memory. The above techniques can effectively guarantee the successful and efficient development of the system.

  1. operational feasibility

The user interface of the corporate website is simple and easy to operate. Common interface windows are used to log in to the interface, and access operations are performed through computers. Users can access operations as long as they have used computers at ordinary times. The development of this system is developed with Java technology. Humanization and perfection are the more prominent features of B/S structure development, which makes user operations more concise and convenient than others. Easy to operate, easy to manage, and good interactivity are fully reflected in the operation of this system.

  1. Functional Requirements Analysis

The user use case diagram is shown below.

Figure 1 User use case diagram

The administrator use case diagram is shown below.

Figure 1 Administrator user use case diagram

The use case description of enterprise recruitment addition is shown in the table below.

Table 1 Description of enterprise recruitment adding use case

use case name

Add new business recruitment

participant

administrator

Use case overview

This use case is used for administrators to add new company recruitment operations

Preconditions

The administrator must log in to the system before adding new company recruitment

postcondition

系统中添加一个新企业招聘

基本事件流

参与者动作

系统响应

  1. 管理员在后台主界面选择“新企业招聘”。

4、管理员填写新企业招聘信息,点击“添加”按钮。

2、系统打开添加新企业招聘界面。

3、系统检查管理员输入的企业招聘信息是正确有效的。

5、系统将企业招聘添加到数据库中。

6、系统提示“操作成功”。

7、系统跳转到企业招聘管理界面。

其他事件流

系统验证管理员输入的企业招聘名为空,则提示“*请填写企业招聘信息!”。

用户编辑用例描述如下表所示。

表2用户编辑用例描述

用例名称

修改用户

参与者

管理员

用例概述

本用例用于管理员进行修改用户信息操作

前置条件

管理员已经登录系统

后置条件

系统中更新一条用户记录

基本事件流

参与者动作

系统响应

1、管理员在后台主界面选择“用户管理”。

4、管理员在用户列表中选择一个用户,点击“编辑”按钮。

6、管理员填写用户信息,点击“保存修改”按钮。

2、系统从数据库中获取用户信息。

3、系统打开用户列表界面。

5、系统打开修改用户信息界面。

7、系统将更改后的添加到数据库中。

8、系统提示“操作成功”。

9、系统跳转到用户管理界面。

其他事件流

简历投递添加用例描述如下表所示。

表1简历投递添加用例描述

用例名称

添加新简历投递

参与者

管理员

用例概述

本用例用于管理员进行添加新简历投递操作

前置条件

管理员添加新简历投递前必须登录系统

后置条件

系统中添加一个新简历投递

基本事件流

参与者动作

系统响应

  1. 管理员在后台主界面选择“新简历投递”。

4、管理员填写新简历投递信息,点击“添加”按钮。

2、系统打开添加新简历投递界面。

3、系统检查管理员输入的简历投递信息是正确有效的。

5、系统将简历投递添加到数据库中。

6、系统提示“操作成功”。

7、系统跳转到简历投递管理界面。

其他事件流

系统验证管理员输入的简历投递名为空,则提示“*请填写简历投递信息!”。

  1. 非功能性需求分析

随着用户量的增加,系统可能会需要同时服务上千、上万个页面,服务器需要同时响应大量用户的操作,这就要求系统需要有良好的可扩展性,否则系统会出现延迟,卡顿甚至服务器崩溃的问题。高扩展性可以使软件保持旺盛的生命力,同时也能够使系统更好的适应用户增加、提高性能需求、增加应用功能等改变。

系统中保存了大量用户和管理员的个人信息,因此,保证系统服务器和数据安全是在开发过程中需要考虑的重要问题。安全性包括服务器安全、操作系统安全、数据库安全、程序代码安全以及系统用户信息安全等,系统可以通过采用防火墙技术、加密技术、认证技术等来增强其安全性,只有一个健壮安全的系统才能具有长久的生命力。

  1. 系统设计

  1. 功能模块设计

通过软件的需求分析已经获得了系统的基本功能需求。根据各大功能模块的不同,将系统分为各种功能大块。系统功能结构如下图所示。

图4系统功能结构图

  1. 数据库设计

  1. 概念模型设计

概念设计包括实体和联系两部分,如该系统中,用户是一个实体,其属性包括用户 ID 标识、用户名、密码、电话、地址等属性。联系是指实体之间有意义的关联,包括一对一、一对多、多对多三种类型。

系统E-R图如下所示。

图5系统E-R图

连接数据库的文件在Resources 文件夹下的application.yml文件,代码如下:

server:

port: 5000

servlet:

context-path: /api

spring:

datasource:

url: jdbc:mysql://127.0.0.1:3306/CS725260_20211101091736?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8

username: root

password: root

driver-class-name: com.mysql.cj.jdbc.Driver

jackson:

property-naming-strategy: CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES

default-property-inclusion: ALWAYS

time-zone: GMT+8

date-format: yyyy-MM-dd HH:mm:ss

servlet:

multipart:

max-file-size: 100MB

max-request-size: 100MB

  1. 数据库表设计

数据库表是设计和实现系统的一个重要基础。以下列出了企业网站几个重要的数据库表。

名称

类型

长度

不是null

主键

注释

registered_user_id

int

11

注册用户ID

user_name

varchar

64

用户名

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

user_id

int

11

用户ID

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

名称

类型

长度

不是null

主键

注释

corporate_culture_id

int

11

企业文化ID

title

varchar

64

标题

cultural_category

varchar

64

文化类别

cover

varchar

255

封面

publisher

varchar

64

发布人

release_time

date

0

发布时间

content

longtext

0

内容

hits

int

11

点击数

praise_len

int

11

点赞数

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

名称

类型

长度

不是null

主键

注释

enterprise_recruitment_id

int

11

企业招聘ID

recruitment_position

varchar

64

招聘岗位

number_of_recruits

varchar

64

招聘人数

educational_requirements

varchar

64

学历要求

delivery_methods_

varchar

64

投递方式

salary

text

0

薪资待遇

job_requirements

text

0

工作要求

details

longtext

0

详情

hits

int

11

点击数

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

名称

类型

长度

不是null

主键

注释

resume_delivery_id

int

11

简历投递ID

recruitment_position

varchar

64

招聘岗位

user_name

int

11

用户名

contact_number

varchar

64

联系电话

education

varchar

64

学历

curriculum_vitae

varchar

255

个人简历

examine_state

varchar

16

审核状态

examine_reply

varchar

16

审核回复

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

名称

类型

长度

不是null

主键

注释

forum_id

mediumint

8

论坛id

display

smallint

5

排序

user_id

mediumint

8

用户ID

nickname

varchar

16

昵称

praise_len

int

10

点赞数

hits

int

10

访问数

title

varchar

125

标题

keywords

varchar

125

关键词

description

varchar

255

描述

url

varchar

255

来源地址

tag

varchar

255

标签

img

text

0

封面图

content

longtext

0

正文

create_time

timestamp

0

创建时间:

update_time

timestamp

0

更新时间:

avatar

varchar

255

发帖人头像:

type

varchar

64

论坛分类

  1. 系统实现

  1. 用户登录的实现

用户注册完成后,点击“登陆”进入到登陆页面,输入用户名和密码,点击“登陆”按钮,对用户名和密码进行验证,根据传入的用户名和密码在数据库中是否能查询到一条用户信息,若不能返回用户信息则登陆失败,页面提示用户名或密码错误。

登陆拦截管理器,在config文件夹下的WebAppConfig.java文件,代码如下:

@Configuration

@Slf4j

public class WebAppConfig implements WebMvcConfigurer {

@Override

public void addInterceptors(InterceptorRegistry registry) {

//登录拦截的管理器

InterceptorRegistration registration = registry.addInterceptor(loginInterceptor());

//拦截的地址

registration.addPathPatterns("/**");

//方行的地址

//registration.excludePathPatterns("/**");

//根据需要拦截,一般设置所有地址拦截,放行公共连接

}

@Bean

public LoginInterceptor loginInterceptor(){

return new LoginInterceptor();

}

}

登录界面如下图所示。

图5-1登录界面

用户登录的关键代码如下。

/**

* 登录

* @param data

* @param httpServletRequest

* @return

*/

@PostMapping("login")

public Map<String, Object> login(@RequestBody Map<String, String> data, HttpServletRequest httpServletRequest) {

log.info("[执行登录接口]");

String username = data.get("username");

String email = data.get("email");

String phone = data.get("phone");

String password = data.get("password");

List resultList = null;

Map<String, String> map = new HashMap<>();

if(username != null && "".equals(username) == false){

map.put("username", username);

resultList = service.select(map, new HashMap<>()).getResultList();

}

else if(email != null && "".equals(email) == false){

map.put("email", email);

resultList = service.select(map, new HashMap<>()).getResultList();

}

else if(phone != null && "".equals(phone) == false){

map.put("phone", phone);

resultList = service.select(map, new HashMap<>()).getResultList();

}else{

return error(30000, "账号或密码不能为空");

}

if (resultList == null || password == null) {

return error(30000, "账号或密码不能为空");

}

//判断是否有这个用户

if (resultList.size()<=0){

return error(30000,"用户不存在");

}

User byUsername = (User) resultList.get(0);

Map<String, String> groupMap = new HashMap<>();

groupMap.put("name",byUsername.getUserGroup());

List groupList = userGroupService.select(groupMap, new HashMap<>()).getResultList();

if (groupList.size()<1){

return error(30000,"用户组不存在");

}

UserGroup userGroup = (UserGroup) groupList.get(0);

//查询用户审核状态

if (!StringUtils.isEmpty(userGroup.getSourceTable())){

String sql = "select examine_state from "+ userGroup.getSourceTable() +" WHERE user_id = " + byUsername.getUserId();

String res = String.valueOf(service.runCountSql(sql).getSingleResult());

if (res==null){

return error(30000,"用户不存在");

}

if (!res.equals("已通过")){

return error(30000,"该用户审核未通过");

}

}

//查询用户状态

if (byUsername.getState()!=1){

return error(30000,"用户非可用状态,不能登录");

}

String md5password = service.encryption(password);

if (byUsername.getPassword().equals(md5password)) {

// 存储Token到数据库

AccessToken accessToken = new AccessToken();

accessToken.setToken(UUID.randomUUID().toString().replaceAll("-", ""));

accessToken.setUser_id(byUsername.getUserId());

tokenService.save(accessToken);

// 返回用户信息

JSONObject user = JSONObject.parseObject(JSONObject.toJSONString(byUsername));

user.put("token", accessToken.getToken());

JSONObject ret = new JSONObject();

ret.put("obj",user);

return success(ret);

} else {

return error(30000, "账号或密码不正确");

}

}

  1. 系统主要功能实现

  1. 首页的实现

用户界面要尽量简洁大方,使用户能够方便找到需要的功能入口,浏览企业资讯、企业文化、企业招聘信息、简历投递等,且要易于修改和维护,同时还要保证用户合法和系统安全。

首页界面如下图所示。

图5-2首页界面

  1. 系统用户注册的实现

系统用户进入系统首页后,点击“注册”链接进入到注册页面,按照页面提示输入用户名密码和手机号,页面进行表单验证,验证输入的用户名和账号是否合法,表单验证通过后,点击“立即注册”按钮,利用 Ajax 技术,对用户名和账号实现页面无刷新验证,检测数据库中是否已经存在该用户名,若数据库中不存在,则注册成功,注册成功后,自动跳转到登录页面。

系统用户注册逻辑代码如下:

/**

* 注册

* @param user

* @return

*/

@PostMapping("register")

public Map<String, Object> signUp(@RequestBody User user) {

// 查询用户

Map<String, String> query = new HashMap<>();

query.put("username",user.getUsername());

List list = service.select(query, new HashMap<>()).getResultList();

if (list.size()>0){

return error(30000, "用户已存在");

}

user.setUserId(null);

user.setPassword(service.encryption(user.getPassword()));

service.save(user);

return success(1);

}

/**

* 用户ID:[0,8388607]用户获取其他与用户相关的数据

*/

@Id

@GeneratedValue(strategy = GenerationType.IDENTITY)

@Column(name = "user_id")

private Integer userId;

/**

* 账户状态:[0,10](1可用|2异常|3已冻结|4已注销)

*/

@Basic

@Column(name = "state")

private Integer state;

/**

* 所在用户组:[0,32767]决定用户身份和权限

*/

@Basic

@Column(name = "user_group")

private String userGroup;

/**

* 上次登录时间:

*/

@Basic

@Column(name = "login_time")

private Timestamp loginTime;

/**

* 手机号码:[0,11]用户的手机号码,用于找回密码时或登录时

*/

@Basic

@Column(name = "phone")

private String phone;

/**

* 手机认证:[0,1](0未认证|1审核中|2已认证)

*/

@Basic

@Column(name = "phone_state")

private Integer phoneState;

/**

* 用户名:[0,16]用户登录时所用的账户名称

*/

@Basic

@Column(name = "username")

private String username;

/**

* 昵称:[0,16]

*/

@Basic

@Column(name = "nickname")

private String nickname;

/**

* 密码:[0,32]用户登录所需的密码,由6-16位数字或英文组成

*/

@Basic

@Column(name = "password")

private String password;

/**

* 邮箱:[0,64]用户的邮箱,用于找回密码时或登录时

*/

@Basic

@Column(name = "email")

private String email;

/**

* 邮箱认证:[0,1](0未认证|1审核中|2已认证)

*/

@Basic

@Column(name = "email_state")

private Integer emailState;

/**

* 头像地址:[0,255]

*/

@Basic

@Column(name = "avatar")

private String avatar;

/**

* 创建时间:

*/

@Basic

@Column(name = "create_time")

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

private Timestamp createTime;

@Basic

@Transient

private String code;

}

  1. 企业招聘管理的实现

企业招聘管理页面,主要信息包括有:招聘岗位、招聘人数、学历要求、投递方式、薪资待遇、工作要求信息等进行维护管理。如下图所示。

图5-3企业招聘管理页面

企业招聘管理的关键代码如下。

@PostMapping("/add")

@Transactional

public Map<String, Object> add(HttpServletRequest request) throws IOException {

service.insert(service.readBody(request.getReader()));

return success(1);

}

@Transactional

public Map<String, Object> addMap(Map<String,Object> map){

service.insert(map);

return success(1);

}

public Map<String,Object> readBody(BufferedReader reader){

BufferedReader br = null;

StringBuilder sb = new StringBuilder("");

try{

br = reader;

String str;

while ((str = br.readLine()) != null){

sb.append(str);

}

br.close();

String json = sb.toString();

return JSONObject.parseObject(json, Map.class);

}catch (IOException e){

e.printStackTrace();

}finally{

if (null != br){

try{

br.close();

}catch (IOException e){

e.printStackTrace();

}

}

}

return null;

}

public void insert(Map<String,Object> body){

StringBuffer sql = new StringBuffer("INSERT INTO ");

sql.append("`").append(table).append("`").append(" (");

for (Map.Entry<String,Object> entry:body.entrySet()){

sql.append("`"+humpToLine(entry.getKey())+"`").append(",");

}

sql.deleteCharAt(sql.length()-1);

sql.append(") VALUES (");

for (Map.Entry<String,Object> entry:body.entrySet()){

Object value = entry.getValue();

if (value instanceof String){

sql.append("'").append(entry.getValue()).append("'").append(",");

}else {

sql.append(entry.getValue()).append(",");

}

}

sql.deleteCharAt(sql.length() - 1);

sql.append(")");

log.info("[{}] - 插入操作:{}",table,sql);

Query query = runCountSql(sql.toString());

query.executeUpdate();

}

  1. 简历投递管理的实现

简历投递信息的输入框,管理员在输入框内输入具体的项目信息,系统将管理员输入的简历投递信息传递到后台。首先创建一个实体类 PageBean,该实体类的属性包括页码 pageCode、每页记录数 pageSize、总记录数 totalRecord 和一个 List 集合 beanList,用循环将搜索到的结果分页展示。

简历投递管理界面如下图所示。

图5-4简历投递管理界面

简历投递管理的关键代码如下。

@RequestMapping("/get_obj")

public Map<String, Object> obj(HttpServletRequest request) {

Query select = service.select(service.readQuery(request), service.readConfig(request));

List resultList = select.getResultList();

if (resultList.size() > 0) {

JSONObject jsonObject = new JSONObject();

jsonObject.put("obj",resultList.get(0));

return success(jsonObject);

} else {

return success(null);

}

}

public Query select(Map<String,String> query,Map<String,String> config){

StringBuffer sql = new StringBuffer("select ");

sql.append(config.get(FindConfig.FIELD) == null || "".equals(config.get(FindConfig.FIELD)) ? "*" : config.get(FindConfig.FIELD)).append(" ");

sql.append("from ").append("`").append(table).append("`").append(toWhereSql(query, "0".equals(config.get(FindConfig.LIKE))));

if (config.get(FindConfig.GROUP_BY) != null && !"".equals(config.get(FindConfig.GROUP_BY))){

sql.append("group by ").append(config.get(FindConfig.GROUP_BY)).append(" ");

}

if (config.get(FindConfig.ORDER_BY) != null && !"".equals(config.get(FindConfig.ORDER_BY))){

sql.append("order by ").append(config.get(FindConfig.ORDER_BY)).append(" ");

}

if (config.get(FindConfig.PAGE) != null && !"".equals(config.get(FindConfig.PAGE))){

int page = config.get(FindConfig.PAGE) != null && !"".equals(config.get(FindConfig.PAGE)) ? Integer.parseInt(config.get(FindConfig.PAGE)) : 1;

int limit = config.get(FindConfig.SIZE) != null && !"".equals(config.get(FindConfig.SIZE)) ? Integer.parseInt(config.get(FindConfig.SIZE)) : 10;

sql.append(" limit ").append( (page-1)*limit ).append(" , ").append(limit);

}

log.info("[{}] - 查询操作,sql: {}",table,sql);

return runEntitySql(sql.toString());

}

  1. 系统测试

  1. 系统可靠性测试

以进入系统首页的访问速度为例展示系统的性能测试;系统的主要用户群体是企业人员,系统要在3秒钟内响应;需要完成页面的企业资讯、企业文化、企业招聘以及简历投递以及各功能模块入口等元素的显示。

  1. 系统功能性测试

功能性测试是指执行指定的工作流程,通过对一个系统的所有特性和功能都进行测试确保符合需求和规范。

系统功能性测试表如下表所示。

表11系统功能性测试表

编号

测试功能

测试内容

测试结果

1

用户登录

1.验证用户名与密码的正确性。

2.验证密码是否可见。

通过

2

首页展示

1.首页数据是否成功加载。

2.验证搜索功能的准确性。

3.验证是否可以异步加载。

4.验证导航栏按钮。

通过

3

信息修改

1.验证登录名是否可以正常更改。

2.验证联系方式是否可以更改。

3.验证密码是否可以修改。

通过

4

企业招聘管理

1.招聘清单是否可以生成。

2.验证信息是否准确。

通过

7

简历投递管理

1.简历投递是否可以成功。

2.验证项目删除是否可以成功。

通过

  1. 系统合格性测试

集成测试后,所有的模块已经全部连接完毕,形成了一个完整的系统。合格性测试是在集成测试完毕后,进一步对系统进行综合性的检测。经过合格性测试,可以检查出系统是否符合系统的设计,能够完成需求的所有功能。本系统经过最后的测试,所有模块功能都能按预定要求工作。

  1. 测试结果

在实际测试中,经过一系列系统性的测试,使我们能够及时发现一些系统在设计中出现的疏忽和漏洞。经过严密的测试,不仅发现了模块内部的错误,也查找到模块连接后产生的错误。经过测试,对系统产生错误的地方进行优化、修改和完善,使得系统能够实现最初设计的基本功能。

  1. 总结与展望

本文针对企业网站的特点和用户需求,利用 Java相关技术、Springboot框架和等技术,通过详细的需求分析、页面设计和功能设计,系统利用JQuery 技术和 CSS 技术进行了页面设计,实现了包括系统登录、企业资讯管理、简历投递管理、企业招聘管理等。并添加了用户的访问控制,建立了一个完整、健壮、安全稳定的企业网站。

由于时间限制和本人能力条件有限,还存在一些不足,今后也会出现许多新的开发技术,未来还可以对程序做出更加优化的改进

参考文献

[1]阙小平,吴贺男.企业管理工作信息化建设思路探索[J].商讯,2021(33):113-115.

[2]贺岩春.探讨人力资源管理理念在建筑企业管理中的应用价值[J].上海商业,2021(11):94-95.

[3]孙翔艳.探究国有企业管理的现状及其战略转变[J].营销界,2021(28):155-156.

[4]郭海琴.加强干部人事档案信息化管理全面促进企业管理创新[J].中国集体经济,2021(22):129-130.

[5]王琛.企业管理工作信息化建设探析[J].现代营销(经营版),2021(06):113-114.

[6]陈慧娟.单位人事管理向人力资源管理的转变[J].中国中小企业,2021(01):191-192.

[7]徐宏伟.人力资源管理软件在企业管理中的运用研究[J].中国管理信息化,2020,23(24):110-111.

[8]刘蓉,丁旭.现代企业管理信息系统的设计与实现[J].黄河.黄土.黄种人,2020(17):36-37.

[9]曹智. 基于SSM框架的企业管理系统的设计与实现[D].电子科技大学,2019.

[10]徐向.基于C/S的集团公司网站设计研究[J].数码世界,2019(02):69.

[11]彭辉.企业管理的重要性及方法[J].中外企业家,2019(05):78.

[12]马英豪.企业管理的重要性及方法[J].低碳世界,2018(12):308-309.

[13]王佳越. 基于Spring Cloud的集团公司网站的设计与实现[D].吉林大学,2018.

[14]王惠.基于JSP的集团公司网站的设计与实现[J].电脑知识与技术,2018,14(33):75-77.

[15]王炅.新时期企业管理的探讨[J].内蒙古科技与经济,2018(16):31+34.

[16]余小成,汪颖,周凌云. 规范企业管理 构建和谐劳动关系[N]. 人民法院报,2018-06-28(005).

[17]孙文刚. 基于混合架构的集团公司网站的设计与实现[D].吉林大学,2018.

[18]Haiyang MA,Lejun LI,Xiaomei LIU,Weijun ZHAO,Baoyi LOU.Teaching Design of Tourism Management Based on Information-based Teaching Method: A Case Study of Selection of Hotel Construction Site[J].Asian Agricultural Research,2021,13(12):55-61.

致谢

本次设计历时3个月。在这个毕业设计中,它离不开指导教师的指导,使事情基本顺利。指导老师无论是在毕业设计历经中,还是在论文做完中都给了了我特别大的助益。另1个方面,教师认真负责的工作姿态,谨慎的教学精神厚重的理论水准都使我获益匪浅。他勤恳谨慎的教学育人学习姿态也给我留下了特别特别深的感觉。我从老师那里学到了很多东西。在理论和实践中,我的技能得到了特别大的提高。在此,特向教师表示由衷的感激。

经过对该毕业设计的全部研究和开发,我的系统研发经历了从需求分析到实现详细功能,再到最终测试和维护的特殊进展。让我对系统研发有了更深层次的认识。如今我的动手本领单独处理疑惑的本领也获取到了特别大的演练学习增多,这是这次毕业设计最好的收获。

最后,在整个系统开发过程中,我周围的同学和朋友给了我很多意见,所以我很快就确认了系统的商业思想。在次,我由衷的向他们表示感激。

点赞+收藏+关注 → 私信领取本源代码、数据库

Guess you like

Origin blog.csdn.net/DZBS2000/article/details/128974380