Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize textbook Management system with Java

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces you how to achieve Java textbook management system, the content is very detailed, interested friends can refer to, hope to be helpful to you.

I. brief introduction of the project

Functions include: administrators can add, delete, change and check teaching materials, textbook merchants, input teaching materials, users (including students and teachers) can carry out teaching materials merchants and teaching materials. Import and export operation of Excel. Teachers can return the teaching materials in order to receive the stored teaching materials. Students can only get the teaching materials from the corresponding teachers, and they can return the teaching materials and inquire about the teaching materials they have received. And pay for the received teaching materials and so on.

II. Project operation

Environment configuration: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (both supported by IntelliJ IDEA,Eclispe,MyEclispe,Sts)

Project technology: JSP + Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven and so on.

Check the class selection information: @ Servicepublic class TopicsServiceImpl implements TopicsService {@ Autowired private MyClassMapper classMapper; @ Autowired private StudentMapper studentMapper; @ Autowired private SubjectselectedMapper subjectselectedMapper; @ Autowired private SubjectMapper subjectMapper; @ Autowired private HttpServletRequest request; / * View the class selection information * / @ Override public List classinfo (Long id) {MyClass className = classMapper.selectById (id) / find the class name List students = studentMapper.selectByListAll (id); / / find the owner of the user's class according to the student form class id List projectselectedlist = new ArrayList (); List projectlist = new ArrayList (); Subjectselected projectselected = null; Subject project = null; for (int I = 0; I

< students.size(); i++) { List tprojectselecteds = subjectselectedMapper.selectBystudentid(students.get(i).getId()); if (tprojectselecteds != null && tprojectselecteds.size() >

0) projectselected = tprojectselecteds.get (0); if (projectselected! = null) {projectselectedlist.add (projectselected);} else {projectselected = new Subjectselected (); projectselected.setId (0L); projectselected.setIdProject (0L); projectselected.setIdStudent (0L) Projectselected.setStuselectFlag (0L); projectselectedlist.add (projectselected);}} for (int I = 0; I

< projectselectedlist.size(); i++) { if (projectselectedlist.get(i).getId() != 0) { projectlist.add(subjectMapper.selectById(projectselectedlist.get(i).getIdProject())); } else { project = new Subject(); project.setProjectname("无"); project.setTeachernames("无"); projectlist.add(project); } } List infolist = new ArrayList(); classinfo info = null; for (int i = 0; i < projectlist.size(); i++) { info = new classinfo(); info.setId(students.get(i).getId()); info.setClassName(className.getClassName()); info.setName(students.get(i).getName()); info.setStuNum(students.get(i).getStunum()); info.setProjectName(projectlist.get(i).getProjectname()); info.setTeacherNames(projectlist.get(i).getTeachernames()); info.setStuSelectFlag(projectselectedlist.get(i).getStuselectFlag()); infolist.add(info); } return infolist; } /** * 查看课题信息 * 通过classid */ @Override public List topics(Long id) { String specialty = classMapper.selectByspecialty(id); List projectlist = subjectMapper.selectByAll("%" + specialty + "%"); List topicsinfolist = new ArrayList(); topicsinfo info = null; for (int i = 0; i < projectlist.size(); i++) { info = new topicsinfo(); info.setProject_id(projectlist.get(i).getId()); info.setProjectType(subjectMapper.selectByprojectType(projectlist.get(i).getIdProjecttype().intValue())); info.setProjectSource(subjectMapper.selectByprojectSource(projectlist.get(i).getIdProjectsource().intValue())); info.setProjectName(projectlist.get(i).getProjectname()); info.setSelectFlag(projectlist.get(i).getSelectFlag()); info.setMarchSpecialty(projectlist.get(i).getMarchspecialty()); info.setTeacherNames(projectlist.get(i).getTeachernames()); topicsinfolist.add(info); } return topicsinfolist; } /** * 课题具体信息 */ @Override public List topicsinfo(Long project_id) { List listed = subjectselectedMapper.selectByprojectid(project_id);//中间表 request.getSession().setAttribute("listsize",listed.size()); List tolist = new ArrayList(); topicsto to = null; Student student = null; for (int i = 0; i < listed.size(); i++) { to = new topicsto(); student = studentMapper.selectByid(listed.get(i).getIdStudent()); if(student == null) continue; to.setStuNum(student.getStunum()); to.setName(student.getName()); to.setStuSelectFlag(listed.get(i).getStuselectFlag()); to.setClassName(classMapper.selectById(student.getIdClass()).getClassName()); tolist.add(to); } return tolist; } /** * 获取该用户是否选报了课题 */ public Long state(Student student) { Subjectselected project = null; List tprojectselecteds = subjectselectedMapper.selectBystudentid(student.getId()); if (tprojectselecteds != null && tprojectselecteds.size() >

< static_students.size(); i++) { List projectselecteds = select_Projectselected(static_students.get(i).getId(), null); if (projectselecteds != null && projectselecteds.size() >

0) {static_students.get (I) .setStuselectFlag ("" + projectselecteds.get (0). GetStuselectFlag ()); static_students.get (I) .setProjectname (projectselecteds.get (0). GetProject_name ()); static_students.get (I) .setTeachernames (projectselecteds.get (0). GetProject_teachers ()) } else {static_students.get (I) .setProjectname ("not selected"); static_students.get (I) .setTeachernames ("");} return static_students } @ Override public List select_class (Long institute_id, Long section_id, Long specialty_id, Long class_id, String class_name) {return classMapper.select_class (institute_id, section_id, specialty_id, class_id, class_name) } / / Professional direction additions, deletions, modifications and queries @ Override public int add_specialty (Long section_id, String specialty_name) {List specialties = select_specialty (null, specialty_name); if (specialties = = null | | specialties.size () = 0) {Specialty specialty = new Specialty (); specialty.setIdSection (section_id); specialty.setSpecialtyName (specialty_name) Return specialtyMapper.insert (specialty);} return 0;} @ Override public int delete_student (Long student_id) {return studentMapper.deleteByPrimaryKey (student_id);} @ Override public int update_student (Long student_id, String userName, String stuNum, Long id_class, String name, String gender, String pwd) {Student student = new Student (); student.setId (student_id) Student.setUsername (userName); student.setStunum (stuNum); student.setIdClass (id_class); student.setName (name); student.setGender (gender); student.setPwd (pwd); return studentMapper.updateByPrimaryKeySelective ((StudentWithBLOBs) student) } @ Override public List select_student (Long institute_id, Long specialty_id, Long class_id, Long student_id, String name) {List static_students = studentMapper.select_Student (institute_id, specialty_id, class_id, student_id, name); if (static_students! = null) {for (int I = 0; I)

< static_students.size(); i++) { Static_student static_student = static_students.get(i); List projectselected = select_Projectselected(static_student.getId(), null); if (projectselected != null && projectselected.size() != 0) { String s = ""; if (projectselected.get(0).getStuselectFlag() == 1) s = "选题待审核"; else if (projectselected.get(0).getStuselectFlag() == 2) s = "选题未通过"; else s = "选题通过"; static_student.setStuselectFlag(s); static_student.setProjectname(projectselected.get(0).getProject_name()); static_student.setTeachernames(projectselected.get(0).getProject_teachers()); } } return static_students; } return null; } // 通过学生id 或者 课题id 查 课题的选择 情况 public List select_Projectselected(Long student_id, Long project_id) { return subjectselectedMapper.select_Projectselected(student_id, project_id); } public List select_ProjectXQ(Long institute_id, Long section_id, String name) { List projects = subjectMapper.select_ProjectXQ(institute_id, section_id, name); if (projects != null) { for (int i = 0; i < projects.size(); i++) { if (projects.get(i).getSelectFlag() == 0) projects.get(i).setProjectGB("可选"); else if (projects.get(i).getSelectFlag() == 1) projects.get(i).setProjectGB("不可选"); } } return projects; } public int delete_specialty(Long specialty_id) { return specialtyMapper.deleteByPrimaryKey(specialty_id); } @Override public int update_specialty(Long specialty_id, Long section_id, String specialty_name) { Specialty specialty = new Specialty(); specialty.setId(specialty_id); specialty.setIdSection(section_id); specialty.setSpecialtyName(specialty_name); return specialtyMapper.updateByPrimaryKeySelective(specialty); } @Override public List select_specialty(Long institute_id, Long section_id, Long specialty_id, String specialty_name) { return specialtyMapper.select_specialty(institute_id, section_id, specialty_id, specialty_name); // 根据学院id 或者 教研室id 查所有专业方向 } @Override public List select_institute(Long institute_id, String institute_name) { InstituteExample instituteExample = new InstituteExample(); InstituteExample.Criteria criteria = instituteExample.createCriteria(); if (institute_id != null && institute_id != 0) criteria.andIdEqualTo(institute_id); if (institute_name != null && institute_name.length() >

0) criteria.andInstituteNameEqualTo (institute_name); return instituteMapper.selectByExample (instituteExample);}} about how to implement the textbook management system in Java is shared here. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report