• 基于javaweb+mysql的宿舍管理系统


    基于javaweb+mysql的宿舍管理系统

    运行环境

    Java≥8、MySQL≥5.7、Tomcat≥8

    开发工具

    eclipse/idea/myeclipse/sts等均可配置运行

    适用

    课程设计,大作业,毕业设计,项目练习,学习演示等

    功能说明

    登录、退出、宿舍、教师、班级、学生、卫生、访客、管理员等模块的增删改查管理

    技术框架

    JavaBean MVC JSP SSM(Spring SpringMVC MyBatis) MySQL CSS JavaScript Bootstrap JSP jQuery LayUI


    	}
    
    }
    package com.demo.controller;
    
    import com.demo.po.DormClean;
    import com.demo.po.PageInfo;
    import com.demo.service.DormCleanService;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Controller;
    import org.springframework.ui.Model;
    import org.springframework.web.bind.annotation.RequestBody;
    import org.springframework.web.bind.annotation.RequestMapping;
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
                    <a title="编辑"    id= "updateEdit"    href="/findStudentById?s_id=${student.s_id}">
                        <i class="layui-icon">i>
                    a>
                    <a title="删除" onclick="member_del(this,'${student.s_id}')" href="javascript:;">
                        <i class="layui-icon">i>
                    a>
                td>
            tr>
    c:forEach>
            tbody>
        table>
    
    <div class="" >
        <input type="hidden" id="totalPageCount" value="${pi.pageTotalCount}"/>
        <c:import url="pageBtn.jsp">
            <c:param name="totalCount" value="${pi.totalCount}"/>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    
        <%--添加模态框--%>
        <div class="layui-row" id="test" style="display: none;">
            <div class="layui-col-md10">
                <form class="layui-form" id="addEmployeeForm">
                    <div class="layui-form-item">
                        <label class="layui-form-label">学号:label>
                        <div class="layui-input-block">
                            <input type="text" lay-verify="required" name="s_studentid"   class="layui-input" placeholder="请输入学号">
                        div>
                    div>
    
                    <div class="layui-form-item">
                        <label class="layui-form-label">姓名:label>
                        <div class="layui-input-block">
                            <input type="text" lay-verify="required" name="s_name"  class="layui-input" placeholder="请输入姓名">
                        div>
                    div>
    
                    <div class="layui-form-item">
                        <label class="layui-form-label">学生卫生:label>
                        <div class="layui-input-block">
                            <input type="text" name="s_grade" class="layui-input" placeholder="请输入卫生打分">
                        div>
                    div>
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
        <script src="/layui_exts/excel.js">script>
    
        <style type="text/css">
            .layui-table{
                    text-align: center;
                }
            .layui-table th{
                text-align: center;
            }
        style>
    head>
    
    <body>
    <div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页a>
            <a href="/findAdmin">管理员信息a>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
                    div>
    
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="updateForm">更新button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置button>
                        div>
                    div>
                form>
            div>
        div>
    
    
        <%--表格数据--%>
        <table class="layui-table">
            <thead>
            <tr>
                <%--<th>--%>
                    <%--<div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">i>div>--%>
                <%--th>--%>
                <th>IDth>
                <th>学号th>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    //        private Integer s_grade;
    //        private Integer s_classid;
    //        private Integer s_dormitoryid;
    
    
            int d = studentCleanService.updateStudentClean(vo);
            return "redirect:/findStudentClean";
        }
    
    
        @RequestMapping( "/findStudentCleanById")
        public String findDormCleanById(Integer g_id, HttpSession session) {
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
                    div>
    
                    <div class="layui-form-item">
                        <label class="layui-form-label">年龄:label>
                        <div class="layui-input-block">
                            <input type="text" name="s_age" class="layui-input" i placeholder="请输入年龄">
                        div>
                    div>
    
                    <div class="layui-form-item">
                        <label class="layui-form-label">电话:label>
                        <div class="layui-input-block">
                            <input type="text"  name="s_phone"  class="layui-input" placeholder="请输入电话">
                        div>
                    div>
    
                    <div class="layui-form-item">
                        <label class="layui-form-label">班级编号:label>
                        <div class="layui-input-block">
                            <input type="text" name="s_classid" class="layui-input" placeholder="请输入班级编号">
                        div>
                    div>
    
                    <div class="layui-form-item">
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
        @Override
        public List<StudentClean> getAll(){
            List<StudentClean> studentCleanList = studentCleanDao.getAll();
            return studentCleanList;
        }
    
        //添加宿舍卫生信息
        @Override
        public int addStudentClean(StudentClean studentclean) {
            return studentCleanDao.addStudentClean(studentclean);
        }
    
        //通过id删除宿舍卫生信息
        @Override
        public int deleteStudentClean(Integer g_id) {
            return studentCleanDao.deleteStudentClean(g_id);
        }
    
        //修改宿舍卫生信息
        @Override
        public int updateStudentClean(StudentClean studentclean) {
            return studentCleanDao.updateStudentClean(studentclean);
        }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
                <tr>
                    <td>${di.r_id}td>
                    <td>${di.d_id}td>
                    <td>${di.d_dormbuilding}td>
                    <td>${di.r_name}td>
                    <td>${di.reason}td>
                    <td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${di.create_time}"/>td>
                    <td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${di.update_time}"/>td>
                    <td>
                        <a title="编辑"    id= "updateEdit"    href="/findDormRepairById?r_id=${di.r_id}">
                            <i class="layui-icon">i>
                        a>
                        <a title="删除" onclick="member_del(this,'${di.r_id}')" href="javascript:;">
                            <i class="layui-icon">i>
                        a>
                    td>
                tr>
            c:forEach>
            tbody>
        table>
    
        <div class="" >
            <input type="hidden" id="totalPageCount" value="${di.pageTotalCount}"/>
            <c:import url="pageBtn.jsp">
                <c:param name="totalCount" value="${di.totalCount}"/>
                <c:param name="currentPageNo" value="${di.pageIndex}"/>
                <c:param name="totalPageCount" value="${di.pageTotalCount}"/>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
                        data:JSON.stringify(param),
                        contentType: "application/json; charset=utf-8",
                        success:function(da){
                            console.log(da);
                            layer.msg('添加成功', {icon: 1, time: 2000});
                            setTimeout(function () {window.location.href='/findAdmin';},2000);
    
                        },
                        error:function(){
                            layer.msg('添加失败',{icon:0,time:2000});
                            setTimeout(function () {window.location.href='/findAdmin';},2000);
                        }
                    });
                    // return false;
                });
            });
    
        });
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
         */
        @RequestMapping(value = "/exportdormcleanlist", method = RequestMethod.POST)
        @ResponseBody
        public List<DormClean> exportDormclean(){
            List<DormClean> dormclean = dormCleanService.getAll();
            return dormclean;
        }
    
        /**
         * 添加宿舍卫生信息
         */
        @RequestMapping(value = "/addDormClean" ,method = RequestMethod.POST)
        @ResponseBody
        public String addDormClean( @RequestBody DormClean dormclean) {
            int d = dormCleanService.addDormClean(dormclean);
            return "dormclean_list";
        }
    
        /**
         * 删除宿舍卫生信息
         */
        @RequestMapping( "/deleteDormClean")
        @ResponseBody
        public String deleteDormClean(Integer g_id) {
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
               $.get("/deleteStudent",{"s_id":s_id},function (data) {
                    if(data =true){
                        layer.msg('删除成功!',{icon:1,time:2000});
                      setTimeout(function () {window.location.href='/findStudent';},2000);
    
                    }else {
                        layer.msg('删除失败!',{icon:1,time:3000});
                        setTimeout(function () {window.location.href='/findStudent';},2000);
                    }
                });
            });
        }
    
    script>
    
    
    body>
    
    
    html>
    <%--
      Created by IntelliJ IDEA.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
          <span class="layui-breadcrumb">
            <a href="">首页a>
            <a href="/findDormClean">学生卫生a>
    
          span>
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="/findStudentClean" title="刷新">
            <i class="layui-icon" style="line-height:30px">i>a>
    div>
    <div class="x-body">
        <div class="layui-row">
            <form class="layui-form layui-col-md12 x-so" action="/findStudentClean" >
                <input class="layui-input" placeholder="请输入学号" name="s_studentid" id="s_studentid">
                <input class="layui-input" placeholder="请输入姓名" name="s_name" id="s_name">
                <input class="layui-input" placeholder="请输入寝室编号" name="s_dormitoryid" id="s_dormitoryid">
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
        function member_del(obj,s_id){
            layer.confirm('确认要删除吗?',function(index){
                //发异步删除数据
               $.get("/deleteStudent",{"s_id":s_id},function (data) {
                    if(data =true){
                        layer.msg('删除成功!',{icon:1,time:2000});
                      setTimeout(function () {window.location.href='/findStudent';},2000);
    
                    }else {
                        layer.msg('删除失败!',{icon:1,time:3000});
                        setTimeout(function () {window.location.href='/findStudent';},2000);
                    }
                });
            });
        }
    
    script>
    
    
    body>
    
    
    html>
    <%--
      Created by IntelliJ IDEA.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
                    <td>${di.d_dormbuilding}td>
                    <td>${di.r_name}td>
                    <td>${di.reason}td>
                    <td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${di.create_time}"/>td>
                    <td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${di.update_time}"/>td>
                    <td>
                        <a title="编辑"    id= "updateEdit"    href="/findDormRepairById?r_id=${di.r_id}">
                            <i class="layui-icon">i>
                        a>
                        <a title="删除" onclick="member_del(this,'${di.r_id}')" href="javascript:;">
                            <i class="layui-icon">i>
                        a>
                    td>
                tr>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述

  • 相关阅读:
    OAuth2及sa-token框架实践
    有多少小于当前数字的数字
    2.05_python+Django+mysql实现pdf转word项目_项目开发-表结构设计
    无线通信———比较射频和蜂窝电话
    ssm框架的网上招聘系统的设计与实现,ssm框架,java编程,mysql数据库 myeclipse开发平台
    LeetCode每日一题(218. The Skyline Problem)
    【BUG库】 记录自己学习工作中遇到的程序BUG
    产品推荐 | 基于Anlogic系列EG4S20 FPGA开发板
    从libc-2.27.so[7fd68b298000+1e7000]崩溃回溯程序段错误segfault
    「组装式开发」企业数字化转型的及时雨
  • 原文地址:https://blog.csdn.net/m0_69592937/article/details/127742057