First assesment _832201229蔡绍恩

832201229 蔡绍恩 2024-10-31 14:51:01

https://github.com/Noimp137/front

https://github.com/Noimp137/back

1.3 My PSP Table

ModulesTask DescriptionEstimated TimeActual Time
Demand AnalysisDetermine the requirements of the web page and the functions that can be achieved3 hour3 hour
Database DesignDesign database schema, including contact information25 hours25 hours
Backend DevelopmentCreate a Spring Boot application and write an interface20 hours30 hours
Front-end DevelopmentPage design, front-end development using Vue20 hours30 hours
TestTest whether the web page meets expectations10 hours10 hours
DeployDeploy the application to the server10 hours15 hours
Total 88 hours113 hours

 .1  Archive

This system uses MYSQL open source database, the main reason for using it is because MYSQL data is small, fast, easy to connect, and will not contain high cost, but also open source, in the general small and medium-sized enterprises, they will choose MYSQL database as the website database MySQL. Will optimize the SQL query algorithm, effectively improve the query speed, and add, delete, modify and check. It can also provide support for multiple languages.

2.2  J2EE

The core of J2EE is reflected in the standardization of technology and architecture, which includes various components, service architectures and technical levels, because they all have the same standards and specifications, and all programs that comply with the J2EE architecture have good compatibility between different platforms.

2.3 JSP technology features

(1) Generate components that can be reused multiple times

Most JSP pages rely on reusable cross-platform components, such as JavaBeans components, to implement the more complex processing required by the application.

(2) Adopt identification to simplify development

You can build specific features, such as recognition. This will greatly improve the efficiency of development, but also can quickly build the dynamic web page developers need.

(3) Adaptation platform

Because JSP technology can adapt to a variety of development environments, but also written in JAVA language, it will have all the advantages of JAVA technology.

(4) The data link is JDBC technology

Because almost all developers now use ODBC to connect to the database, and in this way to connect to the database is simple and not locked, while connecting with other frameworks is not difficult

3.1 Overall Functional modules
The textbook management system developed can run normally on the specified software platform. The current textbook management system can run on a normal laptop computer, the operating system is Windows 10. There are no restrictions on the database, but based on the size of the database, processing speed and security, it is recommended to use a relational database.

The teaching material management system is mainly divided into two user roles: system administrator and teacher. As shown in Figure 3.1

Figure 3.1 Functional requirement analysis

3

2 Function modules of the system administrator
(1) Class information management: Complete the information entry of the department, major, class name, and number of students of the class, and can delete the graduated class.

(2) Course information management: The academic administration personnel shall enter the name of the course, the credits and hours of the course, and strictly introduce the course.

(3) Teacher information management: the system administrator enters the teacher's job number, name, gender, age, and mobile phone number.

(4) Textbook information management: input relevant textbook number, textbook introduction, publishing house, author, unit price, textbook category, textbook cover and textbook name.

(5) Selected textbooks to be assessed: determine the audit through the teaching materials requested by the teacher user.

(6) Selected textbooks query: query the textbooks that have been rejected and passed, and query the detailed information output.

(7) Order teaching materials: According to the application of teacher users, the purchase of teaching materials.

(8) Ordering management of teaching materials: the number of ordered teaching materials and textbooks.

(9) Textbook storage: the amount of textbook information that has been stored.

(10) Textbook inventory management: check the number of textbooks that have been stored.

(11) Textbooks to be collected: In this function, you can view the textbooks that are already available for collection.

(12) Collection record: record whether the textbook has been collected. As shown in Figure 3.2

Figure 3.2 System Administrator functions

3

.3 Teacher function module
The functions of the teacher are shown in Figure 3.3

(1) Select course materials: This function is completed to view the input and select the class, the material information according to the class size to buy materials.

(2) My selected textbook: Check my purchase record, and judge whether it can be put forward from the warehouse according to the approval of the audit.

(3) Collection record: The collection record of teaching materials under the teacher user. As shown in Figure 3.3.

Figure 3.3 Teacher function diagram

 

4.1 SSM Framework
SSM framework is based on Spring MVC, Spring, Mybatis three combination framework abbreviation. The integration and collaborative use of the three frameworks can effectively improve the efficiency of the code, so that the development time of the program can be more effectively shortened, and the development cost of our system can be reduced.

4.2  Mybatis configuration file

Configuring database connections

<beanid="dataSource"class="org.apache.commons.dbcp.BasicDataSource"destroy-method="close">

<property name="driverClassName"value="#{jdbc.driver}"/>

<property name= "url" value="#{jdbc.url}"/>

<property name="username"value="#{jdbc.user}"/>

<property name="password"value="#{jdbc.password}"/>

<property name="maxActive"value="#{jdbc.maxActive}"></property></bean>

Configure the information for a data source, that is, the connection information for the database, then configure the information for the sessionFactory, and finally pass

<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">

<property name="basePackage" value="com.dao"/>

</bean>This configuration statement scans all configured mybatis configuration file information

4.3  SpringMVC配置文件

Scan configuration components

<context:component-scan base-package="com.controller"/>

<! -- Configuring MVC Annotation Scanning -->

<mvc:annotation-driven />

<beanid="multipartResolver"  class="org.springframework.web.multipart.commons.CommonsMultipartResolver">

<!-- one of the properties available; the maximum file size in bytes -->

    <property name="maxUploadSize" value="10000000"/>

    <property name="defaultEncoding"value="UTF-8"/></bean>

This is the configuration file of Spring MVC. The main function of this file is to scan all the resource information of all the com.controller layer.

This chapter details the main features of the system and describes the functionality of each feature in code. And in each function module, how to complete this module

4.3 Login Page
This feature page determines whether the user is a superuser or a non-superuser based on the account entered by the user, as shown in Figure 6.1.

Figure 6.1 System login page

The main code of this page is: // login

@RequestMapping("/login.do")

public void login(HttpServletRequest request,HttpServletResponse response,String username,String password,String role){

PrintWriter writer = this.getPrintWriter(response);

User user = userService.userlogin(username, password,role);

if(user==null){

writer.print("<script language=javascript>alert('The user name or password is incorrect');window.location.href='login.jsp';</script>");

}else{HttpSession session = request.getSession();

session.setAttribute("manage", user);

writer.print("<script language=javascript>alert('Login successful');window.location.href='index.jsp';</script>");}}

This code is the teacher User login code, will be through the user user=userService.userlogin(username, password,role); To call the value of the database to determine whether the user exists, if the verification is successful, the login is successful, and jump to the index.jsp page.

4.3 Class information management page
To add, delete, change, and check classes, and query by class name, as shown in Figure 6.2 Class Information Management

Figure 6.2 Class information management

4.4 Course information management
Add, delete, revise and check the teaching materials, and inquire the required teaching materials. Query by teacherService. SelectBeanList approach to interaction calls, to find qualified record. The records that meet the query criteria are transmitted to the displayed page using the request.setAttribute method. Also by returning "teacherlist.jsp"; Specify a specific JSP page, as shown in Figure 6.3 Course Information Management

Figure 6.3 Course information management

4.5 Teacher information management
This function can be added through the super user account, so this is also a vulnerability, can not register ordinary users, only through the super user to add. The added common user will successfully log in to the teacher user interface according to the password to purchase textbooks, as shown in Figure 6.4 Teacher information management.

Figure 6.4 Teacher information management

主要代码://教师信息列表

@RequestMapping("/teacherlist.do")

public String teacherlist(HttpServletRequest request,String pagenum,String classname,String jobno,String cname){

…….

if (pagenum != null) {

currentpage = Integer.parseInt(pagenum);}//组装查询的sql语句

StringBuffer sb = new StringBuffer();

sb.append(" select * from t_teacher where  ");//查询条件返回页面

if (jobno != null && !"".equals(jobno)) {

sb.append(" jobno like '%"+jobno+"%' ");

sb.append(" and ");

request.setAttribute("jobno", jobno);}

if (cname != null && !"".equals(cname)) {

sb.append(" cname like '%"+cname+"%' ");

sb.append(" and ");

request.setAttribute("cname", cname);}

sb.append(" 1=1 order by id desc ");

String sql = sb.toString();//查询列表

Map<String,List<Teacher>> map = teacherService.selectBeanMap(currentpage,pageSize,url,sql);

String pagerinfo = map.keySet().iterator().next();";}

4.6 Textbook information management
Textbook information management page, increase, reduce, modify, search required textbooks, query required textbooks. When adding textbooks, you should fill in the textbook name, textbook compilation, textbook category, textbook name, author, publisher and unit price. At the same time, you can click the View button to view the textbook information. Every time the super administrator adds a text message, the same record will appear on the teacher user side. The teacher user will select the new teaching material information displayed, select the required teaching material and feedback it to the Academic Affairs Office for review, and the super user can also veto the teacher's review and let the teacher choose the teaching material again.

And through code teacherService. SelectBeanList method to invoke the database query method to check the qualified record, through the request. The setAttribute method to query to record to display the page. Also return "teacherlist.jsp"; Specify which JSP page is returned to a specific designation, as shown in Figure 6.5 Textbook Information Management.

 

图6.5  教材信息管理

此页面主要代码://教材信息列表

@RequestMapping("/booklist.do")

public String booklist(HttpServletRequest request,String pagenum,String bnumber,String bname,String cname){

String url = "book/booklist.do";

……

sb.append(" bnumber like '%"+bnumber+"%' ");

sb.append(" and ");

request.setAttribute("bnumber", bnumber);}

if (bname != null && !"".equals(bname)) {

sb.append(" bname like '%"+bname+"%' ");

sb.append(" and ");

request.setAttribute("bname", bname);}

if (cname != null && !"".equals(cname)) {

sb.append(" cname like '%"+cname+"%' ");

sb.append(" and ");

request.setAttribute("cname", cname);}

sb.append(" 1=1 order by id desc ");

String sql = sb.toString();//查询列表

Map<String,List<Book>> map = bookService.selectBeanMap(currentpage,pageSize,url,sql);

String pagerinfo = map.keySet().iterator().next();

List<Book> list = map.get(pagerinfo);//列表返回页面

……..

return "booklist.jsp";}

首先获得bnumber、bname 、cname 的值,然后通过if(bnumber!=null&&!"".equals(bnumber)){if(bname !=null&&!"".equals(bname )){if(cname !=null&&!"".equals(cname )){通过这句条件语句分别判断下这个值是否为空,根据命令代码bookService.selectBeanList方法调用数据库中的查询方法来查到符合条件的信息记录,在根据request.setAttribute方法把查询到的记录传到显示的页面。同时通过return "booklist.jsp";指定传回到具体指定的是哪个JSP页面。

4.7 Query selected teaching materials
In this function option, super users can query a series of information such as the teacher of the selected textbook, the name of the textbook, and more importantly, they can query whether the textbook has passed the audit, as shown in Figure 6.7 Query of selected textbook.

Figure 6.7 Query for selected textbooks

4.8 Ordering Teaching Materials
The super user will select the teaching material according to this function item, submit the selected teaching material information to the teacher user and receive the operation, as shown in Figure 6.8 Ordering teaching materials.

Figure 6.8 Ordering teaching materials

4.9 Textbook ordering management
The super user can query the information and quantity of the ordered textbooks according to this function, as shown in Figure 6.9 Textbook ordering management.

Figure 6.9 Textbook ordering management

4.10 Storage management of teaching materials
In this function item, the super user will query the information of the textbooks that have been stored, as shown in Figure 6.2.

Figure 6.2 Storage management of teaching materials

4.11 Textbook inventory management
The super user will query the remaining amount of the textbook inventory according to this function option, as shown in Figure 6.3 Textbook inventory management.

Figure 6.3 Textbook inventory management

4.12 User information editing test
User information management is mainly to query user information and other operations, can be added and deleted according to the content of the user information, the detailed test data is shown in Table 7.1.

Table 7.1 User Information test Table

测试功能

业主信息

模块功能

用户信息的查询和编辑

测试目的

是否正常删除一条信息

输入数据

按照姓名查询一条用户信息,比如查询1001,显示教师信息后点击删除

预期结果

显示删除成功

输出结果

删除成功别切删除的业主信息无法找到

4.13User login
Test Case 1 and test process:

Login: Input such as account number, account password, and then click login for operation, there will be two cases: one case is successful login, enter the user's corresponding functional interface to make the next arrangement, data screening; The other case indicates that the login is unsuccessful, and the system will pop up a dialog box asking for re-login operation and clear the input information in the login bar.

Test Case 2 and test process:

Administrator login: Enter the account, password, and permission, and then click login to perform operations, there will be two cases: successful login to the administrator has permission to enter the function interface and prompt login failure or teacher login information page. In one case, the login succeeds and the administrator page is displayed for the next step. In the other case, a message indicating a login failure is displayed, and a dialog box is displayed asking you to log in again.

Detailed operations will be carried out according to the main contents of Test 1 and Test 2, and whether user information can be logged in, as shown in Table 7.2.

Table 7.2 User Login test table

功能特性

用户登录验证

测试目的

验证是否输入合法的信息

测试数据

用户名称:1111 密码:1111

测试内容

操作描述

数据

期望结果

实际结果

测试状态

1

输入用户姓名,按“登陆”按钮。

用户姓名:1111,

密码为空

显示警告信息“用户名或密码误!”

显示警告信息“用户名或密码误!”

与期望结果相同

2

输入密码,按“登陆”按钮。

用户姓名为空,密码:1111

显示警告信息“用户名或密码误!”

显示警告信息“用户名或密码误!”

与期望结果相同

3

输入用户姓名和密码,按“登陆”按钮。

用户姓名:1,

密  码:1

显示警告信息“用户名或密码误!”

显示警告信息“用户名或密码误”

与期望结果相同

4

输入用户姓名和密码,按“登陆”按钮。

用户名:1111,密  码:1111

正确登入到会员操作界面

正确登入到会员操作界面

与期望结果相同

  

...全文
65 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

170

社区成员

发帖
与我相关
我的任务
社区描述
2401_MU_SE_FZU
软件工程 高校
社区管理员
  • FZU_SE_TeacherL
  • 助教-吴可仪
  • 助教-孔志豪
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧