赞
踩
目 录
第一章 引言 1
1.1 项目背景 1
1.2 编写目的 2
第二章 软件概述 3
2.1 目标 3
2.2 功能 3
2.3 性能 3
第三章 软硬件环境和数据管理 4
3.1 硬件环境 4
3.2 软件环境 4
3.3 系统部署和运行 4
3.4 数据导入 5
第四章 软件使用说明 7
4.1 用户登录 7
4.2 管理员用户 7
4.3 教师用户 8
4.4 学生用户 11
基于的科技水平和大学生现在人手一部带摄像头的智能手机的有利现状,本文提出了一种采用Android智能手机的摄像头进行人脸识别的电子化学生考勤管理系统,采用Android智能手机人脸识别的好处是利用现有的人手一部带摄像头的智能手机的优势,免除考勤打卡机样式的系统的成本外,它还提高签到的准确率,杜绝了考勤中代人签到的行为,由于是手机考勤,学生课堂考勤的信息会直接传输到该学生考勤系统的服务端,如此一来方便了学生和教师查看过往考勤记录以及便于将该考勤记录直接导入到教务系统等其他平台。
1.2编写目的
传统的考勤方式会存在一些代签到、漏签到的现象,电子化的考勤方式能够保证考勤的准确性,可以减少人工纸质考勤或刷卡考勤投入的人力、财力和时间,并且更加环保,督促学生自觉地出勤,本文转载自http://www.biyezuopin.vip/onews.asp?id=16762提高学生的出勤率,减轻学校和教师的负担,提高课堂效率。该系统提供三类角色的功能:学生具有签到、请假和查询考勤记录功能;老师具有准假、查询考勤记录、获得考勤记录表功能;管理员具有管理学生和教师个人信息功能。
第二章软件概述
2.1目标
1)减轻老师点名的负担;
2)杜绝学生代课行为;
3)降低考勤统计中出错率;
4)减少上课点名所浪费的时间。
2.2功能
该系统主要有三类角色用户:管理员用户、教师用户和学生用户。
1)管理员用户具有管理教师用户和学生用户信息的功能;
2)教师用户具有点名功能、批准假条功能、修改学生出勤记录功能和获取考勤记录统计表的功能;
3)学生用户具有签到功能、请假功能和查看考勤记录功能。
package com.example.attendancesystem_client_android; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.RadioButton; import android.widget.TextView; import android.widget.Toast; import com.alibaba.fastjson.JSONObject; import com.example.attendancesystem_client_android.manager.ManagerMain; import com.example.attendancesystem_client_android.student.StudentMain; import com.example.attendancesystem_client_android.teacher.TeacherCourse; import com.example.attendancesystem_client_android.teacher.TeacherMain; import java.util.HashMap; import java.util.Map; import java.util.Objects; public class MainActivity extends AppCompatActivity implements View.OnClickListener { EditText et_account; EditText et_password; Button btn_login; RadioButton rb_student; RadioButton rb_teacher; RadioButton rb_manager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Objects.requireNonNull(getSupportActionBar()).hide(); setContentView(R.layout.activity_main); //startActivity(new Intent(this, TeacherCourse.class)); bindView(); } private void bindView(){ btn_login = findViewById(R.id.btn_login); btn_login.setOnClickListener(this); et_account = findViewById(R.id.et_account); et_password = findViewById(R.id.et_password); rb_student = findViewById(R.id.rbStudent); rb_teacher = findViewById(R.id.rbTeacher); rb_manager = findViewById(R.id.rbManager); } @Override public void onClick(View view) { if(view == btn_login){ login(); } } void login(){ boolean internet = false; ConnectivityManager cm = (ConnectivityManager) getApplicationContext() .getSystemService(Context.CONNECTIVITY_SERVICE); assert cm != null; NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); if (activeNetwork != null) { // connected to the internet if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) { internet = true; } else if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE) { internet = true; } } if(internet){ GlobalVariable.getInstance().setAccount(String.valueOf(et_account.getText())); GlobalVariable.getInstance().setPassword(String.valueOf(et_password.getText())); GlobalVariable.getInstance().setType(getType()); String account = GlobalVariable.getInstance().getAccount(); String password = GlobalVariable.getInstance().getPassword(); int type = GlobalVariable.getInstance().getType(); Intent intent = new Intent("android.intent.action.MAIN"); if(type == 1){ intent.setClass(MainActivity.this, StudentMain.class); new Thread(new Runnable(){ @Override public void run() { Map<String, String> map = new HashMap<String, String>(); map.put("action", "student_login"); map.put("account", account); map.put("password", password); OkHttp.Response response = OkHttp.httpPostForm("http://192.168.137.1/mgr/student/", map); assert response != null; Map content = (Map) JSONObject.parse(response.content); String code = Objects.requireNonNull(content.get("ret")).toString(); Log.e("MainActivity", response.content); if(code.equals("0")){ map = new HashMap<String, String>(); map.put("action", "student_get_self_info"); map.put("student_id", account); response = OkHttp.httpPostForm("http://192.168.137.1/mgr/student/", map); assert response != null; content = (Map) JSONObject.parse(response.content); String student_name = Objects.requireNonNull(content.get("student_name")).toString(); String student_class_id = Objects.requireNonNull(content.get("student_class_id")).toString(); GlobalVariable.getInstance().setStudent_name(student_name); GlobalVariable.getInstance().setStudent_class_id(student_class_id); startActivity(intent); } else if(code.equals("1")){ ToastChildThread.show(MainActivity.this, "账号或密码错误!", Toast.LENGTH_LONG); } else if(code.equals("2")){ ToastChildThread.show(MainActivity.this, "账号不存在!", Toast.LENGTH_LONG); } } }).start(); } else if(type == 2){ intent.setClass(MainActivity.this, TeacherMain.class); new Thread(new Runnable(){ @Override public void run() { Map<String, String> map = new HashMap<String, String>(); map.put("action", "teacher_login"); map.put("account", account); map.put("password", password); OkHttp.Response response = OkHttp.httpGetForm("http://192.168.137.1/mgr/teacher/", map); Map content = (Map) JSONObject.parse(response.content); String code = Objects.requireNonNull(content.get("ret")).toString(); if(code.equals("0")){ map = new HashMap<String, String>(); map.put("action", "teacher_get_self_info"); map.put("teacher_id", account); response = OkHttp.httpPostForm("http://192.168.137.1/mgr/teacher/", map); assert response != null; content = (Map) JSONObject.parse(response.content); String teacher_name = Objects.requireNonNull(content.get("teacher_name")).toString(); String teacher_email = Objects.requireNonNull(content.get("teacher_email")).toString(); GlobalVariable.getInstance().setTeacher_name(teacher_name); GlobalVariable.getInstance().setTeacher_email(teacher_email); startActivity(intent); } else if(code.equals("1")){ ToastChildThread.show(MainActivity.this, "账号或密码错误!", Toast.LENGTH_LONG); } else if(code.equals("2")){ ToastChildThread.show(MainActivity.this, "账号不存在!", Toast.LENGTH_LONG); } } }).start(); } else if(type == 3){ intent.setClass(MainActivity.this, ManagerMain.class); new Thread(new Runnable(){ @Override public void run() { Map<String, String> map = new HashMap<String, String>(); map.put("action", "manager_login"); map.put("account", account); map.put("password", password); OkHttp.Response response = OkHttp.httpGetForm("http://192.168.137.1/mgr/manager/", map); Map content = (Map) JSONObject.parse(response.content); String code = Objects.requireNonNull(content.get("ret")).toString(); if(code.equals("0")){ startActivity(intent); } else if(code.equals("1")){ ToastChildThread.show(MainActivity.this, "账号或密码错误!", Toast.LENGTH_LONG); } else if(code.equals("2")){ ToastChildThread.show(MainActivity.this, "账号不存在!", Toast.LENGTH_LONG); } } }).start(); } } else{ ToastChildThread.show(MainActivity.this, "请检查网络连接!", Toast.LENGTH_LONG); } } int getType(){ if(rb_student.isChecked()) return 1; else if(rb_teacher.isChecked()) return 2; else return 3; } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。