考勤管理系统的实现

//涉及的功能

1.项目以及数据库搭建
2.用户异步登录.退出
3.拦截器功能实现以及整合动态代理
4、公告模块的增加、修改、删除、查询以及预览功能实现、文件异步上传
5、文档模块的增加、修改.删除、查询以及文档的上传下载
6.员工信息的增加、修改、删除、查询以及员工头像异步上传、员工信息导出至Exce|文件
7.自定义分页标签实现( 24种样式随意切换)
8.代码机器人使用。

//使用的技术

1.前端:jsp. css、 javascript. jQueryjs框架)、jquery.form.js. HTML富文本编辑器、
My97时间控件(添加员工)
2.后台: Struts2.动态代理、Mybatis框架、 log4J日志框架、
jst|自定义分页标签、代码机器人、Dwr. POI (实现Exce|文件的导入导出)等
3.数据库: MysqI
4.服务器: Tomcat

导入导出excel表的插件:poi.jar等等

定时器:jQuery, ajax

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
目 录 目 录 I 摘 要 I ABSTRACT II 第1章 问题定义 1 1.1 引言 1 1.2开发背景 1 1.3问题描述 1 第2章 可行性分析 3 2.1 引言 3 2.2 目的和意义 3 2.3 可行性分析 3 第3章 需求分析 5 3.1 引言 5 3.2 用户需求描述 5 3.2.1学生用户需求描述 5 3.2.2任课老师用户需求描述 5 3.2.3班主任用户需求描述 6 3.2.4院(系)领导用户需求描述 6 3.2.5学校领导用户需求描述 6 3.2.6系统管理员用户需求描述 6 3.3功能需求描述 7 3.4系统开发工具 7 3.5相关开发工具简介 7 3.5.1 B/S(浏览器/服务器)简介 7 3.5.2 JAVA/JSP简介 8 3.6 系统功能划分 8 3.7 数据字典 9 3.8 数据流图 11 3.9运行需求 12 3.9.1 最低配置 12 3.9.2 建议配置 12 第4章 总体设计 13 4.1 引言 13 4.2 系统布局设计 13 4.3 总体结构图 14 4.4 本人主要工作任务 15 第5章 详细设计 16 5.1 引言 16 5.2 系统功能流程图 16 5.3系统目录结构设计 17 5.4 数据库设计与实现 17 5.4.1 实体模型 17 5.4.2 E-R模型 18 5.4.3 数据库的逻辑设计 19 5.4.4 数据库表的创建 19 5.4.5 数据库的建立 21 5.5 前端操作页面设计 21 5.5.1 系统登陆设计 21 5.5.2 学生用户功能设计 21 5.5.3 任课老师用户功能设计 22 5.5.4 班主任用户功能设计 23 5.5.5 院系领导用户功能设计 23 5.5.6 学校领导用户功能设计 24 第6章 编码 25 6.1用户操作页面编码 25 6.1.1 系统登陆编码 25 6.1.2 学生用户功能编码 27 6.1.3 任课老师用户功能编码 30 6.1.4 班主任用户功能编码 34 6.1.5 院系领导用户功能编码 35 6.2 数据库连接池编码 38 6.2.1数据库连接池程序编码 38 6.2.2 连接池配置文件 41 第7章 软件测试 43 7.1 引言 43 7.2 测试方案 43 7.2.1 黑盒测试 43 7.2.2 白盒测试 43 7.2.3 其它测试方案 43 7.2.4 本系统所采用测试方案 43 7.3 测试过程 44 7.3.1 用户登陆测试 44 7.3.2 页面使用安全测试 44 7.3.3学生用户测试 45 7.3.4任课老师用户测试 46 7.3.5班主任用户测试 46 7.3.6院系领导/学校领导用户测试 47 总 结 48 参考文献 49 致 谢 50 附 录 51 附录一:文献资料 51 原文 51 译文 53 附录二、系统部署及使用手册 57 开发工具的安装与配置 57 系统部署 59 用户操作手册 60
以下是一个简单的学生考勤数据库功能实现代码,使用MySQL数据库和Python编程语言实现: ```python import mysql.connector # 连接数据库 mydb = mysql.connector.connect( host="localhost", user="root", password="password", database="attendance" ) # 创建游标对象 mycursor = mydb.cursor() # 创建学生表 mycursor.execute("CREATE TABLE students (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), gender VARCHAR(255), age INT)") # 创建教师表 mycursor.execute("CREATE TABLE teachers (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), gender VARCHAR(255), age INT)") # 创建课程表 mycursor.execute("CREATE TABLE courses (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), teacher_id INT, FOREIGN KEY (teacher_id) REFERENCES teachers(id))") # 创建考勤记录表 mycursor.execute("CREATE TABLE attendance_records (id INT AUTO_INCREMENT PRIMARY KEY, student_id INT, course_id INT, attendance_time DATETIME, status VARCHAR(255), FOREIGN KEY (student_id) REFERENCES students(id), FOREIGN KEY (course_id) REFERENCES courses(id))") # 创建成绩表 mycursor.execute("CREATE TABLE scores (id INT AUTO_INCREMENT PRIMARY KEY, student_id INT, course_id INT, score INT, FOREIGN KEY (student_id) REFERENCES students(id), FOREIGN KEY (course_id) REFERENCES courses(id))") # 插入学生数据 sql = "INSERT INTO students (name, gender, age) VALUES (%s, %s, %s)" val = [ ('Alice', 'Female', 18), ('Bob', 'Male', 19), ('Charlie', 'Male', 20), ('David', 'Male', 19), ('Eve', 'Female', 18) ] mycursor.executemany(sql, val) mydb.commit() print(mycursor.rowcount, "students inserted.") # 插入教师数据 sql = "INSERT INTO teachers (name, gender, age) VALUES (%s, %s, %s)" val = [ ('Mr. Smith', 'Male', 35), ('Ms. Johnson', 'Female', 30), ('Mr. Brown', 'Male', 40) ] mycursor.executemany(sql, val) mydb.commit() print(mycursor.rowcount, "teachers inserted.") # 插入课程数据 sql = "INSERT INTO courses (name, teacher_id) VALUES (%s, %s)" val = [ ('Math', 1), ('Physics', 2), ('English', 3) ] mycursor.executemany(sql, val) mydb.commit() print(mycursor.rowcount, "courses inserted.") # 插入考勤记录数据 sql = "INSERT INTO attendance_records (student_id, course_id, attendance_time, status) VALUES (%s, %s, %s, %s)" val = [ (1, 1, '2022-01-01 08:00:00', 'Present'), (2, 1, '2022-01-01 08:00:00', 'Late'), (3, 1, '2022-01-01 08:00:00', 'Absent'), (4, 2, '2022-01-01 08:00:00', 'Present'), (5, 2, '2022-01-01 08:00:00', 'Present') ] mycursor.executemany(sql, val) mydb.commit() print(mycursor.rowcount, "attendance records inserted.") # 插入成绩数据 sql = "INSERT INTO scores (student_id, course_id, score) VALUES (%s, %s, %s)" val = [ (1, 1, 90), (2, 1, 85), (3, 1, 75), (4, 2, 80), (5, 2, 90) ] mycursor.executemany(sql, val) mydb.commit() print(mycursor.rowcount, "scores inserted.") # 查询某个学生的考勤记录 sql = "SELECT students.name, courses.name, attendance_records.attendance_time, attendance_records.status FROM attendance_records INNER JOIN students ON attendance_records.student_id = students.id INNER JOIN courses ON attendance_records.course_id = courses.id WHERE students.name = %s" val = ('Alice',) mycursor.execute(sql, val) myresult = mycursor.fetchall() for x in myresult: print(x) # 查询某个课程的成绩排名 sql = "SELECT students.name, scores.score FROM scores INNER JOIN students ON scores.student_id = students.id WHERE scores.course_id = %s ORDER BY scores.score DESC" val = (1,) mycursor.execute(sql, val) myresult = mycursor.fetchall() rank = 1 for x in myresult: print(str(rank) + ". " + x[0] + ": " + str(x[1])) rank += 1 ``` 以上代码实现了创建数据库表、插入数据、查询数据等基本功能,可以根据实际需求进行修改和扩展。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值