2020.2.18 开发访客模块后台的CRUD以及导出、注销功能

main
ppdxzz 5 years ago
parent b70a430f5f
commit 32e9c936d6

@ -8,17 +8,16 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="8033210d-c341-4f39-a328-95fe94016f00" name="Default Changelist" comment=""> <list default="true" id="8033210d-c341-4f39-a328-95fe94016f00" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/AdminController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/AdminController.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/StudentController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/StudentController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/impl/AdminServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/impl/AdminServiceImpl.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/dao/StudentDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/dao/StudentDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/admin-add.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/admin-add.jsp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/admin-edit.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/admin-edit.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/admin-list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/admin-list.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/main.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/main.jsp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/main.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/main.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/welcome.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/welcome.jsp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/student-add.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/student-add.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/controller/AdminController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/controller/AdminController.class" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/student-edit.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/student-edit.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/impl/AdminServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/impl/AdminServiceImpl.class" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/student-list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/student-list.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/controller/AdminController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/controller/AdminController.class" afterDir="false" /> <change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/student-add.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/student-add.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/impl/AdminServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/impl/AdminServiceImpl.class" afterDir="false" /> <change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/student-list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/student-list.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/admin-list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/admin-list.jsp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/宿管系统SSM框架日进度.md" beforeDir="false" afterPath="$PROJECT_DIR$/宿管系统SSM框架日进度.md" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -29,9 +28,9 @@
<option name="RECENT_TEMPLATES"> <option name="RECENT_TEMPLATES">
<list> <list>
<option value="HTML File" /> <option value="HTML File" />
<option value="Jsp File" />
<option value="Interface" /> <option value="Interface" />
<option value="Class" /> <option value="Class" />
<option value="Jsp File" />
</list> </list>
</option> </option>
</component> </component>
@ -76,12 +75,12 @@
<property name="aspect.path.notification.shown" value="true" /> <property name="aspect.path.notification.shown" value="true" />
<property name="js.last.introduce.type" value="VAR" /> <property name="js.last.introduce.type" value="VAR" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/main/webapp/css" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/src/main/webapp/css" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.5137931" />
<property name="settings.editor.selected.configurable" value="editor.preferences.gutterIcons" /> <property name="settings.editor.selected.configurable" value="editor.preferences.gutterIcons" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="D:\Development tools\IDEA\IntelliJ IDEA 2019.2.4\hellossm\src\main\webapp" />
</key>
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="D:\Development tools\IDEA\IntelliJ IDEA 2019.2.4\hellossm\src\main\webapp\css" /> <recent name="D:\Development tools\IDEA\IntelliJ IDEA 2019.2.4\hellossm\src\main\webapp\css" />
<recent name="D:\Development tools\IDEA\IntelliJ IDEA 2019.2.4\hellossm\src\main\webapp\images" /> <recent name="D:\Development tools\IDEA\IntelliJ IDEA 2019.2.4\hellossm\src\main\webapp\images" />
@ -89,8 +88,24 @@
<recent name="D:\Development tools\IDEA\IntelliJ IDEA 2019.2.4\hellossm\src\main\webapp" /> <recent name="D:\Development tools\IDEA\IntelliJ IDEA 2019.2.4\hellossm\src\main\webapp" />
<recent name="D:\Development tools\IDEA\IntelliJ IDEA 2019.2.4\hellossm\src\main\webapp\WEB-INF\jsp" /> <recent name="D:\Development tools\IDEA\IntelliJ IDEA 2019.2.4\hellossm\src\main\webapp\WEB-INF\jsp" />
</key> </key>
<key name="MoveFile.RECENT_KEYS">
<recent name="D:\Development tools\IDEA\IntelliJ IDEA 2019.2.4\hellossm\src\main\webapp" />
</key>
</component> </component>
<component name="RunManager" selected="Tomcat Server.Tomcat 9.0.24"> <component name="RunManager" selected="Tomcat Server.Tomcat 9.0.24">
<configuration name="LocalIp" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="cn.ppdxzz.utils.LocalIp" />
<module name="hellossm" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="cn.ppdxzz.utils.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="MD5Util" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="MD5Util" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="cn.ppdxzz.utils.MD5Util" /> <option name="MAIN_CLASS_NAME" value="cn.ppdxzz.utils.MD5Util" />
<module name="hellossm" /> <module name="hellossm" />
@ -195,9 +210,11 @@
<item itemvalue="Application.MD5Util" /> <item itemvalue="Application.MD5Util" />
<item itemvalue="Application.WriteExcel" /> <item itemvalue="Application.WriteExcel" />
<item itemvalue="Tomcat Server.Tomcat 9.0.24" /> <item itemvalue="Tomcat Server.Tomcat 9.0.24" />
<item itemvalue="Application.LocalIp" />
</list> </list>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Application.LocalIp" />
<item itemvalue="Application.WriteExcel" /> <item itemvalue="Application.WriteExcel" />
<item itemvalue="Application.MD5Util" /> <item itemvalue="Application.MD5Util" />
</list> </list>
@ -207,7 +224,7 @@
<option name="viewStates"> <option name="viewStates">
<list> <list>
<serviceView> <serviceView>
<option name="contentProportion" value="0.18209876" /> <option name="contentProportion" value="0.20910494" />
<treeState> <treeState>
<expand> <expand>
<path> <path>
@ -255,6 +272,9 @@
<workItem from="1581814839916" duration="4082000" /> <workItem from="1581814839916" duration="4082000" />
<workItem from="1581820499500" duration="20191000" /> <workItem from="1581820499500" duration="20191000" />
<workItem from="1581913917133" duration="32750000" /> <workItem from="1581913917133" duration="32750000" />
<workItem from="1581985281715" duration="3589000" />
<workItem from="1581989660185" duration="1250000" />
<workItem from="1582001026668" duration="32026000" />
</task> </task>
<servers /> <servers />
</component> </component>
@ -274,90 +294,90 @@
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state x="137" y="23" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1366.728@0.0.1366.728" timestamp="1581485477637" /> <state x="137" y="23" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1366.728@0.0.1366.728" timestamp="1581485477637" />
<state x="488" y="84" key="#com.intellij.ide.util.MemberChooser" timestamp="1581928960332"> <state x="488" y="84" key="#com.intellij.ide.util.MemberChooser" timestamp="1582031252663">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state x="488" y="84" key="#com.intellij.ide.util.MemberChooser/0.0.1366.728@0.0.1366.728" timestamp="1581928960332" /> <state x="488" y="84" key="#com.intellij.ide.util.MemberChooser/0.0.1366.728@0.0.1366.728" timestamp="1582031252663" />
<state width="1059" height="73" key="GridCell.Tab.0.bottom" timestamp="1581948908204"> <state width="1325" height="246" key="GridCell.Tab.0.bottom" timestamp="1582035290843">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="73" key="GridCell.Tab.0.bottom/0.0.1366.728@0.0.1366.728" timestamp="1581948908204" /> <state width="1325" height="246" key="GridCell.Tab.0.bottom/0.0.1366.728@0.0.1366.728" timestamp="1582035290843" />
<state width="1059" height="73" key="GridCell.Tab.0.center" timestamp="1581948908204"> <state width="1325" height="246" key="GridCell.Tab.0.center" timestamp="1582035290843">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="73" key="GridCell.Tab.0.center/0.0.1366.728@0.0.1366.728" timestamp="1581948908204" /> <state width="1325" height="246" key="GridCell.Tab.0.center/0.0.1366.728@0.0.1366.728" timestamp="1582035290843" />
<state width="1059" height="73" key="GridCell.Tab.0.left" timestamp="1581948908204"> <state width="1325" height="246" key="GridCell.Tab.0.left" timestamp="1582035290842">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="73" key="GridCell.Tab.0.left/0.0.1366.728@0.0.1366.728" timestamp="1581948908204" /> <state width="1325" height="246" key="GridCell.Tab.0.left/0.0.1366.728@0.0.1366.728" timestamp="1582035290842" />
<state width="1059" height="73" key="GridCell.Tab.0.right" timestamp="1581948908204"> <state width="1325" height="246" key="GridCell.Tab.0.right" timestamp="1582035290843">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="73" key="GridCell.Tab.0.right/0.0.1366.728@0.0.1366.728" timestamp="1581948908204" /> <state width="1325" height="246" key="GridCell.Tab.0.right/0.0.1366.728@0.0.1366.728" timestamp="1582035290843" />
<state width="1059" height="73" key="GridCell.Tab.1.bottom" timestamp="1581948908204"> <state width="1024" height="14" key="GridCell.Tab.1.bottom" timestamp="1582035290837">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="73" key="GridCell.Tab.1.bottom/0.0.1366.728@0.0.1366.728" timestamp="1581948908204" /> <state width="1024" height="14" key="GridCell.Tab.1.bottom/0.0.1366.728@0.0.1366.728" timestamp="1582035290837" />
<state width="1059" height="73" key="GridCell.Tab.1.center" timestamp="1581948908204"> <state width="1024" height="14" key="GridCell.Tab.1.center" timestamp="1582035290837">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="73" key="GridCell.Tab.1.center/0.0.1366.728@0.0.1366.728" timestamp="1581948908204" /> <state width="1024" height="14" key="GridCell.Tab.1.center/0.0.1366.728@0.0.1366.728" timestamp="1582035290837" />
<state width="1059" height="73" key="GridCell.Tab.1.left" timestamp="1581948908204"> <state width="1024" height="14" key="GridCell.Tab.1.left" timestamp="1582035290837">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="73" key="GridCell.Tab.1.left/0.0.1366.728@0.0.1366.728" timestamp="1581948908204" /> <state width="1024" height="14" key="GridCell.Tab.1.left/0.0.1366.728@0.0.1366.728" timestamp="1582035290837" />
<state width="1059" height="73" key="GridCell.Tab.1.right" timestamp="1581948908204"> <state width="1024" height="14" key="GridCell.Tab.1.right" timestamp="1582035290837">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="73" key="GridCell.Tab.1.right/0.0.1366.728@0.0.1366.728" timestamp="1581948908204" /> <state width="1024" height="14" key="GridCell.Tab.1.right/0.0.1366.728@0.0.1366.728" timestamp="1582035290837" />
<state width="1059" height="73" key="GridCell.Tab.2.bottom" timestamp="1581948908205"> <state width="1024" height="14" key="GridCell.Tab.2.bottom" timestamp="1582035290837">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="73" key="GridCell.Tab.2.bottom/0.0.1366.728@0.0.1366.728" timestamp="1581948908205" /> <state width="1024" height="14" key="GridCell.Tab.2.bottom/0.0.1366.728@0.0.1366.728" timestamp="1582035290837" />
<state width="1059" height="73" key="GridCell.Tab.2.center" timestamp="1581948908205"> <state width="1024" height="14" key="GridCell.Tab.2.center" timestamp="1582035290837">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="73" key="GridCell.Tab.2.center/0.0.1366.728@0.0.1366.728" timestamp="1581948908205" /> <state width="1024" height="14" key="GridCell.Tab.2.center/0.0.1366.728@0.0.1366.728" timestamp="1582035290837" />
<state width="1059" height="73" key="GridCell.Tab.2.left" timestamp="1581948908205"> <state width="1024" height="14" key="GridCell.Tab.2.left" timestamp="1582035290837">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="73" key="GridCell.Tab.2.left/0.0.1366.728@0.0.1366.728" timestamp="1581948908205" /> <state width="1024" height="14" key="GridCell.Tab.2.left/0.0.1366.728@0.0.1366.728" timestamp="1582035290837" />
<state width="1059" height="73" key="GridCell.Tab.2.right" timestamp="1581948908205"> <state width="1024" height="14" key="GridCell.Tab.2.right" timestamp="1582035290837">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="73" key="GridCell.Tab.2.right/0.0.1366.728@0.0.1366.728" timestamp="1581948908205" /> <state width="1024" height="14" key="GridCell.Tab.2.right/0.0.1366.728@0.0.1366.728" timestamp="1582035290837" />
<state width="1059" height="87" key="GridCell.Tab.3.bottom" timestamp="1581939640569"> <state width="1024" height="137" key="GridCell.Tab.3.bottom" timestamp="1581990081733">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="87" key="GridCell.Tab.3.bottom/0.0.1366.728@0.0.1366.728" timestamp="1581939640569" /> <state width="1024" height="137" key="GridCell.Tab.3.bottom/0.0.1366.728@0.0.1366.728" timestamp="1581990081733" />
<state width="1059" height="87" key="GridCell.Tab.3.center" timestamp="1581939640569"> <state width="1024" height="137" key="GridCell.Tab.3.center" timestamp="1581990081733">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="87" key="GridCell.Tab.3.center/0.0.1366.728@0.0.1366.728" timestamp="1581939640569" /> <state width="1024" height="137" key="GridCell.Tab.3.center/0.0.1366.728@0.0.1366.728" timestamp="1581990081733" />
<state width="1059" height="87" key="GridCell.Tab.3.left" timestamp="1581939640569"> <state width="1024" height="137" key="GridCell.Tab.3.left" timestamp="1581990081733">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="87" key="GridCell.Tab.3.left/0.0.1366.728@0.0.1366.728" timestamp="1581939640569" /> <state width="1024" height="137" key="GridCell.Tab.3.left/0.0.1366.728@0.0.1366.728" timestamp="1581990081733" />
<state width="1059" height="87" key="GridCell.Tab.3.right" timestamp="1581939640569"> <state width="1024" height="137" key="GridCell.Tab.3.right" timestamp="1581990081733">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="87" key="GridCell.Tab.3.right/0.0.1366.728@0.0.1366.728" timestamp="1581939640569" /> <state width="1024" height="137" key="GridCell.Tab.3.right/0.0.1366.728@0.0.1366.728" timestamp="1581990081733" />
<state width="1059" height="87" key="GridCell.Tab.4.bottom" timestamp="1581939640569"> <state width="1024" height="137" key="GridCell.Tab.4.bottom" timestamp="1581990081733">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="87" key="GridCell.Tab.4.bottom/0.0.1366.728@0.0.1366.728" timestamp="1581939640569" /> <state width="1024" height="137" key="GridCell.Tab.4.bottom/0.0.1366.728@0.0.1366.728" timestamp="1581990081733" />
<state width="1059" height="87" key="GridCell.Tab.4.center" timestamp="1581939640569"> <state width="1024" height="137" key="GridCell.Tab.4.center" timestamp="1581990081733">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="87" key="GridCell.Tab.4.center/0.0.1366.728@0.0.1366.728" timestamp="1581939640569" /> <state width="1024" height="137" key="GridCell.Tab.4.center/0.0.1366.728@0.0.1366.728" timestamp="1581990081733" />
<state width="1059" height="87" key="GridCell.Tab.4.left" timestamp="1581939640569"> <state width="1024" height="137" key="GridCell.Tab.4.left" timestamp="1581990081733">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="87" key="GridCell.Tab.4.left/0.0.1366.728@0.0.1366.728" timestamp="1581939640569" /> <state width="1024" height="137" key="GridCell.Tab.4.left/0.0.1366.728@0.0.1366.728" timestamp="1581990081733" />
<state width="1059" height="87" key="GridCell.Tab.4.right" timestamp="1581939640569"> <state width="1024" height="137" key="GridCell.Tab.4.right" timestamp="1581990081733">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1059" height="87" key="GridCell.Tab.4.right/0.0.1366.728@0.0.1366.728" timestamp="1581939640569" /> <state width="1024" height="137" key="GridCell.Tab.4.right/0.0.1366.728@0.0.1366.728" timestamp="1581990081733" />
<state width="1059" height="415" key="GridCell.Tab.5.bottom" timestamp="1581939297473"> <state width="1059" height="415" key="GridCell.Tab.5.bottom" timestamp="1581939297473">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
@ -378,10 +398,14 @@
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state x="213" y="23" key="Maven.ArtifactSearchDialog/0.0.1366.728@0.0.1366.728" timestamp="1581325031095" /> <state x="213" y="23" key="Maven.ArtifactSearchDialog/0.0.1366.728@0.0.1366.728" timestamp="1581325031095" />
<state x="150" y="8" key="SettingsEditor" timestamp="1581663216599"> <state x="150" y="0" key="SettingsEditor" timestamp="1581988882930">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="150" y="0" key="SettingsEditor/0.0.1366.728@0.0.1366.728" timestamp="1581988882930" />
<state x="253" y="13" key="com.intellij.javaee.view.ServerArtifactsDialog" timestamp="1581988671572">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state x="150" y="8" key="SettingsEditor/0.0.1366.728@0.0.1366.728" timestamp="1581663216599" /> <state x="253" y="13" key="com.intellij.javaee.view.ServerArtifactsDialog/0.0.1366.728@0.0.1366.728" timestamp="1581988671572" />
<state x="221" y="104" width="924" height="543" key="com.intellij.xdebugger.impl.breakpoints.ui.BreakpointsDialogFactory$2" timestamp="1581662063052"> <state x="221" y="104" width="924" height="543" key="com.intellij.xdebugger.impl.breakpoints.ui.BreakpointsDialogFactory$2" timestamp="1581662063052">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>

@ -6,6 +6,7 @@ import com.github.pagehelper.PageInfo;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -16,6 +17,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.List; import java.util.List;
/** /**
@ -131,6 +133,16 @@ public class StudentController {
} }
@RequestMapping("/editStudent")
public ModelAndView editStudent(HttpServletRequest request) throws Exception {
ModelAndView mv = new ModelAndView();
request.setCharacterEncoding("utf-8");
String sno = request.getParameter("sno");
Student stu = studentService.findBySno(sno);
mv.addObject("stu",stu);
mv.setViewName("student-edit");
return mv;
}
/** /**
* *
* @param student * @param student

@ -0,0 +1,161 @@
package cn.ppdxzz.controller;
import cn.ppdxzz.domain.Visitor;
import cn.ppdxzz.service.VisitorService;
import com.github.pagehelper.PageInfo;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* Description:
*
* @Date: 2020/2/18 16:26
* @Author: PeiChen
*/
@Controller
@RequestMapping("/visitor")
public class VisitorController {
private VisitorService visitorService;
@Autowired
public void setVisitorService(VisitorService visitorService) {
this.visitorService = visitorService;
}
@RequestMapping("/login")
public String register() {
return "regist_visitor";
}
/**
* 访C
* @param visitor
* @return
* @throws Exception
*/
@RequestMapping("/add")
public ModelAndView addVisitor(Visitor visitor) throws Exception {
ModelAndView mv = new ModelAndView();
if (visitor == null || visitor.getName() == null || visitor.getSno() == null || visitor.getPhone() == null || visitor.getPlace() == null) {
mv.addObject("error_msg","来访登记失败,请重新登记!");
mv.setViewName("regist_visitor");
return mv;
}
if (visitor.getId() == null || "".trim().equals(visitor.getId())) {
String uuid = UUID.randomUUID().toString().replace("-", "");
visitor.setId(uuid);
}
String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
visitor.setBegin_date(date);//设置来访时间为提交来访登记时间
//先设置离开时间为空串,后续注销时再修改为注销时系统时间
if (visitor.getEnd_date() == null || "".trim().equals(visitor.getEnd_date())) {
visitor.setEnd_date("");
}
visitorService.add(visitor);
mv.addObject("id",visitor.getId());
mv.setViewName("visitor-success");
return mv;
}
/**
* 访
* @param request
* @return
* @throws Exception
*/
@RequestMapping("/logout")
public ModelAndView logout(HttpServletRequest request) throws Exception {
ModelAndView mv = new ModelAndView();
String id = request.getParameter("id");
if (id == null || "".trim().equals(id)) {
mv.addObject("logout_msg","系统繁忙,请稍后再试!");
mv.setViewName("error_msg");
}
String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
visitorService.logout(id,date);
mv.addObject("logout_msg","注销成功");
mv.setViewName("regist_visitor");
return mv;
}
/**
* 访
* @param request
* @param response
* @throws Exception
*/
@RequestMapping("/updateStatus")
public void updateStatus(HttpServletRequest request,HttpServletResponse response) throws Exception {
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
PrintWriter writer = response.getWriter();
String id = request.getParameter("id");
if (id == null || "".trim().equals(id)) {
writer.write("false");
return;
}
String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
visitorService.logout(id,date);
writer.write("true");
}
/**
* 访
* @param page
* @param size
* @param request
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/findAll")
public ModelAndView findAll(@RequestParam(name = "page",required = true,value = "1") int page, @RequestParam(name = "size",required = true,value = "4") int size,HttpServletRequest request,HttpServletResponse response) throws Exception {
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
ModelAndView mv = new ModelAndView();
List<Visitor> visitors = null;
String keyword = request.getParameter("keyword");
if (keyword == null || "".trim().equals(keyword) || keyword.length() == 0) {
visitors = visitorService.findAll(page,size);
}else {
visitors = visitorService.search(page,size,keyword);
}
PageInfo pageInfo = new PageInfo(visitors);
mv.addObject("pageInfo",pageInfo);
mv.setViewName("visitor-list");
return mv;
}
/**
* 访
* @param response
* @throws Exception
*/
@RequestMapping("/visitorInfo")
public void export(HttpServletResponse response) throws Exception {
InputStream is = visitorService.getInputStream();
response.setContentType("application/vnd.ms-excel");
response.setHeader("contentDisposition","attachment;filename=visitorInfo.xls");
ServletOutputStream outputStream = response.getOutputStream();
IOUtils.copy(is,outputStream);
}
}

@ -56,7 +56,7 @@ public interface StudentDao {
void delete(String sno) throws Exception; void delete(String sno) throws Exception;
/** /**
* * id
* @param student * @param student
* @throws Exception * @throws Exception
*/ */

@ -0,0 +1,55 @@
package cn.ppdxzz.dao;
import cn.ppdxzz.domain.Visitor;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Description:访
*
* @Date: 2020/2/18 16:27
* @Author: PeiChen
*/
@Repository
public interface VisitorDao {
/**
* 访
* @param visitor
* @throws Exception
*/
@Insert("insert into visitors(id,name,sno,phone,place,begin_date,end_date,visit_result) values(#{id},#{name},#{sno},#{phone},#{place},#{begin_date},#{end_date},#{visit_result})")
void add(Visitor visitor) throws Exception;
/**
* 访
* @return
* @throws Exception
*/
@Select("select * from visitors order by begin_date desc")
List<Visitor> findAll() throws Exception;
/**
* 访访
* @param id
* @param end_date
* @throws Exception
*/
@Update("update visitors set end_date = #{end_date} where id = #{id}")
void logout(@Param(value = "id") String id,@Param(value = "end_date") String end_date) throws Exception;
/**
* 访
* @param keyword
* @return
* @throws Exception
*/
@Select("select * from visitors where name like '%${keyword}%' or sno like '%${keyword}%' or phone like '%${keyword}%' or place like '%${keyword}%' or begin_date like '%${keyword}%' or end_date like '%${keyword}%' or visit_result like '%${keyword}%' order by begin_date desc ")
List<Visitor> search(@Param(value = "keyword") String keyword) throws Exception;
}

@ -0,0 +1,112 @@
package cn.ppdxzz.domain;
import java.io.Serializable;
/**
* Description:访
*
* @Date: 2020/2/18 16:29
* @Author: PeiChen
*/
public class Visitor implements Serializable {
private String id;//uuid 全球唯一id
private String name;//访客姓名
private String sno;//访客学号
private String phone;//联系方式
private String place;//访问地址
private String begin_date;//来访时间
private String end_date;//离开时间
private String visit_result;//到访原因
public Visitor() {
}
public Visitor(String id, String name, String sno, String phone, String place, String begin_date, String end_date, String visit_result) {
this.id = id;
this.name = name;
this.sno = sno;
this.phone = phone;
this.place = place;
this.begin_date = begin_date;
this.end_date = end_date;
this.visit_result = visit_result;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSno() {
return sno;
}
public void setSno(String sno) {
this.sno = sno;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPlace() {
return place;
}
public void setPlace(String place) {
this.place = place;
}
public String getBegin_date() {
return begin_date;
}
public void setBegin_date(String begin_date) {
this.begin_date = begin_date;
}
public String getEnd_date() {
return end_date;
}
public void setEnd_date(String end_date) {
this.end_date = end_date;
}
public String getVisit_result() {
return visit_result;
}
public void setVisit_result(String visit_result) {
this.visit_result = visit_result;
}
@Override
public String toString() {
return "Visitor{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", sno='" + sno + '\'' +
", phone='" + phone + '\'' +
", place='" + place + '\'' +
", begin_date='" + begin_date + '\'' +
", end_date='" + end_date + '\'' +
", visit_result='" + visit_result + '\'' +
'}';
}
}

@ -0,0 +1,26 @@
package cn.ppdxzz.service;
import cn.ppdxzz.domain.Visitor;
import java.io.InputStream;
import java.util.List;
/**
* Description:
*
* @Date: 2020/2/18 18:27
* @Author: PeiChen
*/
public interface VisitorService {
void add(Visitor visitor) throws Exception;
List<Visitor> findAll(int page,int size) throws Exception;
List<Visitor> search(int page,int size,String keyword) throws Exception;
void logout(String id,String end_date) throws Exception;
InputStream getInputStream() throws Exception;
}

@ -0,0 +1,101 @@
package cn.ppdxzz.service.impl;
import cn.ppdxzz.dao.VisitorDao;
import cn.ppdxzz.domain.Visitor;
import cn.ppdxzz.poi.WriteExcel;
import cn.ppdxzz.service.VisitorService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
/**
* Description:
*
* @Date: 2020/2/18 18:50
* @Author: PeiChen
*/
@Service("visitorService")
public class VisitorServiceImpl implements VisitorService {
private VisitorDao visitorDao;
@Autowired
public void setVisitorDao(VisitorDao visitorDao) {
this.visitorDao = visitorDao;
}
/**
* 访
* @param visitor
* @throws Exception
*/
@Override
public void add(Visitor visitor) throws Exception {
visitorDao.add(visitor);
}
/**
* 访
* @return
* @throws Exception
*/
@Override
public List<Visitor> findAll(int page, int size) throws Exception {
PageHelper.startPage(page,size);
return visitorDao.findAll();
}
/**
* 访
* @param keyword
* @return
* @throws Exception
*/
@Override
public List<Visitor> search(int page, int size, String keyword) throws Exception {
PageHelper.startPage(page,size);
return visitorDao.search(keyword);
}
/**
* 访访
* @param id
* @param end_date
* @throws Exception
*/
@Override
public void logout(String id, String end_date) throws Exception {
visitorDao.logout(id,end_date);
}
/**
* 访
* @return
* @throws Exception
*/
@Override
public InputStream getInputStream() throws Exception {
//Excel中的每列列名依次对应数据库的字段
String[] title = new String[]{"ID","姓名","学号","联系方式","访问地址","来访时间","离开时间","来访原因"};
List<Visitor> visitors = visitorDao.findAll();
List<Object[]> datalist = new ArrayList<>();
for (int i = 0; i < visitors.size(); i++) {
Object[] obj = new Object[8];
obj[0] = visitors.get(i).getId();
obj[1] = visitors.get(i).getName();
obj[2] = visitors.get(i).getSno();
obj[3] = visitors.get(i).getPhone();
obj[4] = visitors.get(i).getPlace();
obj[5] = visitors.get(i).getBegin_date();
obj[6] = visitors.get(i).getEnd_date();
obj[7] = visitors.get(i).getVisit_result();
datalist.add(obj);
}
WriteExcel excel = new WriteExcel(title,datalist);
return excel.export();
}
}

@ -104,6 +104,13 @@
var name = $("#name").val().trim(); var name = $("#name").val().trim();
var phone = $("#phone").val().trim(); var phone = $("#phone").val().trim();
var description = $("#description").val().trim(); var description = $("#description").val().trim();
layer.confirm('确定要修改吗',function (index) {
if (${sessionScope.adminInfo.power < 2}) {//非管理员不能修改管理员信息
layer.msg('对不起,您权限不足');
layer.close(index);
return false;
}
$.ajax({ $.ajax({
url: "${pageContext.request.contextPath}/editAdmin",//要请求的服务器url url: "${pageContext.request.contextPath}/editAdmin",//要请求的服务器url
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取 //这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
@ -127,6 +134,7 @@
} }
} }
}); });
});
} }
</script> </script>
</body> </body>

@ -142,12 +142,20 @@
<li> <li>
<a onclick="xadmin.add_tab('访客信息','unicode.html')"> <a onclick="xadmin.add_tab('访客信息','unicode.html')">
<i class="iconfont">&#xe6a7;</i> <i class="iconfont">&#xe6a7;</i>
<cite>访客信息</cite></a> <cite>访客信息</cite>
</a>
</li> </li>
<li> <li>
<a onclick="xadmin.open('来访登记','unicode.html')"> <a onclick="xadmin.open('来访登记(手机端)','unicode.html')">
<i class="iconfont">&#xe6a7;</i> <i class="iconfont">&#xe6a7;</i>
<cite>来访登记</cite></a> <cite>来访登记(手机端)</cite>
</a>
</li>
<li>
<a onclick="xadmin.open('访客日志','unicode.html')">
<i class="iconfont">&#xe6a7;</i>
<cite>访客日志</cite>
</a>
</li> </li>
</ul> </ul>
</li> </li>

@ -0,0 +1,17 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/18
Time: 15:49
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Title</title>
</head>
<body>
</body>
</html>

@ -91,7 +91,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<button type="submit" id="add-student" class="btn btn-primary">确认修改</button> <button type="button" id="add-student" class="btn btn-primary">确认修改</button>
<a type="button" href="${pageContext.request.contextPath}/student/findAll" class="btn btn-default">返回列表</a> <a type="button" href="${pageContext.request.contextPath}/student/findAll" class="btn btn-default">返回列表</a>
</td> </td>
</tr> </tr>
@ -99,6 +99,21 @@
</table> </table>
</form> </form>
<script> <script>
$(function () {
//ajax校验学号已被注册
$("#sno").change(function () {
//取sno的值
var sno = $(this).val();
//ajax异步请求
$.get("${pageContext.request.contextPath}/student/isExist",{"sno":sno},function (date) {
//$(".error").html(msg);
if (date) {
layer.msg('学号已被注册,请重新输入!');
return false;
}
});
});
});
$("#add-student").click(function () { $("#add-student").click(function () {
var name = $("#name").val().trim(); var name = $("#name").val().trim();
var sex = $("#sex").val().trim(); var sex = $("#sex").val().trim();
@ -116,7 +131,34 @@
var d1 = $("#dorm1").val(); var d1 = $("#dorm1").val();
var d2 = $("#dorm2").val(); var d2 = $("#dorm2").val();
var dorm_id = d1+""+d2+""+dorm3; var dorm_id = d1+""+d2+""+dorm3;
alert(dorm_id); //alert(dorm_id);
$.ajax({
url: "${pageContext.request.contextPath}/student/add",//要请求的服务器url
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
//data:{method:"ajaxTest",val:value},
data: {
name:name,
sex:sex,
sno: sno,
stu_class:stu_class,
phone: phone,
place: place,
dorm_id:dorm_id,
teacher:teacher
},
type: "POST", //请求方式为POST
dataType: "json",
success:function(result){ //这个方法会在服务器执行成功时被调用 参数data就是服务器返回的值(现在是json类型)
//alert(result);
if(result){
layer.msg('添加成功!');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
}else {
layer.msg('添加失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
}
}
});
}); });
</script> </script>
</body> </body>

@ -1,3 +1,4 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- <%--
Created by IntelliJ IDEA. Created by IntelliJ IDEA.
User: user User: user
@ -12,6 +13,7 @@
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/layer/layer.js"></script>
</head> </head>
<body> <body>
<form> <form>
@ -19,18 +21,25 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
<input type="hidden" id="id" value="${stu.id}">
<label for="name">姓名</label> <label for="name">姓名</label>
</td> </td>
<td> <td>
<input type="text" readonly class="form-control" value="peichen" id="name" name="name" required> <input type="text" readonly class="form-control" value="${stu.name}" id="name" name="name" required>
</td> </td>
<td> <td>
<label for="sex">性别</label> <label for="sex">性别</label>
</td> </td>
<td> <td>
<select class="form-control" name="sex" id="sex"> <select class="form-control" name="sex" id="sex">
<option value="男" selected>男</option> <c:if test="${stu.sex == '男'}">
<option value="女">女</option> <option value="男" selected>男</option>
<option value="女">女</option>
</c:if>
<c:if test="${stu.sex == '女'}">
<option value="男">男</option>
<option value="女" selected>女</option>
</c:if>
</select> </select>
</td> </td>
</tr> </tr>
@ -39,43 +48,118 @@
<label for="sno">学号</label> <label for="sno">学号</label>
</td> </td>
<td> <td>
<input type="text" name="sno" class="form-control" id="sno" aria-describedby="textHelp" required> <c:if test="${sessionScope.adminInfo.power >= 3}">
<input type="text" value="${stu.sno}" name="sno" class="form-control" id="sno" aria-describedby="textHelp" required>
</c:if>
<c:if test="${sessionScope.adminInfo.power < 3}">
<input type="text" readonly value="${stu.sno}" name="sno" class="form-control" id="sno" aria-describedby="textHelp" required>
</c:if>
</td> </td>
<td> <td>
<label for="class">班级</label> <label for="stu_class">班级</label>
</td> </td>
<td> <td>
<input type="text" name="class" class="form-control" id="class" required> <c:if test="${sessionScope.adminInfo.power < 2}">
<input type="text" readonly value="${stu.stu_class}" name="stu_class" class="form-control" id="stu_class" required>
</c:if>
<c:if test="${sessionScope.adminInfo.power >= 2}">
<input type="text" value="${stu.stu_class}" name="stu_class" class="form-control" id="stu_class" required>
</c:if>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><label for="phone">联系方式</label></td> <td><label for="phone">联系方式</label></td>
<td> <td>
<input type="text" name="phone" class="form-control" id="phone" required> <input type="text" value="${stu.phone}" name="phone" class="form-control" id="phone" required>
</td> </td>
<td><label for="place">家庭住址</label></td> <td><label for="place">家庭住址</label></td>
<td> <td>
<input type="text" name="place" class="form-control" id="place" required> <input type="text" value="${stu.place}" name="place" class="form-control" id="place" required>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><label for="dorm_id">宿舍号</label></td> <td><label for="dorm_id">宿舍号</label></td>
<td> <td>
<input type="text" name="dorm_id" class="form-control" id="dorm_id" required> <c:if test="${sessionScope.adminInfo.power < 2}">
<input type="text" readonly value="${stu.dorm_id}" name="dorm_id" class="form-control" id="dorm_id" required>
</c:if>
<c:if test="${sessionScope.adminInfo.power >= 2}">
<input type="text" value="${stu.dorm_id}" name="dorm_id" class="form-control" id="dorm_id" required>
</c:if>
</td> </td>
<td><label for="teacher">育人导师</label></td> <td><label for="teacher">育人导师</label></td>
<td> <td>
<input type="text" name="teacher" class="form-control" id="teacher" required> <c:if test="${sessionScope.adminInfo.power >= 1}">
<input type="text" value="${stu.teacher}" name="teacher" class="form-control" id="teacher" required>
</c:if>
<c:if test="${sessionScope.adminInfo.power < 1}">
<input type="text" readonly value="${stu.teacher}" name="teacher" class="form-control" id="teacher" required>
</c:if>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<button type="submit" id="addAdmin" class="btn btn-primary">确认修改</button> <button type="button" id="edit-btn" class="btn btn-primary">确认修改</button>
<a type="button" class="btn btn-default">返回列表</a> <a type="button" class="btn btn-default" href="${pageContext.request.contextPath}/student/findAll?page=1&size=4">返回列表</a>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</form> </form>
<script>
$("#edit-btn").click(function () {
var id = $("#id").val().trim();
var name = $("#name").val().trim();
var sex = $("#sex").val().trim();
var sno = $("#sno").val().trim();
var stu_class = $("#stu_class").val().trim();
var phone = $("#phone").val().trim();
var place = $("#place").val().trim();
var dorm_id = $("#dorm_id").val().trim();
var teacher = $("#teacher").val().trim();
if (name == 0 || sex == 0 || sno == 0 || stu_class == 0 || phone == 0 || place == 0 || dorm_id == 0 || teacher == 0) {
layer.msg('字段不能为空');
return false;
}
layer.confirm('确定要修改吗',function (index) {
if (${sessionScope.adminInfo.power < 1}) {
layer.msg('对不起,您没有权限');
layer.close(index);
return false;
}
$.ajax({
url: "${pageContext.request.contextPath}/student/update",//要请求的服务器url
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
//data:{method:"ajaxTest",val:value},
data: {
id:id,
name:name,
sex:sex,
sno: sno,
stu_class:stu_class,
phone: phone,
place: place,
dorm_id:dorm_id,
teacher:teacher
},
type: "POST", //请求方式为POST
dataType: "json",
success:function(result){ //这个方法会在服务器执行成功时被调用 参数data就是服务器返回的值(现在是json类型)
//alert(result);
if(result){
layer.msg('修改成功');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
}else {
layer.msg('修改失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
}
}
});
});
});
</script>
</body> </body>
</html> </html>

@ -71,6 +71,7 @@
</form> </form>
</div> </div>
<xblock> <xblock>
<a href="${pageContext.request.contextPath}/student/addStudent" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe654;</i>添加</a>
<c:if test="${sessionScope.adminInfo.power > 1 }"> <c:if test="${sessionScope.adminInfo.power > 1 }">
<a onclick="exportInfo()" class="layui-btn layui-btn-warm" href="javascript:;"><i class="layui-icon">&#xe67c;</i>导出</a> <a onclick="exportInfo()" class="layui-btn layui-btn-warm" href="javascript:;"><i class="layui-icon">&#xe67c;</i>导出</a>
</c:if> </c:if>
@ -110,12 +111,9 @@
<td>${student.teacher}</td> <td>${student.teacher}</td>
<c:if test="${sessionScope.adminInfo.power > 1}"> <c:if test="${sessionScope.adminInfo.power > 1}">
<td class="td-manage"> <td class="td-manage">
<a title="编辑" href="${pageContext.request.contextPath}"> <a title="编辑" href="${pageContext.request.contextPath}/student/editStudent?sno=${student.sno}">
<i class="layui-icon">&#xe642;</i> <i class="layui-icon">&#xe642;</i>
</a> </a>
<a title="注册" onclick="" href="${pageContext.request.contextPath}/student/addStudent">
<i class="layui-icon">&#xe654;</i>
</a>
<a title="删除" onclick="member_del(this,${student.sno},${sessionScope.adminInfo.power})" href="javascript:;"> <a title="删除" onclick="member_del(this,${student.sno},${sessionScope.adminInfo.power})" href="javascript:;">
<i class="layui-icon">&#xe640;</i> <i class="layui-icon">&#xe640;</i>
</a> </a>

@ -0,0 +1,214 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/18
Time: 15:56
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/xadmin.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
function changePageSize() {
//获取下拉框的值
var pageSize = $("#changePageSize").val();
//向服务器发送请求,改变每页显示条数
location.href = "${pageContext.request.contextPath}/visitor/findAll?page=1&size="+ pageSize;
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=4&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=4";
});
</script>
</head>
<body>
<%--<div class="x-nav">
<span class="layui-breadcrumb">
<a href="">首页</a>
<a href="">演示</a>
<a>
<cite>导航元素</cite></a>
</span>
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
<i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>--%>
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body ">
<form id="myform" class="layui-form layui-col-space5">
<div class="layui-inline layui-show-xs-block">
<input class="layui-input" type="text" autocomplete="off" placeholder="请输入关键字" name="keyword" id="keyword" value="${param.keyword}">
</div>
<div class="layui-inline layui-show-xs-block">
<button class="layui-btn" id="serarch_btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
</div>
<div class="layui-inline layui-show-xs-block x-right">
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=4"><i class="layui-icon">&#xe669;</i></a>
</div>
</form>
</div>
<xblock>
<c:if test="${sessionScope.adminInfo.power > 2 }">
<a onclick="exportInfo()" class="layui-btn layui-btn-warm" href="javascript:;"><i class="layui-icon">&#xe67c;</i>导出</a>
</c:if>
<span class="x-right" style="line-height:40px">共有数据:${pageInfo.total} 条</span>
</xblock>
<div class="layui-card-body">
<table class="layui-table layui-form">
<thead>
<tr style="text-align: center">
<c:if test="${sessionScope.adminInfo.power > 3 }">
<th style="text-align: center">ID</th>
</c:if>
<th style="text-align: center">姓名</th>
<th style="text-align: center">学号</th>
<th style="text-align: center">联系方式</th>
<th style="text-align: center">访问地址</th>
<th style="text-align: center">来访时间</th>
<th style="text-align: center">离开时间</th>
<th style="text-align: center">到访原因</th>
<c:if test="${sessionScope.adminInfo.power > 2}">
<th style="text-align: center">操作</th>
</c:if>
</thead>
<tbody>
<c:forEach items="${pageInfo.list}" var="visitor">
<tr id="light" style="text-align: center">
<c:if test="${sessionScope.adminInfo.power > 3 }">
<td>${visitor.id}</td>
</c:if>
<td>${visitor.name}</td>
<td>${visitor.sno}</td>
<td>${visitor.phone}</td>
<td>${visitor.place}</td>
<td>${visitor.begin_date}</td>
<c:if test="${visitor.end_date == null || visitor.end_date == ''}">
<td>尚未离开</td>
</c:if>
<c:if test="${visitor.end_date != ''}">
<td>${visitor.end_date}</td>
</c:if>
<td>${visitor.visit_result}</td>
<c:if test="${sessionScope.adminInfo.power > 2}">
<td class="td-manage">
<a title="注销访客" onclick="update(this,${visitor.id})">
<i class="layui-icon">&#xe642;</i>
</a>
</td>
</c:if>
</c:forEach>
</tr>
</tbody>
</table>
</div>
<div class="pull-left">
<div class="form-group form-inline">
共&nbsp;${pageInfo.pages}&nbsp;页&emsp;当前页:${pageInfo.pageNum}&nbsp;/&nbsp;${pageInfo.pages}&emsp; 每页
<select class="form-control" id="changePageSize" onchange="changePageSize()">
<option value="1">${pageInfo.size}</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
</select> 条
</div>
</div>
<c:choose>
<c:when test="${pageInfo.pages < 5}">
<c:set var="begin" value="1">
</c:set>
<c:set var="end" value="${pageInfo.pages}">
</c:set>
</c:when>
<c:when test="${pageInfo.pageNum <= 3}">
<c:set var="begin" value="1">
</c:set>
<c:set var="end" value="5">
</c:set>
</c:when>
<c:when test="${pageInfo.pageNum > 3 and pageInfo.pageNum <= pageInfo.pages-2}">
<c:set var="begin" value="${pageInfo.pageNum - 2}">
</c:set>
<c:set var="end" value="${pageInfo.pageNum + 2}">
</c:set>
</c:when>
<c:otherwise>
<c:set var="begin" value="${pageInfo.pages - 4}">
</c:set>
<c:set var="end" value="${pageInfo.pages}">
</c:set>
</c:otherwise>
</c:choose>
<div class="layui-card-body x-right" style="height: min-content">
<div class="page">
<div>
<a class="next" href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=${pageInfo.pageSize}&keyword=${param.keyword}">首页</a>
<c:if test="${pageInfo.pageNum > 1}">
<a class="prev" href="${pageContext.request.contextPath}/visitor/findAll?page=${pageInfo.pageNum-1}&size=${pageInfo.pageSize}&keyword=${param.keyword}">上一页</a>
</c:if>
<c:forEach var="i" begin="${begin}" end="${end}" step="1">
<c:if test="${pageInfo.pageNum == i}">
<span class="current">${i}</span>
</c:if>
<c:if test="${pageInfo.pageNum != i}">
<a class="num" href="${pageContext.request.contextPath}/visitor/findAll?page=${i}&size=${pageInfo.pageSize}&keyword=${param.keyword}">${i}</a>
</c:if>
</c:forEach>
<c:if test="${pageInfo.pageNum < pageInfo.pages}">
<a class="next" href="${pageContext.request.contextPath}/visitor/findAll?page=${pageInfo.pageNum+1}&size=${pageInfo.pageSize}&keyword=${param.keyword}">下一页</a>
</c:if>
<a class="next" href="${pageContext.request.contextPath}/visitor/findAll?page=${pageInfo.pages}&size=${pageInfo.pageSize}&keyword=${param.keyword}">尾页</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function update(obj,id) {
$.get("${pageContext.request.contextPath}/visitor/updateStatus",{"id":id},function (data) {
if (data) {
layer.msg('注销成功');
}else {
layer.msg('系统繁忙,请联系系统管理员');
}
});
}
//导出Excel操作
function exportInfo() {
layer.confirm('确定导出所有访客数据吗?',function (index) {
location.href="${pageContext.request.contextPath}/visitor/export";
layer.close(index);
});
}
</script>
</body>
</html>

@ -0,0 +1,19 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/18
Time: 20:07
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<h3>恭喜您,来访登记成功!</h3>
<br>
<a href="${pageContext.request.contextPath}/visitor/logout?id=${id}">注销登记</a>
</body>
</html>

@ -104,6 +104,13 @@
var name = $("#name").val().trim(); var name = $("#name").val().trim();
var phone = $("#phone").val().trim(); var phone = $("#phone").val().trim();
var description = $("#description").val().trim(); var description = $("#description").val().trim();
layer.confirm('确定要修改吗',function (index) {
if (${sessionScope.adminInfo.power < 2}) {//非管理员不能修改管理员信息
layer.msg('对不起,您权限不足');
layer.close(index);
return false;
}
$.ajax({ $.ajax({
url: "${pageContext.request.contextPath}/editAdmin",//要请求的服务器url url: "${pageContext.request.contextPath}/editAdmin",//要请求的服务器url
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取 //这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
@ -127,6 +134,7 @@
} }
} }
}); });
});
} }
</script> </script>
</body> </body>

@ -142,12 +142,20 @@
<li> <li>
<a onclick="xadmin.add_tab('访客信息','unicode.html')"> <a onclick="xadmin.add_tab('访客信息','unicode.html')">
<i class="iconfont">&#xe6a7;</i> <i class="iconfont">&#xe6a7;</i>
<cite>访客信息</cite></a> <cite>访客信息</cite>
</a>
</li> </li>
<li> <li>
<a onclick="xadmin.open('来访登记','unicode.html')"> <a onclick="xadmin.open('来访登记(手机端)','unicode.html')">
<i class="iconfont">&#xe6a7;</i> <i class="iconfont">&#xe6a7;</i>
<cite>来访登记</cite></a> <cite>来访登记(手机端)</cite>
</a>
</li>
<li>
<a onclick="xadmin.open('访客日志','unicode.html')">
<i class="iconfont">&#xe6a7;</i>
<cite>访客日志</cite>
</a>
</li> </li>
</ul> </ul>
</li> </li>

@ -91,7 +91,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<button type="submit" id="add-student" class="btn btn-primary">确认修改</button> <button type="button" id="add-student" class="btn btn-primary">确认修改</button>
<a type="button" href="${pageContext.request.contextPath}/student/findAll" class="btn btn-default">返回列表</a> <a type="button" href="${pageContext.request.contextPath}/student/findAll" class="btn btn-default">返回列表</a>
</td> </td>
</tr> </tr>
@ -99,19 +99,66 @@
</table> </table>
</form> </form>
<script> <script>
$(function () {
//ajax校验学号已被注册
$("#sno").change(function () {
//取sno的值
var sno = $(this).val();
//ajax异步请求
$.get("${pageContext.request.contextPath}/student/isExist",{"sno":sno},function (date) {
//$(".error").html(msg);
if (date) {
layer.msg('学号已被注册,请重新输入!');
return false;
}
});
});
});
$("#add-student").click(function () { $("#add-student").click(function () {
if ($("#name").val().trim() == 0 || $("#sex").val().trim() == 0 || $("#sno").val().trim() == 0 var name = $("#name").val().trim();
|| $("#stu_class").val().trim() == 0 || $("#phone").val().trim() == 0 || $("#place").val().trim() == 0 var sex = $("#sex").val().trim();
|| $("#dorm3").val().trim() == 0 || $("#teacher").val().trim() == 0) { var sno = $("#sno").val().trim();
var stu_class = $("#stu_class").val().trim();
var phone = $("#phone").val().trim();
var place = $("#place").val().trim();
var dorm3 = $("#dorm3").val().trim();
var teacher = $("#teacher").val().trim();
if (name == 0 || sex == 0 || sno == 0 || stu_class == 0 || phone == 0 || place == 0 || dorm3 == 0 || teacher == 0) {
layer.msg('字段不能为空'); layer.msg('字段不能为空');
return false; return false;
} }
var d1 = $("#dorm1").val(); var d1 = $("#dorm1").val();
var d2 = $("#dorm2").val(); var d2 = $("#dorm2").val();
var d3 = $("#dorm3").val().trim(); var dorm_id = d1+""+d2+""+dorm3;
var dorm_id = d1+""+d2+""+d3; //alert(dorm_id);
alert(dorm_id); $.ajax({
url: "${pageContext.request.contextPath}/student/add",//要请求的服务器url
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
//data:{method:"ajaxTest",val:value},
data: {
name:name,
sex:sex,
sno: sno,
stu_class:stu_class,
phone: phone,
place: place,
dorm_id:dorm_id,
teacher:teacher
},
type: "POST", //请求方式为POST
dataType: "json",
success:function(result){ //这个方法会在服务器执行成功时被调用 参数data就是服务器返回的值(现在是json类型)
//alert(result);
if(result){
layer.msg('添加成功!');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
}else {
layer.msg('添加失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
}
}
});
}); });
</script> </script>
</body> </body>

@ -1,3 +1,4 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- <%--
Created by IntelliJ IDEA. Created by IntelliJ IDEA.
User: user User: user
@ -12,6 +13,7 @@
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/layer/layer.js"></script>
</head> </head>
<body> <body>
<form> <form>
@ -19,18 +21,25 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
<input type="hidden" id="id" value="${stu.id}">
<label for="name">姓名</label> <label for="name">姓名</label>
</td> </td>
<td> <td>
<input type="text" readonly class="form-control" value="peichen" id="name" name="name" required> <input type="text" readonly class="form-control" value="${stu.name}" id="name" name="name" required>
</td> </td>
<td> <td>
<label for="sex">性别</label> <label for="sex">性别</label>
</td> </td>
<td> <td>
<select class="form-control" name="sex" id="sex"> <select class="form-control" name="sex" id="sex">
<option value="男" selected>男</option> <c:if test="${stu.sex == '男'}">
<option value="女">女</option> <option value="男" selected>男</option>
<option value="女">女</option>
</c:if>
<c:if test="${stu.sex == '女'}">
<option value="男">男</option>
<option value="女" selected>女</option>
</c:if>
</select> </select>
</td> </td>
</tr> </tr>
@ -39,43 +48,118 @@
<label for="sno">学号</label> <label for="sno">学号</label>
</td> </td>
<td> <td>
<input type="text" name="sno" class="form-control" id="sno" aria-describedby="textHelp" required> <c:if test="${sessionScope.adminInfo.power >= 3}">
<input type="text" value="${stu.sno}" name="sno" class="form-control" id="sno" aria-describedby="textHelp" required>
</c:if>
<c:if test="${sessionScope.adminInfo.power < 3}">
<input type="text" readonly value="${stu.sno}" name="sno" class="form-control" id="sno" aria-describedby="textHelp" required>
</c:if>
</td> </td>
<td> <td>
<label for="class">班级</label> <label for="stu_class">班级</label>
</td> </td>
<td> <td>
<input type="text" name="class" class="form-control" id="class" required> <c:if test="${sessionScope.adminInfo.power < 2}">
<input type="text" readonly value="${stu.stu_class}" name="stu_class" class="form-control" id="stu_class" required>
</c:if>
<c:if test="${sessionScope.adminInfo.power >= 2}">
<input type="text" value="${stu.stu_class}" name="stu_class" class="form-control" id="stu_class" required>
</c:if>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><label for="phone">联系方式</label></td> <td><label for="phone">联系方式</label></td>
<td> <td>
<input type="text" name="phone" class="form-control" id="phone" required> <input type="text" value="${stu.phone}" name="phone" class="form-control" id="phone" required>
</td> </td>
<td><label for="place">家庭住址</label></td> <td><label for="place">家庭住址</label></td>
<td> <td>
<input type="text" name="place" class="form-control" id="place" required> <input type="text" value="${stu.place}" name="place" class="form-control" id="place" required>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><label for="dorm_id">宿舍号</label></td> <td><label for="dorm_id">宿舍号</label></td>
<td> <td>
<input type="text" name="dorm_id" class="form-control" id="dorm_id" required> <c:if test="${sessionScope.adminInfo.power < 2}">
<input type="text" readonly value="${stu.dorm_id}" name="dorm_id" class="form-control" id="dorm_id" required>
</c:if>
<c:if test="${sessionScope.adminInfo.power >= 2}">
<input type="text" value="${stu.dorm_id}" name="dorm_id" class="form-control" id="dorm_id" required>
</c:if>
</td> </td>
<td><label for="teacher">育人导师</label></td> <td><label for="teacher">育人导师</label></td>
<td> <td>
<input type="text" name="teacher" class="form-control" id="teacher" required> <c:if test="${sessionScope.adminInfo.power >= 1}">
<input type="text" value="${stu.teacher}" name="teacher" class="form-control" id="teacher" required>
</c:if>
<c:if test="${sessionScope.adminInfo.power < 1}">
<input type="text" readonly value="${stu.teacher}" name="teacher" class="form-control" id="teacher" required>
</c:if>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<button type="submit" id="addAdmin" class="btn btn-primary">确认修改</button> <button type="button" id="edit-btn" class="btn btn-primary">确认修改</button>
<a type="button" class="btn btn-default">返回列表</a> <a type="button" class="btn btn-default" href="${pageContext.request.contextPath}/student/findAll?page=1&size=4">返回列表</a>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</form> </form>
<script>
$("#edit-btn").click(function () {
var id = $("#id").val().trim();
var name = $("#name").val().trim();
var sex = $("#sex").val().trim();
var sno = $("#sno").val().trim();
var stu_class = $("#stu_class").val().trim();
var phone = $("#phone").val().trim();
var place = $("#place").val().trim();
var dorm_id = $("#dorm_id").val().trim();
var teacher = $("#teacher").val().trim();
if (name == 0 || sex == 0 || sno == 0 || stu_class == 0 || phone == 0 || place == 0 || dorm_id == 0 || teacher == 0) {
layer.msg('字段不能为空');
return false;
}
layer.confirm('确定要修改吗',function (index) {
if (${sessionScope.adminInfo.power < 1}) {
layer.msg('对不起,您没有权限');
layer.close(index);
return false;
}
$.ajax({
url: "${pageContext.request.contextPath}/student/update",//要请求的服务器url
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
//data:{method:"ajaxTest",val:value},
data: {
id:id,
name:name,
sex:sex,
sno: sno,
stu_class:stu_class,
phone: phone,
place: place,
dorm_id:dorm_id,
teacher:teacher
},
type: "POST", //请求方式为POST
dataType: "json",
success:function(result){ //这个方法会在服务器执行成功时被调用 参数data就是服务器返回的值(现在是json类型)
//alert(result);
if(result){
layer.msg('修改成功');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
}else {
layer.msg('修改失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
}
}
});
});
});
</script>
</body> </body>
</html> </html>

@ -71,6 +71,7 @@
</form> </form>
</div> </div>
<xblock> <xblock>
<a href="${pageContext.request.contextPath}/student/addStudent" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe654;</i>添加</a>
<c:if test="${sessionScope.adminInfo.power > 1 }"> <c:if test="${sessionScope.adminInfo.power > 1 }">
<a onclick="exportInfo()" class="layui-btn layui-btn-warm" href="javascript:;"><i class="layui-icon">&#xe67c;</i>导出</a> <a onclick="exportInfo()" class="layui-btn layui-btn-warm" href="javascript:;"><i class="layui-icon">&#xe67c;</i>导出</a>
</c:if> </c:if>
@ -110,12 +111,9 @@
<td>${student.teacher}</td> <td>${student.teacher}</td>
<c:if test="${sessionScope.adminInfo.power > 1}"> <c:if test="${sessionScope.adminInfo.power > 1}">
<td class="td-manage"> <td class="td-manage">
<a title="编辑" href="${pageContext.request.contextPath}"> <a title="编辑" href="${pageContext.request.contextPath}/student/editStudent?sno=${student.sno}">
<i class="layui-icon">&#xe642;</i> <i class="layui-icon">&#xe642;</i>
</a> </a>
<a title="注册" onclick="" href="${pageContext.request.contextPath}/student/addStudent">
<i class="layui-icon">&#xe654;</i>
</a>
<a title="删除" onclick="member_del(this,${student.sno},${sessionScope.adminInfo.power})" href="javascript:;"> <a title="删除" onclick="member_del(this,${student.sno},${sessionScope.adminInfo.power})" href="javascript:;">
<i class="layui-icon">&#xe640;</i> <i class="layui-icon">&#xe640;</i>
</a> </a>

@ -7,6 +7,7 @@
5. 2020.2.15实现了管理员信息模糊查询并分页的效果并增加了超级管理员可给普通管理员授权的功能着手实现数据导出功能发现程序运行时报错经验证后发现是json格式从后台传向前台需要经过解析故导入了相关依赖即可而后又遇到layui的Excel模块不可用开始着手解决。 5. 2020.2.15实现了管理员信息模糊查询并分页的效果并增加了超级管理员可给普通管理员授权的功能着手实现数据导出功能发现程序运行时报错经验证后发现是json格式从后台传向前台需要经过解析故导入了相关依赖即可而后又遇到layui的Excel模块不可用开始着手解决。
6. 2020.2.16实现了管理员数据Excel格式的导出并可以指定保存位置。 6. 2020.2.16实现了管理员数据Excel格式的导出并可以指定保存位置。
7. 2020.2.17结束了管理员模块并继续开发学生模块后台controller、service、dao的CRUD功能已完成并测试成功前台页面所有学生信息可分页展示删除功能已实现前台注册学生功能还未实现待明天实现。 7. 2020.2.17结束了管理员模块并继续开发学生模块后台controller、service、dao的CRUD功能已完成并测试成功前台页面所有学生信息可分页展示删除功能已实现前台注册学生功能还未实现待明天实现。
8. 2020.2.18今天实现学生信息添加的时候使用ajax异步去请求后台的时候后台返回的结果前台接受不到捣鼓了一上午才发现原来是因为一个提交方式为“submit”使用异步应该将其设置为“button”特将其错误记录于此。下午结束了学生模块的基本操作进一步开发访客模块后台均已写好待设计前台访客来访记录表页面。

Loading…
Cancel
Save